Загрузка видео...
Не удалось загрузить видео
I think the new chunk-based water simulation is almost done! Still need to deactivate stale chunks & update the lower LODs, but the base sim works perfectly now, integrated with water bodies created by the world generator. #indiedev #indiegames #gamedev
10,750 просмотров • 7 месяцев назад •via X (Twitter)
Комментарии: 9

One 16x16 water chunk takes ~3us to update, so I can update, say, 300 of these in under 1ms, which is pretty great. I was planning to optimize it further with SIMD, but I guess I'll postpone that a bit, it already runs fast enough.

Nice. Reminds me a bit of where you fight against a liquid alien mass.

Damnnn nice job!!!

How do you cull updates of chunks? Is it view dependent or do you just yolo all unsettled chunks given your budget and hope there’s only 300 of them active any time? What if you have some freak setup where villagers or whatever influence your water across the entire map blowing your budget?

Just yolo, yep. Like if you blow up a 100x100x100 brick of TNT in Minecraft - everyone know that, if it doesn't crash the game, it'll at least lag a ton. Though I do plan to limit the simulation to chunks around your villagers, but this system isn't there yet.

Makes sense, another approach could be to stochastically distribute computation across the chunks, like with a probability depending on proximity to villagers. If your limit is 300 chunks and 200 chunks are active, all will get full update rate. If there’s 600 active chunks they will update at half the rate on average. I used such a simplistic system with great success in a simulator once. We did character skinning on the CPU back then and could animate a certain number only within a frame. So I just assigned a probability 0..1 for each character based on screen size and some bias for user controlled entities. Then, when rendering, I just rolled a dice per character and compared to the respective probability. Farther or unimportant characters would update less often but often enough for their visual importance whereas characters that were large or close would have the smoothest animations, while always staying within budget.

damn dude this looks so sick.

Haha! I love it! Surfer simulator!

woaw waves
