GithubHelp home page GithubHelp logo

owenashurst / agar.io-clone Goto Github PK

View Code? Open in Web Editor NEW
2.9K 2.9K 1.1K 1.18 MB

Agar.io clone written with Socket.IO and HTML5 canvas

License: MIT License

HTML 3.50% JavaScript 89.99% CSS 6.13% Dockerfile 0.38%

agar.io-clone's People

Contributors

aadilzbhatti avatar abalabahaha avatar bjarneo avatar coderjoew avatar comus avatar cschwarz avatar espressobit avatar francisco-maciel avatar giongto35 avatar huytd avatar igorantun avatar incognitov avatar jniles avatar joemattie avatar juhq avatar juslee avatar kbariotis avatar madarauchiha avatar owenashurst avatar peterdavehello avatar sarencurrie avatar saviosg avatar scoolnik avatar themuddfamily2 avatar thevoxcraft avatar vikramdurai avatar villers avatar vytorcalixto avatar wb9688 avatar zoldszemesostoros avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

agar.io-clone's Issues

"node server/server.js" or "npm start" is not working

I have all packages (NPM,Socket,Bower, etc.). I think that I installed all of requires correctly. But I get an error like;

root@xxx:~/agar.io-clone# npm start

[email protected] start /root/agar.io-clone
node server/server.js

Config file not found!

When I try to write "node server/server.js"

root@sinankose:~/agar.io-clone# node server/server.js
-bash: /usr/sbin/node: No such file or directory

Both are not working, what should I do?

Spiky 4s in names

If a player's name includes a 4, then it renders with a spike above it. See screenshot. Size varies dependant on cell mass. Not critical, just strange.

screenshot

Add a LICENSE

Adding a license (MIT seems like it would fit the project best) lets a contributor know how their code will be used in the future. Could you add one?

Add team mode

maybe even where you can choose which team to join, so playing 6 vs 6 on your local lan party is possible

Add virus

It's time to add some virus to the game.
My idea is:

  • The virus will be in violet color (#9b59b6 for filling color, #9b50ba for border color)
  • Virus also has it's own mass
  • Virus can be feed to get more mass (become larger)
  • Player will be exploded if he has bigger size than the virus (and he eat it)

More idea?

Menu Feature?

a menu that you can choose your name can be very cool.

Grid background

We should draw a grid to background to see if player is moving or not when there are no foods on screen

Server being spammed

The server is flooding the game console when a player moves and/or a food has been eaten.

Issue assigment

Please assign yourself to whatever issue you want solve. I want to contribute but I dont know on which one peaple are currently working.

Adding animations?

I'm thinking about adding an animation engine for handling some animation (split animation,...) and for faster HitTest.

But have no idea where should we calculate the animation. On server side (more complex) or on client side (much easier? any risk?)

EDIT: Appended #134

"... noticed when you eat the "food" the transition between your current size and the next size is instantaneous. Could you add the transition of the "expansion" from your current size to the new size?"

Limit area size?

Maybe should be limit area size X x X in settings?
Now I can travel unlimited away from others...

Bad Server/Client Communication Architecture ?

1. player's move need server feedback

first, player send playerSendTarget command to server.
then server got it, calculate the new position, and send back the serverTellPlayerMove command to this player.

after the server feedback, the player can move.

If there is a big lag between player and server,
the player move will be blocked in a long time.

This should be player move first, then got the server feedback,
player modify it's position with the server feedback data.

2. The server broadcast message immediately

when a player move mouse,
the server will got a playerSendTarget command, and target data.

server do some calculate (eat food, or eat other players),
then broadcast serverUpdateAllPlayers to all connected players.

This is a bad design.

If there are 100 players connected to the server.
every player move mouse one times per second.

It means, the server will broadcast 100 times in one seconds.
And every client will got 100 times messages.

This is very overload to both server and client.

This should be done as the follows:

Server has a tick rate (maybe 10Hz. 10 times per second) to sync the whole game world to all clients.
(AOI. (area of interest ) are just ignored right now )

player send playerSendTarget to server immediately.
server do calculate, and NOT broadcast the message to other clients.

When next server tick comes, then send serverUpdateAllPlayers to all clients.

This can avoid the overload of server and client in a high rate communicate.
Server To Client rate is Fixed to the server tick rate.

Player name shouldn't grow with cell size

The usernames are growing as you eat more food. That shouldn't happen (unless name fits entirely on cell size, perhaps?)

As it is right now, even if your name overflows the cell size, it'll continue to get bigger as your cell does.

Proper source code structure

Shouldn't the code be more structured? What about adding some .editorconfig file and linting/hinting? Would you accept such PRs?

Getting literally 2 FPS

I've tried multiple different servers, even the demo, Im pretty sure its due to my bad computer or the network usage, just thought I'd put this as a bug as I do not lag on agar.

Invisible Players & out-of-sync player counter

Seeming randomly, after playing with 15 people, the largest person went invisible, you could clearly see him eating the food particles as he approached, then you get disconnected as he reached you.
Also, once somebody has died, the player counter loses count somehow, showing 13 when 15 players were clearly visible.

I'm investigating these now.

Let newbies be eaten?

I think newbies should be allowed to be eaten. I feel it makes the game more fun when you start you have to work your way up

Hit test: NaN ยฑ 10

When starting a game i can see my red dot, but as soon as i move my cursor the server says "Hit test: NaN ยฑ 10" and the food dots begin to appear.

Problem with hosting C9

Hi, I have a problem with the configuration of Agar Clone on Cloud9 (c9.io). I installed everything, I configured IP and port (0.0.0.0), but after starting the application error pops up:

TypeError: Cannot read property 'name' of undefined
at Socket. (/home/ubuntu/workspace/server/server.js:152:44)
at Socket.emit (events.js:95:17)
at Socket.emit (/home/ubuntu/workspace/node_modules/socket.io/lib/socket.js:129:10)
at Socket.onclose (/home/ubuntu/workspace/node_modules/socket.io/lib/socket.js:418:8)
at Client.onclose (/home/ubuntu/workspace/node_modules/socket.io/lib/client.js:230:12)
at Socket.emit (events.js:117:20)
at Socket.onClose (/home/ubuntu/workspace/node_modules/socket.io/node_modules/engine.io/lib/socket.js:248:10)
at WebSocket.g (events.js:180:16)
at WebSocket.emit (events.js:92:17)
at WebSocket.Transport.onClose (/home/ubuntu/workspace/node_modules/socket.io/node_modules/engine.io/lib/transport.js:113:8)

In addition, I give a private message to log data hosting, in order to help. Have you some free hosting to test it yourself to calm the game engine? Thanks in advance for any help! :)

