Skip to content

map57.txt starts me with no planets #5

Description

@damag

Hi, when testing with map57.txt, this framework is starting me with no planets in universe.my_planets, even though the map obviously starts me with one when I look at the text file.

I created a bot that just logs the planets:

from planetwars import BaseBot, Game
from logging import getLogger

log = getLogger(__name__)

class Bot(BaseBot):
    def do_turn(self):
        log.debug(self.universe.planets)
        log.debug(self.universe.my_planets)
        log.debug(self.universe.enemy_planets)

Game(Bot)

And the log file shows that my home planet is missing from the start:

2010-09-14 00:56:25,181 INFO: ----------- GAME START -----------
2010-09-14 00:56:25,182 INFO: === TURN START === (Turn no: 1)
2010-09-14 00:56:25,183 DEBUG: Planets([<P(18)@(2.60x3.38) #52 +1>, <P(19)@(19.72x19.95) #52 +1>, <P(21)@(15.85x11.72) #23 +2>, <P(17)@(4.07x10.79) #89 +5>, <P(0)@(11.16x11.67) #24 +4>, <P(1)@(4.12x5.52) #10 +5>, <P(2)@(18.20x17.82) #100 +5>, <P(20)@(6.47x11.61) #23 +2>, <P(3)@(16.64x22.20) #66 +5>, <P(4)@(5.68x1.13) #66 +5>, <P(5)@(21.13x17.81) #88 +3>, <P(6)@(1.19x5.52) #88 +3>, <P(7)@(20.25x2.06) #90 +1>, <P(8)@(2.07x21.27) #90 +1>, <P(9)@(19.09x10.16) #71 +4>, <P(10)@(3.23x13.17) #71 +4>, <P(11)@(21.95x14.06) #10 +3>, <P(12)@(22.32x23.33) #22 +1>, <P(13)@(0.00x0.00) #22 +1>, <P(14)@(16.94x9.80) #10 +1>, <P(15)@(5.38x13.53) #10 +1>, <P(16)@(18.25x12.54) #89 +5>])
2010-09-14 00:56:25,183 DEBUG: Planets([])
2010-09-14 00:56:25,183 DEBUG: Planets([<P(2)@(18.20x17.82) #100 +5>])
2010-09-14 00:56:25,183 INFO: ### TURN END ### (time taken: 0.0008 s)

Any idea why this is happening? When I look at the full list of planets and their locations, it seems that P(1) should be mine, but it is starting it with 10 ships instead of 100? Is the line being parsed wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions