Jump to content
  • entries
    943
  • comments
    5,899
  • views
    923,761

Design Problem


Josh

1,906 views

 Share

I finished the collision editor, and now came across a pretty significant design issue. The approach the main editor has always taken is that by the time assets get into it, they are finished and ready for usage. Now I am making it so the model editor can change the structure of a model, save it, and have the main editor reload all instances of it. However, the Lua class scripts cause some problems with this. If I load a model with it's script enabled, the script might delete limbs fromt he model, replace them with other entities, or add new limbs. For example, the monster truck script frees the wheel meshes and creates vehicle wheels in their place. If this is allowed, then the tree view for the model will not be the same as what the GMF file originally contains. If the model is resaved, it will overwrite the existing GMF, and no longer contain the same limbs the script looks for.

 

I could disable the class script in the model editor, but I also want to be able to view a finished model with the script enabled. For example, if I have a street light with an added corona, I want to be able to look at that in the nice big model editor window.

 

Probably the best I can do is just leave it up to the end user not to do anything in the script that will break the model if it is resaved. Either that, or we have two separate applications built into the editor: a model viewer, which uses script, and a model editor, which disables the script.

 

One kind of neat thing I did was set it up so the surface tree nodes only get populated when the user opens them. You might remember early versions of the model editor were slow to load large meshes because a ton of vertex data had to be turned into tree nodes. This will allow full display of all data, but it won't slow down loading. The worst that might happen is a brief pause when a surface node is opened. I'm planning to make all the data in each vertex editable, so you can clean up meshes by brute force, if you choose to. A few options like "Update Normals" will be available on a global and per-surface basis.

 Share

4 Comments


Recommended Comments

Nope, there is a collision editor built into it. It gives instant visual feedback, so it's easier to use than phygen, but it's basically the same thing.

Link to comment

I would just make an checkbox in Model Editor, which says: "Run Model Script when Loading Model", which the user can click on/off before loading a model. It should be possible to disable scripts in the engine anyway with a function like SetModelScripts(0), instead of having to rename the lua file for example to luax before the model is loaded.

Link to comment

I think for the model editor you could leave the script off, the sandbox editor itself works well as a viewer. This is great news, a visual, integrated physics editor will rock (especially if you can set up joints w/ constraints in it).

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...