Git Product home page Git Product logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
The Bag is used in Artemis to ensure high performance, but it does not have 
objects ordered by the insertion order.

The EntitySystem has two methods, inserted() and removed(), which you can 
override, and there you can put the entities into an ordered collection like 
ArrayList inside your system. A bit of a duplication, but solves the issue.

I do this here:
http://code.google.com/p/spaceship-warrior/source/browse/src/com/gamadu/spaceshi
pwarrior/systems/SpriteRenderSystem.java

I'm looking into how to add ordered support into Artemis without sacrificing 
performance. Not sure when I'll add it.

Original comment by [email protected] on 2 Sep 2012 at 2:56

  • Changed state: Started

from artemis-framework.

GoogleCodeExporter avatar GoogleCodeExporter commented on September 26, 2024
Why not order only systems, and only to some level?

From API point of view, for my needs something like

world.setSystem(..., false, order (int with default 0))

would be enough - and then for certain "order" value, the order of calls does 
not matter, but one could place some systems (especially render ones) on higher 
levels. About implementation, I'm wasn't thinking about it yet (Array of 
Bag<EntitySystem> maybe? no idea), but I believe, that:

1) it is enough to solve most cases when we would want ordered processing - 
including original issue (UseShaderProgramSystem updated before any other 
rendering related systems), although it wouldn't solve everything (cases when 
one needs ordered entities, like in SpriteRenderSystem example posted)
2) it does not break compatibility with current code (in old code all would be 
in same "order" at level 0 (default), so it would be same behaviour - at the 
price of maybe single check per world.process to access element of Array (or 
something else) containing Bag with EntitySystems)
3) seems to be potentially faster than fully ordered approach
4) requires least work to solve the issue

what do you think?

Original comment by [email protected] on 1 Jan 2013 at 10:10

from artemis-framework.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.