Giter Site home page Giter Site logo

Comments (21)

snaar avatar snaar commented on May 28, 2024

What language is the bot in?

from halite-ii.

julskast avatar julskast commented on May 28, 2024

I've asked him here: https://forums.halite.io/t/bug-update-map/118/3

from halite-ii.

Patriot1394 avatar Patriot1394 commented on May 28, 2024

Python

from halite-ii.

Patriot1394 avatar Patriot1394 commented on May 28, 2024

game.update_map() works for more than 1 second
и я сбой с тайм-аутом

from halite-ii.

Patriot1394 avatar Patriot1394 commented on May 28, 2024
  • and I'm crashing with a timeout

from halite-ii.

snaar avatar snaar commented on May 28, 2024

Does default bot work? Or is this default bot failing as well?

from halite-ii.

Patriot1394 avatar Patriot1394 commented on May 28, 2024

the standard bot is working. this error occurs when a large number of ships are simultaneously on the map.

from halite-ii.

harikmenon avatar harikmenon commented on May 28, 2024

@j-clap can you take a look at this?

from halite-ii.

j-clap avatar j-clap commented on May 28, 2024

Can we get a full traceback of the error? How did you find out this is caused by update map?

from halite-ii.

Patriot1394 avatar Patriot1394 commented on May 28, 2024

a_times = timeit.default_timer()
game_map = game.update_map()
logging.info(timeit.default_timer()-a_times)

at some point, it takes more than 2 seconds.

from halite-ii.

j-clap avatar j-clap commented on May 28, 2024

Can you post a replay here?

from halite-ii.

Patriot1394 avatar Patriot1394 commented on May 28, 2024

Replay
https://halite.io/play/?game_id=1847733

Log
https://api.halite.io/v1/api/user/1308/match/1847733/error_log

from halite-ii.

harchuk avatar harchuk commented on May 28, 2024

profiletext.txt

Judging by the profile, the readline function is to blame. Please correct!

from halite-ii.

snaar avatar snaar commented on May 28, 2024

One theory would be that the bot didn't send move instructions for one of the turns, so backend isn't sending new map to the bot, so client is stuck waiting for the map from the backend. This assumes no bugs in either backend or python client :P

from halite-ii.

j-clap avatar j-clap commented on May 28, 2024

Also, readline just reads the line. I mean I could use the c version here, but considering that 2 of the other 4 bots in the game run the same python library and none of them timed out, it's not very likely it's the library...

Could you send me your code so I can take a look?

from halite-ii.

snaar avatar snaar commented on May 28, 2024

I would propose adding check to standard kits that "you ran map update without sending move commands first", regardless of what happens in this issue.

from halite-ii.

j-clap avatar j-clap commented on May 28, 2024

@snaar That sounds like a good idea.

from halite-ii.

Patriot1394 avatar Patriot1394 commented on May 28, 2024

@snaar it seems so it is.
just send a message when waiting for more than a second

from halite-ii.

snaar avatar snaar commented on May 28, 2024

It sounds like you have figured out what is wrong and fixed it. If that is not the case, please reopen and we'll try to figure it out.

from halite-ii.

MattFaus avatar MattFaus commented on May 28, 2024

I also noticed game_map.update_map() taking a long time to run. I suspect that the sys.stdin.readline() is blocking until it gets input from the halite engine causing the measured execution time from the perspective of the bot to be too much. Surely the engine counts the "turn time" as starting after the new game state is sent to each bot.

from halite-ii.

liviuchircu avatar liviuchircu commented on May 28, 2024

The game_map.update_map() call actually includes the remaining processing time of all active opponents! Whatever you do, do NOT include it in your timeout measurements! This was non-intuitive for me as well, and was stuck for a good couple of days with issue #248 .

from halite-ii.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.