Lux-AI-Challenge / Lux-Design-S1

Home to the design and engine of the @Lux-AI-Challenge Season 1, hosted on @kaggle
https://lux-ai.org/
Apache License 2.0
897 stars 151 forks source link

Python kit improvements #107

Closed IsaiahPressman closed 3 years ago

IsaiahPressman commented 3 years ago

Fixed bug where city_tile_count only incremented when new city_tiles were spawned, but never decremented if some cities died.

Fixed bug with text and sidetext functions which lacked the necessary single quotes around the message text.

QOL improvement by replacing ' ' with '_' for text function, because otherwise only the first word was displayed.

StoneT2000 commented 3 years ago

Thanks for the fixes!

StoneT2000 commented 3 years ago

Actually how did you verify the city_tile_count was not correct? It should be correct since every turn the starter kit will automatically reset that value to 0 before adding it back in

IsaiahPressman commented 3 years ago

Whoops, I seriously misread that portion of code. I was dealing with a bug with city counting and thought this was the problem. I reverted that change and left the message debug message fix.

StoneT2000 commented 3 years ago

actually for message debugging we may handle this internally on the engine because other kits would have this issue too then.

StoneT2000 commented 3 years ago

ok our fix will be like this

def text(x: int, y: int, message: str, fontsize: int = 16) -> str:
    return f"dt {x} {y} {fontsize} '{message}'"

so the parameters are first, then the arbitrarily long message is placed last.

I'll merge in what you have and make the fixes. Thanks!