G

Gabriel Gambetta

gabrielgambetta.com · Personal blog · on HN since 2013

Gabriel Gambetta, a game developer, writes about multiplayer game networking, computer graphics and classic game remakes.

What HN saysHN commenters cite his client-server architecture series as the reference on client-side prediction, and one found his emulator-backed remakes idea wild.
64HN people shared it
39linked it in comments
29stories submitted
2.6Kstory points
3 months agolast shared
2013people per year2026

Most-shared posts

  1. 1
  2. 2
    Computer Graphics from Scratch
    14 people · 1.8K points · first shared 2017 · 116 comments on HN
  3. 3
    Fast-Paced Multiplayer: Client-Side Prediction (2017)
    6 people · 5 points · first shared 2017 · discussion on HN
  4. 4
  5. 5
    Computer Graphics from Scratch
    5 people · 35 points · first shared 2017 · discussion on HN
  6. 6
    Client side prediction server reconciliation
    5 people · first shared 2018
  7. 7
    Computer Graphics from Scratch
    4 people · 3 points · first shared 2021 · discussion on HN
  8. 8
    00 introduction
    4 people · first shared 2021
  9. 9
    Pathfinding Demystified (2014)
    3 people · 106 points · first shared 2017 · 11 comments on HN
  10. 10
  11. 11
    Tiny raytracer
    3 people · first shared 2013
  12. 12
    Pathfinding Demystified
    2 people · 77 points · first shared 2014 · 20 comments on HN
  13. 13
    Fast Paced Multiplayer Programming
    2 people · 3 points · first shared 2014 · discussion on HN
  14. 14
    Cheat Sheet for Linear Algebra
    2 people · 2 points · first shared 2021 · discussion on HN
  15. 15
    1986 listado.jpg
    2 people · first shared 2013

What HN people wrote when they linked it

