For some reason, I've wanted to do a project where a whole world of nations battle each-other until one victor stands alone, ruler of the whole world. This post will explain the four steps within this project - 1) setting up the map, 2) starting the nations, 3) letting the nations battle, and 4) finding out which will win.
Step one is to get a good world map off Google and then create a 2-D array storing which pixels are sea and which are land. You should thus look out for those very sparse maps with just two colours and no text or PNG artifacts. In my case, I wanted to do a hexagonal grid, which is a bit of an issue when the world maps are not using hexagonal pixels. I just offset every second row of pixels, which does sometimes create strange, spiky coastlines, though this is more apparent in the image exports than in-game where the spikes are only half a tile big.
Step two is to set up a new array which stores the owner of each tile. My program then picks a couple thousand random tiles each frame, then runs a script for each. If the tile is unowned (as they all are at the beginning), first we try to find a nearby tile that is owned, so that this one can be gobbled up. If there is no nearby owned tile, there is a chance to instead spawn a new civilisation, which will then gobble up nearby unowned tiles in the next steps.
This is what we see in the above animation - just random nations taking up random territories. This creates quite interesting shapes, and since some nations are spawned before others, we also get widely different sizes that feel pretty natural. And then, the world ends as all unowned tiles have found an owner.
Step three is wars and politics. At default, all nations are at peace. All nations also have relations with all other nations. Whenever a border tile is picked in the above script, the relationship between the two nations worsens. If it gets bad enough, the superior nation might declare war on the inferior nation.
Step four is to find out who wins in a fight. Whenever a border tile is picked in the above script, and the two nations are at war, the tile will be taken over by the opponent. But working like this, wars would, on average, be in a stalemate with only random chance to put one nation as victor. We need a skewed chance, so that it is most likely for the superior nation to take land off the inferior than vice versa.
It would seem obvious just to have the nations compare their size. However, this would mean that larger nations always win. This might be logical and realistic, sort of. But also boring.
Let's talk about wealth.
While a nation is at peace, it builds up wealth proportional to its size. Larger nations will accumulate more wealth than smaller nations. While at war, nations will lose wealth as they struggle for dominance. The nation with more wealth will win each battle 90% of the time. But winning a battle does not mean winning the war. Winning territory costs more than losing it, so eventually, the at richer nation will have less wealth than the other, and so the tables turn. This will happen up to several times in a single war, and at the end, unless a nation is wiped out completely, both will end at less than 0 wealth and sign a truce. Still, usually the superior nation takes territory from the inferior one.
Let's talk about aggressive expansion.
As territory changes hands, one nation gains territory and the other loses it. The game keeps track of this and can tell how much aggressive expansion a given nation has accrued. Recent territorial expansions do not add more wealth during peace-time. They also worsen relations with all neighbours. This leads to quite interesting scenarios.
So you have nation A attack nation B. Both nations lose most of their wealth, but nation A started out with more and thus accrues both territory and aggressive expansion. As nation A now is poor and has lots of aggressive expansion, its neighbours might declare war on it. Now A fights a three-pronged war, losing resources even faster, both wealth and territory. Perhaps B even takes back some of its lost territory. Perhaps nation A goes into debt and eventually collapses.
This is what is shown in the timelapse above. It leads to the rise of empires that then are taken out by coalitions of several smaller nations. It leads to a system where larger nations tend to do better than smaller ones, but nothing is certain.
Still, the game is quite simplistic, and the whole relationship system could do with a makeover. But I am quite happy with finding a balance between "biggest nation wins" and "size don't matter."
Step one is to get a good world map off Google and then create a 2-D array storing which pixels are sea and which are land. You should thus look out for those very sparse maps with just two colours and no text or PNG artifacts. In my case, I wanted to do a hexagonal grid, which is a bit of an issue when the world maps are not using hexagonal pixels. I just offset every second row of pixels, which does sometimes create strange, spiky coastlines, though this is more apparent in the image exports than in-game where the spikes are only half a tile big.
Step two is to set up a new array which stores the owner of each tile. My program then picks a couple thousand random tiles each frame, then runs a script for each. If the tile is unowned (as they all are at the beginning), first we try to find a nearby tile that is owned, so that this one can be gobbled up. If there is no nearby owned tile, there is a chance to instead spawn a new civilisation, which will then gobble up nearby unowned tiles in the next steps.
This is what we see in the above animation - just random nations taking up random territories. This creates quite interesting shapes, and since some nations are spawned before others, we also get widely different sizes that feel pretty natural. And then, the world ends as all unowned tiles have found an owner.
Step three is wars and politics. At default, all nations are at peace. All nations also have relations with all other nations. Whenever a border tile is picked in the above script, the relationship between the two nations worsens. If it gets bad enough, the superior nation might declare war on the inferior nation.
Step four is to find out who wins in a fight. Whenever a border tile is picked in the above script, and the two nations are at war, the tile will be taken over by the opponent. But working like this, wars would, on average, be in a stalemate with only random chance to put one nation as victor. We need a skewed chance, so that it is most likely for the superior nation to take land off the inferior than vice versa.
It would seem obvious just to have the nations compare their size. However, this would mean that larger nations always win. This might be logical and realistic, sort of. But also boring.
Let's talk about wealth.
While a nation is at peace, it builds up wealth proportional to its size. Larger nations will accumulate more wealth than smaller nations. While at war, nations will lose wealth as they struggle for dominance. The nation with more wealth will win each battle 90% of the time. But winning a battle does not mean winning the war. Winning territory costs more than losing it, so eventually, the at richer nation will have less wealth than the other, and so the tables turn. This will happen up to several times in a single war, and at the end, unless a nation is wiped out completely, both will end at less than 0 wealth and sign a truce. Still, usually the superior nation takes territory from the inferior one.
Let's talk about aggressive expansion.
As territory changes hands, one nation gains territory and the other loses it. The game keeps track of this and can tell how much aggressive expansion a given nation has accrued. Recent territorial expansions do not add more wealth during peace-time. They also worsen relations with all neighbours. This leads to quite interesting scenarios.
So you have nation A attack nation B. Both nations lose most of their wealth, but nation A started out with more and thus accrues both territory and aggressive expansion. As nation A now is poor and has lots of aggressive expansion, its neighbours might declare war on it. Now A fights a three-pronged war, losing resources even faster, both wealth and territory. Perhaps B even takes back some of its lost territory. Perhaps nation A goes into debt and eventually collapses.
This is what is shown in the timelapse above. It leads to the rise of empires that then are taken out by coalitions of several smaller nations. It leads to a system where larger nations tend to do better than smaller ones, but nothing is certain.
Still, the game is quite simplistic, and the whole relationship system could do with a makeover. But I am quite happy with finding a balance between "biggest nation wins" and "size don't matter."
Loving this! Getting really close to generating wars between my own nations, I'll definitely be stealing some of your ideas here.
ReplyDeleteWhat game is this called? Whatever this is? I am never going to play and i'm gonna make the data delete on the game
DeleteDo you want to play battle Royale similar? It's very cool. I love it.
DeleteThe reason why is because You can actually change the name, download it now and and if you love it, Just go to the bathroom and do it because I I do it because I kind of love to play the long time. And I actually do go to the bathroom and go to the bathroom. And when The game actually along so likevery time. I love The game because it actually is the greatest game I ever played download it Now
Allow me to have access to the World Battle Royale, I really want to try it out
ReplyDeleteI can't fucking play
ReplyDeleteikr
DeleteDownload Gylala
ReplyDeletewhat
Deletethe hell
DeleteI wanna play this so bad
Deletewhy
Deletei cant play
ReplyDeleteMEE WANT TO PLAY TOO!
Deleteirtrrrrrrrrrrrrrrrrrr rrrrrrrrrrrr
Deletehow to play it
ReplyDeleteidk
Deleteask him
ReplyDeleteWorld
ReplyDeletecan i fucking play
ReplyDeletewhyyyyyyyyyyyyy cant i fucking play
ReplyDeleteDownload battle royale simulator
Deletedsnks
ReplyDeletei want to playy
ReplyDeleteSus
ReplyDeleteI wanna play
ReplyDeleteASS
ReplyDeletewhy the living shitty fuck can i not play
DeleteWhy the living shitty fuck can I not play
ReplyDeletemother fuck it wont play
DeleteLet me play
ReplyDeleteI whant to a geography game
ReplyDeleteI can't play
ReplyDeleteSTOP ACTING LIKE A BICH!!!!!!
ReplyDeleteme can't play :(
Deleteaw shit
ReplyDeleteshity fucking bichs
ReplyDeleteWhen is the battle royale being released
ReplyDeletei cant play the fuckin game
ReplyDelete😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭
ReplyDeletebnnn
ReplyDeletettyyyyyy
ReplyDeleteidk how to play it
ReplyDeletebruh
ReplyDeletethis shiitty poo game wont let me play
ReplyDelete5yw5 ys
ReplyDeleteI am a skiddiiy tolite
ReplyDeletewtf
ReplyDeletehow the f@ck do you play
ReplyDeletebro show us how to play it bro it,s been like 3 years or 4 years bro let us play this game already bro like dud why u not leting us play and also i think it,s called world battel royal or smt bro just pls let us play men like bro let us play this video game dud bro pls plssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss let,s us play dudplssss dud im beging ubro so ples let us play this stupid gme already bro and also just put the wed sit i n idk but pls if u know it,s realy easy u like 19 or smt or 29 or 99 bc bro i can,t take u motr than 4 years or40000000000000000000000000000000 years like dud pls let us play man like bro just let us playyyyy 🙏plsssssssssssssss im beging u it can,t take like 100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b no it can,t like bro just make i better ok beo mke it better ok okkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkdkdadlshfbkshuyffffffffffffffffhgug9;cbtfu9ebufgqwutge8cyudghnbchvyufgyurgfyugyfurgufrgygfuef so plsssssssss we have cars right knowbro flying cars sooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo pls pls man pls ok just dooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo it plssssssssssssss ok mean do it bro u slow
ReplyDeleteplssssssssssssss bro pls
Deletecan uuuuuu ppplllleeeeaaaassssssseeeee let us play dis game . are you serious ya u shoud be like we goin crazy we goin stBBBBBBBBBBBBBBBBBBBRRRRRRRRRRRRRRRRRRRRRRRRRUUUUUUUUUUUUUUUUUUUUUHHHHHHHHHHHHHHHHHHHHH
ReplyDeleteya
Delete