Quake code in Half-Life 2? by John Carmack

Gorgon

Newbie
Joined
Aug 20, 2003
Messages
6,684
Reaction score
0
I intended to release the Q3 source under the GPL by the end of 2004, but we had another large technology licensing deal go through, and it would be poor form to make the source public a few months after a company paid hundreds of thousands of dollars for full rights to it. True, being public under the GPL isn’t the same as having a royalty free license without the need to disclose the source, but I’m pretty sure there would be some hard feelings.

Previous source code releases were held up until the last commercial license of the technology shipped, but with the evolving nature of game engines today, it is a lot less clear. There are still bits of early Quake code in Half Life 2, and the remaining licensees of Q3 technology intend to continue their internal developments along similar lines, so there probably won’t be nearly as sharp a cutoff as before. I am still committed to making as much source public as I can, and I won’t wait until the titles from the latest deal have actually shipped, but it is still going to be a little while before I feel comfortable doing the release.

read more @

http://www.armadilloaerospace.com/n.x/johnc/Recent Updates
 
Of course there's quake code in HL2. HL2 is just HL1 on steroids, HL1 was a modified quake engine. (I dread to think how much quake code is in HL2 given how the engine feels, and I'm amazed they don't need the 'powered by quake/id' label)

I love how so many of HL2's 'features' are really quake-engine hacks, such as the 3d skyboxes.
 
comoxer said:
Didnt valve state that they built the source code entirely from scratch?
They technically did. Think about this, when you draw a picture, you are drawing in a style that you have done before and that other people have shown you.
Personally, who cares if there's a couple of Quake source lines in the overall code. Does it look the same??
 
well they probably created Source from scratch, but we have to remember that VALVe was working with Q1/Q2 technology for many years. so there may be some parts of the code similar to those in Quake engine, just rewritten and optimised.
there's no point in reinventing the wheel. why change something that already works fine?
 
I'd say what's implied by that statement is that some components of the source engine still use the same technique that the Quake engine used. When Valve re-wrote all the code, bit by bit, for source, there would have been various things that were already done as efficiently as possible using the current coding method, so it would be pointless to think up an entirely different method.

Source is a brand new engine, but it's certainly based on the quake engine technology used in HL1.. after all, it's partially backwards compatible with HL1 content.
 
That's like saying a musician is using material from another musician because they both happen to be in D-minor. With some things, once they've been done once, they'll be done a million times.
 
justmatt said:
That's like saying a musician is using material from another musician because they both happen to be in D-minor. With some things, once they've been done once, they'll be done a million times.
My thoughts exactly.
 
I'm sure there is of course some code from Quake (such as Hammer I bet still has a lot). In the game there is probably still some to keep HL1 and HL2 still fairly compatible, but certainly probably the rendering engine was created from almost complete scratch.

Plus though, does it really matter? I read this yesterday, and it didn't bother me, enigne works fine, who cars how the innards are if the engine works perfectly fine.
 
It may work, but it's not elegant and is bad for modularity and upgrading/scaling the engine.
 
If you take all the water out of a pool scrape it, wash it off with water wash that out, and then fill it with water again, there will still be a bit of urine in it still, but it wont matter cuz its so little no one would ever notice. Sort of the same principle I belive.
 
Iced_Eagle said:
...certainly probably...
Sorry, but that sequence of words made me chuckle. :)


No doubt they've used techniques/data structures based on the same as Quake (BSP maps being an obvious one). Also, since they were working on their 2nd engine, it's only natural that they'd use the best bits of their first engine (containing Quake code), so it's not really suprising.

Doesn't really matter either way though, does it?
 
_-_-SELAS-_-_ said:
If you take all the water out of a pool scrape it, wash it off with water wash that out, and then fill it with water again, there will still be a bit of urine in it still, but it wont matter cuz its so little no one would ever notice. Sort of the same principle I belive.

That's actually a good analogy, because the pool is the same size!
 
FictiousWill said:
It may work, but it's not elegant and is bad for modularity and upgrading/scaling the engine.
??

How is re-using good code not good for modularity, upgrading and scaling?
If they're re-using it then it's gonna be good, and i guess that could be considered elegant (because of the effectivness of said code), otherwise why would they re-use it.

I'd say that the fact that they can re-use it means that it's very good for modularity and upgrading/scaling, since the fact that the code can exist in 2 different engines shows this.

FictiousWill said:
That's actually a good analogy, because the pool is the same size!
What do you mean?
 
