I`m considering split my project into some Libraries: Overdesign?


I’ve recently finished a core functionality for my project, whose purpose is to do some weapon management (equip, switch, drop, reload, fire, networking etc.). But even though this library is somewhat stable, the project itself is not, and I see myself recreating copies of the project, moving assets around to create more “final versions” after many drafts. This usually happens when I’m just trying to figure out a new functionality or new asset and decide to leave out, or moving things around to improve/adjust them.

Recently, after checking the Loading Screen sub-project, delivered in the Shooter Project, I was considering doing something similar with this Weapon API (and perhaps with some others too). I think this could allow an easy transfer of this core functionality, and perhaps even allow me to create some abstractions and re-use it in another project. But I’m not entirely sure this is not an over-design, trying to solve an issue related to my workflow for project setup/management.

I’d really like to read some input on the subject, before really deciding to go ahead and break the main C++ project into a “core project” which depends on some others, including the aforementioned weapon lib. So, thoughts? =)


Is good practice to convert sub-systems to tools or modules always when you can.
Most developers however are used to “hardcode” functionality into the game itself and heavily rely on backups because at a certain point it’s impossible to modulate the project anymore and this is where things start getting ugly;
If for some reason your main project files get corrupt it’s absolute hell to fix it, no matter which engine you’re working on…

I often work this way, I find it helps me to build more reusable code. You do have to ask yourself though “Does this make sense as a general and fairly complex reusable component?”.

I do make sure to design and document the code on a per-library basis though, with its own API structure, and if there’s too many interdependence between them then I make sure the design is as clean as possible.

As an example for my current experimental project I have at least the following libraries (Don’t have the code on this machine so can’t check…):

  • A custom tile-based route finding library
  • Procedural mesh generation for level geometry
  • A run-time file library for reading .OBJ files into meshes(May expand to other formats…)
  • A run-time file library for reading .PNG files into textures
  • An XPath based data store library
  • An RPG library for building characters, abilities, and items in a generic way (Uses XPath data store library)