Jump to content
  • Advertisement
Sign in to follow this  
transformation

Engine design + networking and scripting

This topic is 4837 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

Hi all I've heard many times that if you are going to include networking support in an engine then you have to design it in from the beginning. I'm lost as to how that works. I do intend to include network support in my engine, but I don't see the problem of leaving it for the end. And remember I'm not talking about the actual game here, just the game engine. I plan on just adding different things as I go. Let me explain the design a bit: The engine contains 2 layers (technically 3 but the 3rd is the common layer so feh). The first layer is the wrapper layer. This layer is just a bunch of wrappers around different APIs. This is there so that the second layer doesnt need to know about whether it's using d3d or ogl. THe wrappers in this layer are a graphics wrapper, audio, video, window wrapper, input wrapper and network wrapper. The next layer is the actual engine I guess. It will only use the wrapper implemented int eh previous layer. I plan on first implementing the 3d object system. Each object is composed of a material, vertices and rendering method, so the first thing is to make an object manager where you can load in objects and their materials and then give them a rendering method. Objects are given to the render queue and filtered according to render method first, then material and then vertices. The objects are placed in the scene graph first so that the scene graph can automatically submit the objects to the render queue as it recurses through its nodes. Collision and response will be implemented directly in the scene graph as well. I'm a little confused with all this "a scene graph can be logocal or physical". I don't get the difference, doesnt a logically created scene graph look exactly the same as a physically created one? If the wheel is to the left of the car, then it is physically to teh left of the car as well right? Not jsut logically. Everything will start ferom the scene graph. You create an object, assign a scrip to the object, assign a rendering method to the object and give it to the scene graph. Each object will have physical properties and material properties. As the scene graph is travered, each object is first has to pass the culling test, if it survives, it is given to the physica processor and then the effect processor. If I've got the basic idea of engine design down, then is there going to be a problem with adding network support late in the game? Is ther eanything i have to design differently if I plan on adding networking? The networking system I figure is going to be like the windows messaging system. You just add a callback and handle the messages you recieve from teh network. Is there anything else I need to watch out for? And also about scripting. I'm guessing there wont be any problem adding the scripting late in the game as well. But I'm confused as to whether it should be part of the first layer (the wrapper layer), or the actual engine layer? Thanks for any feedback.

Share this post


Link to post
Share on other sites
Advertisement
Engine design is an art not a science, so anything I say here will probably be countered by someone that did it completely opposite and still had a great engine.

Personally, I would put the scripting engine at the API level. Conceptually, you should be exporting the same functions the the scripting engine. The scripting engine should be abstract enough so that you can mix and match scripting engines as you feel the need; much like how you wrapped the video, audio, windowing, etc.

Undoubtably, others will feel differently, and bring up just as valid points. However, my instinct tells me that implementing it at the API level will be the most flexible and more maintainable solution.

Note: you Will have to put some code to glue the scripting engine with the other engines, also, you will probably want to create a group of functions that enable easy maniplulation of the scenegraph and export these to the scripting engine as well.

Good luck!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!