ukoethe / bomberman_rl

24 stars 66 forks source link

show bomb owner in game_state #9

Open Philipp-g opened 3 years ago

Philipp-g commented 3 years ago

Currently the game_state does not provide the owner of a bomb.

Without this information the model can't really differentiate if a result occurred because of its own bomb or because of the bomb of another agent.

Since this information is also provided in the graphical representation of the game (color of the bomb), I think it is only fair to include it in the game_state too.

fdraxler commented 3 years ago

Thanks for your contribution! I agree that this information is available in the GUI. However, I think that it will not change the way people train their agents and the information that an agent cannot drop a bomb is available in the agent's state. So I am leaving this open until the project is over.

Philipp-g commented 3 years ago

I think it makes a huge difference during training.

Consider this example:

The bomb of Agent_1 kills Agent_2 => Reward 5 for Agent 1

now take the same state and replace the bomb of agent_1 with the bomb of agent_3

Agent_3 kills Agent_2 => Reward 0 for Agent_1

Without the information of the owner of the bomb these would be exactly the same transitions to the agent but with completely different rewards.

I agree that you don't really need the owner of all bombs but you at least need to be able to differentiate if the bomb belonged to you or another agent.

ukoethe commented 3 years ago

Knowing the owner of a bomb indeed makes a huge difference. However, I think this information is not made explicit in normal game play, i.e. when a human player only sees the GUI. Instead, one needs to infer ownership from the game history. Thus, learning ownership is much more interesting (from a didactic point of view) than just providing this information in the API.

Philipp-g commented 3 years ago

I think the GUI makes this information quite explicit because different agents have different bomb icons. Of course if everyone specifies the same custom bomb icon then this information is no longer there. But this could also be applied to the agent icons themselves and the API still provides a way to differentiate the agents.

fdraxler commented 3 years ago

I agree with you that the information is explicit in the GUI together with the game history.

But if you just want to know whether it was your bomb that killed another agent (and this is the moment where your agent gets its reward), use the game event KILLED_OPPONENT. It is fired in addition to OPPONENT_ELIMINATED when your agent was the one who put down the bomb.