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.
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.
Yes it’s
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
The first version of the program was 90 lines long but now it has grown to 275. This includes code to let the computer play and checking code plus I’ve refactored it a bit, simplifying the code. I haven’t extensively tested it and at least one bug has crept in. Occasionally the computer seems to claim ownership of a player cell. This stops you adding one to that cell so its not good.
ack in the mid 80s I was busy writing games for ZX Spectrum, MSX and CBM-64 and also porting games between 6502 and Z80. That was also when the original NES appeared. That had a 6502 CPU but a lot less RAM than the CBM-64.
Don’t get me wrong, I like Linux. I’ve put in enough hours, especially on Raspberry Pi programming but games don’t seem to sell at all well on Linux. For one there’s a massive expectation of free software. Ubuntu comes with plenty of free games and some really good quality ones like 0Ad or Battle of Wesnoth.