RE: energy system ideas
Fortifying doesn't effect geo-eff, so it's not recaltulated here.
For evacing, average time is 1.1s
For capturing empty land, average time is 1.4s
For attacking another nation, average time is 2s
Running a few tests, a 5K nation attacking another 5K nation (5K as in the number of tiles), we're talking close to 3.6s
Do you calculate the tiles every time an attack/evac is done? I mean do you load every tile and look at its faces or just the 5 that you actually need. If you attack or evac its always just 1 tile that changes plus the 4 connecting ones. No matter how big a nation is this should take the same time.
If each nation has an entry for tiles and faces you only have to update that on changes. If i add land to my nation i get 1 tile and 4 faces max. Then you only have to retrieve the 5 entries for the 5 tiles affected. I have no idea how to do that with SQL but this is how you would calculate it.
// ON SUCCESSFUL ATTACK
$tiles++;
$new_faces = 4;
if ($x-1 == OWNED) $new_faces--;
if ($x+1 == OWNED) $new_faces--;
if ($y-1 == OWNED) $new_faces--;
if ($y+1 == OWNED) $new_faces--;
// ON EVAC OR IF BEING ATTACKED
$tiles--;
$new_faces = 0;
if ($x-1 == OWNED) $new_faces++;
if ($x+1 == OWNED) $new_faces++;
if ($y-1 == OWNED) $new_faces++;
if ($y+1 == OWNED) $new_faces++;
If you are already doing it this way forget what i just wrote. I just think this action should take the same time no matter whom is attacking here.
