custom loader in Gile[s]

Community Forums/Developer Stations/custom loader in Gile[s]

Ross C(Posted 2006) [#1]
Hey, i was wondering if Gile[s] supported some sort of script, so i could load in a level saved in my own format. The reason being i have an editor, and it's easy to position and rotate items and such. But, i would like to lightmap them when i'm done. Does Gile[s] have this functionality?


jfk EO-11110(Posted 2006) [#2]
Hey I need the same thing. Giles has a plugin folder and will load all DLLS found inside. DLLs must be written following some specs. I hate this. So I'd rather write a little import script myself. I think it will be most easy to use the giles file format to declare meshes and a number of lights.

I have to say and I hope Fredborg doesn't mind - I really don't like the interface. It usually takes me a year or so to position a single light. So I'd like to write a little tool that will convert my level editor files to something giles can read.


Ross C(Posted 2006) [#3]
Hey, i'm glad to see someone else has the same issue :o) Great for lightmapping. Not much on positioning though :o) I was tinking with the idea of trying to get a save .b3d working, that would svae everything as the one scene and try and import it to Gile[s].


jfk EO-11110(Posted 2006) [#4]
Yeah, I thought the same too. I probably will edit the SlimShady source so it will allow to use/apply/save masked and alpha textures, plus some additional things that are required, eg. ScaleTexture etc.

A lot of work. However, if I can manage the SaveB3D code to work with all kinds of meshes (includes hacking of brush properties etc.) then I'll let you know.

I also wonder if giles will create a light when there's a light object in the scene. I'll test this asap with a 3ds scene file that includes a light. And if it work, how would i have to do that with a b3d file?


fredborg(Posted 2006) [#5]
Hi,

Please feel free to suggest any improvements in the positioning of lights and stuff.

You can load lights from a B3D file if you follow the guidelines given in the gile[s] manual (see the exporting section). gile[s] will load lights from 3ds, ase, and some other file formats as well.


jfk EO-11110(Posted 2006) [#6]
Hi Fredborg. Thanks for your help. I've seen 3ds lights can be imported.

Do I get this right, gile[s] will save light properties in the model name of a pivot? So names may include line breaks? I have no idea, are they enclosed in ""? I even don't know how to save a pivot in a B3D file.

The B3D docs I got only refer to meshes, brushes, textures.

The user interface of gile[s] is powerful, but I found it not very intuitive. I have the choice to: A read the entire docs first or B try a lot of buttons and things. As I said, I'm not very patient. I also am not familar with the graph system you're using, I guess this is something common?

Probably it's only me. I also often make the mistake to try to learn how to handle a tool with a way to big mesh loaded, so every little test takes ages. It's really my mistake. Personally I would like a real flytrough first person camera mode that allows to click meshes or light dummies to open their properties panel, including position, scale, rotation etc. clicking the numeric values should activate a virtual scrollbar that allows to alter the values. Well that's the system I use in my editor, so no surprise I like it :o)

If such a properties panel needs to be closed by a click on a close button or the X-Button - what a waste of time. I'd rather suggest the panel should be opened and closed by a single click, eg. rmb.

The user should also be able to load a mesh at the current camera position at any time.

Basicly, most important is the speed. one click good, two clicks nice, 20 clicks for a single action: bad. (Not saying this is so in gile[s]).

You see, this is kind of "my world", it may be hard to add to an app with Standard controls.


fredborg(Posted 2006) [#7]
Hi,

Yes, lights are saved as pivots with extra info in the name. In a b3d file a pivot is saved the same as a mesh, just without the 'MESH' chunk :) So basically just a node with position, rotation, scale etc.

So let's say you save a pivot with this name in your b3d file:
bob
[LIGHT]
Omni
1.0
0.5
0.0
1.0
1.0
1000.0
0.0
80.0
1
1
0
0
[/LIGHT]
gile[s] would load this as a light named 'bob' which is an omni light with an orange color, an intensity of 1.0, ranges 1.0-1000.0, innercone/outercone are ignored for omni lights, it's active, it casts shadows, it's not infinite and overshoot is ignored for omni lights.

It's very simple, just seperate each parameter by a line feed (Chr(10) in Blitz3D).


jfk EO-11110(Posted 2006) [#8]
Thanks a lot! Probably I'll try to write a DLL in PureBasic. I got an older version only, will this work too? (v 3.3)

My Level editor allows to load and position etc. a number of meshes.

So I could add a gile[s] flag to each object that will tell the gile[s] import DLL if it has to merge a certain mesh or light. Indeed an importer for my engines native format would be great.

Tho, for me who is completely unfamilar with PureBasic it would be WAY easier if there was some kind of standard import macro format, eg:

path
name
x
y
z
pitch
yaw
roll
tex1
tex2
...

And so on. Basicly a list of lists of all to be wrapped parameters of the objects of a scene. All world editors out there would then be easily capable of converting their save format to such a macro list. Only a suggestion, tho I confess it would be very useful for me.

EDIT - of course, it may be an option to use the B3D format right away. Although, I found it always a little tricky to make things work. Additionally, there are some diffrences in the ways blitz3D and giles are loading B3D. I remember one of my editors saved a map as B3D that was looking ok when loaded in BLitz3D, but the UVs were messed up in giles. This may have something to do with the fact that I used UV values greater than 1.0 to achieve texture tiling.


jfk EO-11110(Posted 2006) [#9]
I have just realized: it isn't all so easy. Because in a game most things that are using masked textures, eg. fences, grass etc. have to be unpickable to allow the player to shoot trough, as well as the enemies to linepick trough (see the player behind the fence etc.) So these masked things need to be saved as a seperate mesh. It would be useful if I could group things in giles and then save the lightmapped result as several mehses, depending on their group membership. I know I should RTFM, but - are groups yet possible somehow?


jfk EO-11110(Posted 2006) [#10]
Oh and BTW, I need to load the mesh(es) as static meshes, using LoadMesh. So it's no option for me to use LoadAnimMesh and then parse the childrens entity names. This would force me to completely restructure a big lot of things. Ok maybe a bad design. But it's the way it is, and worked for me so far. I also think the handling is faster, since it doesn't require to apply everything recursively to the map mesh.

Right now I don't see possibilities for groups in giles, other than to use certain string tags in texture names that would allow to create partial clone meshes with individual settings (pickabilitiy etc. as mentioned before) in the game engine level loading process. Pretty complicated IMHO.


jfk EO-11110(Posted 2006) [#11]
Ok ok ok, shame on me. Of course you can group things in gile[s].

There are the "group selected" and "ungroup selected" functions in the edit menu. This works nicely. Tho, if you got a lot of little merged objects, you may wish to be able to add or remove a certain mesh from a group with the help of some kind of a simple group membership manager. (I wouldn't be surprised if this is already implemented and I only didn't see it).

The more I use gile[s], the more respect I get cause this is really a top application. Its huge amount of features only requires to take some time to learn the basics.

So please excuse me if I was kind of negative.


fredborg(Posted 2006) [#12]
From the manual:
Hierachy

If a model has children, an arrow is shown next to the eye icon and a tree branch shows which models are children of that model. You can hide the children of a model (in the list only) by clicking on the arrow, and show them again by clicking once more.

To modify the hierachy of models, click on a model in the list and keep the mouse button pressed, while dragging the model onto another model.

If you release a model on top of it self, no changes will be made.

If you release a model on top of it's parent, the model (and it's children) will be detached completely from any parent model. If you are dragging a model over it's parent, you will see the parent model highlighted in red.

Releasing the model on any other model, will make that model the parent of the selected model. This is indicated by the model being highlighted in green.



Ross C(Posted 2006) [#13]
Hey Fredbord. Any chance of implementing a simple text scripting, for loading say meshes in? For example, say i save the positions, rotations and scale... to a text file.

Is there any chance you could implement a simple script engine to allow the use of positionmesh, scale mesh, load mesh.. etc..

For example:

TEXT FILE

LOADMESH("model.b3d")
POSITIONENTITY 30,30,30
SCALEENTITY 2,2,2

LOADMESH("model1.b3d")
POSITIONENTITY 30,30,30
SCALEENTITY 1,2,1


Something very simple, that will allow people to save their level easily, and import it into Gile[s]. Most people who make their own editors, would tend to save it to an easy format like a text file, holding positions and such anyway.


D4NM4N(Posted 2006) [#14]
I would find this useful too, to have an option to allow users of ted to use the internal lm (prop2terrain) and lightmap just the props using Giles as an external app.

Would be great if it could batch process read and write a list ie. with:

[Light info]
type position rot etc,
[/light info]

[mesh load filenames]
list of filenames position rotation scale..
[/mesh load filenames]



Then giles could:
setuplights()

choose to merge all objects or load separately(batch)
repeat
   load or merge respectively and position next mesh in list 
   lightmap it
   save it again lightmapped with mabe the file prefix "GileLM_"
until end of list

exit when done

This could also turn giles into a kind of batch processor for either doing loads of scenes in one go, or lightmapping individual meshes in a scene onto each other without making an actual scene out of them.


jfk EO-11110(Posted 2006) [#15]
good point. This way you can shoot lightbulbs to darken a single room (by replacing its lightmap dynamicly).


Ice9(Posted 2007) [#16]
I would like to see something like this also. It would
allow you to put it in just about any pipeline.


D4NM4N(Posted 2007) [#17]
What would be cool is if you could load in custom properties from an imported meshes name (in the format it exports)

also, if a mesh or pivot has a certain custom properties it will appear as a light in giles
ie:
class=light
color=rgb
range=etc etc etc

This would make it kind of I/O pipelineable with other worldeditors.


Perturbatio(Posted 2007) [#18]
can I suggest that you put these suggestions on the gile[s] forum? http://www.frecle.net/forum/


jfk EO-11110(Posted 2007) [#19]
As Fredborg said, you can import lights with relative ease.

Simply grab the SaveB3D code from the archives, remove everything but the NODE writing part. Write a NODE for every light, using an entityname like this:
bob
[LIGHT]
OMNI
255
255
255
1.0
1.0
1000.0
0.0
80.0
1
1
0
0
[/LIGHT]
For a description of the parameters read Fredborgs post in this thread. Note: RGB isn't 0 to 1.0 as he said, but 0 to 255. The parameters must be seperated by a linebreak ( CHR$(10) ).

I just added an export for giles function to slimshady, so I can use its fast workflow to drop a number of lights and stuff, then export as mesh with giles compatible lights, then import it in giles as a scene or merge its light to an already loaded scene.

One thing that I'm missing in Giles is copy/paste at camera position. Altough CREATE will create a light at the camera position when the 3D window is active, using ctrl-v (clone) will only clone the currently selected object - and position it at its "genetic origin" location. This complicates things and prevents me from dropping lights while flying around. If you got to model a dozen or so maps then every saved hour counts. And the diffrence is huge. I add 20 LIghts in a few minutes in slimshady, where I needs hours for the same job in giles. Of course, probably also because I'm not familar with the interface and the shortcuts. Slimshadys interaction is much simpler, but also more intuitive.