Barbosik / MultiOgar

An open source Ogar server implementation, written with Node.js.
Other
61 stars 44 forks source link

Performance #14

Closed Sicmda closed 8 years ago

Sicmda commented 8 years ago

It sometimes lag slowly. Please fix it.

BaumanDev commented 8 years ago

Can you specify? Like when it happens? Pretty sure Barbosik has done refactoring to make performance better.

Sicmda commented 8 years ago

@NatsuTheGreat When it lag, game is slow. sometimes it return, But it lag again.

Barbosik commented 8 years ago

I'm working on performance, but first I want to fix game physics. There are at least two physics things that should be fixed:

Sicmda commented 8 years ago

@Barbosik oh.. thank you!

Sicmda commented 8 years ago

@Barbosik Maybe i think you should see a short lag video for know this problem. bandicam 0054.zip

F0RIS commented 8 years ago

@Chancerst it's from bots using

Barbosik commented 8 years ago

I think it's fixed now. Current MultiOgar has a fairly good performance for private servers.

Sicmda commented 8 years ago

@Barbosik um.. This is weird. Still it lag and slow again. i don't know this problem.. bandicam 0056.zip

Barbosik commented 8 years ago

It lags because GameServer.getCellsInRange consumes almost all cpu time, it's slow. So, if you want, you can rewrite this function. It lags when there are a lot of colliding cells. Just don't use too many bots and it will works fine. 10 bots works ok.

How many bots u're using? What is your map size? How many food on the map? What is your CPU?

Just write how to reproduce it. Otherwise I cannot know what is going on with your server.

Also, note that agario client consumes a lot of cpu. So, if your computer is too slow, then it's bad idea to run private server on the same computer where you playing.

Sicmda commented 8 years ago

@Barbosik i use 16 bots. size vanilla agar.io size (14142). i use FoodStartamount: 1500, Max: 2000. I use cpu AMD FX(tm)-8300 Eight-core Proccessor.

Barbosik commented 8 years ago

do you have lags with no bots? What is your gameserver.ini?

Sicmda commented 8 years ago

@Barbosik My gameserver.ini is

// Ogar configurations file // Lines starting with slashes are comment lines

// [Server] // serverGamemode: 0 = FFA, 1 = Teams, 2 = Experimental, 10 = Tournament, 11 = Hunger Games // serverBots: Amount of player bots to spawn (Experimental) // serverViewBase: Base view distance of players. Warning: high values may cause lag // serverStatsPort: Port for the stats server. Having a negative number will disable the stats server. // serverStatsUpdate: Amount of seconds per update for server stats // serverLogLevel: Logging level of the server. 0 = No logs, 1 = Logs the console, 2 = Logs console and ip connections // serverScrambleCoords: Toggles scrambling of coordinates. 0 = No scrambling, 1 = scrambling. Default is 1. // serverMaxLB: Controls the maximum players displayed on the leaderboard. serverMaxConnections = 64 serverPort = 443 serverGamemode = 0 serverBots = 16 serverViewBaseX = 1920 serverViewBaseY = 1080 serverStatsPort = 88 serverStatsUpdate = 60 serverLogLevel = 1 serverScrambleCoords = 1 serverMaxLB = 10

// [Border] // Border values of the map (Vanilla values are left/top = 0, right/bottom = 14142.135623730952) borderLeft = 0 borderRight = 14142 borderTop = 0 borderBottom = 14142

// [Spawn] // Each interval is 1 tick (50 ms) spawnInterval = 20 foodSpawnAmount = 50 foodStartAmount = 1500 foodMaxAmount = 2000 foodMass = 1 foodMassGrow = 1 foodMassGrowPossiblity = 50 foodMassLimit = 5 foodMassTimeout = 120 virusMinAmount = 20 virusMaxAmount = 35 virusStartMass = 100 virusFeedAmount = 7

// [Ejected Mass] // ejectMass: Mass of ejected cells // ejectMassCooldown: Tick count until a player can eject mass again (1 tick = 40 ms) // ejectMassLoss: Mass lost when ejecting cells // ejectSpeed: Base speed of ejected cells // ejectSpawnPlayer: Chance for a player to spawn from ejected mass ejectMass = 13 ejectMassCooldown = 3 ejectMassLoss = 14 ejectSpeed = 100 ejectSpawnPlayer = 50

// [Player] // playerRecombineTime: Base amount of ticks before a cell is allowed to recombine (1 tick = 1000 milliseconds) // playerBotGrowEnabled: If 0, eating a cell with less than 17 mass while cell has over 625 wont gain any mass // playerMassAbsorbed: Fraction of a player cell that gets absorbed upon eating (i.e., 1 = 100%, 0.8 = 80%, etc) // playerMassDecayRate: Amount of mass lost per tick (Multiplier) (1 tick = 1000 milliseconds) // playerMinMassDecay: Minimum mass for decay to occur // playerDisconnectTime: The amount of seconds it takes for a player cell to be removed after disconnection (If set to -1, cells are never removed) // playerSpeed: Player speed multiplier (1=normal speed, 2=twice faster) playerStartMass = 155 playerBotGrowEnabled = 1 playerMaxMass = 22500 playerMinMassEject = 32 playerMinMassSplit = 35 playerMaxCells = 16 playerRecombineTime = 30 playerMassAbsorbed = 1.0 playerMassDecayRate = .002 playerMinMassDecay = 9 playerMaxNickLength = 15 playerSpeed = 1 playerDisconnectTime = 5

// [Gamemode] // Custom gamemode settings // tourneyTimeLimit: Time limit of the game, in minutes. // tourneyAutoFill: If set to a value higher than 0, the tournament match will automatically fill up with bots after value seconds // tourneyAutoFillPlayers: The timer for filling the server with bots will not count down unless there is this amount of real players tourneyMaxPlayers = 12 tourneyPrepTime = 10 tourneyEndTime = 30 tourneyTimeLimit = 20 tourneyAutoFill = 0 tourneyAutoFillPlayers = 1

And I'll test When no bots it doesn't have lag.

Barbosik commented 8 years ago

try the latest version. I missed some detail from documentation about buffer allocation, so I fixed it. I'm not sure if it helps

Sicmda commented 8 years ago

@Barbosik ok. I will try new version

PS. When i remove bot, it didn't lag :0.. Also it lag ogarproject too.. I think it have problem about bot source..

Sicmda commented 8 years ago

@Barbosik it Also lag .. PS. please refer ogar unlimited 10.6.3 bot source. it have no lag.

Barbosik commented 8 years ago

check the latest version, please let me know if it resolve your issue

Sicmda commented 8 years ago

@Barbosik It looks like fixed. Thank you! But if it lag again, I'll tell you.