How I'm planning to fix lag


1 Like

i havent gotten disconnected since u refreshed the server, and my ping went from 26k to like 40


I have been asking a lot of people, and no’one has been disconnected after the update. So that means the update is working!


For some reason the disconnecting bug still works for me after the update

Anyone else getting it still? None of the players I have seen in game got it

There is some slight botting going down bringing down the TPS but nothing too bad


The next optimization…

Alright it’s been a while so it’s time for the next optimization.

This time I’m taking on something a bit more hard, probably the hardest one on here.

Protocol Rewrite

So basically swordbattle has a protocol, a protocol is kind of a language on which the server and your computer talks. So that if you press a button, the server knows and it updates everyone else’s game.

Now I’ve noticed that the swordbattle protocol is very inefficient.

For example:

  • It sends a lot of unneeded data about each player every frame. We only need to know a player’s name once. We can use the player’s id to link it to a player. But the current protocol sends a players name 30 TIMES A SECOND (or whatever the TPS is)

  • It sends it super fast. The current default TPS is 30. This is very high and most modern games use at max 20 TPS. I’ve experimented with lower TPS but if I go down from 30 it starts losing smoothness. So the protocol needs to be optimized to allow for lower TPS and smoother gameplay…

The new update aims to fix all this by entirely re-writing and redesigning the protocol from the ground up. This will also include a lot of rewritten code in the client and the server, so they can still understand each other optimally.

This may take a lot of time, since this is prone to many small bugs, and rewriting messy code is always a pain, but when this is finished, I do believe lag will be MUCH better if not completely gone.

Again please be patient I do this game for fun, not for profit. I won’t be adding many new features during this period, maybe some new skins ( @ManagePasswords ), and some small improvements but nothing big.

Thanks. updated protocol - Google Docs

I am working on this document, to contain the updated protocol. This is not perfect and be subject to change.


cool, im sure that will help the game greatly


Thank you!

1 Like

New skins will be coming out soon


New server!

I used to use Heroku as my server. While heroku was decent with performance, and inexpensive, it was really terrible with maintainence.

For example, it would restart once a day, and I would have no control over it.

It also made it really hard to update the game, I had to kick everyone out for it to update the game.

So I decided it’s finally time to get rid of it… now uses GCP (google cloud!)

now since this is a server from Google it’s way more reliable and lag free, I’m noticing improved TPS already.

(note: I have only switched the USA server, the Europe server is still running on heroku)

new problems…

Now switching to GCP comes with it’s own set of problems.

The main thing is schools

The advantage with heroku is that heroku gives out a free url for your app: *

This is not a huge deal but, I noticed that most players are using this heroku url to play, since the main OFFICIAL url ( is being blocked by schools.

I have been testing without the heroku url and there are so many complaints of the game not working.

So I am leaving the heroku url to work for a few months, but the URL will still connect to the GCP server.

This will not last forever though, since it’s just an extra thing to maintain.


While this update did improve the game, it caused issues for a lot more players.

Do let me know if I should switch back to heroku

For the time being, GCP is much more easier for me.


1 Like

Jdjidbbxh. I told u. smtn like this for chests


U liie the post but dint do it…

Do something like what?

A nice organized post ezplaining chest spawns and coins/their rank based on their color. We went over this…

1 Like

well isnt it a bit late now lol

maybe there should be a wiki

1 Like

No bc i still dont knoww

1 Like

XD it doesnt matter

Also I switched the server to ANOTHER ONE, this time within GCP.

I actually did some research before choosing and I think it is much better with TPS now, haven’t seen any TPS drops even at 20+ real players. Hope it cna stay that way.

the server: N1 standard with 5 gb SSD (lowered it to reduce cost), 1 core and 3.75g of ram, Intel Skylake, Running Debian which is blazingly fast (except I had to set everything up using just the command line, no windows lol).

about $25 / mo with is still pretty expensive but I can afford

1 Like

It is important. We deserve to know whicch color chest is best, its spawn time, health, and coins given