site banner

Tinker Tuesday for April 7th, 2026

This thread is for anyone working on personal projects to share their progress, and hold themselves somewhat accountable to a group of peers.

Post your project, your progress from last week, and what you hope to accomplish this week.

If you want to be pinged with a reminder asking about your project, let me know, and I'll harass you each week until you cancel the service.

3
Jump in the discussion.

No email address required.

Still not much progress on the background generation. Mostly I've been goofing around with benchmarks, trying to see if the previous changes did actually boost performance. Indeed I'm now able to run the simulation with +/- 640K monsters at reasonable framerates (for as long as the laptop doesn't get hot), whereas previously I could only reach +/- 250K. However, this only works when I turn off the bullet simulation. It's not surprising it turned out to be a bottleneck - I basically copy pasted the monster simulation code, just to have something working for now, and I had the thought I'm doing the collision detection the wrong way around:

  • Currently for each bullet, I check if it hits any monster. There already is a spatial sorting mechanism for the monsters, so it's relatively easy to look up the ones in the neighborhood of a projectile. However, due to the nature of how they move (in a straight line, and separated from each other), each projectile is likely to have a different neighborhood, and this will cause thread divergence
  • Instead, I think I should add a similar sorting mechanism for the bullets, and check collisions from each monster to each bullet in the neighborhood. Monsters are more likely to be clumped together, so their neighborhood will be the same, and they will be doing the same lookups, and not cause any divergence. Hopefully... in theory...

That said, I'll leave that alone for now, and get back to the background generation thing.

How have you been doing @Southkraut?