AJS-development / OpenAgar

An open source web game
Other
45 stars 20 forks source link

Gallery #1

Open Andrews54757 opened 8 years ago

Andrews54757 commented 8 years ago

Gallery

Revenge system: Icon grows bigger when you are closer to the player, and the icon is put on the cell when in the screen

screen shot 2016-11-03 at 3 01 23 pm screen shot 2016-11-03 at 3 01 29 pm

Skins: (the skin is a custom skin)

screen shot 2016-12-10 at 5 11 50 pm

Multi-Processes

screen shot 2016-12-10 at 5 21 21 pm

Website (opnagar.us)

screen shot 2016-12-10 at 5 22 25 pm

Plugin system:

screen shot 2016-11-28 at 2 29 32 pm

Onan config editor (plugin)

screen shot 2016-12-10 at 5 18 51 pm
Andrews54757 commented 8 years ago

CURRENT EFFICIENCY AS OF NOV 5

I made it much more efficient again. Note that 1000 bots are running. I am comparing with OgarUL

OpenAgar:

screen shot 2016-11-05 at 7 54 37 pm

OgarUL:

screen shot 2016-11-05 at 7 54 32 pm

MultiOgar:

screen shot 2016-11-05 at 7 59 09 pm

Conclusion

Open agar has surpassed both multiogar and ogarUL now in preformance. OgarUl just froze when 1000 bots were added, MultiOgar slowed down and became choppy when 1000 bots were added, and OpenAgar, had no lag whatsoever which is very very surprising.

makandz commented 8 years ago

@Andrews54757 That's interesting. What features does the server have right now?

Andrews54757 commented 8 years ago

Almost all the basics, except viruses. Yet the infrastructure is complete. Every feature that I add has virtually no performance drawbacks as they are made with extreme caution. More is being added. So these stats are probably off by a bit. But then, as I add more features, I also make it more efficient. So it balances out. I keep my CPU profiler at hand all the time to monitor the server

Andrews54757 commented 8 years ago

There are also cool features as well. Such as the revenge icon. Most features however, are devoted to efficiency. There are soo many features for efficiency, It is hard to list them all. Oh well, Il try

  1. Server side caches
  2. Client side caches
  3. Slow FPS protocol - > Will be explained in the wiki
  4. Hashbounds
  5. SmartNodes protocol - > Will be explained in the wiki
  6. Lag detection. (the server will adapt to lag)
  7. Async console
  8. and more I can't remember

Anyway, I envision that future OpenAgar servers could hold 1000 players and 500 bots with zero lag

makandz commented 8 years ago

Interesting 👍

Andrews54757 commented 8 years ago

I find it depressing that Ogar is dead. No ogar server was ever updated in the last 2 months. Agar.io is apparently dead.

segg21 commented 8 years ago

@Andrews54757 That's why we need to bring it back to life, not only as it being similar to Agar.io, but as to what you created Unlimited. Private servers still exist, but new updates to the game? nah. That's hardly never heard from miniclip, except them patching and making everything look better than before.

omidh28 commented 8 years ago

@Andrews54757 I don't think it's dead yet, Personally I'm looking for hosting hundreds of mini Ogar servers.

makandz commented 8 years ago

@LegitSoulja The whole game concept is dead now. The game used to be fun, but games are only fun for a bit. Unless if there would be a gamemode that would completely blow out all other .io games than it would work. But the issue is now there are hundreds of .io games that just have a MUCH better concept than Agar.io, after all, Agar.io was the first .io hit.

Andrews54757 commented 8 years ago

Yes, but I am thinking of adding special things such as mini games

DaAwesomeRazor commented 8 years ago

@Andrews54757 Thats amazing, my multiogar server lags a ton in the bots gamemode when i give people more than 9 bots each,

m-byte918 commented 8 years ago

Damn @Andrews54757 that's impressive, I'm so hype for this project!

Andrews54757 commented 8 years ago

New performance charts: This compares the performance before and after this

BEFORE:

screen shot 2016-11-23 at 9 53 06 am

AFTER

screen shot 2016-11-23 at 9 53 11 am

Andrews54757 commented 8 years ago

I tried 2000 bots, and there was NO LAG!!

Andrews54757 commented 8 years ago

Well, next up: 3000 bots. And smart bots too.

Andrews54757 commented 8 years ago

@LegitSoulja OpenAgar is basically finished. There are only two things I have to do

  1. Smarter bots. Im planning on making the bots extremely smart (very easy)
  2. More gamemodes (even easier, since OpenAgar's game mode api is almost the same as Ogar's)
segg21 commented 8 years ago

@Andrews54757 I'll check out making new gamemodes when I get home.

I don't know when exactly. I might not go back home till this weekend :/.

segg21 commented 8 years ago

