Thoughts about the Onslaught map generator

With the 2nd Tutorial under my belt, I’ve ben thinking about the map generator which is the subject of the third tutorial. I suspect it will be based on the Empire map generator which you can read about from an earlier blog post.
The difference is that there will only be one continent not several and it has to occupy between maybe 50% and 80% of the specified map size. These are 20 across by 15 deep (small), 30 x 20 across (medium) and 40 across x 30 deep (large). On a 1024 x 768 Window, I managed to fill it with 31 across by 28 deep, so I’ll need a larger playing Window. The current one is 1024 x 768.
The Empire generator works by first scattering a number of land and sea points in an empty grid then growing layers around each point in the empty cells, stopping when a non-empty cell is found. I’ll need to modify it so that the starting land points are near enough to form a single continent when grown and reject any map that has 2 or more continents.
I also put Onslaught on my Raspberry Pi and found that it runs a lot slower than on the Hyper-V Ubuntu. I can only put this down to the number of hexagons. a screenful at 1024 x 768 is 31 x 28 hexagons and that requires 868 blits ( each a call to SDL_RenderCopy). Each blit copies 1088 bytes in VRAM. That’s almost 1 MB of VRAM being copied in itself each frame which is not that much for a GPU but there’s probably some overhead for each blit and I imagine that could be the performance killer.
Developed by Salvatore Sanfilippo aka antirez and licensed under the
I’m quite pleased with this. It took about six hours in total to create including the time to create the graphics. Running in Hyper-V under Ubuntu 20.04, it draws a screenful of graphics in about 65 microseconds.
This is debugging vs code with lldb. It seems as of clang-10, it’s no longer supported which is a pita. I’d been working on the Onslaught code and something wasn’t working so I thought I’d try to debug it. However the debugger wouldn’t start. Investigating a bit further and I found
Yes it’s
If you’re interested in seeing how 3D math(s) are done,
If you remember
One of my favourite casual games is Slay by Sean O’Connor. I bought the full game which sells for $10 and it’s still selling well via his
I fixed the bug in the Atoms game and the third tutorial finishes it off. The source code (in this case atoms3.c) has been placed on
A university student by the pen name of Tronus has put a project from his 3rd year in his degree course on