Thursday, 13 October 2011

Step 1: complete.

I had forgotten just how efficient Carmack had made Quake 3. I read a bunch of his devblog stuff a few weeks ago, and he mentioned something about how entities such as rockets and plasma balls, once fired, are completely ignored by the game until something happens to them: either they hit something, or they disappear. The point of this was that, at the time, internet was so bad that it was necessary to save as much bandiwdth as possible, even 1kb. Adding the x/y/z co-ordinates of each rocket/plsama ball for every frame would drastically increase the size of each packet, and would even create huge lag on modern systems, with modern internet.

I was thinking that I would have to add info to every frame on the co-ordinates of the rocket, but it turns out that I just specify the origin and speed, and it lasts forever. Of course, in the original demo, it hit the end of the map and disappeared. That was a total of one line, though: remove="true". I cut that out, and the rocket would continue infinitely.

I only added a few 100ms (10fps) frames to the end of this demo, so that the rocket would continue for a while, then the demo would end. It turns out that, because the position of the rocket is calculated by the engine but ignored by the client/server protocol thingy, it never becomes choppy, no matter what framerate you have. It always transitions smoothly from frame to frame, whether the frames are 1ms or 1000ms apart. Of course, if you're running at 1fps, then a real game would be pretty fucked up. That was not the case here.

So, because this was so painfully easy and simple, I made a video. It took me about a minute, and I think it's kind-of cool.

here it is!

No comments:

Post a Comment