C# Artemis Entity System Tutorial

Artemis is a high performance Entity System framework for games, originally written in Java by Arni Arent and Tiago Costa, now ported to C#.
Its goal is to provide a clean API to abstract your game world organization into entities, components and systems.
Artemis has no dependencies (for PC, in Xbox and Windows Phone 7 we have one) and can be used with any game framework or library, 2D or 3D, and even multiplatform, if you use it with Mono/MonoTouch/Mono4Android.

Differences from the original version

We support all the features included in the original Java version, but we’ve also added the following features:

  • Multithreading Support (two ways of doing this)
  • Specialized System templates for your multithreading needs
  • Communication between Systems using a Blackboard approach
  • Bugs fixed, performance improvements
  • Xbox/WP7/Mono(Android/Linux/Mac/iOS) support
  • Events for intercepting adding/removal of entities/components
  • Blackboard for sharing common objects between systems
  • Entity Pool (to make objects reusable, minimize garbage collection activity, improve performance)
  • Small goodies, like feeding the EntityWorld with whole Entities(maybe loading from external resources), enabling/disabling systems and entities, getting Entity tag, API shortcuts(see unit tests for more on this), etc.

Getting Started

  • Entities are only an aggregation of Components, identified by a unique id
  • Components are only data
  • Systems publish/subscribe to Components, creating behavior

There is much more to tell about this paradigm and we already have rich articles which inspired this framework. Some of them:

And many more can be found here.

Your components must inherit from the class Component or ComponentPoolable if you want it to use the Artemis Component Pool. Example:

