Entitas-csharp: Example projects

Created on 9 Dec 2017  路  8Comments  路  Source: sschmid/Entitas-CSharp

There have been quite a few people coming to the Entitas gitter chatroom in search of examples on how to use entitas, not only in small projects but large ones as well with different requirements such as navmesh, physics, state handling (e.g. menu state, game state switching etc and game events), buff/de-buff systems etc.

We have the Entitas cookbook project on @mzaks repo to define and explain various entitas patterns and ECS techniques we could use but we don't have any practical examples of it. Rather than constantly reinventing the wheel for others I propose we list example projects that we want and write them here so that the community can pick out an example, implement it and post it. Examples which do not couple to unity and are in a separate assembly would also be beneficial as well to demonstrate different setups. (@sschmid not sure whether a pull request is a appropriate for this or simply making a wiki page to other repos).

Specific descriptions with as little words as possible for the desired example project is preferable over "example using physics/navmesh" so that we can build up a library of examples for variying levels of complexity. Here is an example:

"Entitas version of unity tanks which uses physics and navmesh" - such an example may use physics and colliders for tank projectiles and navmesh for tank AI.

This is the list so far:

Ongoing/Wishlist:

  • [ ] Entitas version of unity tanks which uses physics and navmesh (@T2RKUS)
  • [ ] Moba-like character utilizing timer system for spells/attacks (should include count down and count up timers)
  • [ ] save/load game example using flat buffers
  • [ ] in-game tile-map editor

Example Projects:

#

when you have selected an example, please let us know below and I will update this issue.

Most helpful comment

Is this topic still alive?
I've uploaded the RTS template I promised: https://github.com/ShadeSlider/Entitas-RTS-Template

All 8 comments

I'm working on rewriting my RTS project using Entitas and I'm willing to share the basic functionality when I'm done with it.
That includes:
1) Universal mouse and keyboard input processing using keymap config.
2) Click and drag selection of units/structures in the scene
3) Basic 'right-click' navigation for units using, probably, A* Pathfinding Project (thanks to @StormRene for suggesting it, btw)
4) Basic resource system for construction with a UI panel.
5) Possibly, something else.

@ShadeSlider
Did your project make for multiplayers? I'm working on a similar project using Entitas, I found some problem to update agent properties with ECS way.

  1. There are thousands of agents to sync with server. (State Synchronization)
  2. createEntity on Message(id, create), and addPosition(), addRotation(), addxxx()...
  3. every time I get the Message(id, new_pos), I need find the entity which created before.
    with the old way it usually need an AgentManager to hold a map , (ignore octree here) then get and update Position on receiving the message.
    with the ecs way, I can only solve with
group<entity> allAgents = context.GetGroup<Matcher.AllOf(Matcher.Id, Matcher.Positon)>
foreach(var agent in allAgents.GetEntities()){
    if(agent.Id.val == id){
        ....
    }
}

but traversing the array is expensive. How do you solve such things, to quickly find some entity with ID or some key component else.

@wallpap3r you can use a custom entity index to get entites based on id which contains a position component. Please refer to https://github.com/sschmid/Entitas-CSharp/issues/351 for examples.

@T2RKUS It's exactly what I what, I was just try to ask how the [EntityIndex] attribute is used then It's here.
Thanks you for the tutorial.

Is this topic still alive?
I've uploaded the RTS template I promised: https://github.com/ShadeSlider/Entitas-RTS-Template

Updated list.

@ShadeSlider I've added your RTS Template to the examples page. Thanks for sharing!

Update: I've started on Entitas Tanks Example.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xkyii picture xkyii  路  3Comments

JamesMcMahon picture JamesMcMahon  路  5Comments

angelotadres picture angelotadres  路  5Comments

zhuchun picture zhuchun  路  4Comments

Stals picture Stals  路  4Comments