Skip to content

The Lost Island of R'anal-Monogame - Rpg Written in C# using the MonoGame framework

License

Notifications You must be signed in to change notification settings

AnshumanKumar14/The-Lost-Island-of-R-anal-Monogame

Repository files navigation

The Lost Island of R'anal-Monogame

Rpg Written in C# using the MonoGame framework

Planing on developing this further or moving to Unity?

Made WIth:

alt text

alt text

Using the Entity Component System Setup:

What is an ECS?

An Entity Component System (ECS) is a way to build and manage the entities (or game objects) in your game by composing their component parts together. An ECS consists of three main parts:

Components

A component is simply a class that holds some state about the entity. Typically, components are lightweight and don't contain any game logic. It's common to have components with only a few properties or fields. Components can be more complex but inheritence is not encouraged.

Entities

An entity is a composition of components identified by an ID. Often you only need the ID of the entity to work with it. For performance reasons, and entity ID is only valid while the entity is alive. Once the entity is destroyed, it's ID may be recycled.

Systems

A system is a class that will run during the game's Update or Draw calls. They usually contain the game logic about how to manage a filtered collection of entities and their components.

Using components, we can pick and choose bits of behavior for each object we want alt text

Some components (like Position) are shared between systems. Other components can be private to a particular system, which allows for information hiding and greater optimization in memory layouts.

For example, let’s say that one scene in the game contains a thousand entities. Almost all of these entities contain a position, so we could just allocate a large 1000-element array for our position components, and store the position for each entity indexed by its entity ID. Since the array is almost completely populated, and we’ll want to reference entity positions on a regular basis, this is probably the most efficient way to store this information.

On the other hand, maybe only a relatively small amount of our scene’s entities have a velocity. In this case, we might use some other strategies to allocate just enough memory for the velocities we do have, and then map entity IDs into our velocities array.

Strategies like this let us potentially do a better job than a general-purpose GC or system allocator — although of course we should be careful and continually profile to make sure we’re actually benefiting from the extra complexity of managing our own memory.

Further reading:

A list of useful data-oriented design resources.

Screenshots:

Example Enemy: alt text

Boss: alt text

NPC That turns into a werewolf: alt text

About

The Lost Island of R'anal-Monogame - Rpg Written in C# using the MonoGame framework

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published