DaanVanYperen / artemis-odb-contrib

Drop-in extensions for artemis-odb. Prefab systems, components, networking, events!
MIT License
75 stars 19 forks source link

Isometric and Tiled #122

Closed brettsaunders21 closed 4 years ago

brettsaunders21 commented 5 years ago

I am fairly new to ECS and artemis odb and am trying to create an isometric game. Im not completely sure how best to go about it with rendering and storing of the isometric world.

I saw in the Jam package that there is a Tiled map section for loading maps and operations. I was wondering if I could use this to build an isometric map on Tiled and use that to render it. The documentation is sparse on this wiki, but wasn't sure about the way it gets property "entity"? Do I need to create a map in a certain way so that it is stored as an entity instead of the normal format as its ECS.

DaanVanYperen commented 5 years ago

I'd use the Jam package exclusively to grab some ideas from, it's fairly rough and volatile as is.

When you edit the spritesheet in tiled you can edit properties of tiles. If you add an 'entity' property of type string it'll do the job.

Namek commented 5 years ago

Whatever you do, I don't recommend to create a entity for each tile. Let the RenderSystem pick the only tiles that are needed for rendering by using a camera projection. If you want the System to be stateless you could store whole tilemap in one entity. Only store individual fields if you really need to do it in non-specific order. Otherwise, you would gain nothing but complexity, rendering ordering issues and in some cases worse performance.

DaanVanYperen commented 5 years ago

Good advice, I basically only spawn dynamic elements as entities (doors, enemies, platforms etc) as entities, and the map / collision mask as singleton components.