Of course there is, the core technology hasn't changed much (lightmapped BSP maps) and redoing it merely to be authentic is like reinventing the wheel for no particular reason.
I assume the way HL2 does static lighting and occlusion hasn't changed much.
 
Wheres his proof and why EXACTLY is it obvious?

If you could be abit more obscure John, that'd be great. Go learn how to make an outdoor enviroment while you're at it.
 
azz0r said:
Wheres his proof and why EXACTLY is it obvious?
To make that statement i guess he has some, probably directly from valve.

It's obvious because everything points to that fact (see above posts). Ok, so it *may* not be true, but that's very unlikely.

azz0r said:
Go learn how to make an outdoor enviroment while you're at it.
How about you go do it. :)
 
azz0r said:
Go learn how to make an outdoor enviroment while you're at it.

Tell that to Valve.


Let me give you an example of a source hack:

A big problem with the HL engine was that it could not support large open areas very well. One of the reasons was because of the way maps were compiled. The larger the area the harder it was to compile a map. For HL2, larger areas were promised, but instead of rework the engine to use less bsp or go for a hybrid approach like unreal, farcry or halo, valve decided to use the '3d skybox' idea.

The reason why 3d skyboxes are necessary is the only way to make huge skyboxes compile well is to scale them down to the a size managable by the HL1 engine. So this is exactly what valve does, and adds a rendering hack to display the skybox and the area the player is in simultaneously, producing seemingly larger areas, with as little work to update the HL1 engine as possible.

This is bad for modularity and upgrading. The problems with this are that the large space problem is still not addressed and map size and compile time are still a stumbling block for mappers. Levels may look bigger, but closer inspection reveals they're not. Secondly, if ever valve wants to add the ability to make huge areas, they've painted themseleves into a corner because in order to do so they would have to revamp the major portions of not only the source engine core, but the renderer, as well as hammer, and the compile tools.

Valve's short-term hack to patch up the quake engine, while providing pretty skyboxes, has in the long run stunted the growth of the engine.
 
hl2 is basically the hl1 engine with little modules added to it that make it pretty.

hl1 is modified quake 3
 
That's a good point, hadn't thought of that.

