Live data from Hacker News

Source code for Quake 2 rerelease

github.com

201–210 of 232 posts

Re: Source code for Quake 2 rerelease

#201
post #95

I'll drop my Quake II anecdote here. Quake II was the first FPS I ever beat (at least I think I beat it). I did it over a week in the summer when visiting a friend out of state (never would have been allowed otherwise). When I started, I had only ever played the original DOOM, so I used those controls, and lo and behold they worked, and I thought nothing of it. At some point as I was playing along, my view suddenly b…

> Glad to see the source code released! In case you were unaware, this is actually the source code of the rerelease of Quake II. The source code for the original Quake II has been released for many years[0], along with many of the id Software classics[1]. [0]: https://github.com/id-Software/Quake-2 [1]: https://github.com/id-Software

It's also only the code for the game.dll, which is important for modding but doesn't include the new engine.

If it's anything like the Quake re-release, it's not actually using idTech 2 at all.

Re: Source code for Quake 2 rerelease

#202

Earlier quoted context omitted.

Sometimes it is about code quality. Defensively written, well-documented and well-tested code would not be as likely to suffer from such bugs. It's not just subtle floating-point errors either, but also outright wrong maths that appears to work (see [1] for an example), memory leaks [2], buffer overflows [3] etc. [1] https://www.youtube.com/watch?v=4gNYTqn3qRc [2] https://news.ycombinator.com/item?id=20410166 [3] htt…

I think they made the right trade-off, back in the 90s on hardware that could barely run the game, sticking extra defensive checks to make sure you have not accidentally clipped through the geometry, or simpler ones like making sure you are not running too fast, seems excessive. They weren't coding for some NASA space probe and they knew it.

Typically you'd put the checks only in debug builds.

Re: Source code for Quake 2 rerelease

#203
post #54
post #47

Earlier quoted context omitted.

The question would be “by what dimension of interesting”? Quake 3’s source is pretty interesting from the perspective of id just transitioning from C to C++, and famously has an implementation of fast inverse square root. It’s also a pretty clean codebase overall with a reasonably modern engine architecture.

Quake 3 was still completely C, IIRC. You might be thinking of Doom 3?

the rerelease mentioned here rename .c to .cpp globally but the code base is still c, why is that? I thought it was rewritten in c++.

Re: Source code for Quake 2 rerelease

#204
post #5

I saw grumbling elsewhere about how the re-release doesn't include a Linux version, but here they are with the source and it claims to be tested with clang. Big props to iD for sticking to their principles.

I wonder why they released the source code for this one. Is it purely because of the principles, or did they have a legal requirement since the old one is also GPL licensed? I'm assuming they don't have legal requirements since they owned the old code anyway.

This is not the engine code, this is the game code that was released even prior to Quake 2 being GPLd.

    -----------------------------------------
    John Carmack's .plan for Dec 11, 1997
    -----------------------------------------

    The Quake 2 public code release is up at:

    ftp://ftp.idsoftware.com/idstuff/quake2/source/q2source_12_11.zip

    This source code distribution is only for hard-core people that are
    going to spend a lot of time pouring over it. This is NOT a
    how-to-make-levels-for-q2 type dsitribution!

    This should keep a bunch of you busy for a while. :)
https://github.com/ESWAT/john-carmack-plan-archive/blob/mast...

Re: Source code for Quake 2 rerelease

#205

Earlier quoted context omitted.

Talking about clear and coherent, does anyone know if there is a deeper reason for using `break' and `continue' instead of pure structured programming? The snippet i = ent->client->chase_target - g_edicts; do { i++; if (i > maxclients->value) i = 1; e = g_edicts + i; if (!e->inuse) continue; if (!e->client->resp.spectator) break; } while (e != ent->client->chase_target); for instance, from the function ChaseNext in t…

I think it's debateable which is clearer. Your while condition requires some mental parsing of the booleans whereas the original can be analysed one at a time. I'd say I prefer the original.

For me the original is much clearer and is how I normally structure my iterators/do/for loops, since explicitly checking for conditions and using 'continue' when the iterated value is not worth processing makes it nice and clear that everything _after_ these checks is valid and can contain the meat of the processing without more if/else checks.

