• Advertisement
Sign in to follow this  

Program structure - Requesting useful feedback

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

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.

Share this post


Link to post
Share on other sites
Advertisement

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@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

Share this post


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

  • Advertisement