EntelectChallenge / 2017-Battleships

MIT License
22 stars 31 forks source link

Added discriminators to bot names. #30

Closed oOCKYOo closed 7 years ago

oOCKYOo commented 7 years ago

The botHarness adopts the playerType of the first bot with the same name as itself. If 2 bots have the same name, only the first occurrence will ever be used. The botHarness is also only related to the engine players via the name (which is chosen as Nickname, Author or Email in that order) so the only way to force a 1:1 relationship is to ensure the names are unique.

Changing the player name is reflected visually as well since the same name is used by the renderers.

This change adds the index from the list of bot paths provided as arguments to the botHarness and the engine player, ensuring that even if bot names match, the discriminator will be different since it points to a unique bot path index.

Tested using 2 consoleHarnesses , 1 consoleHarness and 1 botHarness and 2 botHarnesses without problems.

This is in response to #14.

EntelectChallenge commented 7 years ago

Hi oOCKYOo,

Thanks for the merge request. I have something a bit different in mind for this. Instead of adding the discriminator, the BotHarness should just get the player type from the player that it was registered with. I will make the change on my side and push it a little bit later.

oOCKYOo commented 7 years ago

Hey,

Yeah there were multiple approaches to solving this one. This solution did feel like it touched a little too many files when I looked at it. Hope it pointed out the problem at least :)

EntelectChallenge commented 7 years ago

Yeah it helped a lot, you found the bug, we just know of a one liner that can fix it :)