@Andrews54757 Check gitter

Niall7459 commented 8 years ago

This looks very nice! great work!

m-byte918 commented 7 years ago

@Andrews54757 I have a question, what was the starting size of the bots when you ran them? I'd like to compare the performance to my MultiOgar, but I need to know the correct settings first.

Andrews54757 commented 7 years ago

Default

Andrews54757 commented 7 years ago

It takes a lot for OpenAgar to lag. Note that bots run on a different process, the same process in which collisions, leaderboard, and mass checking runs in. So they might be slowed down when bots are flooded. But the main physics wont. This only occurs for bots (not minions or players) because the bots run on the same process, and they are not optimised at all. Still though, you can run 2000 bots with no lag (for me), without the effect I mentioned. But I bet if the bot code was optimised (it is the same AI as OgarUL), it will be able to run 2500 bots without the effect. But still, lag is not visible even if you add more bots than expected (for me). The server is made to detect lag and mitigate it, you can see some lag status by going into the debug console (Type debug).

segg21 commented 7 years ago

@Andrews54757 Does running a child process happen on the same core, or all?

In that case I got a 8 core, gtx x4 64 gb mem, OS running on an SSD with 2 more internal, and processing speed is 5.7 (Overclocked). I flashed my motherboard :) in case you're wondering. That's how custom built my computer is.

Andrews54757 commented 7 years ago

So, after studying nodejs processes, I learned a v8 engine is very expensive. And using .fork spawns a new instance. So I have it set up dynamically to get the most bang out of my buck.

  1. A new child will spawn when a server is created. Including using the multi-server system.
  2. If the amount of processes, equals the amount of cpus, it will not create another but will assign the server to the process with the least assigned servers.
  3. When a server is removed, (not shut down), it will deassign the server from its process
  4. If the number of assigned servers go to 0, the process will be shut down

And yes, a new child will operate in another core

segg21 commented 7 years ago

@Andrews54757 Good note.

Andrews54757 commented 7 years ago

I am kindof dissapointed though, that people are trying to steal my work, I just realised, the entire advancedness (a word?) of the program and how much work it took me to make

Andrews54757 commented 7 years ago

I just posted an update a while ago that changes the UID system so the keygen is different now. The client and everything will have to be updated.

Andrews54757 commented 7 years ago

Now I realise that I should have kept this project completely private

Andrews54757 commented 7 years ago

Oh well, this will be good on my resume anyway. Not anybody can do what I did with this in just 2-3 months

Andrews54757 commented 7 years ago

@LegitSoulja Please go to gitter

m-byte918 commented 7 years ago

@Andrews54757 I know you are probably busy and all and its the holidays and all that, but I would like to ask a few more questions.

How is the performance with 5000 ten mass minions? Be brutally honest, I'd like to compare performance again. If you do test it, can you leave the contents of the debug command here? Did the server slow down or physics become choppy? Please explain in great detail, I want to feel as if I tested it for myself.

I know I've already asked a similar question and you probably don't have time to answer, but I couldn't wait any longer and the forums are closed as of now. Since I missed my chance to generate my own key, I cannot test the performance myself. I figured I would ask someone who has access to it.

Thank you for your time :) Sorry if I distracted you from your work :/

Andrews54757 commented 7 years ago

@Megabyte918 This is what will happen with 5000 minions: The server will lag badly.

[Debug] Client (ID: 1) was added to server 1                                   
[Debug] Possible lag spike detected: 187 MS. Nodecount: 5671                   
[Debug] Mitigating lag...                                                      
[Debug] Possible lag spike detected: 137 MS. Nodecount: 5671                   
[Debug] Mitigating lag...                                                      
[Debug] Possible lag spike detected: 127 MS. Nodecount: 5671                   U[Debug] Mitigating lag...                                                      
[Debug] Possible lag spike detected: 144 MS. Nodecount: 5671                   
[Debug] Mitigating lag...                                                      
[Debug] Possible lag spike detected: 87 MS. Nodecount: 5671                    
[Debug] Mitigating lag...                                                      
[Debug] Possible lag spike detected: 94 MS. Nodecount: 5671                    
[Debug] Mitigating lag...                                                      
[Debug] Possible lag spike detected: 91 MS. Nodecount: 5671                    
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 97 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 101 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 146 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 131 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 91 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 90 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 134 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 134 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 109 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 95 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 113 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 112 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 81 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 115 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 91 MS. Nodecount: 5671
[Debug] Mitigating lag...
[Debug] Possible lag spike detected: 95 MS. Nodecount: 5671
[Debug] Mitigating lag...
Andrews54757 commented 7 years ago

@Megabyte918 I will however, try to make preformance even better so it can handle 5000 minions. The reason for the horrible lag at 5000 minions is because they don't run on separate processes, unlike bots, because it is not "worth it" seeing that minions are only "temporal" when playing.

