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 152 forks source link

Research points not adding #130

Closed ZachariahRosenberg closed 2 years ago

ZachariahRosenberg commented 2 years ago

PROBLEM

Citytile research method do not add to player research_points:

SOURCE

Citytile.research():

https://github.com/Lux-AI-Challenge/Lux-Design-2021/blob/f303f410fb9077f5dddd5af53c364264583409af/kits/python/simple/lux/game_objects.py#L49-L53

Constants.INPUTS:

https://github.com/Lux-AI-Challenge/Lux-Design-2021/blob/f303f410fb9077f5dddd5af53c364264583409af/kits/python/simple/lux/constants.py#L1-L9

https://github.com/Lux-AI-Challenge/Lux-Design-2021/blob/f303f410fb9077f5dddd5af53c364264583409af/kits/python/simple/lux/game.py#L41-L48

SOLUTION

Update research() to send obj like:

return "rp {} {}".format(self.pos.x, self.pos.y)

Currently making this fix returns error:

Agent 0 sent malformed command: rp 12 4

Which is a result of not matching the action in:

https://github.com/Lux-AI-Challenge/Lux-Design-2021/blob/7fbdf8721bad0506d8fb7dbb95a4d7668e2efd9f/src/Game/index.ts#L162-L437

specifically, Game.ACTIONS.RESEARCH.

Does anyone know where to set Game.ACTIONS.RESEARCH?

Thanks!

StoneT2000 commented 2 years ago

This is actually not a bug. People are able to research fine with python.

ZachariahRosenberg commented 2 years ago

@StoneT2000

How are research points ever added to the player?

https://github.com/Lux-AI-Challenge/Lux-Design-2021/blob/f303f410fb9077f5dddd5af53c364264583409af/kits/python/simple/lux/game.py#L33-L48

For the above to update the player's research_points, the input_identifier == "rp"

https://github.com/Lux-AI-Challenge/Lux-Design-2021/blob/f303f410fb9077f5dddd5af53c364264583409af/kits/python/simple/lux/constants.py#L1-L3

However the update msg that gets sent when calling research() is

https://github.com/Lux-AI-Challenge/Lux-Design-2021/blob/f303f410fb9077f5dddd5af53c364264583409af/kits/python/simple/lux/game_objects.py#L49-L53

"r" vs "rp"?

StoneT2000 commented 2 years ago

Sending an action is different from receiving observations so they don't need the same identifier

ZachariahRosenberg commented 2 years ago

Aha, understood. Thank you @StoneT2000 for the explanation.

For some reason self.player.research_points isn't incrementing on my local - but I'll continue looking for where the error may be.

I'll close this issue.