How Does agar.io Work?

Discussion in 'Gaming Lounge' started by turtl, Jul 13, 2015.

  1. So, how exactly does agar.io work? When I right-click while playing agar.io it treats the game like an image. Just wondering how the game works.
     
  2. When in game, right click and click inspect element.
     
    • Winner Winner x 1
  3. Press W to feed others

    Press space to split yourself to eat others

    Use your mouse as a navagation. Dont eat or get swallowed into the Green virus things. They will make you explode or you will die. Other players will grow bigger and try to eat you. So dont die.
     
    • Funny Funny x 3
  4. He means the internals I believe, not the controls.
     
    • Agree Agree x 1
  5. md_5

    Administrator Developer

    html5 canvas probably.
     
    • Agree Agree x 3
    • Informative Informative x 2
  6. Lol sorry.
     
  7. Thanks for all the replies guys! :)
     
  8. It's a Websocket based game. When you browse to the site a random server is choosen and you get the gamedata rendered on a canvas
     
    • Informative Informative x 1
  9. Honestly I never bothered looking...hmm...
     
  10. i've never understood why that game is so popular among youtuber's right now.
     
    • Agree Agree x 1
  11. Like @md_5 said it uses html5 canvases to render, also it uses html5 websockets to allow the game to connect to the servers. IIRC, the backend was fully custom developed in c++(websocket server).
     
    • Useful Useful x 1
  12. Although it's worth mentioning writing the server in C++ is a wasted effort. NodeJS would be a more suitable platform.
    Although I can't really say the developer is really smart in the first place, the client is five times heavier than it should be.
     
    • Agree Agree x 1
  13. and what was node.js written in? (mainly the v8 engine <3)

    **no doubt node is great for this sort thing, just had to point out the irony**
     
  14. This is a thread made a year ago lol
     
  15. There is no irony here, all x86 code ends up as assembly at some point. When all comes to, every x86 programming language is "written in" assembly.

    If you're going to argue that C/++ is partially written in C/++ as well via bootstrapping, keep in mind that NodeJS and V8 do the same with JavaScript.
     
  16. ahh, but javascript is interpreted by c++<3 it is true that technically all x86 languages are written in x86 assembly. I was just implying that the V8 engine, what powers Node.JS (of course not by itself), interprets the code, not compiles it- therefore concluding it would be a bit slower than actual C++ because of the great abstractions and pure fact of being an interpreted language.

    All love tho bro. I'm a big fan of node myself :)
     
  17. V8 is JIT, not interpreted.
     
  18. You're correct. My comment was dumb <3
     
  19. JIT is compilation. JavaScript is not an interpreted language.

    I assume that's what you meant by this post, but I'm just making sure.
     
  20. Moving around your mouse, Being bigger and bigger. :p