ggambetta · 2026-06-07
I was thinking exactly the same thing, this is CSP/SR. One of my favorite topics! https://gabrielgambetta.com/client-server-game-architecture.html
TacticalCoder · 2026-06-03
Your blog entry: https://www.gabrielgambetta.com/remakes.html is wild! I love the idea. I used Claude Code / Sonnet 4.6 to get back to compile an old DOS game I wrote back around 1991 and for which I had lost the tooling (compiler / linker / notes / build files). It was on my todo list since years, decades even, but I never got to it. With a LLM it was easy: I didn't let the LLM do everything, I used it to find what needed fixing (like two macros I had used with names that were now clashing with "modern" compilers methods names etc.). > I hacked together the art using my terrible Gimp skills and some Public Domain and Creative Commons assets from OpenGameArt IMO AI models are better at generating pictures than at writing code, in that pictures do tolerate sloppy approximations. While code doesn't tolerate slop that much. Why not use AI for the assets?
wly_cdgr · 2023-11-23
The details are outdated now, I guess, but I don't know if there's any more inspiring reading for an aspiring graphics programmer than Fabian Giesen's "A trip through the graphics pipeline" https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-p… As for a place to actually start, I think Computer Graphics From Scratch is a good place https://www.gabrielgambetta.com/computer-graphics-from-scratch/. A great thing about the book is it gives you many ideas for where to go next once you work your way through to the end.
aboodman · 2023-11-16
It's true that a CRDT is often not the right thing for a classic client/server application. But this doesn't mean we should just give up on ux and use locking. There are approaches to multiplayer that are client/server native. By leveraging the authoritative server they can offer features that CRDTs can't, while preserving the great ux. I'm partial to server reconciliation: https://www.gabrielgambetta.com/client-side-prediction-server-reconcil… My product, Reflect, implements server reconciliation as a service. You can learn more about how it works here: https://rocicorp.dev/blog/ready-player-two
daenz · 2021-09-06
My understanding is that the network relevancy radius is usually pretty large, so you're unlikely to notice a lot of edge cases. Also, by using events for relatively unimportant things (animation playing, effects, sounds, etc) and replicated state for the important stuff, then everything mostly works out correctly, since the server makes a strong effort to ensure eventual consistency of replicated state. Where network replication matters a lot more though is on things like movement and shooting in competitive games. There is a great short series of blog posts by Gabriel Gambetta that covers different problems and solutions, but everything is a tradeoff https://www.gabrielgambetta.com/client-server-game-architecture.html
cassepipe · 2021-03-13
Hey hum sorry to contact you here but I did not want to write to you on your acting address and I don't use Twitter. If I followed the math correctly I think there is a small mistake in the computation of diffused light at https://gabrielgambetta.com/computer-graphics-from-scratch/03-light.ht… : In figure 3.5, the two triangles that are presented side by side are not the same. It follows I think that it is the cos of the Beta angle that should be used. Please correct me if I am wrong. Also let me thank you again for making it available as your method is very clear for a beginner and your explanations are good and straight to the point. I have sworn to myself I would buy the book by the time I finish implementing part 1 :)
huskyr · 2021-02-03
Excellent resource! I really like the fact that everything is centred around the idea of just a single 'PutPixel' function. Makes things much more approachable. I've took the liberty of rewriting the 'Perspective projection' demo (1) in more up-to-date Javascript, using ES6 classes and all the other niceties that modern browsers have. I also used the regular canvas line drawing methods to focus on just the vertex-to-line conversion, and updated the code so that it will work on any resolution. https://codepen.io/hay/pen/gOLazpm 1: https://gabrielgambetta.com/computer-graphics-from-scratch/demos/raste…
kevinskii · 2020-12-01
I went through this set of lessons a couple of years ago. It is well worth doing. Interested folks may also want to take a look at Gabriel Gambetta's "Computer Graphics from Scratch" [1]. Both tutorials are excellent, but Gabriel's explanations just gelled a little bit better with my personal learning style. [1] https://www.gabrielgambetta.com/computer-graphics-from-scratch/introdu…
exlurker · 2020-08-21
Many realtime online games use the same techniques today. For a very understandable walkthrough of the concept, I recommend Gabriel Gambretta's excellent 4 part series: https://gabrielgambetta.com/client-server-game-architecture.html
fuball63 · 2019-10-16
This is cool. I'm trying to learn how to do multiplayer networking from scratch, and it is a challenge. I have a C++ game project in my to do projects, might try it out. It says that all the logic is coded on the server side... would it also be client side too to do the interpolation? I'm coming from the perspective of this article, which I'm following for my networking experiments: https://www.gabrielgambetta.com/client-server-game-architecture.html
Taylorious · 2013-11-19
This is very cool. Interestingly it was generated by Google's Closure compiler. The author has the full source with excellent comments on his site. link: http://www.gabrielgambetta.com/tiny_raytracer.html
Zababa · 2021-05-26
I'll preface this by saying that I don't want to be mean and just give you honest feedback. I haven't read either of your books and just looked at the amazon page you linked, look at the cover and read the blurb for The Golden Seed, and looked at https://gabrielgambetta.com/computer-graphics-from-scratch/, looked at the cover, skimmed the table of contents and read the paragraph under the title. This is of course entirely personal feedback based on how I feel about both of your books. For "The Golden Seed", both the cover and the blurb seem "too much", like the kind of book you encounter by the dozen in a bookstore. It's also a fiction book, which appeals less to me because I can either ask people in my family for recommendations (there are a few big readers) and then have something to talk about, or read well-known books (for example, I've read The Three-Body Problem recently, after hearing about it 4 or 5 times here and really liked it). On the other hand, Computer Graphics from Scratch attracts me more: its cover is in the same style as "Automate the Boring Stuff with Python", of which I've heard great things about; the "from scratch" appeals to me because I like the idea of building things from scratch; the table of contents has an entire part on raytracing, and the book seems oriented at beginners, which I like because I previously tried and failed to build a raytracer following the raytracer in one weekend project, and I think I could achieve it with this book. It's…
aninteger · 2026-07-23
Sorta unrelated but I really enjoy (I don't want to use the past tense as I often refer back to it) your article on Emulator Backed Remakes (https://gabrielgambetta.com/remakes.html). Thanks!
troupo · 2026-07-23
It's not just because of that. Everything is steeped in OpenGL API. All the "fundamentals" are about OpenGL. Another link floated to the top of HN discussion just now, and every sibgle link there is better than these "fundamentals": https://news.ycombinator.com/item?id=49022038 E.g. "Computer Graphics from Scratch" https://gabrielgambetta.com/computer-graphics-from-scratch/ or Mathematics for Computer Graphics https://www.amazon.co.uk/Mathematics-Computer-Graphics-John-Vince-eboo…
pipes · 2026-03-16
I heard him say that too. And he's probably right. But it's more like every knitter now has access to an automated loom. Oddly I feel AI is getting me off the endless learn new tech churn. I was looking at a few odd ball programming books on my shelf, graphics programming from scratch and retro game dev (c64 edition and nes editions) and thinking I might now have time to work through these instead of learning technology x. https://www.retrogamedev.com/ https://gabrielgambetta.com/computer-graphics-from-scratch/ And I'll be manually coding as I want to learn!
drivers99 · 2026-01-01
I really enjoyed this one as an introduction: https://www.gabrielgambetta.com/computer-graphics-from-scratch/ It touches on both ray traced and raster graphics. It lets you use whatever language and graphics library you want as long as you can create a canvas/buffer and put pixels on it so you can target whatever platform you want. It includes links to JavaScript for that if you want. (I didn’t want to use a new-to-me language so I used python and Pygame at the expense of speed.)
bennysonething · 2023-03-05
I know nothing about grapgics programming, but this is on my list of things to work through: https://gabrielgambetta.com/computer-graphics-from-scratch/00-introduc…
neandrake · 2022-07-06
Here's a series of articles about client-server game architecture which I found tremendously interesting, and it's a bit more involved than what's explained in this article on cursor positions though I agree the basics are similar. It starts out explaining a naive approach, identifying the issues with that, and moving to more advanced solutions which involve prediction. The article also has a good explanation that goes a bit more in-depth to how the latency causes issues with the gameplay. https://www.gabrielgambetta.com/client-server-game-architecture.html
meinersbur · 2022-05-17
That's just another kind of latency. Additional time has still passed from you (or the enemy player) doing an action, and you seeing the results of that action on your screen. By contrast, the server rolling back the game state is indistinguishable from the server always being 15ms behind and the clients running the simulation ahead of time (which they do anyway for fluency [1]). The "jumpiness" is called rubberbanding [2]. [1] https://www.gabrielgambetta.com/client-side-prediction-server-reconcil… [2] https://www.urbandictionary.com/define.php?term=rubberbanding
lwansbrough · 2022-04-20
I would also submit Gabriel Gambetta's series which includes a bite-sized demo written in JS: https://www.gabrielgambetta.com/client-server-game-architecture.html
tgflynn · 2022-03-07
There are a few around. https://raytracing.github.io/books/RayTracingInOneWeekend.html https://graphicscodex.courses.nvidia.com/app.html https://www.gabrielgambetta.com/computer-graphics-from-scratch/index.h… I can vouch for the first two as being good. I haven't actually looked at the third but I found I had a bookmark for it.
rembicilious · 2022-01-01
https://www.gabrielgambetta.com/computer-graphics-from-scratch/00-intr… This walks through the creation of a raytracer and a rasterizer in a way that was pretty easy for me to understand. It’s not exhaustive; it’s just right.
airhead969 · 2021-05-29
It can also be used to mutate hard game state (I wouldn't try it with dynamic, interpolated values like object position, angle, acceleration, or velocity.) There are many other methods, some are more precise and compressible than others: Trailing State Synchronization https://www.cs.ubc.ca/~krasic/cpsc538a/summaries/38/ Basic ideas https://www.gafferongames.com/post/state_synchronization/ https://engineering.monstar-lab.com/2021/02/09/Game-server-Synchroniza… https://www.gabrielgambetta.com/client-side-prediction-server-reconcil…
wernsey · 2021-03-23
Gabriel Gambetta's book Computer Graphics from Scratch is available freely online and was discussed here just the other day: https://gabrielgambetta.com/computer-graphics-from-scratch/ Another link I found interesting is this one: https://github.com/ssloy/tinyrenderer/wiki
d26900 · 2021-02-14
I would start with fundamental rendering algorithms first before anything. - Write a software rasterizer - Write a software ray tracer You can do all that without exiting a programming language's standard library. I wrote a simple ray tracer (primary rays only) in vanilla C89 in about 30 lines (if you don't count the PPM image library that I made): https://github.com/d26900/JamaisVu/blob/main/tests.c Lines 66 - 91. Screenshot: https://raw.githubusercontent.com/d26900/JamaisVu/main/screenshot_trac… Here are great resources: - https://www.scratchapixel.com/ - https://www.gabrielgambetta.com/computer-graphics-from-scratch/00-intr… - https://erkaman.github.io/posts/junior_graphics_programmer_interview.h… - http://immersivemath.com/ila/index.html
halftheopposite · 2021-02-12
If you're looking for resources on learning the basic principles of multiplayer games I invite you to read the very well written and illustrated tutorials by Gabriel Gambetta https://www.gabrielgambetta.com/client-server-game-architecture.html.
nickyvanurk · 2019-06-05
Client-Side Prediction, Server Reconciliation, Entity Interpolation, Lag Compensation. See this post for more information: https://www.gabrielgambetta.com/client-server-game-architecture.html

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close