Skip to main content
gamedev.net
🔒 Locked

Adding Single Effects

Started by jonbell 1 reply 500+ views
Original Post
jonbell
jonbell
How have people managed to add effects to a scene that are specific to a scene? Obviously the best way to manage a project that has lots of differant scenes is through the use of a scripting system and this is what i have done but now say that i want to add a number of single effects that are specific to a single scene how would people go about doing this? For example when the player walks over a specific part of the scene i may want to deform the scenery in some way and maybe set part of it rotating. I can do the effect itself but how do i specify this in my script and get my program to execute the correct code. To be honest this side of game architecture impresses me more than graphical effects. I mean how can you keep your code clean and still have varied levels?
pixelstar
pixelstar
When your character enters a portion of your octree or pathmesh or 3dtile system or basic 3d cube system, each node, poly, tile, or cube (depending on what method you like to use) should have a tripwire mechanism so to speak - ie: if it''s a tile-floor system then what you''d do is have an attribute of the tile - for example a structure for a node or tile could have attributes like these:{
int reaction_mechanism
int tile_3d_slope
TBIND tile_binding; //character barrier mechanisms
etc}
That''s obviously a long shot from how it would need to be coded - but it gets the basic idea across.
So a wide variety of methods can be used:
If the tile_occupation contains a reaction_machanism>0 then check the relative coordinates to the tile against the specifications provided by the mechanism to see if some reaction should occur and use the reaction mechanism''s upper 8 bits or whatever to determine what effect functions should be called and which parameters should be passed(basically based on strings of characters).
With pathmesh methods you can simply change the name of the textures, objects, or whatever - basically an instance of some geometry or texture that uses a different string name of which has characters - which the program will recognize and respond to with an effect event.
IE. A node entered by the character may have a string starting with "$" - and the program knows that this will be under a certain category of tripwire mechanism -- like an effect-event trigger.
Let''s say it was $F8AB3996 -- the hex code after this would represent the node-relative coordinates for the bounding box or b-sphere in which the event in the following string(#2F) would be triggered. (The original string being "Grassy__$F8AB3996#2F")
Anyway, that''s one of a million ways to set up event and effect triggering mechanisms. Many of which I''ve not yet tried.
One simple thing you can do is create HelperObjects with code names and export them and use those as tripwire mechanisms.
I''m not sure if that''s the kind of info you were looking for.

Anyways, if anyone has some script based methods/tricks to share please feel free.
(>-<)
jonbell
jonbell
What i''m really getting at is how to support a wide variety of effects and yet keep the code clean. I thought of having all my effect functions stored in dll''s which are specified in the script. Ie when the player performs action x run the single function contained in xxx.dll.

This would allow effects to be tested as seperate programs and also would cut down of the complexity of the core code. Any thoughts on this method, is it a good way to go about things?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.