Andrews54757 commented 7 years ago

@Megabyte918 I have experimented more, and found that the limit for no lag minions are 2000

Andrews54757 commented 7 years ago

@Megabyte918 I have some ideas on how to optimize them.

  1. When minions are not in view of players (not bots), don't do collision checking unless the minions are set to collect food or if their count is below 1000.
  2. When two minions overlap, do collision checking only once for them
  3. Minions close to each other will be using the same movement "numbers"
  4. And more
Andrews54757 commented 7 years ago

@Megabyte918 I think, however, the lag is caused when huge amount of data is being sent to child processes. I could use a database to store the objects, and that could solve the problem, but its the same thing Micheal and I tried to do in the dev branch of ogarul. Didn't end up too well as people were complaining about the slow start time.

Andrews54757 commented 7 years ago

@Megabyte918

Normal Operation:

screen shot 2016-12-23 at 8 26 55 am

2000 minions:

screen shot 2016-12-23 at 8 26 34 am

5000 minions:

screen shot 2016-12-23 at 8 26 31 am

Andrews54757 commented 7 years ago

@Megabyte918 I also learned, that a lot of the lag I experienced, was infact client lag, even though I shut off the server, it still was "moving".

m-byte918 commented 7 years ago

@Andrews54757 Very interesting... I have a few things to state about the possible optimizations:

When minions are not in view of players (not bots), don't do collision checking unless the minions are set to collect food or if their count is below 1000.

Won't that cause bugs with collision for other players trying to eat the minions? For example if I ran 2000 minions, and other players were trying to eat them out of my viewbox, if the collision checking is disabled, then the players won't be able to eat/feed/interact with the minions right?

When two minions overlap, do collision checking only once for them

Wouldn't having the server constantly checking if minions are overlapping decrease performance? Especially if your running greater than the recommended amount of minions

m-byte918 commented 7 years ago

@Andrews54757 Have you tried disabling visible-node calculations for minions? It really helps. Here is an example of it in action on my server:

Disabled(default): https://streamable.com/6om8h Enabled: https://streamable.com/xx9vz

I am using an extension because my computer can't handle recording with 5k minions with the agario client's graphics.

That being said I am very very impressed on how well OpenAgar handles 2k minions, especially with all features it has and all of the configs and all that. I'm glad it didn't turn out like OgarUL did with the lag and all, you guys did a great job @Andrews54757 and @LegitSoulja. Thanks for taking the time to respond to all of my questions with such detail, I wish you guys the best of luck and a happy holidays :)

Andrews54757 commented 7 years ago

@Megabyte918 Minions already don't have visible calculations and whatnot. They are very very simplified. Take a look at the code and you will see the pure simplicity. They still have all the features though

m-byte918 commented 7 years ago

@Andrews54757 Nice, I can't wait to see what it can do after your future optimizations 👍

Andrews54757 commented 7 years ago

@Megabyte918 I have discovered something: Socket.io is very slow. I found out that OpenAgar is not lagging minions due to the fact that socket.io is slow. I then pried through Socket.io's code, and made it much more efficient. Then, the server could handle more minions

BEFORE OPTIMISATION: (note in all images, it is running 2000 minions)

screen shot 2016-12-30 at 6 05 33 pm

AFTER OPTIMISATION:

screen shot 2016-12-30 at 6 05 14 pm

@Megabyte918 's MultiOgar-Edited:

screen shot 2016-12-30 at 6 05 10 pm

m-byte918 commented 7 years ago

@Andrews54757 Wow.. that's impressive 👍

KaanAga commented 7 years ago

Hey @Andrews54757 Andrews54757 I dont know "How can I Setup OpenAgar?" Plz record video and send link plsss I want this OpenAgar

segg21 commented 7 years ago

@KaanAga

We don't provide support. OpenAgar comes in the box, WithInstructions which are basic. Nobody provide things without meaning, sources, and docs.

All we ask you is to read. Or ask google,bing,yahoo,stackoverflow,twitter,or a friend who has experience with doing it. However we don't provide. You can read the old project "videos, issues, and even projects". Better hurry on the issues.

Andrews54757 commented 7 years ago

@LegitSoulja, should we make the packets binary? (that didnt make so much sense). I created a tool to do so: https://github.com/ThreeLetters/Binary

Andrews54757 commented 7 years ago

@LegitSoulja I am creating a more detailed documentation here: https://ajs-development.github.io/OpenAgar/

segg21 commented 7 years ago

@Andrews54757 If it turns out with better performance then sure

segg21 commented 7 years ago

I kindof want to make my own socket in which with non nodejs, but with browser, in which can communicate with socket.io, and websockets using protocols.

Or even my own sys, in which sends vice versa data.