Long time, no SIMD

JK, the naivest stupidest binary tree blows fancy 4-way SIMDed BVH out of the water.

Actually, it may be slower by itself, but multicore apparently *destroys* wide instruction performance. At the same time cache^W completely oblivious scalar traversal is happy to run on all the capabilities available.

High ceremony 4-wide or primitive 10-/20-/whatever-wide? :blobthonkang:

Textures are just `Material a` combinators concerned with producing stuff at hit points.

Since the Material is a Monad now, no need for special cases for colors and then another bunch of combinators for materials.
A sampler can be used to pick entire materials if needed.
(Ooops, I actually CPSd a little...)

Show thread

`instance Monad Material where`

Sitting on my hands to avoid going full CPS on it (again)

I should write a huge text about how is a great language and is getting better all the time.
Just to dilute the stream of negativity constantly appearing on feeds.

Maybe *you* should too.

Gosh, I sometimes hate that the LSPs are a thing now. People really like to dunk on and its "toolchain" for LSP deficiencies.

Come on, people, this stuff is barely mature by itself.

And you really can do without it.

Subtleties of animation...
Had to slice the effect sprite into fg/bg parts and put them on different layers. And synchronize everything manually 😓

Extracted tile "proxy" data from Tilesetter projects. Makes maps a little less bland.

Visibility is surprisingly tricky. Lots of implementation options, semantic options and how to combine those :blobcoffee:

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).

I had a late night thought that my sparse quad tree structure can be split up into a bunch of functors.

And that is indeed the case:

type SparseQuadTree a = Free Quad (Sparse (Range a))And the scaffold/compact functions are “bring your own algebra” now.

Replace Quad with Binary or Octal and you’d get the matching structure.

Going from a dense (but lazy) scaffold to sparse states that in type:

(a -> Sparse a) -> Free s a -> Free s (Sparse a)And the decider is a simple function that isn’t concerned with structure at all, making it reusable.

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.)

The floor and lava

(There are some kinky borders. Most likely the fix would end up involving a rewrite of the quad-tree structure or something like that.)

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.