Slick Forums

Discuss the Slick 2D Library
It is currently Sat Feb 23, 2019 1:27 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Nov 14, 2013 6:23 am 
Offline
Game Developer
User avatar

Joined: Wed Feb 17, 2010 12:24 am
Posts: 598
I'm using artemis-odb 0.4.0, but should be compatible with artemsis.

I have a basic world, entities, systems, etc working and have some questions:

* How do you use EntityObserver (and SystemObserver if there is one?). Basically, my goal is to call dispose() on any entity or system that has been deleted from the world (some of my entities need to do clean up).

* What is a passive system?

* What is a Manager?

* What is a ComponentType?

in regards to artemis-odb:

* I see you have plans for pooling entities in 0.5.0 which is awesome. Does it automatically pool Components too or should I do that manually?

* Any plans with merging with this (viewtopic.php?f=28&t=6736) fork or at using the libgdx collections?


Top
 Profile  
 
PostPosted: Thu Nov 14, 2013 12:40 pm 
Offline

Joined: Sun Jun 03, 2012 9:21 pm
Posts: 49
Quote:
How do you use EntityObserver (and SystemObserver if there is one?). Basically, my goal is to call dispose() on any entity or system that has been deleted from the world (some of my entities need to do clean up).


Both Managers and Systems implement EntityObserver. If your components hold managed resources, I recommend a Manager that intercepts entities that are removed(/added/changed). For an example, see: https://github.com/junkdog/agrotera/wiki/@ArtemisManager.

Quote:
What is a passive system?


Passive systems don't run during world#process - they must be invoked directly (ie, SomePassiveSystem#process).

Quote:
What is a Manager?


Managers belong to a world, but are only triggered upon entity state changes (see EntityObserver).

Quote:
What is a ComponentType?


Mostly for internal use; ComponentType holds metadata about component classes, specifically the component type's index (the index is mapped to different Bag indices internally). Artemis-odb adds some additional metadata to ComponentType, like whether the component is a pooled or packed etc.

Quote:
I see you have plans for pooling entities in 0.5.0 which is awesome. Does it automatically pool Components too or should I do that manually?


- Entities are automatically pooled.
- Components are pooled only if they extend com.artemis.PooledComponent. Alternatively, annotating a normal com.artemis.Component with @PooledWeaver transforms the component into a PooledComponent at compile-time (via the artemis-odb-maven-plugin).
- PooledComponents are automatically recycled, but must be instantiated via Entity#createComponent(Class<Component>).

For more info, see Component Types on the artemis-odb wiki.

Quote:
Any plans with merging with this (viewtopic.php?f=28&t=6736) fork or at using the libgdx collections?


I thought about it, but I don't want to add a hard dependency on libgdx. The old bugs in Bag have been fixed now (or so I believe), and it was one of the few classes that made me consider replacing it with libgdx's Array etc.

_________________
agrotera: bytecode-weaving antiboilerplate lib for artemis. | artemis-odb: bugfixing and performance optimized fork.


Top
 Profile  
 
PostPosted: Thu Nov 14, 2013 12:52 pm 
Offline

Joined: Sun Jun 03, 2012 9:21 pm
Posts: 49
I might just as well add: artemis-odb 0.5.0 is ~2w away. I don't expect any breaking changes to the API until then, in case you want to use the github repo directly.

_________________
agrotera: bytecode-weaving antiboilerplate lib for artemis. | artemis-odb: bugfixing and performance optimized fork.


Top
 Profile  
 
PostPosted: Thu Nov 14, 2013 7:02 pm 
Offline
Game Developer
User avatar

Joined: Wed Feb 17, 2010 12:24 am
Posts: 598
wow! Thanks for all the great information. It'll take me a bit to absorb :)

Is there a 0.5.0 .jar available?


Top
 Profile  
 
PostPosted: Fri Nov 15, 2013 12:35 pm 
Offline

Joined: Sun Jun 03, 2012 9:21 pm
Posts: 49
Quote:
wow! Thanks for all the great information. It'll take me a bit to absorb :)


Np, shout if you want any further clarification.

There are currently no snapshot releases deploy any maven repo.

Are you using maven? If so, clone artemis-odb and run mvn install from the root. Refer to artemis-test/pom.xml for how to setup your pom.

The annotation processor (artemis-validator) needs some improvements before release, so it can pretty much be disregarded for the time being.

Only artemis-odb-0.4.1-SNAPSHOT.jar is required, unless you want bytecode transformations offered by @*Weaver annotations.

_________________
agrotera: bytecode-weaving antiboilerplate lib for artemis. | artemis-odb: bugfixing and performance optimized fork.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group