Try it at BuildBlast.com
Or try it on a dev server
Install go, (or sudo apt install golang
on a modern ubuntu)
git clone https://github.com/crazy2be/buildblast.git buildblast
cd buildblast && ./runserver
google-chrome http://localhost:8081
You may need to do some config setup due to some things being slightly broken, see #189
To run the www server, enable authentication, and enable multiple worlds, see WEBREADME.md
We use two main coordinates systems in the code:
In map generation and geometry code, which is particularly concerned with the existence of chunks, you may also see the following coordinate systems used:
floor(bc / 32)
. Gives the coordinate of a chunk, relative to other chunks. Multiply by 32 to get the position of the chunk in 3d space.In order to make the game playable with hundreds of milliseconds of lag we apply multiple algorithms to reduce the appearance of lag. You might find this article by Valve to be helpful if you are interested in this.
If the client shoots at time 0 ms, and the server receives it at time 100 ms, it is likely the person they were shooting at has moved since the time they shot. So, we "lag compensate" players (entities). This means the server stores the history of positions for every player, and the player timestamps its shoot events, so when the server receives the shoot it can simulate it with the player positions that existed when the shot was fired.
When the player presses a movement key technically we need to wait until the server confirms the message to know if we can move, since the server is the "master". However, it's much nicer from a user's perspecitve if the controls respond immediately. Thus, we use the client's game state to make predictions about what will happen, and show that state to the player. If the server thinks something different happened, we'll throw away our predictions, and follow it's command.
The server may send messages at a varying speed, and we may receive them at a varying speed. This means other player's will appear to jerk around as we receive movement messages. To get around this we store don't immediately show player positions as we receive them, instead we show players where they were lagInduction
time in the past. This gives us a buffer to hide the impact of lag (and smooth out movement). clock.entityTime()
is the current time that entities are being displayed at.
The architecture is based on a few fairly simple structures, which communicate through a few objects (similar to http://yuml.me/d5f4fb7b). Specifically:
If you find any bugs, please report them in the issue tracker with your hardware specs, screenshot, and steps taken to trigger the issue.
Firefox is not supported pending #504553.
If you want to try out something hard, and possibly impossible, attempt one of these:
Or checkout the bug list (for bugs or features, whichever suits your fancy).