Jump to content
  • Advertisement
Sign in to follow this  
arithma

Componentizing Games

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

I was thinking the other day about "COMPONENT-IZING" my game. So my idea was to provide a rendering engine, a physics engine and a "definition" engine. Renderring and physics are well understood. A "definition engine" would allow plug-in DLLS to populate object classes: like giving a definition for a new tank using turrets and control systems already defined by the game. It could also be a human-layer-device port for controlling specific items in the game. I believe that the main advantage here is allowing for MASSIVELY DISTRIBUTED DESIGN for the game. So a gamer could download some DLL from the internet, install it, then go compete with some other guy. Is there any dangers with such technical design? Can you think of other benefits? Would you be interested in developing something for such an engine (not that I'm asking you to)?

Share this post


Link to post
Share on other sites
Advertisement
If this is something that the people themselves will be able to create objects for, probably the large chance that it gives for people to cheat. As well as the fact that it will be difficult for people to create objects unless they know at least something about the inner workings of your objects.

If this is something that people won't be able to create for themselves, ignore this post.

Share this post


Link to post
Share on other sites
Yann L suggests a effect/shader implementation that makes use of dlls

Shader Implementation


In my engine I componentize like this

Engine executeable
Client DLL
Server DLL

shader DLLs

the shader DLLs define which effects they can render and are choose by a priority, possible hardware support and user quality/performance settings

it allows the easy update of visual quality on the fly

Its very similar to the system Yann L explained in detail in the thread above


As for componentizing game objects in dlls, I would rather for for a Client Server DLL approach to avoid cheating issues.

Also think about the potential security problems when downloading dlls from a random server on the net.

I think a scripting solution would be a better choice in this case
I think there are some scripting engines for lua that you can plug into you project

here s the link to their page
Lua homepage

Share this post


Link to post
Share on other sites
Cheating concerns are not a threat since the written DLLs will act as to be read from. The server would be responsible for validating the output. You may imagine the DLL as a player + the ability to construct objects from other PREDEFINED OBJECTS.
So the concern would be whether or not these Dlls pose general security issues? Is there a way to limit the DLL abilities to call only functions defined by the Server?
Using a scripting language is out of my reach right now. I'll check that Lua language anyway...

Share this post


Link to post
Share on other sites
I can't think of any other way to design a game engine without imagining a large stinking pile of badly encapsulated crap code in front of me ;)

But I wouldn't limit the plugin concept to just the game logic (that would be your 'definition' component). I had great success with a microkernel-like game engine which did not link to any libraries besides Boost itself. The image formats it could load were dynamically supplied by plugins. The rendering APIs it could handle were dynamically supplied by plugins. The archives (like .zip, .rar) that it could read from were dynamically supplied by plugins. You get the idea.

Speaking of components, I've broken it apart like this:
- engine (networking, plugin management and other shared code)
- simulation (game logic, physics and other typically server-side stuff)
- visualization (graphics, sounds and other typically client-side stuff)

But a finer granularity also makes sense, I guess. Just make sure you keep the game logic seperate if you're going for multiplayer support.

-Markus-

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!