//Add this Attribute and extend ComponentPoolable if you want your Component to use Artemis Component Pool
[Artemis.Attributes.ArtemisComponentPool(InitialSize=5,Resizes=true, ResizeSize=20, isSupportMultiThread=false)]
class Velocity : ComponentPoolable
        private float velocity;
        private float angle;

        public Velocity() { }

        public Velocity(float vector)
            velocity = vector;

        public Velocity(float velocity, float angle)
            this.velocity = velocity;
            this.angle = angle;

        public float Speed {
            get { return velocity;}
            set { velocity = value; }

        public float Angle
            get { return angle; }
            set { angle = value;}

        public void AddAngle(float a)
            angle = (angle + a) % 360;

        public float AngleAsRadians
            get { return (float)Math.PI * angle / 180.0f; }

        //obligatory for poolable Components
        public void Cleanup()
             coords = Vector3.Zero;

A sample for entity assembling:

Entity e = world.CreateEntity(); // you can pass an unique ID as first parameter.
e.AddComponent(new Transform(200,400));
e.AddComponentFromPool(new Velocity(2.4f,0.9f)); // use AddComponentFromPool if the Component extend from ComponentPoolable
e.Refresh();// always call Refresh() when adding/removing components!

Your systems should inherit from one of the following templates:

  • EntitySystem – the simplest system template, not tied to components, good for stuff like collision
  • EntityProcessingSystem – a template for processing many entities, tied to components
  • IntervalEntitySystem – a simple system template, not tied to components, process periodically, based on world delta.
  • IntervalEntityProcessingSystem – a template that process entities periodically, based on world delta, tied to components.
  • ParallelEntityProcessingSystem – a template to leverage your multicore CPU for processing many entities, tied to components
  • ProcessingSystem – a template that process whichever logic you desire, without being tied to components
  • QueueProcessingSystem – instead of filter by components, this system process entities that are added to its public queue
  • HybridQueueProcessingSystem – process entities by queue and components
  • QueueProcessingSystemThreadSafe – process entities by a public static thread safe queue
  • FQueueSystemProcessingThreadSafe – process anything (not only entities) added to its public static thread safe queue
  • TagSystem – a simple system template, not tied to components, process a tagged entity
  • IntervalTagSystem – a simple system template, not tied to components, process a tagged entity periodically, based on world delta.
  • DelayedEntitySystem – a simple system template that starts process after a given time, based on world delta.
  • DelayedEntityProcessingSystem – a template that starts processing entities after a given time, based on world delta. Tied to components

And here is a system example, using Velocity and Transform components to create the Movement behavior:

//Add this attribute so the EntityWorld knows the systems it should execute, use the Layer to determine execution order
[Artemis.Attributes.ArtemisEntitySystem(ExecutionType = ExecutionType.UpdateSynchronous, Layer = 1)]
public class MovementSystem : EntityProcessingSystem {

    public MovementSystem() : base(Aspect.All(typeof(Transform), typeof(Velocity))) { }

    public override void Initialize() {}

    public override void Process(Entity e) {
        Velocity velocity = e.getComponent();
        float v = velocity.Speed;

        Transform transform = e.getComponent();

        float r = velocity.AngleAsRadians;

        float xn = transform.X + (TrigLUT.Cos(r) * v * world.Delta);
        float yn = transform.Y + (TrigLUT.Sin(r) * v * world.Delta);

        transform.SetLocation(xn, yn);

On your game initialization, create a new EntityWorld and initialize it:

var world = new EntityWorld();
world.InitializeAll(true); // pass true/false to enable/disable DataAttributes on Systems

Update or Draw the World:

world.Draw(); // do this on a different loop, e.g: every 15 ms

And you are good to go. The Entity object has some intuitive methods like Delete(), GetComponent(), RemoveComponent(), which you can see in action on the example game.


Aspects are used in the constructor of your entity systems to tell them which components they should be interested. At the moment we have three methods to build Aspects:

  • Aspect.All(params Type[] types) – Most of the time you will use this option, so the system processes entities which have all components of the Aspect.
  • Aspect.One(params Type[] types) – The system will process entities which have at least one of the components of the Aspect.
  • Aspect.Exclude(params Type[] types) – The system will not process entities which have at least one of the components of the Aspect.

You can also compose your Aspect utilizing these methods together, example:

public LogEnemySystem() : base(Aspect.All(typeof(Health)).One(typeof(Koopa),typeof(Goomba),typeof(Magikoopa)).exclude(typeof(Ghost))) {}

Extending Systems

It’s quite simple to extend the EntitySystem with your own logic, an example can be found here, which gives us less setup on systems which only uses Aspect.All(), example:

[Artemis.Attributes.ArtemisEntitySystem(ExecutionType = ExecutionType.UpdateSynchronous, Layer = 1)]
public class MovementSystem : EntityComponentProcessingSystem {
    public override void Process(Entity e,Transform transform, Velocity velocity) {
        float v = velocity.Speed;
        float r = velocity.AngleAsRadians;

        float xn = transform.X + (TrigLUT.Cos(r) * v * world.Delta);
        float yn = transform.Y + (TrigLUT.Sin(r) * v * world.Delta);

        transform.SetLocation(xn, yn);


Create your entity templates to avoid manually creating and configuring entities:

public EnemyTemplate : Artemis.IEntityTemplate {
	public Entity BuildEntity(Entity e,EntityWorld entityWorld, params object[] args) {
		e.AddComponent(new Transform(200,400));
		e.AddComponent(new Velocity(2.4f,0.9f));

Create your entities with the template applied:

var enemy = world.CreateEntityFromTemplate("BulletExplosion",array_of_parameters); // you can also use an alternative signature passing a custom unique id as the first parameter.


You can easily share common objects between systems using the blackboard, here is a XNA example, on the game initialization:

EntitySystem.BlackBoard.SetEntry("ContentManager", Content);
EntitySystem.BlackBoard.SetEntry("GraphicsDevice", GraphicsDevice);
EntitySystem.BlackBoard.SetEntry("SpriteBatch", spriteBatch);

Then you can retrieve the objects inside systems like this:

this.device = EntitySystem.BlackBoard.GetEntry("GraphicsDevice");
this.spriteBatch = EntitySystem.BlackBoard.GetEntry("SpriteBatch");
this.contentManager = EntitySystem.BlackBoard.GetEntry("ContentManager");

Games created with Artemis C#

Magnetic by Nature – by Tripleslash Studios. They also have a Kickstarter running for the game, support it!

Discussion, issues, suggestions

We have a forum section here.

 Use It !!!


  1. #1 by insurance for group 8 car on 29 de setembro de 2016 - 8:25 pm

    If you’re still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you’ll know which is right for you.

  2. #2 by Wakizashi Swords on 29 de setembro de 2016 - 8:33 pm

    exactly what my daughter wanted ! thanks!

  3. #3 by Naginata Sword on 29 de setembro de 2016 - 8:34 pm

    grand article , exp茅dition rapide

  4. #4 by SAKABATO Sword on 29 de setembro de 2016 - 8:44 pm

    Neat shoe, Thanks!

  5. #5 by Samurai Swords on 29 de setembro de 2016 - 8:49 pm

    Chaussure mignonne ! Recommander vendeur , merci pour l’expédition rapide & livraison !

  6. #6 by Neal Mccune on 29 de setembro de 2016 - 8:50 pm

    Handyman Service in Alhambra

  7. #7 by http://shoesbychavez.com/the-microeconomics-of-insurance.html on 29 de setembro de 2016 - 9:16 pm

    Ya we feel you Fam – you always right on time with it. That is much needed. I;m going to see if we can make that happen. I know that when school is out we’ll get the girls out and we’ll see about the rest

  8. #8 by sword on 29 de setembro de 2016 - 9:21 pm

    Absolutely the most awesome seller!! Thanks for the super fast shipping!!

  9. #9 by http://everyheadcounts.org/do-you-need-car-insurance-to-register-a-car-in-ct.html on 29 de setembro de 2016 - 9:26 pm

    This ad is bad enough, but it’s also worth mentioning the ad that followed next featuring Voldo – a close up on his uh, codpiece, with the word “curious?” written in Japanese above his stomach.Within a few days the ad was banned due too many complaints of it’s risque nature.Yeeeap.(Google search “Voldo banned ad” for the picture)

  10. #10 by japanese katana on 29 de setembro de 2016 - 9:29 pm

    Arrivé rapidement ! Merci !

  11. #11 by aarp auto insurance review on 29 de setembro de 2016 - 9:33 pm


  12. #12 by Malcolm Bartholomay on 29 de setembro de 2016 - 9:33 pm

    Excellent read. I just now passed this on 9/29/2016 to a coworker who has been involved in some work of her own on this subject. To say thank you, they just bought me a drink! So, I should probably say: Thanks for the meal!

  13. #13 by http://ofiratia.com/national-general-insurance-claims.html on 29 de setembro de 2016 - 9:53 pm

    That’s an expert answer to an interesting question

  14. #14 by cheap car insurance quotes young drivers on 29 de setembro de 2016 - 9:54 pm

    Thank you so much Kris for a wonderfully open and factual discussion. There is no sensationalism in what you say, just a lovely down to earth interview. You are discussing so openly and frankly your attraction to a fetish that is, I believe, so little known. To me your words can only open up people’s minds, at least I hope they do. Thank you so much for sharing yourself with us, and giving us another aspect of how some people love to live. You go girl!!

  15. #15 by Cheap 1060 Steel Samurai Sword on 29 de setembro de 2016 - 9:55 pm

    Great communication with seller.

  16. #16 by Hoverboard Marktplaats on 29 de setembro de 2016 - 9:55 pm

    A ladies feedback not to mention reactions to be able to level of caffeine content varies from your millions of people’s, specially in the way caffeine intake communicates using body’s hormones, this period, as well as other body operates.

  17. #17 by Battle Ready Ninja Swords on 29 de setembro de 2016 - 9:55 pm

    Very nice item.Fast shipping.Thanks

  18. #18 by guexfdf on 29 de setembro de 2016 - 10:14 pm

    C. ホストウェブにゕ プリから CSS フゔ゗ルをコピーします。 新潟県柏崎市四谷1-14-40[ボールパーク柏崎 高橋裕 たかはしゆたか マイナーリーグ柏崎 ☎0257-22-6973]は、МLBメジャーリーグのユニフォームに勝手に背番号を貼り付けて店頭およびインターネットで販売しています(ライセンス契約法違反および商標法違反)。 [url=http://asahi-tsuzuki.org/regul/ap2_1/index.html]714 AP2アイアン[/url]
    でもたくさんの方法があって、最も少ない時間をエネルギーをかかるのは最高です。 マイナンバーは収集・利用・廃棄に至るまで、厳格な管理が義務付けられています。
    [url=http://www.rtcnet.co.jp/rtcnetgolf/rtcnetgolf_1/]タイトリスト MB 714[/url] 総重量やバランスの面でハード過ぎる長尺ドライヴァーとなり易いからです。 5Iぐらいまではきっちりインパクト出来たら打球痕が残ります。
    [url=http://burikkuman.com/burigolf/burigolf_1/index.html]セレクト ニューポート2[/url]
    今は、平熱に戻っていますが、疲れや緊張もあり、発熱したのだと思います。 コントロール画面→プログラムと機能→Officeを右クリック→変更をクリック下の画面になるので、修復を選択し続行をクリック。 [url=http://www.rtcnet.co.jp/rtcnetgolf/rtcnetgolf_1/]714 mbアイアン[/url]
    ウイルス感染した瞬間の↓スクリーンショット画像です。 それは確かにそうですが、その知識を身につけることは難しくないとといわれています。
    [url=http://yamatoko.com/dunlop/xxio7_1/index.html]ゼクシオ 7 アイアン レディース[/url] Microsoftの70-347一発合格はIT業界にとても重要な地位があることがみんなが、たやすくその証本をとることはではありません。 日本が大嫌いだから、日本人に損をさせたいから、理研やSTAPを潰したかったNHK、毎日新聞他メディア、理研の生殺与奪の権利 を持っていて、調査委員会に露骨な圧力をかけた某政治家、ネット書き込み隊等のプロ運動団体、理研内部の反野尻、竹市、笹井派勢力は躍起になって、特許を取り下げろと迫ったのです。
    [url=http://www.somecco.biz/somegolf/somegolf_1/index.html]タイトリストセレクト ニューポート2パター[/url]

  19. #19 by Moupvqs on 29 de setembro de 2016 - 10:15 pm

    おそらくプロに任せるしかないレベルではないかと…。 さらに、14(同26)年11月から12月にかけて、米国の映画会社に対するサイバー攻撃が発生した。 [url=http://link-b.com/16923/office2010_1/index.html]office 2010 プロダクトキー[/url]
    (なので第23回は割愛)Announcing Windows 10 Insider Preview Build 14390 for PC and Mobile今回のビルドは14390と中途半端ではない数字です。 (/quena_jp/24314359.htmlのようにNECからドライバを落とす。
    [url=http://niezawodni.eu/16922/windows8_1_1/index.html]windows8.1 ライセンス認証[/url] 「全基地撤去」我支撐是這個「全基地撤去」,不過見著,由日美兩政府的各種各樣的干擾。 古いパソコンなので、WindowsUpdate の数が相当で何時間もかかりましたが、なんとか使える状態になりました。
    [url=http://solidiphy.com/16922/office2013_1/index.html]office 2013 認証[/url]
    資格取得に興味がなく、手話でコミュニケーションが出来ることやお手伝いができればそれだけで充分満足だという生徒さんがいる。 で、MacBook Airを新調するなら、データの移行を簡単にできるし、バックアップも取れる例のアレ。 [url=http://link-b.com/16923/office2010_1/index.html]office 2010 認証[/url]
    しかもこのこのドライヴァーもつかまりは良いのだそうだ。 NEC、ソニー、パナソニック、東芝、富士通、レノボ、デル、Hp、マウスコンピュータ、ASUS、ACER、Epson、Frontier…結構さわってきてますねぇ。
    [url=http://solusiukm.com/16923/windows7_1/index.html]windows7 oem[/url] このため、Internet Explorer に設定を変更しました。 モバイルノートはそんなリスクも小さいし、そもそもあまり使い勝手の良くないWin8.1なのでアップグレードしたら使い易くなるかと思い実行です。
    [url=http://niezawodni.eu/16922/windows8_1_1/index.html]windows8.1 プロダクトキー[/url]

  20. #20 by Merrilee Behran on 29 de setembro de 2016 - 10:18 pm

    weight loss coaching

  21. #22 by Beatris Wurl on 29 de setembro de 2016 - 10:24 pm

    timeline of last days of jesus

  22. #23 by http://ofiratia.com/auto-insurance-rate-quotes.html on 29 de setembro de 2016 - 10:30 pm

    Pois pra mim, a Jackeline é como uma melhor amiga.Daquelas melhores amigas MESMO, que fala a verdade por mais que doa e nos faz pensar mais com a cabeça e um pouco menos com o coração.Eu AMO esse blog.

  23. #24 by http://lastingmemoryphotos.com/what-is-a-good-credit-score-for-auto-insurance.html on 29 de setembro de 2016 - 10:59 pm

    We’re a group of volunteers and starting a new scheme in our community. Your web site offered us with valuable information to work on. You’ve done a formidable job and our entire community will be thankful to you.

  24. #25 by cool swords on 29 de setembro de 2016 - 11:38 pm

    Nice item… good communication! Thanks!

  25. #26 by car insurance quote moncton on 29 de setembro de 2016 - 11:53 pm

    doing makeovers and staying up late.like 1 time we stay up until 5:56 in the morning.it was fun!!we warch fun videos.I am in a youtub video its called time with ceili.

  26. #27 by cheap car insurance on 30 de setembro de 2016 - 12:08 am

    cuba letakkan alarm utk bas…bila lebih limit…satu bas bleh tau….dulu aku selalu naik bas dri jb-kelantan-jb….kalau menghala ke jb,slow jer dia bwak…..tpi kalau ke kelantan….mak oiiiii……jln corner pun laju…betul pnya profesional…..penumpang kt dlm terhoyong hayang…..takut beb..

  27. #28 by http://todosossites.site/site/dailydot.com on 30 de setembro de 2016 - 12:20 am

    vi è sembrato di capire quello che puffolottiaccident ha scritto è solamente perché il suo intervento in realtà va letto dal basso in alto e da destra a sinistra.Ed ecco magicamente venire a galla il puffolottese.Chi credevi di turlupinare, eh?!? ;-)PS nessuno ha notato che, anche se il nome è scritto tutto attaccato, le iniziali di puffolottiaccident sono identiche a quelle di un rettiliano bioplasmatico di cui evitiamo di fare il nome per questione di privacy?PPS e nessuno ha notato che tutto attaccato si scrive staccato e staccato si scrive tutto attaccato?

  28. #29 by rams youth jersey on 30 de setembro de 2016 - 12:24 am

    For those who have a home in an area that has a number of snow, and even you are feeling considerably adventurous type, contemplate seizing snow-boarding. Baseball could be the fantastic approach to try to incorporate speed plus coordination somebody who else loves a bit of time over the slants. Once you turn out to be familiar with the main unnerving down hasty, you will find the feeling exceptionally refreshing, energizing. Once you get good at the very first premature learning period, snow-boarding will not be consequence to your overall body, and even snowboarding provides for a big boost for your cardiovascular system activity levels.

  29. #30 by nike huarache on 30 de setembro de 2016 - 12:58 am

    I intended to create you the little bit of remark in order to say thank you over again with the stunning pointers you have discussed on this site. This is really seriously open-handed of you to make unreservedly all a number of people might have sold as an electronic book to earn some money on their own, mostly now that you might well have tried it if you ever wanted. The thoughts likewise served like the fantastic way to recognize that some people have similar fervor like my personal own to learn somewhat more when it comes to this issue. I know there are millions of more pleasant instances up front for those who browse through your blog.

  30. #31 by http://lastingmemoryphotos.com/suncorp-comprehensive-car-insurance.html on 30 de setembro de 2016 - 2:05 am

    mag07 eccezionale questo post!“Stiamo tutti diventando TERRORIZZATI dal contatto fisico, uomini e donne. Non si capisce perché, forse è che sembra poco ADULTO, poco MATURO, poco da 3° millennio.”Mamma mia che frase fantastica!Il filmato poi azzeccatissimo!Bravo marco!

  31. #32 by federal way auto insurance on 30 de setembro de 2016 - 2:05 am

    Millionnaire’s matchmakerMillionnaire’sMillionnaire’sMillionnaire’sMillionnaire’sMillionnaire’sTsé un moment donné c’est dur prendre ca au sérieux…J’m’excuse là mais moi s’pas une poule qui marche au cash qui m’intéresse

  32. #33 by where can i get auto insurance online on 30 de setembro de 2016 - 2:07 am

    Rédigé par : CELINE | le 16 novembre 2011 à 11:41Merci, un si gentil compliment venant d’une si belle famille me remplit de joie.Mais ma syntaxe (c’était celle du soir, décidément!) m’a encore joué un tour. C’est de la sÅ“ur de Green dont je voulais parler (était-ce Ann?), je crois que c’est elle qui a fait bouillir la marmite pendant les années de guerre. Quant aux James, c’est une tribu de génies comme les Claudel. Je jetterai un coup d’Å“il à ce Journal un de ces jours.

  33. #34 by http://everyheadcounts.org/auto-insurance-for-seniors-over-80.html on 30 de setembro de 2016 - 2:13 am

    styled Shoot – From Borrowed and BleuMirror Mirror and Snow White – From Rock my WeddingMad Men Wedding Ideas – From the Wedding Chicks Best FoodMini Food Snacks for a Wedding – From Polka dot Bride Best Personal PostIf

  34. #35 by vpn 购买 on 30 de setembro de 2016 - 2:19 am

    Good site! I truly love how it is simple on my eyes and the data are well written. I am wondering how I might be notified whenever a new post has been made. I’ve subscribed to your feed which must do the trick! Have a nice day!

  35. #36 by NJ car insurance on 30 de setembro de 2016 - 2:43 am

    Oh, okay. Sounds like you’re doing admirable work, then. I sort of suspect I’ll end up teaching too, I just don’t think I’d be any good at it. It’s either that or some generic office job. If I could choose though, I’d rather be a political adviser or a pop culture writer, or maybe something in academia.

  36. #37 by jananese katana sword on 30 de setembro de 2016 - 2:53 am

    Exactly as described THANK YOU!!!

  37. #38 by samurai on 30 de setembro de 2016 - 2:54 am

    fast shipping! Product was perfect. Amazing seller!

  38. #39 by http://shoesbychavez.com/car-insurance-quotes-springfield-il.html on 30 de setembro de 2016 - 2:56 am

    Surprisingly well-written and informative for a free online article.

  39. #40 by vpn 购买 on 30 de setembro de 2016 - 4:02 am

    I have not checked in here for a while as I thought it was getting boring, but the last several posts are good quality so I guess I will add you back to my daily bloglist. You deserve it my friend :)

  40. #41 by travelers auto insurance toll free number on 30 de setembro de 2016 - 4:05 am

    Thanks for spending time on the computer (writing) so others don’t have to.

  41. #42 by vpn 购买 on 30 de setembro de 2016 - 4:22 am

    I am curious to find out what blog system you happen to be utilizing? I’m experiencing some minor security problems with my latest website and I’d like to find something more safeguarded. Do you have any recommendations?

  42. #43 by vpn 中国 on 30 de setembro de 2016 - 4:22 am

    When I originally commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get several emails with the same comment. Is there any way you can remove people from that service? Cheers!

  43. #44 by add insurance to new car on 30 de setembro de 2016 - 5:15 am

    9e7amarianna:c19cА я решила не ставить перед фактом. К тому же доводы у него были довольно убедительные, он военный, разные фамилии в семье иметь — документально волокитное дело для военных. Да и привыкла уже за столько лет.d5

1 369 370 371
(não será publicado)