Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Brainstorming]Modular game

(oO (||||) (||||) Oo)
Loyal Member
Joined
Aug 6, 2009
Messages
2,132
Reaction score
429
So couple weeks ago I asked about making a modular game, just in time modules compiling and something else.
I did some test coding to see how this modular game can be done as well as how module compiling can work.

Today I thought about giving this a try and wanted to see some input from ragezone coders. Maybe some ideas or suggestions. Pretty much anything.

As I stated in previous thread, the basic code of the game is in charge of loading components (world, gui, settings, input, model drawing, etc), as well as compiling sources of modules (default modules or community modules). The basic game will come with some basic modules (walking/camera, world, and other basic stuff) and then end user can load additional modules.

I am also thinking how all this modules can work together without interfering with other modules. So far I have basic idea of how I wanna do it (i have it in my head but describing it will be a hell), but feel free to throw your ideas.

Oh and yes I do plan to have it as open source.
 
Junior Spellweaver
Joined
Oct 27, 2008
Messages
165
Reaction score
89
As I stated in previous thread, the basic code of the game is in charge of loading components, As I stated in previous thread,

So you would need to code a File System and a basic Scripting Engine(1 module) here.

Other modules would be Rendering Interface(DX, OpenGL, other Software Renders)(1 Module for each), After creating this you would need to make some Abstract Classes/Functions for the Rendering Interface since the other Stuff like Camera, Scene graph uses it(another 1 module), there would be Input another module, and the Core(another 1 module if it remains).

The Scene graph has 3 classes The Geometric, Spatial, and Node Class.
- Geometric class is used to draw the Geometric Objects to scene
- The Spatial class is used to position the class in the 3d space(here comes local, and global Coordinate System)
- Node class specify the Scene graph node

Camera is used to make a projection view in the 3d world(camera is part of the Scene Graph, the camera works same as a video camera).
- Operations on camera are (translation, Rotation), here you could use quaternions or matrix transformations
- On translation you move the the camera Eye in the Scene.]
- On rotation you rotate the camera local Coordinate System(by calculatin new coordinates for the camera).

and other stuff like shading, animations, GPU Coding(OpenCL/CUDA), etc

You can make it into 3 modules (Core, RenderInterface, Input/output), and you could add some plugins for more stuff.

To make it module based its simple in C++ just use use LoadLibrary(), GetProcessAddress() and FreeLibrary(), and don't link the DLL using the linker
Code:
typedef RenderInterface* (*pRI_Create)();
//...
//load the DLL acording to your config file (DX9, DX10, OGL, DX11, other Software/Hardware Renders)
HANDLE handle =  LoadLibrary(sInterface);
if(handle != NULL){
   //problem could not load Render Interface 
   //try to load something else, or finish the program
}

//get the function that return the object from the DLL
pRI_create create_func= reinterpret_cast<RI_create>(GetProcAddress(handle, "render_create"));
if (! create_func) {
   //enable to load the function from the dll
   FreeLibrary(handle);
}else{

    //Using the DLL Abstact interface class from the headers file you could just load the render interface 
    RenderInterface* pInstance = create_func();

   //initialize the render
    pInstance->startup();
}
 
Last edited:
Back
Top