11-12-2019, 07:42 AM
This limitation is because of any limitation in hardware. In 2D chipsets, each sprite and background layer is implemented in a chunk of silicon, and mapped to fixed memory positions. So their number is always fixed, just as the number of shaders (or CUDA cores) in any modern GPU is always fixed because they're chunks of silicon too. They can be enabled/disabled/adjusted or allocated to do a given task, but they cannot be created or destroyed.
However, modern graphic APIs hide away the architecture of the cores and expose an abstract model, whereas in classic 2D systems the game programmer must explicitly allocate and manage the hardware sprites because there wasn't any middleware or abstraction layer.
In Tilengine this is a design choice, to have a fixed number of reassignable sprites. This is how 2D chipsets work, and having deterministic identifiers is better for the raster effects, where one can reconfigure the resources (sprites or layers) in the middle of a frame, between scanlines.
However, modern graphic APIs hide away the architecture of the cores and expose an abstract model, whereas in classic 2D systems the game programmer must explicitly allocate and manage the hardware sprites because there wasn't any middleware or abstraction layer.
In Tilengine this is a design choice, to have a fixed number of reassignable sprites. This is how 2D chipsets work, and having deterministic identifiers is better for the raster effects, where one can reconfigure the resources (sprites or layers) in the middle of a frame, between scanlines.