I am planning to create a cRPG game engine that would allow to easily create games like Baldur's Gate. I already tried to do that once, but my knowledge was vastly insufficient at the time. I settled for C++, SFML and TGUI (a GUI library), as this is what I have most experience with. I've read this article on game engine architecture, and I have decided to follow that system's architecture (event/message driven), because I know how much of a unworkable hairball my previous attempt was.
I am mindmapping the concept and its architecture for the past few days now (something I didn't do at all previously); and I came up to the point of how I want to divide (or do I?) the gameplay and rendering. The rendering part is actually very simple, as SFML does bulk of the job. I concluded that I don't even know what I could place in the rendering system apart from drawing sprites. I also can't seem to find more resources about game engine systems, because every time I search for that I get system requirements for unity and unreal.
If I decide to go with the rendering system, what would be the best way to store and send sprites? I suppose that I need to make a sprite resource manager. If so, how is the best way to send them to the render system without coupling things too much? Or perhaps the sprite resource manager should reside in the render system itself?
EDIT: As of current, the planned architecture is divided into 6 systems (Input, Audio, Logging, GUI, Gameplay, Render). I will use Events for decoupling. The problem with this design is that i will have at least 3 direct connections between GUI, Gameplay and Render. Those are:
- Between GUI and Render. The TGUI library introduces a TGUI Window class that inherits from SFML one, and can be used as one. In my case, it will be a part of the Render system. Hovewer, the GUI system will need to have a pointer to the Window to register GUI widgets.
- Between Gameplay and Render. Where applicable, Actor class will have a AnimatedSprite, which i will implement on my own. It will be a part of the Gameplay system, and will have a pointer to the sprite in resource manager (in the Render system); it will just cut it depending on animation/frame. In some cases, when animations are not required, the Actor class will just have pointer to a normal sprite. To get those pointers a function in resource manager will be called from the Gameplay system.
The latter of two is the major problem; as the function could be called at any time. But, it would be a simple function like sf::Sprite * getResource(std::string name) so i think it wont present all those big bad problems of coupling.