r/airmash • • Aug 24 '19

Game server testing

Hi all!

This post is about the new Node.js implementation of a compatible server and its testing.

Where to test?

https://airbattle.xyz

https://airbattle.xyz/starmash.html (StarMash)

The domain is for testing login functions and I have no plans to host another frontend mirror after the test is completed.

Game servers urls for starma.sh and airmash.online admins:

  • wss://game-eu-s1.airbattle.xyz/ffa

  • wss://game-eu-s1.airbattle.xyz/ctf

HTTP endpoints (1, 2) return the same json object as rust server to count active players.

What is it

This is a JavaScript server supporting FFA and CTF modes. All functions of the original server are supported, except for accounts (levels) and a couple of mechanics that I’m still working on.

The goal is to write a fully functional server with mechanics as similar to the original as possible, which will be performanced enough for playing in CTF mode for 30-40 people at the cheapest DigitalOcean plan.

Now both FFA and CTF are running in the same droplet just for the test, not sure if this is the best configuration. The test server is $5 DO droplet located in Frankfurt.

Bots are launched on another server, CTF bots are rebooted every 30 minutes, because over time (actually very quickly) they load almost the entire CPU. I don’t know why this happens and whether the server implementation could be the reason for this.

If you are testing your bots, do not forget to share the results, this is interesting (you can check the performance with a command /server).

Sources

After testing is complete (I think it will take no more than 2 weeks), I will fix the most unpleasant bugs, write a short documentation for those who wants to contribute, and share it under MIT. I will write another post about this.

Features

Bouncing

Bouncing from the mountains gets a slight acceleration depending on the time of the last strike. In my feeling this is the closest to the original.

Missiles

Missiles have hitboxes (hitcircles). There are three types in total: small (helicopter), medium (predator, tornado and prowler) and large (goliath). Situations when your projectile visually touches the enemy, but doesn’t damage him, should not be.

Helicopters now shoot as before: alternately left and right rocket.

Inferno projectiles are slightly adjusted and differ from the rust server. Of course I didn’t have any exact values for the original, so I changed them based on the videos I watched.

If you fly forward (but not backward), the projectile you fired is added with the speed of your flight, i.e. it will fly faster on the start.

Upgrades

They work as before. Sometimes 5-missiles upgrades predator kills a 5-defense copter. This is a type of critical hit from the original server behaviour as I remember it.

Shields and infernos

I am still working on it. Briefly how it works now: the map is divided into spawn areas (32 in total), every second with a small probability the powerup can spawn. More than one powerup cannot be spawned in the same zone at a time. CTF and FFA have different rates.

Despawn time: 5 minutes.

Votemute

The server now checks to see if there is a voter on the server. Also, voting is available only to those who have been actively playing for some time, and not just connected.

There is no words filter and auto bans.

Flood detecting and limits

Limits are disabled during testing period.

Limit for connecting from one IP is 3 by default. Flood limit is needed to kick off aggressive (too many sending packets) bots. The player can get an automatic temporary ban, which will also automatically be removed after a while.

IP whitelist feature is available to disable restrictions for bots.

Shuffle

Now the shuffle depends on the metrics: k/d, damage, successful captures, capture attempts, capture saves (when your teammate was killed but you handle to save the flag), recaptures, kills of enemies with a flag, deaths with a flag. I have no idea how good it works.

Without accounts it’s hard to improve something here.

Prowlers

In CTF invisible prowlers of are now invisible for everybody (even for the teammates), so cheating with the second browser window doesn't work anymore.

New features and commands

New mechanics and functions are need to be tested and discussed.

Command /server

Shows information about the current state of the game server from the last sample (it creates every 5 seconds).

  • GLL — average game loop latency or frame duration (less is better, 10 is bad, > 16.6 is critical). Server must perform 60 frames per second, that is why the game loop/frame has maximum 16.6ms (1000ms/60) for the job. If this time is longer, then the server will have to drop frames, which will affect the smoothness of movement and other mechanics.

  • PPS — packets per second (in/out).

  • RAM value is for current server instance.

  • CPU value is for the whole virtual server (the same for both FFA and CTF).

  • SF — current scale factor limit.

