I would like to prototype a fun idea that I had but I’m not familiar with 2D games so I need help deciding whether Tiles are the way to go or there is a better, more efficient way of creating a grid-based building system like Mindustry has:
I want for the “placeables” to be functional and have multiple properties, thus why I don’t think tiles may be a good fit? In any case, I’m also afraid of Nodes being too slow maybe? Will I need Multimeshes for them to work properly? Thanks for your help
That question seems backwards somehow. If you are set on the game having a grid-based data and logic, then displaying it using tiles is a no-brainer. The things that are not on the grid will have to be displayed using individual nodes, but there is no reason to use them for everything if that is what you mean. I am not sure what multmeshes place in this.
Not sure I understand what you mean by “acting as individual object”. What is an example of that on the screenshot?
A tilemap is a means of visualization. You can certainly have objects with individual properties in your logic, code them to act whichever you want. A tilemap will have a predefined limited set of tiles that you fill the grid with to visualize that internal game state. The tile animations usually aren’t unique, but nothing stops you from augmenting that with additional nodes if you need.
Sorry for not explaining myself correctly, I really have no conception of 2D techniques hehe.
My concern is: imagine that each tile has to act as a cell, like, a literal cell. It may have a health value, an energy value and it should also be able to run its own code, like a Node would do while also getting the chance to have its own independent animations.
I may be wrong, but it doesn’t sound like tiles are the suit for that. Again, I may be wrong, that’s why I’m asking in the first place. It would be a no brainer to not use Node3Ds (maybe Multimeshes for not clogging resources) for this in 3D but since it’s 2D, maybe you just do things differently? Like, maybe cells are better off being implemented as tiles here and the way to go is working with them in batches through a handler script?
You seem to mix together the logic and the graphics. Normally these are separate concerns.
In the simpliest case, you could just have a script implementing logic attached to a sprite node. But in a real game an object is built of multiple nodes, some of which do behavior and others do graphics.
Tilemap is a part that does graphics, for a game where the objects are arranged in a grid. It is very efficient at the thing it is made for, which makes it an easy choice. But it does nothing to track or process the health or energy. The health and energy you program elsewhere the way you need them.
You are free of course to make a map of hundreds by hundreds, or thousands by thousands cells, out of individual nodes, but I imagine that would be extremely inefficient, and may end up being too slow depending on what hardware you intend it to run on.