Although, it was my understanding that they only use the skybox technique for terrain that the player has no interaction with (isn't solid).
HL2 does things like the coast levels fine, and the HL1 engine certainly couldn't run a level as detailed as that.
 
Big Fat Duck said:
hl1 is modified quake 3
Nope, modified quake 1.
Big Fat Duck said:
hl2 is basically the hl1 engine with little modules added to it that make it pretty.
They didn't add to HL1 to make HL2, they used ideas (and code portions possibly) from HL1 to make a new engine from scratch. They didn't start with the HL1 code, they mearly used bits of it.
 
i read something and saw screenshots of "early hl2 builds" looked exactly like hl1

why are all the formats and things BSP and SMD and MDL just like hl1.. hell, its even backwards compatible

its possible they built it from scratch, into THE SAME THING
 
Big Fat Duck said:
i read something and saw screenshots of "early hl2 builds" looked exactly like hl1
The URL/source of the article would be nice, but yeah i agree that early screenshots do look like a bit souped up HL1.

Big Fat Duck said:
why are all the formats and things BSP and SMD and MDL just like hl1.. hell, its even backwards compatible
Perhaps because they'd been using those formats for a while, and thought they were rather good. :p
It's backwards compatible since they wanted the mod community to carry over to the source engine, so they made it as easy as possible.

Big Fat Duck said:
its possible they built it from scratch, into THE SAME THING
Yes, but that's not what you said in your first post. :)
 
FictiousWill said:
Tell that to Valve.


Let me give you an example of a source hack:

A big problem with the HL engine was that it could not support large open areas very well. One of the reasons was because of the way maps were compiled. The larger the area the harder it was to compile a map. For HL2, larger areas were promised, but instead of rework the engine to use less bsp or go for a hybrid approach like unreal, farcry or halo, valve decided to use the '3d skybox' idea.

The reason why 3d skyboxes are necessary is the only way to make huge skyboxes compile well is to scale them down to the a size managable by the HL1 engine. So this is exactly what valve does, and adds a rendering hack to display the skybox and the area the player is in simultaneously, producing seemingly larger areas, with as little work to update the HL1 engine as possible.

This is bad for modularity and upgrading. The problems with this are that the large space problem is still not addressed and map size and compile time are still a stumbling block for mappers. Levels may look bigger, but closer inspection reveals they're not. Secondly, if ever valve wants to add the ability to make huge areas, they've painted themseleves into a corner because in order to do so they would have to revamp the major portions of not only the source engine core, but the renderer, as well as hammer, and the compile tools.

Valve's short-term hack to patch up the quake engine, while providing pretty skyboxes, has in the long run stunted the growth of the engine.

Doesnt really detract from the point that Doom 3 chokes in an outdoor enviroment.
 
azz0r said:
Doesnt really detract from the point that Doom 3 chokes in an outdoor enviroment.
I think that last bit was more directed towards my post.
Kitfox said:
What he said.
I'm not a professional, but i've developed reasonably in-depth games and applications.
 
FictiousWill said:
Tell that to Valve.


Let me give you an example of a source hack:

A big problem with the HL engine was that it could not support large open areas very well. One of the reasons was because of the way maps were compiled. The larger the area the harder it was to compile a map. For HL2, larger areas were promised, but instead of rework the engine to use less bsp or go for a hybrid approach like unreal, farcry or halo, valve decided to use the '3d skybox' idea.

The reason why 3d skyboxes are necessary is the only way to make huge skyboxes compile well is to scale them down to the a size managable by the HL1 engine. So this is exactly what valve does, and adds a rendering hack to display the skybox and the area the player is in simultaneously, producing seemingly larger areas, with as little work to update the HL1 engine as possible.

This is bad for modularity and upgrading. The problems with this are that the large space problem is still not addressed and map size and compile time are still a stumbling block for mappers. Levels may look bigger, but closer inspection reveals they're not. Secondly, if ever valve wants to add the ability to make huge areas, they've painted themseleves into a corner because in order to do so they would have to revamp the major portions of not only the source engine core, but the renderer, as well as hammer, and the compile tools.

Valve's short-term hack to patch up the quake engine, while providing pretty skyboxes, has in the long run stunted the growth of the engine.
I've always wondered why they used skyboxes instead of actually making very large areas like in Battlefield 1942 or FarCry. I hope they do manage to fix this or other engines will pass up Source in no time. HL2 is a great game, but one of my biggest disappointments is the map sizes.

Would you mind posting a source for this info, FictiousWill?
 
I thought Source was built around Havok 1 engine?
 
Doom3 engine doesn't choke outdoors, it's just the lighting looks crap, so they avoided outdoor areas in the game.

during DM development splash damage had large outdoor vehicle DM maps happening.

HL2 uses Q2s radiosity on steroids (very clever steroids, actually), so it looks great outdoors, lighting wise.

HL2 was developed piece by piece on top of the HL1 codebase, Gabe (or someone from VALVe) said somewhere that at no time did they not have a functioning engine.

that means that bits of the HL1 code are going to be left - it only takes a 5 min look thru the HL2 source to see that (start with qboolean, QAngles and Q_sprintf).

'cos HL1 was built of Q1, of course there is Q1 code in HL2.

EDIT: Milkman - Havok is just the Physics engine, it was licensed and made to interface with the renderer and game logic
 
Milkman said:
I thought Source was built around Havok 1 engine?

Heavily modified Havok 1. But that's only for the physics...
 
Milkman said:
I thought Source was built around Havok 1 engine?
This is the physics component. They used Havok and then heavily modified it.

EDIT: beaten :dozey:
 
Yea the map sizes are disappointing. The maps do seem larger than the maps on the original half life, but they still are not large enough for a mod to do something like battlefield 1942.
 
I did a code difference on the sdk and quake 1's source code.

Let's just say it's only simple stufff like sqrt() functions that are the same. And Carmack may have written the actual sqrt() code but it's a dang old and well known way of doing it.
 
^Ben - did you check vvis vs vis and vbsp vs bsp?
that's where i expect the real similarities would be.

the game code would only have basic utility stuff and types in common.

the new vrad may use the same basic technique as the old Q2 rad(there's only really two ways to do radiosity), but it calculates and stores more info.
 
FictiousWill said:
Tell that to Valve.
Let me give you an example of a source hack:

What's this funny little man under the bridge?

Anyway, the 3d skyboxes are primarily for cheaply allowing a range of perspective effects the non-interactive part of the backgrounds: for instance you can have extremely farwaway elements like the Combine citadel present "outside" the map that will nevertheless move realistically against the horizon. Normally, these elements would be static parts of the skybox.

The areas in HL2 are plenty huge with or without the use of 3d skybox: just look at the buggy scenes. 3d skyboxes solve an entirely different problem.
 
Back
Top