
This is a shot of a game I've been developing for the past year or so. The working title is Banished.
The game begins with a small group of people in the wilderness that have a few supplies left. As the player you guide them to survive, build homes, grow or hunt food, provide warmth, and eventually grow a city. Another focus of the game is on limited resources. A tree takes nearly the lifetime of a citizen to grow, so you can't just clear-cut the play area. Over fishing or hunting will dwindle the number of animals. Failure to rotate crops will result in poor soil.
Unlike most games of this type there are no build trees, no taxes, and no money involved. You can build anything at any time as long as you have the resources for them. Each citizen is individually simulated. They spend time at home, tend to crops, go fishing, hunt, visit the market, have families, and children their children grow up to do the same thing.
I've developed all the tech for the game using C++. No third party libraries are used for the final run time.
The code is written to be cross platform compatible, but currently only the PC is support. When finished I plan on supporting other platforms as well.
All assets are configured using text input files that match C++ class member declarations. Binary assets such as models, audio, or textures are loaded from thier source format and then cached for fast loading in a format that is ready to use by the system. Changes to source assets are automatically detected and then re-cached. The code has it's own RTTI system that can be used both for type safety and to serialize pointers to disk and reconnect them on load.
The entity system uses a component based model rather than a typical C++ polymorphic hierarchy. Entities are collections of simple components, such as a Model component - to display a mesh, or a Storage component - a place where resource can be stored, or a Growth component - which allows trees and plants to grow over time. This allows functionality to be shared between class types without having a heavy base class with common implementations. It also allows for strange combinations of entities, such as allowing people to live inside a tree - simply by configuring a new entity asset - no code changes required.
The graphics engine uses a simple scheme of a loose quad tree and hierarchical frustum culling. Any objects found in view are sorted by material and instance identifiers. Objects are then drawn many at a time using instancing. Different instances can have different parameters such as scale and color. When fully zoomed out the game can submit ~16,000 objects which is then submitted to the GPU with ~400 draw calls. The scene is typically drawn twice, once for a full scene shadow map that conforms to the view frustum and then again for the main scene. On a nVidia GTX280 and a single CPU thread the game runs at a solid 60 FPS. The game current runs using shader model 2.0, for widest possible support, but the graphics engine has scalability features built into it to decrease gpu load for slower GPUs.
The material system is very configurable. New materials can be generated without changing C++ code. Using just a few parameters from the game, the shaders in the game light the objects, and then apply seasonal effects. Leaves on trees turn brown and then are lost in autumn, and snow covers the ground and water turns an icy color in winter.
Skinned models and animations are supported and can be drawn instanced, as long as the models are sharing an animation. Animations blend between each other and can blend between instanced and non-instanced sequences. This allows characters in the game to share animations most of the time but gives the ability to play a unique animations. Shared animations also significantly reduce the CPU time for updating 100's of hierarchies.
Pathfinding is dynamic and accomplished using A* as well as node maps that determine areas that are accessible from one another. These node maps remove the worst case scenarios of A* and allow path finding queries to be very fast.
The UI is fairly simple but supports many widget types, such as backgrounds, buttons, check boxes, combo drop downs, images, tables, progress bars, text, drag and drop as well as localizable Unicode font support. The UI has its own implementations of these widgets for cross platform considerations.
Geez, I've written a lot of code this past year...
If you'd like to see progress on the game, follow me here: http://www.shiningrocksoftware.com/
|