A topdown game built in C# .NET Core with Monogame and my own Entity-Component-System. Build structures, fight monsters, establish farms, fish, and explore in this story-driven game!
Table of Contents
The Entity Component System I have programmed is the core of this game. Every single Entity in the game, whether it be a static path decoration, a monster, or the player itself is stored in a class which contains only its data. These classes will implement a set of interfaces (which all inherit from IComponent
) which will provide a template for the properties which need to be provided. Implementing this interface will add any instance created to the list of components registered by any and all Systems which look over these sets of components. These systems will perform the necessary calculations and establish the interactions between Component objects. For example, the PhysicsSystem
provides movement to all objects with a IKinetic
component. Here is a list of all available Component interfaces:
ITransform : IComponent
- BasicTransform
Component that holds positional information. All objects withTransforms
are given to thePhysicsSystem
.IKinetic : ITransform
- Represents an object that can move (is not static). The movement will be handled by thePhysicsSystem
.ISprite : ITransform
- If present, theActiveTexture
will be drawn to the screen at theTransform's
Position by theRenderSystem
.IColliderTransform : ISprite
- Represents any object that has a collider.ISolid : IColliderTransform
- Represents any object who's collider is solid.ITrigger : IColliderTransform
- Represents any object who's collider is simply a trigger.
The world of the game data is stored in the World
class. It contains a Tape
(custom data structure) of a tuple containing a TileMap
and an EntityMap
.
Each node in the Tape
represents one layer of the world. For example, the starting tilemap is the base ground level and the starting entity map describes all static and non-static entities on the ground level. The layer below on the tape might represent the mining area directly underneath ground level.
Time-maps contain a 2D-array of Tiles
. This map can be saved and loaded from memory.
When loaded, the blockdata will be used to automatically select the textures based on adjacency patterns.
For example, if there is dirt adjacent to a grass tile, the grass tile will select a texture which shows the intersection of the two tiles.
With two regular intersecting tiles, there can be over 40 different intersections which are all auto-generated through the Blockdata.
In the Content folder there is a set of blockdata json files which contain the information and tilemap patterns for each tile type (dirt, grass, etc.)
The extension of these files determines the file schema. All schemas represent an BlockModel<T>
where T
is an IAdjacencyModel
(which is then converted to the matching IAdjacencyPattern
). These can be designed manually or autogenerated using the BlockDataGenerator
Console App by simply providing it with a pattern template bitmap. The algorithm will look at all the 3x3 patterns in order and will prompt the user for the Block Name for
each unique color it comes across in the patterns. It will output a generated pattern json.
The available format options are:
DirectAdjacencyModel/Pattern
(name_d.json) - Simplest patterns which matches on only the directly adjacent tiles ( W N E S )SingleAdjacencyModel/Pattern
(name_s.json) - Simple patterns which match on all adjacent tiles ( W NW N NE E SE S SW )DirectRandomAdjacencyModel/Pattern
(name_dr.json) - DirectAdjacency but multiple textures can be listed with random weightsSingleRandomAdjacencyModel/Pattern
(name_sr.json) - SingleAdjacency but multiple textures can be listed with random weights
This project is currently in development. There is no published version, but feel free to download the project and build it yourself!
See the open issues for a list of proposed features (and known issues).
Distributed under the MIT License. See LICENSE
for more information.
- Sofia Echvarria - Game Design and Art
- Ryan Alameddine - Game Design and Programming