I'm trying to make a 2D block system similar to terraria or Minecraft. This includes breaking, placing, block updates, etc. There are multiple ways to achieve this but I'm not quite sure the best way to go at it. I'm looking for good performance and scalability. Can anyone help me with making the right decision?
ideas ive tried:
-
Tilemaps:
The problem with tile maps is their functionality isn't quite designed for what I'm looking for. Tile maps aren't really designed for this sort of thing. I'm looking to support things like block updates as well. Additionally, adding new blocks and block functionality is redundant and tedious if im using a tilemap. -
In-script (gdscript)
I have a system "working" for this already. Chunks, block data, block ticks, block updates, all working. I can dynamically load and unload chunks of the work. The problem is it is 'duck tape' code which I wrote to try and work around gdscript limitations. Right now, the game is running great, but gdscript may not be fast enough later in development especially since i may be processing hundreds of blocks at once. Also, each block I'm rendering as a separate sprite and I'm not sure how performant this is either.
Ideas I have yet to try:
-
Plugins
I don't really know all that much about plugins, but I'm willing to learn them if it means making a better system. I know that plugins are generally more flexible than just using scripts. -
C++ Modules:
Im generally familiar with C++, enough so that I think this is a valid option. I know that C++ is a ton faster than gdscript, and using modules allows me to achieve far more functionality than I ever could with scripts or plugins. -
Other ideas?
Any insight on any of these ideas would help a ton.