hquxmu / ai-contest

Automatically exported from code.google.com/p/ai-contest
0 stars 0 forks source link

Fleet size of 0 #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Send out a fleet with 0 ships

What is the expected output? It will send out a fleet with 0, which allows a 
malicious bot to overload bots with fleets. 

Looking in engine.py, you should just be able to change line 107 from

if order["num_ships"] < 0:

to 

if order["num_ships"] <= 0:

Original issue reported on code.google.com by olsdan...@gmail.com on 10 Sep 2010 at 11:16

GoogleCodeExporter commented 9 years ago

Original comment by olsdan...@gmail.com on 10 Sep 2010 at 11:35

Attachments:

GoogleCodeExporter commented 9 years ago
I suggest that bots that submit zero or negative fleet size orders forfeit the 
game.
I also suggest that bots that send multiple orders with the same source and 
destination planets in one turn also forfeit the game. The opponent should not 
have to waste time crunching a huge fleet list into more fundamental numbers.  
I haven't seen any evidence that this is happening at the moment but I'm sure 
it will! How about forbidding it now? 

Original comment by richard_...@yahoo.co.uk on 12 Sep 2010 at 11:27

GoogleCodeExporter commented 9 years ago
The new fleet-merging behavior ignores 0-size fleets but does not treat them as 
invalid. This fixes the overloading behavior.

Original comment by jokeserver on 18 Sep 2010 at 1:36