Question

Artemis seems like an excellent framework for ECS, but the documentation is to say at the least, lacking. I am new to ECS and have no idea what I am doing, but I want to learn.

My objective is to draw something to the screen. I am using MonoGame and Visual Studio 2012 (with Artemis). I have spent many hours scouring thru the StarWarrior code without any success. I cannot find the link between the SpatialFormComponent and the thing I want to draw (such as PlayerShip).

My best guess for the issue is that I am using the pool wrong. So my 2 questions:

1. What is the Pool in Artemis? (What does AddComponentFromPool() do?)

2. How do I draw something to the screen using Artemis? (What is the missing link?)

I am sorry if that question does not appear well researched, but I assure you it is. That being said, if you find a source which resolves my problem (I doubt you will), then I welcome the downvotes.

Was it helpful?

Solution

Question a bit old but I'm feeling like answering.

  1. Object Pool is a design pattern which helps to reduce garbage collecting by reusing once created objects. When you use object then you get it from pool. When you don't need it anymore, then put it back to the pool, so later it can be reused. Best example of using object pools in gamedev is particle system implementation.

  2. There are many ways to do it in ECS. The simplest is to create some RenderableComponent, put some PositionComponent and RenderSystem which renders based on those two. The fact you might miss there is that Artemis doesn't provide any rendering, it just to manages entities and systems. Look into this wiki and likes on the bottom there to get more info about using ECS.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top