Hi there !
I've been working for a few month on a peculliar game engine from scratch in my spare time, mostly “cuz i can, then why not ?”
I am only using c++ 20 with the std and following the ECS design.
I'm trying to make the core engine totally independant from external libraries (graphics, sysevents, sound, network…).Not sure if this is good but I'll still go all the way and see if it was worth it ^^
My main motivation here are :
- to not bother with visuals and graphic until a later stage of developpment (do i need 3d at the start ? Maybe just 2d while coding the core principle of the gameplay would suffice) (use cheap & quick lib at first then switch to a better one if you need it) (cross plateform ?). That's a lot to think and it's prone to changes so i just prefer doing it later
- Having a “Pure” core game engine which means it would almost with minimum tweaks be crossplateform. And if the “game” part of the code only depends on the engine that's means the same for your game 🙂
The approach I took to resolve this is the following :
A system (which hold the game logic) upon registration can request some services which will be provided upon instanciation. (Dependency injection here). The system will then be able to use the requested service interface that hides which library is actually in use (loose coupling).
I can already see two problems happening in a near future during the game developpement (not only the engine) :
- Handling the loading / lifetime of the lib specific ressources (like a sprite, a texture or a soundPlayer) .
- Making optimization of the lib usage which might depend on the core engine.
Is there anyone that have done or heard of loose coupling libraries in game engine ?
I did read a few things about it but it was mainly about making the code not overly reliant on Unity or Unreal Engine (which hold no interests to me because the funniest part of the dev is already done).
It would be even better if you had some ressources about it (article, books, podcast, gravure, I take anything you might have :p )
If needed I can provide my PlantUML class diagram of the engine.
Thanks for your time reading and any suggestions you might have 🙂 !