I'm in developing of isometric RPG with 3D characters on 2D level. I was trying to develop this using standard OOP paradigm, but face with a lot of issues. Recently i learned about ECS and found this conception fantastic! Currently i'm rewriting my engine using ECS paradigm, but one thing i can't understand, here's what:
I use OpenGL, and have two rendering systems - one for drawing 2d stuff and one for 3d. Each system consists of one VBO id, where appropriate geometry(2d or 3d) stored, shader program id, id of texture unit binded to texture atlas (which accommodates all the tilesets or all the model textures) and other stuff like that. These system provides different logic for drawing 2d and 3d stuff.
But the components for these systems - that's where i stuck.
Say, i have component, where are defined:
1)buffer offset from the beginning of VBO buffer
2)primitive count that needed to be rendered
Let's pretend that i have two instances of such component, but first instance belongs to level floor entity and describes the bunch of quad tiles, and second instance is a character mesh and belongs to the player entity. Ofcourse, first component instance should get in 2d rendering system, and second instance should get in 3d rendering system. But the data structure of these instances are identical! (It must be said that i use EntityX and the components gets in the systems automatically depending on their type).
Both systems require Position and Graphics components, so both systems will take both component instances and one of these component will be processed improperly (2d Graphics component in 3d rendering system and vice versa)
So, i'm thinking about creating the "hollow" components like Sprite and Model, which will indicate what Graphics components in the entity mean. Since these component will not contain any properties and would be used only as "Flags", this solution seems kinda clumsy.
Can you point me to my mistakes and provide a better solution, maybe?