Skip to main content
gamedev.net
🔒 Locked

Scripting implementation woes

Started by Zimans 0 replies 150+ views
Original Post
Zimans
Zimans
I''ve started thinking about how to implement the scripting system in my shootem game and i''ve come to a dilema i''d like some outside opinions and suggestions on. I''d like game objects to be self-contained. One file contains everything that object needs to display and operate. Polys, Textures, Script, etc. This way adding another object to the game is as simple as droping that object file into the data directory and putting a reference to it on a map. However, this leads to a potential problem. Object interaction. Since every object has it''s own script and is not part of one common binary; if an object is created that needs to effect another object in a way that is not normally pre-defined, it becomes difficult. Objects can effect other objects properties, but that can only go so far. For Example: Lets say we have a new object that is a freeze weapon of some sorts. Every other object in the game would have been coded before the freeze ray and therefore would have no special code for dealing with being frozen. The freeze weapon could still effect the other objects, but it could only go as far as what It could do by changing target objects properties. (such as setting nextthink to time + UNFREEZE_TIME) Another Example: A new object touches an old object. The old object reacts to the touch, but since it does not know what the new object is, it does not know how to deal with it.. Hmm, I guess this is a bad example as flags could be used to make every object have certain properties so as DAMAGEABLE, etc. Still, certain cases could still exist... The other option is to have a single common binary but that means that only certain objects could be used at the same time. The whole point is to be able to add and remove objects at will. Any thoghts?
Promit
Promit
I think that the various seperate objects need to be covered by managers that not only maintain collections of the objects and such, but are also aware of each others'' existences. This way, the managers can interact with minimal code, and then internally work out the actions without concerning the objects involved too much.

But to be fair, I''m in exactly the same position as you, and I''ve been playing with this idea for only a very short time...
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.

Topic Locked

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

Sign in to reply to this topic.