Advertisement

How to learn from Quake source code

Started by November 05, 2017 01:16 AM
46 comments, last by h8CplusplusGuru 7 years ago
1 hour ago, Oberon_Command said:
On 7.11.2017 at 8:03 AM, JoeJ said:

If id code is not recommended to beginners, what alternatives do they have? Is none better than imperfect?

There is no such thing as "holy" code. There are no perfect codebases.

I was not the one who used the word 'holy', also i said in my first comment i don't think there is much value in looking at the code too close. 

I'm worried about this: Programmers tend to talk so much about code design that a beginner may conclude: "Code design is the most important thing to get right", which is very wrong IMHO. Similar to trends like "Today hardware is fast - iterating serially over a list of 1000000 objects is faster than using a tree." If you hear it too often, you could conclude learning trees is not that important.

Also i think if somebody is really interested in this old source code then he should read it. It will do no harm to him. If someone want's to get a good guitar player, would you say: "Oh no - don't listen to Jimi Hendrix - that's old! If you listen to that, you'll never learn to play properly!"? 

8 hours ago, JoeJ said:

It's also MUCH easier to work with Windows than with DOS. Remember those horrible close to metal tricks with VGA / EGA modes, Soundblaster vs. Gravis Ultrasound. Just annoying and nothing to learn at all.

Man, this brings back some memories. While it was interesting in its way, it was kind of horrible and it's the reason I don't miss developing on DOS at all.

Advertisement
36 minutes ago, JTippetts said:

Man, this brings back some memories. While it was interesting in its way, it was kind of horrible and it's the reason I don't miss developing on DOS at all.

Hey I loved mode 13h and mode x...  I wonder how popular low level programming would be if MS had standardized a hardware interface to 3d hardware.

-potential energy is easily made kinetic-

Just now, Infinisearch said:

Hey I loved mode 13h and mode x...  I wonder how popular low level programming would be if MS had standardized a hardware interface to 3d hardware.

ModeX and 13h were pretty nice. As you say, standardization makes a difference. Before the ModeX days, in the days of the weird transition from Hercules/monochrome stuff, through CGA and EGA to VGA, it was kind of messy. To make your game work on as large a range of hardware as possible, you had to write a LOT of custom code paths. And 13h didn't do anything for the equally shitty sound card business.

5 hours ago, JoeJ said:

Also i think if somebody is really interested in this old source code then he should read it. It will do no harm to him. If someone want's to get a good guitar player, would you say: "Oh no - don't listen to Jimi Hendrix - that's old! If you listen to that, you'll never learn to play properly!"? 

Unlike computers and software engineering, guitars and guitar playing has not been turned upside down several times since then, the basic mechanism to make sound has not been unrecognizably improved, and music notations don't use completely new concepts and ideas.

1 hour ago, Alberth said:

Unlike computers and software engineering, guitars and guitar playing has not been turned upside down several times since then, the basic mechanism to make sound has not been unrecognizably improved, and music notations don't use completely new concepts and ideas.

I could say it's the opposite way around, really. Crazy techniques has been established since then. Notation only describes the result, not how this works - it's more comparable to the game than the code. Also we experience a form of retro revival with games now, which illustrates gaming has got a history valuable to preserve. This must include the code as well.

I could also say there is no major progress at all - music theory has not recieved a major update since the 70s, code is still based on C. CoD is still a simple FPS. It's subjective, so all angles should be pointed out.

Advertisement
13 hours ago, JoeJ said:

If someone want's to get a good guitar player, would you say: "Oh no - don't listen to Jimi Hendrix - that's old! If you listen to that, you'll never learn to play properly!"? 

Keep your audience in mind.

As someone who actually has played a bit of guitar, if a beginner (refer to the current forum and thus current audience) was wanting to start out with Jimi Hendrix songs, I would probably advise them to hold off on that until they had a better grasp of the fundamentals of playing a guitar, and come back to that wish later on when they were better equipped to deal with it.

Likewise, old Quake code might be a treasure trove of knowledge, but it's not something I would recommend to people starting out for the purposes of learning. There might be other valid reasons for looking at it (e.g. curiosity), but that's not the topic at hand.

An analogy closer to your Jimi Hendrix example would actually be a beginner wanting to make a huge MMO, like World of Warcraft. It's great to have goals and ambitions, but realistically that's just not a good plan when you're starting out. We generally don't advise people to start with their dream project; rather we suggest they work towards it with smaller projects to gain experience and knowledge.

If a kid wants to learn how to read because they see you reading Tolkien book, you give them something like "See Spot Run" to start with, not "Silmarillion".

5 hours ago, JoeJ said:

I could also say there is no major progress at all - music theory has not recieved a major update since the 70s, code is still based on C. CoD is still a simple FPS. It's subjective, so all angles should be pointed out.

No. Something being subjective does not mean all angles need to be pointed out.

The quoted part is disingenuous at best, and since it is, I don't understand where you're going with it. If this is the line of reasoning, then we might as well shut down any attempt of discussion on almost any subject by going "well, that's your subjective opinion, I'm going to ignore you because it doesn't fit my truth". Yes, you could say that CoD is simple, but if you do, don't be surprised if developers strongly disagree with your opinion and call you out on it.

If someone talking to developers/programmers claims CoD is simple, I would either expect them to be able to create a game indistinguishble from CoD within say a month or two, or to (at least when communicating with others) realign their definition of "simple" to the one shared by the rest of the world -- that "a game requiring hundreds of millions of dollars, hundreds of developers for several years, working on an existing codebase they can expand, improve and reuse" is not, in fact, "simple".

If someone asks about their 4 year old nephew wanting a simple and easy game to play, we don't need 400 pages worth of discussion of what constitutes simple and easy. At that point, people would be going "well, Dark Souls isn't actually difficult, you just need to be careful and think", "<puzzle game X> isn't hard, there's not even any enemies that attack you", etc.

Hello to all my stalkers.

I mean CoD has simple gameplay mechanics, like Quake. I did not say it is easy to develop - you just got me totally wrong.

And again - i did NOT recommend quake source code to beginners - i advised against it, like most of you.

I could turn the analogies that you make equally inappropriate, but i won't, because...

18 minutes ago, Lactose said:

The quoted part is disingenuous at best, and since it is, I don't understand where you're going with it. If this is the line of reasoning, then we might as well shut down any attempt of discussion on almost any subject

... we are at exactly this point for some time within this topic already. It's all pointless, so i'll shut up (hopefully :D )

Mr Carmack's source code could be useful to a beginner as an example of well written code, but as to what the code does overall...not so much.  I certainly do not dispute the quality of the code, but it is very complex code to comprehend.

In hind sight, I would start off with just learning Raycasting, ensuring you know your trigonometry and matrices. If you can comfortably follow something like Permadi's tutorials - even implementing floorcasting then you know you are ready to move onto the next step, which is proper 3D.

You see, its not just the 3D rendering you have to worry about, but also the "physical" world you move around in - the one that requires collision detection, and the AI of the characters that inhabit that world.

If you start with the simplest thing first, you can only go forward.  But with something like Quake you'll need to pause often to learn something fundamental.

Languages; C, Java. Platforms: Android, Oculus Go, ZX Spectrum, Megadrive.

Website: Mega-Gen Garage

For the non believers : why do directx exists if dos was not better then windows for game programming back in the days.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

This topic is closed to new replies.

Advertisement