Concord - A feature-complete ECS

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
Tjakka5
Party member
Posts: 243
Joined: Thu Dec 26, 2013 12:17 pm

Concord - A feature-complete ECS

Post by Tjakka5 »

"ANOTHER ECS library? What's the point? There's already dozens of those out there!"
...Is probably what's going trough your mind right now.

And yes, the "market" is quite saturated with ECS implementations, but Concord is a bit unique.
In a nutshell, it offers loads of advanced features that are able to do cool advanced things, while still being very performant!

It offers complete abstraction of Components, Entities, Systems and Instances. These are all designed so that you can build on top of them if you so wish.
Concord also offers a bunch of ways to manipulate each of these objects, all in an efficient manner, of course.

Basically what I'm saying is: Cool features. Fast code. Very neat.


So with all the hype built, I am proud to present: Concord! (https://github.com/Tjakka5/Concord)
Along with documentation available here.

Concord is currently considered stable, if you happen find any bugs, please report them so I can squash them ASAP.


I am also working on a tutorial for how to program in ECS, along with a bunch of examples on how to write efficient systems. These are still in development however.
ryanzec
Prole
Posts: 11
Joined: Sat May 05, 2018 3:37 pm

Re: Concord - A feature-complete ECS

Post by ryanzec »

So I am currently exploring different ECS options for a game I am prototype with Love2D / Lua so many you can help me here. My main concern, as with almost everything with game development, is performance overhead.

For my game, I am going to be rendering a lot of sprites (20k - 30K) however probably about 90 - 95% of those can be grouped into 2-3 sprite batches and don't need to be updated on every frame and prototype that seemed pretty good.

My concern more lies with that I am going to want to have a lot of entities in the game. It is an open world turn based survival roguelike (can't think of any other buzz words to put in there :)) that is going to have a seemingly "infinite world" which could contain 10 's to 100's of thousands of entities. Obviously I can't load and simulate that many entities at once (not on the average computer at least), my naive plan from someone who has not built a game of this scope before is:
  • split the world into small chucks (maybe something like 16x16) that will store all the data related for that chuck (map data, entities, etc.)
  • only load X number of chunks that surround the player (maybe something like 7x7 or 9x9 with the players location being the center chunk)
  • as the player moves, I will load and unload chunks that become in scope and out of scope along with loading and unloading entities related to those chunks in the ECS system
Now most of the entities should have relatively simple logic that needs to be simulated, only a subset (maybe 100 at most 99% of the time) will need more complex things (the most complex things being a* path finding).

Do you think that is something the ECS in Lua can handle in general and more specifically Concord? Maybe I am thinking too grand for using a higher level language (or ECS) and maybe I need to dig into C++ to be able to get the features I want with the performance I need.
User avatar
Tjakka5
Party member
Posts: 243
Joined: Thu Dec 26, 2013 12:17 pm

Re: Concord - A feature-complete ECS

Post by Tjakka5 »

I think LOVE (And Concord) would work fine for your goals. You'll need to do some clever tricks though, as you are already aware:

Definitely use chunks. Don't make them too small or you'll spend a lot of time loading / unloading constantly. Definitely have 3 states for your chunks. Loaded, unloaded but still in ram ready to be loaded, and completely unloaded.

ECS will handle all kinds of entities well. If your entities are fairly static then thats a plus too.


One trick I found is that you should combine entities where possible. For example, my 20x20 tile background COULD be 400 entities. Or it could be one entitiy with 400 quads. The latter being much more efficient of course.
User avatar
yetneverdone
Party member
Posts: 448
Joined: Sat Sep 24, 2016 11:20 am
Contact:

Re: Concord - A feature-complete ECS

Post by yetneverdone »

I agree. This ECS lib is very good. I use this in learning ECS.
ryanzec
Prole
Posts: 11
Joined: Sat May 05, 2018 3:37 pm

Re: Concord - A feature-complete ECS

Post by ryanzec »

Well I was able to convert my tiny.ecs prototype to this relatively easily (it did take a bit more code than when converting from no ECS to tiny.ecs as there is a bit more "boilerplate" code). Speed tests seemed comparable with tiny.ecs running at ~48FPS and Concord running at ~45FPS when I have 15K entities that all just loop 1000 times and do an addition in each loop execution (this was just to try to test the base overhead of the libraries).

The one thing I do like with Concord over tiny.ecs is that fact I can define system with different methods so that I can execute specific code on specific events (maybe I can do that in tiny.ecs and I just don't know how).

One thing I would say is that the examples might need to be updated. For instance, this line errored for me:

Code: Select all

Concord.addInstance(Game)
https://github.com/Tjakka5/Concord/blob ... nit.lua#L9

I only realized the issue after looking at the API documentation which seems to have a different interface for creating instances.
User avatar
Marty
Citizen
Posts: 89
Joined: Mon Dec 04, 2017 1:47 am
Location: Germany

Re: Concord - A feature-complete ECS

Post by Marty »

To be honest, I work with this lib in a serious matter and I'm very satisfied. For me it's the best ECS lib for LÖVE, because of its simplicity and yet huge possibilities for customisations. Also it's very fast compared to other ECS libs with the same feature level.

Great job, Tjakka.
Visual Studio Code TemplateRichLÖVE Mobile (AdMob+UnityAds+PlayGamesServices+GameCenter)Add me on Discord

───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░░░░░░░░█────
▄▄──█░░░▀█▀░░░█──▄▄
█░░█▀▄░░░░░░░▄▀█░░█
User avatar
zeaga
Prole
Posts: 2
Joined: Tue Oct 15, 2013 5:17 pm

Re: Concord - A feature-complete ECS

Post by zeaga »

This looks awesome! I can't wait to start using it.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests