Guild icon
Teeworlds
discord.gg/teeworlds / development
For discussions around the development of the official Teeworlds
Between 2021-05-07 00:00:00Z and 2021-05-08 00:00:00Z
Avatar
Hi, sorry if it's not the appropriate place, but when I tried asking my question in forums, I keep getting errors, and IRC chatroom is empty. The game got my interest and I decided to study its code. Now, I get what individual line is doing but I can't put the whole thing together. Could anyone provide me a general explanation on how the code works, or something like a diagram of the code structure?
Avatar
unexploredtest 2021-05-07 14:18:29Z
In Teeworld's source code, what's the role of src/engine/client ? Is it used when one's connecting to a server?
Avatar
src/engine contains parts of the code that don't have anything to do with gameplay, it handles the lower levels of the protocol (such as joining, leaving, rcon, map downloads, serverinfo requests) etc. (edited)
14:21
Parts of the engine and the game(src/game) interact with each other through interfaces defined in src/engine
Avatar
Avatar
Learath2
src/engine contains parts of the code that don't have anything to do with gameplay, it handles the lower levels of the protocol (such as joining, leaving, rcon, map downloads, serverinfo requests) etc. (edited)
unexploredtest 2021-05-07 14:23:02Z
Thanks! It makes much more sense now, somehow I thought src/engine was were the graphics engine was coded
14:23
Also, src/base contains the laws and physics of the game right?
14:24
src/base abstracts away the platform
14:24
src/base/tl is a (imo misguided) implementation of some data structures in an attempt to avoid the STL
14:25
src/base/system.c is where all the platform specific stuff happens
Avatar
unexploredtest 2021-05-07 14:25:57Z
And where is the physics of the game coded in? (edited)
Avatar
src/game/gamecore.cpp is where the physics are
14:26
Careful, changes there will break prediction for clients. Unless carefully considered 😛 (edited)
Avatar
Avatar
Learath2
src/game/gamecore.cpp is where the physics are
unexploredtest 2021-05-07 14:27:28Z
Ok thanks! That's really help
Avatar
Avatar
Learath2
Careful, changes there will break prediction for clients. Unless carefully considered 😛 (edited)
unexploredtest 2021-05-07 14:27:32Z
XD
14:27
Actually, I wonder what happens if it goes all wrong
14:27
Let me check...
Avatar
If the client prediction does not match the server it can cause things like snapping, jittering, rubber banding
Avatar
Avatar
Learath2
If the client prediction does not match the server it can cause things like snapping, jittering, rubber banding
unexploredtest 2021-05-07 14:29:14Z
How can I test locally? Like some sort of single player?
Avatar
If you are an old player, you might be familiar with ddrace's freeze tiles where you can't move but it used to look like you could on the client, causing a weird feeling.
Avatar
Avatar
unexploredtest
How can I test locally? Like some sort of single player?
You host a server?
Avatar
Avatar
Learath2
You host a server?
unexploredtest 2021-05-07 14:29:49Z
No,
14:30
Is it possible to play without joining/hosting servers?
Avatar
The ? was supposed to imply that I don't understand why you'd have such a question 😛
Avatar
unexploredtest 2021-05-07 14:30:34Z
Oh
14:30
Sorry
Avatar
You compile, you run the server executable and you get a local server
Avatar
Avatar
Learath2
You compile, you run the server executable and you get a local server
unexploredtest 2021-05-07 14:31:12Z
Aha
14:31
Gonna test...
Avatar
If you want to experience the prediction failure, make sure you don't use the client you compile yourself
Avatar
Avatar
Learath2
If the client prediction does not match the server it can cause things like snapping, jittering, rubber banding
unexploredtest 2021-05-07 14:31:34Z
This won't happen then right?
Avatar
use the official client to join the server you compiled with different physics (edited)
👍 1
14:34
Most mods use trickery like sending fake tunes to clients to get the prediction to match better. DDNet client supports protocol extensions which we use to actually send more information about the entities to get better prediction on servers that implement the extended objects
Avatar
Avatar
Learath2
If the client prediction does not match the server it can cause things like snapping, jittering, rubber banding
there's a whole lexical field to lag!
Avatar
unexploredtest 2021-05-07 14:42:16Z
Shoot... That did not go well
Avatar
unexploredtest 2021-05-07 14:52:04Z
Ok, so one last question, src/game/client 's job is to render and animate stuff right? (edited)
Avatar
unexploredtest 2021-05-07 14:53:14Z
Makes sense, thanks
Exported 39 message(s)