owenashurst / agar.io-clone Goto Github PK
View Code? Open in Web Editor NEWAgar.io clone written with Socket.IO and HTML5 canvas
License: MIT License
Agar.io clone written with Socket.IO and HTML5 canvas
License: MIT License
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! :)
Press W or something to fire yourself as a food. To feed other player or virus.
How to use it with public ip ?
Press SPACE to split like agar.io
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
Using interval to respawn foods cost too much CPU usage and it makes the game laggy.
Tested with 2 clients on localhost still lage ๐
Support A/W/S/D and/or UP/DOWN/LEFT/RIGHT arrow keys.
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?
To speed up the connection. Send/receive data in binary format is a better idea than string/object.
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.
Update new algorithm for hit test. To improve speed.
Maybe should be limit area size X x X in settings?
Now I can travel unlimited away from others...
I'm taking this if approved
maybe even where you can choose which team to join, so playing 6 vs 6 on your local lan party is possible
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.
https://agar-io-clone-d3vont3ch.c9.io/
this works like a charm
So we can express our anger when people eat us.
Maybe we should make it so the player can move in a certain area, and only move the camera when the player is close to the screen borders. As it is right now it's pretty hard to play, as in it's hard to get used to it.
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.
Skins could make the game more fun to play.
Working demo hosted on openshift:
https://pillo-nibro.rhcloud.com/
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?
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?
The server is flooding the game console when a player moves and/or a food has been eaten.
We should draw a grid to background to see if player is moving or not when there are no foods on screen
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.
With gulp and babel
#36
Any of demos not work.
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.
Please assign yourself to whatever issue you want solve. I want to contribute but I dont know on which one peaple are currently working.
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.
You can hide enemies, if you have bigger resolution screen than them.
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?"
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/
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.
Shouldn't the code be more structured? What about adding some .editorconfig file and linting/hinting? Would you accept such PRs?
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.
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.
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.jsConfig 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?
or whatever else we want to test
a menu that you can choose your name can be very cool.
Maybe host it on Heroku (rip free tier) or Openshift ?
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
It's time to add some virus to the game.
My idea is:
More idea?
The game's graphic does not scale up or down when resizing windows
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.