7 ms·
Quake 3 Source Code Review: Network Model (2012)
- deleted 2y ago[deleted]
- EarlKing 2y agoLink to the first article in the series: https://fabiensanglard.net/quake3/index.php https://fabiensanglard.net/quake3/index.php
- smolder 2y agoThe grammar is pretty bad, but good for a presumably non-native english user. Overall, it's a good article, especially when you consider that it's free. Game network code and predictive motion and rollback or input delay-based approaches are all fascinating to me. It is a hard problem to deal with network latency in a way that feels real-time and doesn't break a game.
- up2isomorphism 2y agoCome on, it is funny to act like a German if you are not.
- ramon156 2y agoI felt more like a Russian tbh, but fair enough
- karlgkk 2y ago[flagged]
- fabiensanglard 2y agoAgreed. I wrote this a long time ago without anybody to help proofreading. Sometimes I want to take it down out of shame but at the same time it is a good reminder of where I am coming from and a motivation to keep on improving. Although, to be fair, now I speak good.
- shdh 2y agoAppreciate you writing this back in the day, learned a lot from this series!
- brcmthrowaway 2y agoIs there any bullet propf open source middleware for this any more?
- javaunsafe2019 2y agoWhat are you even asking?
- Fade_Dance 2y agomaybe they mean solid open source netcode? Call of Duty famously used Quake 3 net code for a while. That engine was a great core to build from since Carmack made such solid stuff. But then again, they're probably just a bot.
- skhr0680 2y agoAFAIK (remember) Call of Duty was built on a modified Quake 3 engine long before it went open source
- newsclues 2y agoIW Engine is based on the RtCW version of the id Tech 3 (Quake 3) engine they licensed.
- brcmthrowaway 2y agoWhat does Call of Duty use now?
- sour-taste 2y agoPresumably some snapshot id number also gets sent to the client and is what gets acked?
- chvrchbvrner 2y agoIn another article about the network abstraction layer "NetChannel" [1], the author describes that ACK happens by sending "Sequence" numbers in the headers. [1]: https://fabiensanglard.net/quakeSource/quakeSourceNetWork.php https://fabiensanglard.net/quakeSource/quakeSourceNetWork.ph...
- justin66 2y agoThat’s about an earlier engine. Quite different. (Regarding the original question, yes, of course there are sequence numbers. The “recommended readings” at the bottom of the page are worthwhile.)
- shdh 2y agoThey were ACKed as a part of the input command frames sent by the client to the server
- burnt-resistor 2y agoIt's interesting that it's latency predictive with corrections and doesn't use anything fancy like operational transformations (OT). I guess it's actually simpler and shared state isn't a collaboratively-edited document but needs an independent, ultimate source of truth, is faster to develop, and probably more performant as a shared server.
- Sharlin 2y agoYeah, OT would be way overkill in a FPS, and anyway I don't think OT was even out of the academia in Quake 3's time. And there cannot be any resolution of diverging client states, the server must be the sole source of truth, lest you get cheating and exploits.
- Thaxll 2y agoOT is dead slow for real time.
- harha_ 2y agoVery interesting article, as were the previous articles, thanks. On the other hand, reading it made me feel slightly depressed because my work currently is so boring compared to this and I don't have any energy left for hobby projects at the end of the day or week.
- 0xRusty 2y agoI felt much the same way. I wish I had more creative energy at the weekend for these kinds of things... But then I remember that I actually have a much more creative job than most people and my creative energies are spent from 9-6 Monday to Friday (I work in movies). I've found MUCH more peace and pleasure in my "consumption hobbies" like watching tv, reading, playing linear story games that don't require me to be particularly creative and learned to stop being so hard myself for not having a hobby where I'm actively producing something like writing a book or making a game. Weirdly when I have a quiet period at work and am not so creative for 2-3 months I get the urge to pick up creative hobbies again. I've come to realise for myself that I have a measureable amount of bandwidth to create and a measureable amount of bandwidth to consume and they seem to be seesaw'd together.
- M4v3R 2y agoI was exactly in the same boat and I started feeling burnout symptoms and so I quit my job last month for an extended leave so I can rest while also doing some hobby projects that I neglected over the years. Easily best decision I made in years. Of course I am aware not everyone has the privilege of being able to just quit working, but fortunately I had enough savings plus I made sure my expenses are quite low so I can afford it.
- iforgotpassword 2y agoStarted doing 50% this month, and for the first time in years I actually feel like I get stuff done outside work. Like, not just chores and a tiny bit of fun-coding once in a honeymoon, but really spending time on coding for fun, getting something done around the apartment, just going for a walk for two hours. All things I wanted to do or try but always felt too tired, or something more important popped up. Things like, just repainting part of a wall in one room got postponed for almost a year, and now that I did it, it didn't even take half an hour and actually felt good. I'm still working three days a week, because it's not like I hated my job, but it was quite demanding at times. I wrestled with the idea of just reducing hours for way too long. If you do too, just do it.
- ltr_ 2y agoQ: any resource to learn about modern approaches for real time game protocols?
- xeonmc 2y agoPart 1: https://www.youtube.com/watch?v=W3aieHjyNvw https://www.youtube.com/watch?v=W3aieHjyNvw Part 2: https://www.youtube.com/watch?v=odSBJ49rzDo https://www.youtube.com/watch?v=odSBJ49rzDo
- cobalt 2y agoAnd https://www.youtube.com/watch?v=A5KW5d15J7I https://www.youtube.com/watch?v=A5KW5d15J7I
- Thaxll 2y agoOne of the best: https://gafferongames.com/ https://gafferongames.com/
- shdh 2y agoDefinitely the best
- liontwist 2y agoThe main difference in modern games is the set of things in the world that might need sync has grown, much more than the available bandwidth. So need sophisticated logic to filter what needs to be updated in a given frame based on relevance, to fit within a packet, And of course now you need cloud systems for matchmaking, telemetry, etc.
- mfatihmar 2y agoshameless plug: https://github.com/0xFA11/GameNetworkingResources https://github.com/0xFA11/GameNetworkingResources
- nazka 2y ago
- ernestrc 2y agoSuch a good read on a Saturday morning as I slowly sip my matcha. The simple pleasures of life.
- to-too-two 2y agoSeems like the site is getting the HN Hug of Death: <The connection has timed out>
- markandrewj 2y agoThe net code for the original Q3A client worked well for lan, but was sensitive to latency for remote play. One of the exciting changes to Quake Live was the updated net code for better remote play. Internet connections also got better in general with the time.
- testfrequency 2y agoEh. While not great given bandwidth availability at the time, most Quake hosted servers has excellent ping and latency for most people domestically. The main issues were honestly people hosting from their local machines across the world, which obviously had very poor results. I am a former Quake 3 champion, have a lot of experience dealing with Quake 3 servers :)
- markandrewj 2y agoI have been playing Quake since Quake World and dial up. For Quake Live I was ranked highly for a while in RA. It's true that if you were close enough to the server you could get a better experience, but in western Canada servers were limited. In the past though, even with a good ping, rails were much more likely to hit on LAN. The changes to the net code in Quake Live were a welcomed change for myself. As a note, I recently played for the first time in over 10 years. I got banned until 2029 from the main RA3 sever most people play on because I achieved 60%+ accuracy in a match and people thought I was cheating. I also got the aim bot achievement from Steam as a result, which only 3.6% of other players have. Back in the day I had a very tiny sponsorship with HyperGlide where I tested their products before the launch. They are credited for making the first hard surface mouse pad. I only received mouse pads, but I was happy to receive this. https://www.hyperglide.net/ https://www.hyperglide.net/
- mentos 2y agoWhat’s the story around the Unlagged mod was that a mod you remember? It was mentioned in the blog post curious if it was popular and if it eventually got iD's attention to implement something similar officially?
- ChrisMarshallNY 2y agoThis reminds me of the term "isochronous," that I first started hearing, when FireWire came out. They allude to that, in their justification for using UDP. I'm pretty sure that isochronous data transfer is a fairly important part of the current USB/Thunderbolt spec.
- 120bits 2y agoAlmost 12 years ago, I wrote my first web server in C. It was for a router/firewall device running Linux From Scratch(LFS), I can't recall the kernel version(2.6.x?). Reading this just took me back and made me realize even though we have progressed so far with tech stack and new technologies(LLMs), there is so much joy in just writing plain C code. To me its just feels like working on a classic old 68 mustang and getting your hands dirty. What a joy!
- shdh 2y agoThere are a number of issues with the Q3 netcode. When entities are culled due to Potentially Visible Sets (PVS), a player moving fast enough near a vis brush may appear to pop into existence out of thin air. This occurs because of latency. A simple fix would be for the QVM code to extrapolate the player’s position into future frames to determine whether the entity should be culled. The original Q3 netcode lacked lag compensation for hitscan weapons. As a result, players often had to "lead" their crosshair to register proper hits. This issue was later addressed by the Unlagged mod, which introduced lag compensation. Input commands had a back buffer to handle lost input frames, but instead of applying them with a delay, the inputs were applied to entities instantly. Consequently, other players' entities sometimes appeared "choppy" when the respective player had a poor connection. That being said, they got almost everything right: * Snapshots with entities: Efficiently delivering game state updates to clients. * Lerping entities: Smoothing movement on the client side using a snapshot buffer. * Delta encoding: Transmitting only changes in entity states within snapshots. * Huffman encoding: Compressing snapshots for reduced bandwidth usage.
- BoingBoomTschak 2y agoTalking about Unlagged, I would kill for a clear explanation (with diagrams!) of various netcode improvements in it, CPMA and QL. I'm forced to try to piece together a mental model by finding crumbs on the web, with the current situation: https://github.com/minism/fps-netcode https://github.com/minism/fps-netcode https://playmorepromode.com/guides/cpma-client-settings https://playmorepromode.com/guides/cpma-client-settings https://www.esreality.com/?a=post&id=2548041#pid2548771 https://www.esreality.com/?a=post&id=2548041#pid2548771 https://old.reddit.com/r/QuakeChampions/comments/9jd3wv/for_the_love_of_quake_id_please_get_rid_of_the/ https://old.reddit.com/r/QuakeChampions/comments/9jd3wv/for_... PS: the modern way of enjoying Q3 is https://github.com/ec-/Quake3e https://github.com/ec-/Quake3e or CNQ3, these days. Don't know about https://github.com/ioquake/ioq3 https://github.com/ioquake/ioq3
- monkburger 2y agoI can't speak for CMPA or QL, but I can speak a little bit on Unlagged: - w/ Unlagged, the Server now stores a history buffer (g_activeSnapshots[]) of player states. When processing a action shot, it uses the timestamp sent by the client (cmd.serverTime) to interpolate or rewind states for collision checks (G_EvaluateTrajectory()). This allows the server rewinds player positions to the moment a client action occurred (eg: firing a shot) - Unlagged reduces choppy movements by making clients use a snapshot buffer (cg.snap, cg.nextSnap) to interpolate positions with CG_InterpolateEntityPosition(). Extrapolation uses velocity vectors from the last known snapshot (currentState.pos.trDelta). - Unlagged tries to compensate for high latency by rewinding entities to their positions at the time of the shot (ClientThink_real() and G_RewindEntities()). Uses a circular buffer (via lagometerSnapshot_t) to store past states. - Position corrections (cg.predictedPlayerState) are interpolated over several frames using VectorLerp() to fix prediction mismatches between client and server. - Commands are stored in a circular buffer (ucmds[]) and replayed when missing packets are detected (ClientThink_cmd()). This attempts to mitigate packet loss by buffering input commands for later execution
- Bernardbrant28 2y ago[dead]
- Kurtcheng 2y ago[dead]