question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Commands get sent to the wrong bot?

See original GitHub issue
7:01 AM] liviuc: I just noticed some funky behavior, not sure if it's related to a bug or not. Here goes:
[7:02 AM] liviuc: if your bot initializes itself using a different player name than your GitHub acc (e.g. my code actually names the bot "z0d" instead of my "liviuchircu" GitHub id), the Halite platform will only tolerate this in some 90% of your matches(edited)
[7:04 AM] liviuc: In the remaining 10%, the bot kit will misbehave, apparently causing the bot to actually play some other players' ships(edited)
[7:05 AM] liviuc: This happens when your username's index matches the bot's fake name index in some "sorted by name" player array. This is just an assumption, based on lots of replays and analysis
[7:08 AM] liviuc: Some bad replays (say ~10% chance, both "liviu" and "z0d" would be the 4th player sorted by name)
---------------
https://halite.io/play/?game_id=2413897&replay_class=0&replay_name=replay-20171108-112733%2B0000--4084977309-264-176-1510140355
https://halite.io/play/?game_id=2413826&replay_class=0&replay_name=replay-20171108-112528%2B0000--4003060868-312-208-1510140273
https://halite.io/play/?game_id=2411370&replay_class=0&replay_name=replay-20171108-101133%2B0000--3747793101-336-224-1510135723

Some working replays (90% average case, "liviu" and "z0d" indexes differ in the name-sorted player array, and the platform tolerates me providing the "z0d" name)
--------
https://halite.io/play/?game_id=2409653&replay_class=0&replay_name=replay-20171108-091633%2B0000--549507420-312-208-1510132525
https://halite.io/play/?game_id=2408420&replay_class=0&replay_name=replay-20171108-084100%2B0000--2764482809-240-160-1510130445(edited)
[8:15 AM] lidavidm: @liviuc I will file an issue to track this, thanks for reporting. So just to clarify, there is a chance that you accidentally control another player's ships?
[8:16 AM] liviuc: I cannot tell for sure this is what's happening, but the bot behavior is completely insane, so this has to be it
[8:17 AM] liviuc: When I get home, I will re-upload it with the GitHub id, and will let you know if it solves the problem
[8:17 AM] liviuc: So let's just keep the issue open for now, and I will update it
[8:17 AM] lidavidm: Ok. And what you're seeing in those replays is your bot is unexpectedly behaving completely insane?
[8:17 AM] liviuc: Exactly, all I'm doing is navigate(), and it skips turns, and rams into random directions / planets
[8:18 AM] lidavidm: That is indeed weird, especially as the engine only uses the player ID for moves, and the environment actually overrides the name you provide, hmm

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
liviuchircucommented, Nov 9, 2017

Thanks, @lidavidm. I made a mistake where my per-turn self-monitoring for timeouts actually included the blocking reading of the result of game.update_map(). So any time the 2/4 bots took more than 2s/turn combined, my game state would be empty (no ships, no planets, no players!), since the update_map() call would get brutally interrupted by an OS SIGALARM. My command queue would remain untouched from the previous turn, and I would send it again to the game engine (hence why the strange crashes into planets).

The ML bot was good at reproducing this, since it likes to … take its time!

Fun fact: looking back, I now understand why this bug was always happening when I was playing against Java bots and their massive arsenal of libraries XD

Thank you, Liviu

0reactions
lidavidmcommented, Nov 9, 2017

I do not want to lead you astray, so it is not anything about the ML bot in particular, just that it happens to reproduce the issue reliably.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WrongBotLol Commands - Discord Bot - Alternative.me
WrongBotLol Commands. Currently we have help message previews, 0 bot commands and 6 slash commands for WrongBotLol Discord bot. Prefix. wbl.
Read more >
Add WrongBotLol Discord Bot | The #1 Discord Bot List
Get addicted to gambling a virtual currency that will never have any real life valu– err, I mean, have fun playing games like...
Read more >
The World's Funnest Discord Bot — WrongBotLol
The world's funnest Discord bot. Level up your Discord server with anonymous confessions, machine learning memes, custom voice chats and so much more....
Read more >
WrongBotLol - Discord Bots
The world's funnest Discord Bot. No cap. Level up your Discord server with anonymous confessions, custom voice channels, an addictive economy system and...
Read more >
All Bot Commands - botman.nz
If you have set a master password, some bot commands will issue a password challenge. Use this command to send the password to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found