Fire a food

Press W or something to fire yourself as a food. To feed other player or virus.

Problem with new config system

i am getting a lot of problems with the new config system,

problems like this:

npm ERR! [email protected] postinstall: `./node_modules/bower/bin/bower install && cp server/config.dist.yml server/config.yml`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is most likely a problem with the agar-clone package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node_modules/bower/bin/bower install && cp server/config.dist.yml server/config.yml
npm ERR! You can get their info via:
npm ERR!     npm owner ls agar-clone
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.14.13-c9
npm ERR! command "/home/ubuntu/.nvm/v0.10.35/bin/node" "/home/ubuntu/.nvm/v0.10.35/bin/npm" "install"
npm ERR! cwd /home/ubuntu/workspace
npm ERR! node -v v0.10.35
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ubuntu/workspace/npm-debug.log
npm ERR! not ok code 0

the yml is the problem?

Unit Testing

It's time to talk about unit testing.
I used Jasmine for many of my previous project so I choose Jasmine.
If you got any better idea (mocha/chai or something, idk), please suggest.

Cell speed

Cell should have an invisible radius with a fixed size around it that controls its speed. Currently it's pretty annoying that when you reach the window border your cell slows down dramatically.

Add a chat

So we can express our anger when people eat us.

Can't eat each other

Hi,
we are using firefox on fedora and arch linux and we can not eat each other.
it does not matter who is larger, we can not eat the smaller one.
sometimes we can not even see each other

Add new chat type (bubble)

Linked with #3
It's better to have another chat style (bubble)
And we need to make a switch somewhere (config/setting page) to allow user switch between chat type.

Should create Players and Player object

Should create Players and Player object.

Players should be initialized once to hold all players object. It should also have all the methods related to findPlayer, getPlayersList etc.

The Player object should have the x, y etc. And it should probably inherit the playerConfig. This object should be initialized in socket.on("welcome", function(us

Perhaps it also should be packed in webpack, so the code could be shared on the client and server side?

Thoughts?

Connection refused

I get connection refused whenever I run this, I have reinstalled the server 3-4 times now and I am still getting this error, thanks. there are no errors appearing at all it just says "listening on port :3000" here is the server I am running it on http://23.94.96.14:3000/

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.