Looks like this is the reason why Opus, the next-gen Xiph codec, was failed to overtake its predecessor Vorbis despide being pareto-superior to it.
The author of `stb_vorbis.h` that gets shipped far and wide found that they can't make the same for Opus due to licensing shenanigans.
https://nothings.org/stb/stb_opus.html
Switched to map and contour generation from quad tree cells. Those are now correctly represent terrain transitions, not only passable regions.
The thing is more costly to construct, but the map filling is much faster than sampling each tile corner - less duplicate work and big chunks of uniform terrain are naturally aggregated and can be dispatched as one job.
Out of 1M tiles only ~75k are 1-tile transitions that are processed sequentially (presumably while some bigger jobs are chugging in background).
Awww yisss! Everything* I wanted feature-wise from this tileset:
- Map declared in Multicolor SDF (lava is the base layer, everything else is boolean'd together)
- 4-corner Wang tiles extracted from TileSetter project (no, I didn't do those 96 tiles by hand) (package pending)
- Per-tile attributes in the "free" vec4 slot. Here - tile speed (also used for passability).
- A* path-finding with per-tile travel costs (the truck on the screenshot prefers flat terrain as ridges are slow to crawl).
* I have unused alternative biome tiles... to spice up the landscape 😏
Reading Wikipedia resulted in a slightly different path-finding algorithm than intended.
Behold: A-A-A-A-A*!
(At least it doesn't jump straight into lava.)
End of #LudumDare day 1:
https://youtube.com/shorts/zLGhr3dtoRY
Not yet playable, just no-engine basics.
All the pieces so far:
- Dynamic tilemap.
- A minimap view synced to it (using 1px tile atlas for colors).
- Draggable viewport.
- Some animated sprites in world-space.
- Screen-space (yellow) and tile-space (blue) selection boxes.
- Status frames for sprites caught in selection.
- The window is still resizable (tilemap re-center appropriately and minimap sticks to its corner with a small padding).
Toots as he pleases.