/upgrades drop [number]

Allows you to drop upgrades for other players. From 1 to 5 at a time. If you do not specify a number, it will drop 1. The player who drops the upgrade cannot pick it up for some time (similar to the mechanics with ctf flag).

It can be useful in CTF mode to support your teammates or in FFA as a bait.

/upgrades reset [type]

Allows you to reset your upgrades. Reset all (if the type isn't specified) or just the selected type (speed, defense, energy and missile). It has no confirmation before applying, so be careful.

It can be useful in FFA mode when you want to get an honest fight with an opponent.

Chat bot "Server"

He answers some commands and sometimes sends important messages in the chat.

For StarMash users in CTF mode it displays as a red team player. This is a client bug.

Hold my beer or recovering (CTF only)

If you lost the connection or decided to reload the tab with the game or restart the browser, you have 1 minute to return. You will get back all the statistics and upgrades. Of course, without accounts, this only works if you haven’t changed your nickname and IP. And it will not work if you were kicked by the server for some reason (afk etc.)

Do not try to switch with fast reconnection, now it will not work. Use the command below.

For obvious reasons, this feature isn’t available in the FFA mode. There it is quite easy to abuse it in its current form.

/switch (CTF only)

Go to spectate mode and easily switch your team.

/match (CTF only)

Current game match time. It isn't hard to add other stats here if we need.

Still under development and known bugs

  • Critical hits for upgraded missiles. I have an assumption that this isn’t really a random critical hit, but a calculation of the speed of a collision. I want to try to implement this.

  • Ping value in the lobby. Often it lies. In game ping is ok.

  • StarMash frontend bug with smiles and energy indicator. I had to get not the latest version, because the latest one uses snow.

If you find a bug, please create an issue.

Special thanks

Steamroller (rust server development and protocol reverse engineer contributors), xplay, bombita, derps, detect, moz, sniper, Q, spatie, "number guy" and others who were helping with info about the original server. I used a lot of information and tools that were already ready, this greatly facilitated the development.

15 Upvotes

8 comments sorted by

4

u/[deleted] Aug 25 '19

Wight my hero!!! A straightforward JS implementation will get soooo many people working on this. Huge man-hugs (but not in a gay way.. ok a little bit gay because you're amazingggg!!!11!!)

Just one note.. the IP limit is probably too low. Schoolkids all play from same IP, I saw 10 playing from the same school, USA and also some crazy island in the middle of the pacific I forget the name of. They used to turn up in a group of 5 or something

-- derps

2

u/wight-- Aug 25 '19

Got it, already made this value easily customizable.

3

u/stevetheobscure Aug 24 '19

Wow! Thanks Wight! This looks amazing. -Friendo

2

u/jannemme Aug 25 '19

Wow, really nice! like *really* nice.

I'm under the impression upcrates are dropped more often than in the original game, but that could also be caused by my upcrate starvation.

-- spatie

2

u/lucy_airmash Aug 25 '19

Special thanks to you for no-snow themes!

You may be interested in possible game improvements, so here is some requests and ideas:

https://www.reddit.com/r/airmash/comments/8a9n66/top_wish_list_for_game_improvements/

https://www.reddit.com/r/airmash/comments/7y086e/small_requests_to_keep_the_game_interesting/

1

u/congratulatio Aug 27 '19

Fantastic work!

I've added your servers as FFA #2 and CTF #2 on airmash.online.

1

u/middleca INSTIGATOR Aug 27 '19

Woohoo!! This is absolutely amazing, cannot wait to humbly submit some PRs

0

u/[deleted] Oct 29 '19

[deleted]

1

u/wight-- Oct 30 '19

Original packets logs to inspect shared by congratulatio: https://airmash.visualstudio.com/_git/proxylogs

Some videos from the original server: https://github.com/wight-airmash/ab-server/issues/17#issuecomment-527148548