This approach also works fine for c++ and c# code (probably also java too), which I like as it keeps my projects nice and consistent and I can jump between codebases and feel at home.

The only thing that I don't like about it is the if() statements not being contained in {}'ies. That always makes me nervous.

Re: Source code for Quake 2 rerelease

#206
I had to laugh at this https://github.com/ESWAT/john-carmack-plan-archive/blob/mast...

----------------------------------------- John Carmack's .plan for Jan 31, 1997 -----------------------------------------

I went down to the ferrari dealership today with Ann and American with the intention of buying a new f355 as a "sensible" car (in contrast to my other twin turbo monstrosities).

There was an F40 sitting out front.

Umm. Sensible car. F40. Sensible car. F40. Hmmmm.

American played the evil conscience and Ann played the good conscience. For a while. Then Ann got infected by the Dark Side. :-) I bought the F40.

Ok, I now have too many ferraris. I have a plan to fix that. This hasn't gone through all the legal crap necessary yet, but it is my intention to give away my first ferrari as the grand prize of a Quake tournement.

Yes, I am serious.

DO NOT SEND ME ANY MAIL ABOUT THIS! When we have more to say about it, we will make a formal announcement. This would be a good time to start a heated debate in the newsgroups about what the fairest tourney rules would be, though.

The specs:

1987 328 GTS with turbocharged engine. Feature in the january, 1994 issue of Turbo magazine. Made 360 HP at the rear wheels on a chassis dyno. New engine (I melted the first one...), new paint. The interior could use a little work.

I plan to also include enough cash to cover tax and insurance.

Re: Source code for Quake 2 rerelease

#207
post #179

Earlier quoted context omitted.

Using % vs comparison and reset was probably more efficient with the compilers of the time; might still be. Also I doubt everyone would agree that the one exit condition is more clear. For example, if I know that if e->inuse is 0 it will continue with the next round. Arguably it's more difficult to understand that from the single combined expression—because it isn't so: if !e->inuse but e == ent->client->chase_target…

> if !e->inuse but e == ent->client->chase_target, the original will loop but yours will exit. No, the continue statement will jump to the test part also for `do' loops: "The continue statement is related to break, but less often used; it causes the next iteration of the enclosing for, while, or do loop to begin. In the while and do, this means that the test part is executed immediately " -- "The C programming langua…

Well today I have learned something I may have forgotten, thank you :). It seems natural in for and while so it does make sense also the do loops use it.

Re: Source code for Quake 2 rerelease

#208
post #185

Earlier quoted context omitted.

> For instance, Quake was the first FPS where the maps were truly 3D and could have one piece of floor on top of another Bethesda's Terminator: Future Shock predated Quake by a year and also had truly 3D maps - which were often more expansive than Quake's (also you could drive vehicles, fly a helicopter or something like that IIRC, enter various places to find loot - though the loot variety was limited to basically a…

1: It was ID, not Betsheda. 2: Doom's impact was more huge than Quake. The MOD community still releases PWADs today. Doom basically boosted LAN multiplayer matches.

I think badsectoracula was comparing Doom with one of Bethesda's previous games - Terminator: Rampage.

Re: Source code for Quake 2 rerelease

#209
post #3

Quake II soundtrack is still in some sort of copyright limbo. It's easy enough to find on Youtube, but it's not on streaming services as far as I know. EDIT: maybe it's getting sorted out, there's even a fricking vinyl release https://www.lacedrecords.com/products/quake-2-limited-editio...

Presumably this is a general comment, since this release does not (and wasn't intended to) include any of the Quake II models, levels, graphical assets, sound effects, or music. It's purely engine source code.

It's not engine source code, just gameplay code.

Re: Source code for Quake 2 rerelease

#210

This is essentially Microsoft releasing this. After ZeniMax acquired id, they were acquired by Microsoft.

Its scary how many products and people are connected to megacorps that don't seem related at first glance. This reminds me of that conversation at the beginning of Deus Ex:

“Corporations are so big, you don’t even know who you’re working for. That’s terror, terror built into the system”- Deus Ex, NSF.

Post reply on HN