Archived

This topic is now archived and is closed to further replies.

Object Library Implementation...

This topic is 5501 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone who cares... Here''s my situation. I''m design the object library engine for my game. It''s a MMORPG that runs like a client/server style application. The server handles 100% of the decision making process where the client is simply displaying and receiving input (with some very basic rules validation). I want this engine to have a object library that is 100% customizable with the ability to add new objects/monsters to the system with no re-compilation of the main engine. Clients receive the proper static files when these objects are added to the game when they log in. I also have some other rules that I will no break: 1) No code on the client side! The only files that exist on the client side are static graphic files, audio files, and a list of various commands/verbs that can be executed on a given object. 2) No scripting language. I want each object in my object library to be compiled code and not a scripting language module. 3) 1 object ''definition'' is represented as 1 file. 4) I should be able to inherit the functionality of one type of object. A simple single inheritance that will allow other developers add game objects that are like other game objects without rewriting a whole definition. So with these set of rules I have 2 options. Both options dictate that each file be a Win32 DLL that is loaded by an Object Library Manager. Option 1: Use a Windows style messaging system where the game uses messages that are passed to a single function (a message handler). The message handler then routes the messages to the proper function (just like windows development). Developing a new object is like developing a new windows control based on another or subclassing a windows control. Option 2: Every object defines a function table that is registered with the object library manager. This is simply a struct with a bunch of function pointers. Inheritance is done by copying the function table of the base class and replacing the struct members with your own. Both option require that a pointer to the actual object instance be passed to the called functions. I would like to lean more towards option 1 so that I can avoid the huge switch statements that are found with programming in that style, but it''s easier to implement. I hope that this makes some sense to some people. Of these two options, which would you choose and is there a third option? Please don''t post ''Use a scripting language like xyz.'' I have my reasons for not using them. Thanks for the feedback.
Dino M. Gambone Good judgement is gained through experience. Experience, however, is gained through bad judgement.

Share this post


Link to post
Share on other sites
Well, after some research and thinking about this overnight, I have come to the conclusion that I will implementing the object library like Quake 2 does (DLLs and import/export DLL functions).

That''s all I have to say about that.



Dino M. Gambone
Good judgement is gained through experience. Experience, however, is gained through bad judgement.

Share this post


Link to post
Share on other sites