It is currently Wed Apr 25, 2018 7:02 am Advanced search

fleets arriving at the same time

Code won't compile? Found a bug? Post here!

fleets arriving at the same time

Postby MciprianM2 » Fri Nov 26, 2010 1:54 pm

Hello! I think I have more of a misunderstanding then a problem.

Check the following game: http://ai-contest.com/visualizer.php?game_id=8673866

I am MciprianM in that game(the blue one). In the first turn I send 10 ships from the only planet I have to a neutral planet(the one in the center of the map) with 9 ships. So does the other player. The two fleets arrive at the same time on the planet(turn 5). After this the planet is neutral with 0 ships on it and both our fleets are gone. Why is that? Is that ok?
MciprianM2
Cadet
 
Posts: 7
Joined: Wed Nov 24, 2010 9:48 pm

Re: fleets arriving at the same time

Postby Mistmanov » Fri Nov 26, 2010 2:04 pm

Yes, that's the correct behavior.

The algorithm for handling battles is as follows:

-there are three "armies", one of yours, one of the enemy, and one neutral (often, one or more of these armies will have 0 ships)

-after the battle, the army that was largest before the battle will have (largestarmysize - secondlargestarmysize) ships. All the other armies will have 0 ships.

-after the battle, the new owner of the planet will be player who still has ships left (i.e. the person with the largest army before the battle), UNLESS the number of ships that are left after the battle is 0. In that case, the new owner of the planet will just be the old owner.

In your case:

armies before battle: 9 for neutral, 10 for you, 10 for enemy

largest - second largest = 10-10 = 0

remaining ships is zero so new owner will be the old owner, so the planet stays neutral.
Mistmanov
Colonel
 
Posts: 70
Joined: Fri Sep 24, 2010 6:50 pm

Re: fleets arriving at the same time

Postby MciprianM2 » Fri Nov 26, 2010 5:43 pm

Got it! Thanks. Although it didn't strike me as obvious - this way of solving battles where more than 2 armies are involved seems a little bit unnatural - I guess it is the only way to solve it without taking sides.
MciprianM2
Cadet
 
Posts: 7
Joined: Wed Nov 24, 2010 9:48 pm


Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 4 guests