Program structure - Requesting useful feedback

Started by
3 comments, last by wqking 12 years, 1 month ago
Good day gamedev users,

After following the forum for a few weeks I finally decided to signup - of course, this was also influenced by the fact I would like to have your help.

As more people here, I am trying to create a game. I find it important to create a good structure idea before starting programming, but I do not have much experience in this. Here is my current idea:
structure4.png

Some useful information:
-The program will be written in C++ and Lua.
- It will have 3D graphics with a 2D graphical user interface.
- Multiple clients will be connected with one server, which validates all actions send in by clients.

Image explanation:
The program starts by creating a base, which is not included in this image. This base creates all important instances, such as a screen handler, texture loader, user input, and more. The screen handler lets the player move through different screens, which are loaded from an external file, via Lua. Example screens are a connect screen and the game itself.

When a screen handler is created, it will tell the UI what the right GUI is and which hotkeys can be used. The UI is linked to 3D graphics, because via the UI the user is able to change, which 3D effects are enabled. If needed, the screen handler will create a world handler. The world handler handles all objects in the game itself, the world objects. world objects are linked to the player, because the player is actually derived from a world object. The player is linked to the UI because it will tell it which controls it uses.


As said, I do not have much experience in this. I hope it is any good, and love to get some feedback.

Thanks in advance,

Aart Stuurman


--Edit: I forgot an arrow in the image.
--Edit 2: Now it was an arrow too much.
Advertisement
Seems fine to me, as an abstract plan; were there any specific concerns you had with this, or... ?

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


I find it important to create a good structure idea before starting programming, but I do not have much experience in this. Here is my current idea:

Yes, it's important.
But also it's quite difficult to really create very good structure at the beginning, especially you don't have much experience.
So no matter how good structure it is, during your development, you may want to continue refactoring on your code to make it better.


-The program will be written in C++ and Lua.

I like the idea of C++ plus Lua. Good job.


This base creates all important instances, such as a screen handler, texture loader, user input, and more.

That sounds OK. But be careful to avoid that all your game components depending on that base.
The base should better inject the screen handler, loader, etc, to the game components (dependency injection), instead of just passing the base anywhere.

https://www.kbasm.com -- My personal website

https://github.com/wqking/eventpp  eventpp -- C++ library for event dispatcher and callback list

https://github.com/cpgf/cpgf  cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.


Seems fine to me, as an abstract plan; were there any specific concerns you had with this, or... ?


I did not have any specific questions. I was just wondering if it seems fine overal, and if people had ideas how I could improve it.

@wqking
Thanks for the useful feedback. For the base; it creates the important components. After that it passes them to the other instances and functions as an argument. The others will not have access to the base itself(all private). I hope this is about what you meant.

I will now start dividing the program into different independent libraries(networking, graphics etc.) so I can work on it at the same time as my programmer friends.

Thanks,

Aart

@wqking
Thanks for the useful feedback. For the base; it creates the important components. After that it passes them to the other instances and functions as an argument. The others will not have access to the base itself(all private). I hope this is about what you meant.

Exactly what I meant.
Very good start. Enjoy your future development. smile.png

https://www.kbasm.com -- My personal website

https://github.com/wqking/eventpp  eventpp -- C++ library for event dispatcher and callback list

https://github.com/cpgf/cpgf  cpgf library -- free C++ open source library for reflection, serialization, script binding, callbacks, and meta data for OpenGL Box2D, SFML and Irrlicht.

This topic is closed to new replies.

Advertisement