Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Quake 3 Source Code Review

Soulskill posted more than 2 years ago | from the sleep-is-for-the-weak dept.

Quake 107

An anonymous reader writes "id Software has a history of releasing the source code for their older games under the GPL. Coder Fabien Sanglard has been taking it upon himself to go through each of these releases, analyze the source code, and post a detailed write-up about it. He's now completed a review of the Quake 3 source code, diving into the details of idTech3. It's an interesting read — he says he was impressed in particular by the 'virtual machines system and the associated toolchain that altogether account for 30% of the code released. Under this perspective idTech3 is a mini operating system providing system calls to three processes.'"

cancel ×

107 comments

Sorry! There are no comments related to the filter you selected.

FIRST (-1)

Anonymous Coward | more than 2 years ago | (#40508551)

FIRST

Fragged (-1)

Cyphase (907627) | more than 2 years ago | (#40508565)

Fabien just fragged the Quake 3 source code.

You are famously gay. (-1)

Anonymous Coward | more than 2 years ago | (#40508605)

What a god damned fag.

"code" is OBSOLETE, loosers!!!! (5, Funny)

For a Free Internet (1594621) | more than 2 years ago | (#40508567)

Todays compotor scientists program with pure thought connected by JSON/XMLhttpREQUEST to a HTML5 document tree located in four-dimensional time on the APP STORE. This "code" shows that Id software is living in the PAST and won't be arouned for long, it is a DINOSORE and I am going to eat its stock markets for BRUNCH with BEAUTIFUL HOOKERS and jesuse!!!!!

The most insightful comment. Ever. (5, Funny)

Anonymous Coward | more than 2 years ago | (#40508631)

You have just spouted utter nonsense, and have made a more valuable comment than most other people here.

Re:The most insightful comment. Ever. (2, Funny)

For a Free Internet (1594621) | more than 2 years ago | (#40508707)

That's just how I roll, yo. Slashdort is my bailiwick of bogosity.

So this is what happens when reddit goes down. (0)

Anonymous Coward | more than 2 years ago | (#40508787)

People have aneurisms and shit.

Re:So this is what happens when reddit goes down. (0)

Anonymous Coward | more than 2 years ago | (#40509021)

Usually, it's shit then aneurysm then shit.

Re:So this is what happens when reddit goes down. (1)

DeathElk (883654) | more than 2 years ago | (#40509233)

Or an aneurism of shit.

Re:So this is what happens when reddit goes down. (3, Funny)

Hal_Porter (817932) | more than 2 years ago | (#40510633)

I believe it spelled "aneurysm". They were discovered by Aneurysm Bevin, evil inventor of British death panels.

Re:"code" is OBSOLETE, loosers!!!! (-1, Flamebait)

Osgeld (1900440) | more than 2 years ago | (#40508779)

considering its over a decade old, yea its obsolete, thanks for the update shit for brains

Re:"code" is OBSOLETE, loosers!!!! (-1, Troll)

Anonymous Coward | more than 2 years ago | (#40509091)

helo felo intarnot usar!!1 my naem si jeffk!! and i sees yuor a qualiety intarnet commentatar justs liek me!!1 i did vary meny revieiws fo gaems liek quauek and urinal torunamitn (haahah cliffyb si a fagot!!) adn karnov! adn maeds meny supar funey commics!!1

oncse i evan apaleyd for a job at idsoftwarez but they diddant repley even after i sent my partfolio fo quauek2 maps liek mad bomber!11 they cuoldant handal my skillz!11

Re:"code" is OBSOLETE, loosers!!!! (0)

Anonymous Coward | more than 2 years ago | (#40509319)

It's sad I could read that without any problems...

Re:"code" is OBSOLETE, loosers!!!! (0)

Anonymous Coward | more than 2 years ago | (#40509409)

I lost it at "urinal tournament"

Re:"code" is OBSOLETE, loosers!!!! (0)

Anonymous Coward | more than 2 years ago | (#40514799)

Good old Jeffk!!! Brings back some good SomethingAwful memories...

Re:"code" is OBSOLETE, loosers!!!! (-1)

Anonymous Coward | more than 2 years ago | (#40509227)

My COCK is DINOSORE after four hours fragging that lusty female raptor.

Re:"code" is OBSOLETE, loosers!!!! (0)

Anonymous Coward | more than 2 years ago | (#40509905)

You make pretty much the point I was going to write. But yeah, couldn't they just move this into The Cloud and be done with it? All business intelligence data points towards this conclusion. The idea that you could learn something from reviewing the "code" for 3D engine is just beyond pointless.

Re:"code" is OBSOLETE, loosers!!!! (1, Funny)

Hal_Porter (817932) | more than 2 years ago | (#40510755)

If this Carmat guy had spend more time updating his skills with modern languages like PHP his website wouldn't have got pwned

http://doom-ed.com/ [doom-ed.com]

<?php
define('DB_NAME', 'wp_doomed_com'); // The name of the database
define('DB_USER', 'wp_doomed_com'); // Your MySQL username
define('DB_PASSWORD', 'wp15'); // ...and password
//define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
define('DB_HOST', 'mysql25.secureserver.net'); // 99% chance you won't need to change this value
define('MAIN_TITLE', 'doom-ed.com');
 
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die('Could not connect: ' . mysql_error());
mysql_select_db(DB_NAME) or zdie('Could not select database');

Re:"code" is OBSOLETE, loosers!!!! (1)

AaronLS (1804210) | more than 2 years ago | (#40514077)

what is a DINOSORE?

Re:"code" is OBSOLETE, loosers!!!! (0)

Anonymous Coward | more than 2 years ago | (#40515109)

Timecube guy?

I'm a dumbass- (2, Interesting)

WiiVault (1039946) | more than 2 years ago | (#40508575)

But I can't help but revel in the growth and extension of public domain engines and assets by willing companies. As a dum-dum, I still see a lot of value in Q3 based projects. They really look good enough(for me), and I hear good things about the netcode. It isn't the end-all-be-all of engines, but it really is one of the first modern commercially sold engines available to the rest of us. If I may be so bold; gentlemen start your engines. I can't wait to see what you come up with.

Re:I'm a dumbass- (5, Insightful)

mrchaotica (681592) | more than 2 years ago | (#40508603)

"Start your engines; I can't wait?" Dude, this was released years and years ago. In fact, the guy in the article previously reviewed the Doom 3 source code (which is much newer) and just decided to go back and do this old engine for completeness' sake.

Wikipedia has a list [wikipedia.org] of games that already exist that are based on the GPL Quake 3 source. You need to crawl out from under your rock a little more often!

Re:I'm a dumbass- (2)

jones_supa (887896) | more than 2 years ago | (#40509037)

Hey, at least he warned that he's stupid (just like me). ;)

Re:I'm a dumbass- (0)

Anonymous Coward | more than 2 years ago | (#40509839)

I understand English problem isn't Fabien's first language, but it would help if he got his technical terminology right. These reviews are barely more insightful than reading all of Carmack's .plan files at the time, if any.

Seriously? (-1)

Anonymous Coward | more than 2 years ago | (#40508611)

What a god damned fag. "Start your engines." Idiot geeks who might cobble together some dumb little project with this engine (which was released years ago) are not race car drivers astronauts. You are just rucking gay as hell.

Re:Seriously? (-1)

Anonymous Coward | more than 2 years ago | (#40508755)

...and you sir, are a troll.

Re:Seriously? (0)

Anonymous Coward | more than 2 years ago | (#40515785)

No! I'm Spartacus!

Yes, you are- (5, Insightful)

MrEricSir (398214) | more than 2 years ago | (#40508623)

"But I can't help but revel in the growth and extension of public domain engines and assets by willing companies."

Just so we're clear, Quake 3 and its source code are NOT in the public domain.

Re:Yes, you are- (5, Informative)

Baloroth (2370816) | more than 2 years ago | (#40508675)

Public domain? No. GPL? Yes, which is probably what the OP meant (and to be pedantic, it is the engine that is GPL, not the game as such).

Re:Yes, you are- (1)

qxcv (2422318) | more than 2 years ago | (#40509253)

The gamecode is open source as well. id just chose not to release the art assets necessary to create a functioning copy of Q3 for free.

Re:I'm a dumbass- (-1)

Anonymous Coward | more than 2 years ago | (#40508647)

Why use the quake 3 engine when you can use the newest unreal engine with all the tools the professionals use for free?

Re:I'm a dumbass- (4, Informative)

santax (1541065) | more than 2 years ago | (#40508747)

UDK is free for noncommercial and educational use. You may download a copy here. Licensing is required for commercial use, however. From their site ;)

Re:I'm a dumbass- (2)

Tough Love (215404) | more than 2 years ago | (#40508753)

Because you have source code to it and you can make it do new things because of that, while also learning something.

Re:I'm a dumbass- (0)

Anonymous Coward | more than 2 years ago | (#40508765)

Not to mention the fact you can make it a standalone app you can sell.

Re:I'm a dumbass- (2)

santax (1541065) | more than 2 years ago | (#40508791)

Neh different licenses, the regular without source code but for commercial use is USD 99. And 25% of your revenue :P The one that comes with source code = please contact us for more information....

Re:I'm a dumbass- (2, Insightful)

arth1 (260657) | more than 2 years ago | (#40508775)

Why use the quake 3 engine when you can use the newest unreal engine with all the tools the professionals use for free?

Because you might want to release the game one day? Then you have to pay for both the engine and royalties.

Also, you may want to produce a game that can run on a tablet or normal notebook, in which case the Unreal engine requirements disqualifies it.

Re:I'm a dumbass- (2)

Gaygirlie (1657131) | more than 2 years ago | (#40508813)

Because you might want to release the game one day? Then you have to pay for both the engine and royalties.

Release, or release commercially? You're entirely free to develop and release completely free games with UDK, you know, you do not need to pay anything then.

Re:I'm a dumbass- (2)

tepples (727027) | more than 2 years ago | (#40508835)

With a completely free game, how does one recoup the $99 per platform per year fee for a developer certificate?

Re:I'm a dumbass- (4, Informative)

santax (1541065) | more than 2 years ago | (#40508863)

Read this: http://www.develop-online.net/news/37234/UDK-devs-making-75k-only-give-1-to-Epic [develop-online.net] In short, they take 25% if you sell the game, but only if your game makes more than 50.000. They also take into account the 30% that applestore of android take using their distribution platform. But if it's non-commercial, there is no $99 if I'm not mistaken. Btw, that $99, could the average indy develop an engine like this for it? I would say, nah.

Re:I'm a dumbass- (1)

hvm2hvm (1208954) | more than 2 years ago | (#40508921)

Also, even if your game is free to play, I'm sure you can pay the 99$ yourself or get some donations for it. Hosting the game would probably cost more anyway.

Re:I'm a dumbass- (1)

shiftless (410350) | more than 2 years ago | (#40512269)

n short, they take 25% if you sell the game, but only if your game makes more than 50.000.

So in other words, one is better off using IdTech3/4, unless one plans to sell more than $50k, in which case the Unreal engine might be a viable option.

25% of sales is HUGE.

Re:I'm a dumbass- (1)

santax (1541065) | more than 2 years ago | (#40512351)

If you sell more than 250K they advise you to contact them, for a full license... So I guess if you happen to get lucky and make between 50 and 250k this is the cheapest way. If you get more revenue you are better of just taking the full license. But they also state that on their site. "if you make more than 250.000usd, you should give us a call.)

Re:I'm a dumbass- (1)

camperdave (969942) | more than 2 years ago | (#40508955)

With a completely free game, how does one recoup the $99 per platform per year fee for a developer certificate?

"Please send me a dollar for the ad-free version"

Re:I'm a dumbass- (1)

arth1 (260657) | more than 2 years ago | (#40515793)

"Please send me a dollar for the ad-free version"

If you have ads, that counts as income from Epic's perspective, and so does the dollar in donations.
Once you hit the $50,000 mark in total, they want 25% of both your ad revenue and donations.

Re:I'm a dumbass- (2)

Gaygirlie (1657131) | more than 2 years ago | (#40509009)

With a completely free game, how does one recoup the $99 per platform per year fee for a developer certificate?

I do not understand what you don't understand about "do not need to pay anything."

Bad News Brian Reads Slashdot (-1, Troll)

Anonymous Coward | more than 2 years ago | (#40509055)

Hey, a girl!

-

Gay.

App store fee (1)

tepples (727027) | more than 2 years ago | (#40510057)

With a completely free game, how does one recoup the $99 per platform per year fee for a developer certificate?

I do not understand what you don't understand about "do not need to pay anything."

It costs per year to get onto the iOS App Store, Mac App Store, Amazon Appstore, or Windows Store, even for applications priced at $0.00. Epic sees none of this. So let me rephrase: With a completely free game, how does one recoup the $99 per year fee payable to Apple for a developer certificate?

Re:App store fee (1)

Gaygirlie (1657131) | more than 2 years ago | (#40510149)

It costs per year to get onto the iOS App Store, Mac App Store, Amazon Appstore, or Windows Store, even for applications priced at $0.00. Epic sees none of this. So let me rephrase: With a completely free game, how does one recoup the $99 per year fee payable to Apple for a developer certificate?

I really fail to see how that is related to UDK. As for the answer to the question: put away $10 a month by e.g. drinking a few beers less? Ask for donations? Even if you only got 10 donations, each for $10, you'd still afford to pay the $99 fee. Or just release the game on your own website instead of App Store. Quite simple, really.

Re:App store fee (1)

tepples (727027) | more than 2 years ago | (#40510327)

Or just release the game on your own website instead of App Store

Which would mean each user would have to buy his own developer certificate to install it. I guess I could make it exclusive to PC and Android.

Re:App store fee (1)

Fujisawa Sensei (207127) | more than 2 years ago | (#40512957)

$99 is a drop in the bucket. How do you recoup the $100/hr that you as an independent contractor should be charging for your labor?

Unless of course your time isn't worth anything.

Re:App store fee (0)

Anonymous Coward | more than 2 years ago | (#40515815)

Why are you telling people what they need to do? America is that way, pal.

Re:App store fee (1)

Fujisawa Sensei (207127) | more than 2 years ago | (#40521229)

The reality of American life is pay to play.

Looking for a first job (1)

tepples (727027) | more than 2 years ago | (#40516081)

Consider the case of somebody who doesn't (yet) have a job in a given industry. A job seeker will want a portfolio to present to those responsible for hiring, and I don't see how anybody will pay a job seeker to build a portfolio.

Re:Looking for a first job (1)

arth1 (260657) | more than 2 years ago | (#40516295)

Consider the case of somebody who doesn't (yet) have a job in a given industry. A job seeker will want a portfolio to present to those responsible for hiring, and I don't see how anybody will pay a job seeker to build a portfolio.

Welcome to the modern world. Not long ago, vocational schools encouraged students to build a portfolio, and graduation ended with the student presenting a major work, which became the crown of the portfolio and basis for acceptance for apprenticeship (and later in life, the major work would hopefully be replaced by a masterwork).

Some countries still put great value in technical and trade schools.
And some schools still allow or support students in building a portfolio. But yes, times have changed, and employers today want to hire a 25 year old with 30 years experience, and abhor anything that smells of guilds.

Re:Looking for a first job (1)

tepples (727027) | more than 2 years ago | (#40516991)

So if a programmer seeks a job in the video game industry, what should be in his portfolio, and how should he support himself while building it?

Re:Looking for a first job (1)

arth1 (260657) | more than 2 years ago | (#40517195)

So if a programmer seeks a job in the video game industry, what should be in his portfolio, and how should he support himself while building it?

I would think that a game or demo developed while studying would be a good start. If painters are expected to present example paintings at the end of their study, it's surely not to much to ask that a games developer can present a game or demo?

So? (1)

Fujisawa Sensei (207127) | more than 2 years ago | (#40521353)

So what?

You want to build an app for IOS, sell it for a buck or 5 and act like a pro.

If you want to give it away as portfolio material so someone might give you a job. The stop whining and spend the $100 as a cost of education. Maybe you'll get a job or maybe not. But its still a drop in the bucket compared to the amount of money you don't make by not having a job, or the amount of money you spend getting an education.

Re:I'm a dumbass- (1)

Hal_Porter (817932) | more than 2 years ago | (#40510679)

Call your parents and tell them you need $99 for cocaine, hookers, lawyers etc? Hell I'd ask for more.

Re:I'm a dumbass- (1)

tehcyder (746570) | more than 2 years ago | (#40517613)

Call your parents and tell them you need $99 for cocaine, hookers, lawyers etc? Hell I'd ask for more.

If your parents are happy to pay for your cocaine and hookers, why the fuck would you worry about getting a job anyway?

Re:I'm a dumbass- (1)

netwarerip (2221204) | more than 2 years ago | (#40518331)

By 'Call your parents' I am assuming you mean 'yell up the stairs'?

Re:I'm a dumbass- (4, Informative)

gl4ss (559668) | more than 2 years ago | (#40509301)

"Also, you may want to produce a game that can run on a tablet or normal notebook, in which case the Unreal engine requirements disqualifies it."

unreal engine isn't so bad on tablets... http://epicgames.com/infinityblade/ [epicgames.com]

it's a fine engine. what you render with it is what makes all the difference if it runs well or not.

Re:I'm a dumbass- (1)

arth1 (260657) | more than 2 years ago | (#40511473)

unreal engine isn't so bad on tablets... http://epicgames.com/infinityblade/ [epicgames.com]

Except that that isn't the "free for development" UTK x86 engine we were talking about here, but a much more costly license.

Re:I'm a dumbass- (1)

Sir_Sri (199544) | more than 2 years ago | (#40508809)

So you can learn how to implement engine components on top of an existing engine that you didn't write. You can do that with unreal as well, but it's done differently, each has its place.

So that you can do something where you had anyone who wants it the entire source code if you're trying to demonstrate a new idea (e.g. a new bot AI).

Re:I'm a dumbass- (0)

Anonymous Coward | more than 2 years ago | (#40509171)

id has already released DOOM3 engine too, and also the same guy has released review of DOOM3 sources, so I dno what the fuzz is about years ago released Q3 sources...

Re:I'm a dumbass- (0)

Anonymous Coward | more than 2 years ago | (#40509289)

If I may be so bold; gentlemen start your engines.

Spoken with the voice of Martin Prince from Simpsons.

Re:I'm a dumbass- (0)

Anonymous Coward | more than 2 years ago | (#40509667)

I'm probably alone on this, but I wouldn't mind seeing a serious project using the Q1 code.

Re:I'm a dumbass- (-1)

Anonymous Coward | more than 2 years ago | (#40509847)

I'm not sure I could actually care what a person who uses the nick name 'WiiVault' thinks... Are you 14?

Re:I'm a dumbass- (3, Interesting)

Smauler (915644) | more than 2 years ago | (#40510271)

I still see a lot of value in Q3 based projects. They really look good enough(for me), and I hear good things about the netcode.

Literally yesterday, I was looking at a bridge in Lord of the Rings Online (which is quite pretty otherwise), and thought to myself : Why isn't it curved?

It seems the fashion with engines now is to drop curved edges - I'm not sure why. They look so much better, and have been around for ages. Quake 3 did these brilliantly, and when it came out, I thought that would be the end of crappy lumpy bridges, etc. No such luck, they're still with us, over a decade later.

Anyone with knowledge of this issue, and why they're still about?

Re:I'm a dumbass- (0)

Anonymous Coward | more than 2 years ago | (#40512759)

These days it seems like a lot of games use blockier geometry and then try to cover it up with various pixel shaded effects. Since pixel shaders are what modern GPUs are really good at, it makes sense from that perspective.

Back when I made maps for Q3 engine games, I sometimes opted not to use meshes on geometry that wasn't very prominent or in areas that already had lots of details. Instead, you could make a blocky shape out of brushes and add phong blending to the texture shader. It would generally give the appearance of smoothly rounded edges, at least until it was placed under close examination.

Re:I'm a dumbass- (4, Interesting)

parlancex (1322105) | more than 2 years ago | (#40513173)

Q3 engine's curved surfaces are actually quadratic bezier spline patches (9 control points per patch). The patches had to be designed with special tools in an editor and were tessellated at runtime to an appropriate detail level based on the computer's graphics settings. The engine did not support any kind of collision detection with these surfaces so they had to be enveloped in invisible brushes to appease the BSP system for collision and culling.

While they were interesting at the time the reasons nobody really does this anymore are probably:

  • The special tools required to design curved surfaces need to be supported by the artist's tools and entire game toolchain, creating more work for artists and tool programmers
  • Quadratic bezier patches are one of the simplest types of curved surface but can still be difficult to work with. Certain shapes are hard to construct properly with them.
  • Lastly I'd say they've been kind of superseded by smooth / detail surfaces available through subdivision algorithms which can work on conventional geometry and conventional tools, and is supported on modern cards in hardware

Re:I'm a dumbass- (1)

Anonymous Coward | more than 2 years ago | (#40514691)

That's incorrect. The Quake3 engine does have collision detection on curved surfaces. It generates triangular collision volumes along the curve at a pre-defined level of tesselation. What the curves don't do is participation in the BSP tree generation, so you are required to place "caulk" brushes behind them to seal the level if on an outside edge, or to block visibility if this is an internal wall.

Re:I'm a dumbass- (0)

Anonymous Coward | more than 2 years ago | (#40516135)

Patch meshes are designed in GtkRadiant in much the same way as brushes. It is also possible to export entire groups of patches and brushes into 3DS Max ASE model format. I don't understand what you mean by requiring special tools. In addition, a patch can have more or less than nine nodes by adding/subtracting columns/rows, merging patches or splitting them.

As for collision detection, like the other AC says, patches do obstruct players, with exception to a few glitches if the patch happens to be above a player and they are able to crouch and jump into it (low angled shapes or perhaps a very low ceiling). I think you are thinking about models, which aren't automatically clipped.

Re:I'm a dumbass- (2)

hairyfeet (841228) | more than 2 years ago | (#40511839)

I'm sure i'll get hate for saying this but WTF, truth is truth:

It is NOT the engines that are the problem, hell there are still plenty of guys playing games like Freelancer and Far Cry I out there and those are pretty damned far behind the curve, its the simple fact that the FOSS community simply won't put in the work to make decent games.

Now don't get me wrong, not saying making games is easy, just that the engine isn't the problem. i mean what did we get from the last source code releases? 50 bazillion rip offs of Q3 Arena that's what. it doesn't really matter WHAT engine you have if they are all putting out the same tired as hell DM and CTF fragfests over and over AND OVER without deviation. No single player, no story, no innovation, they just come up with some maps and character models and away you go.

So while I'm glad they give out these engines to the community frankly the guys modding non free games have been consistently better when it comes to quality and variety than anything I've yet seen built with one of these free engines. take Freelancer, there have been a dozen new campaigns made by modders, with hundreds of new star systems, a full Elite style economy based system, factions and reputations added, you can play some of those in SP for weeks and not see it all, whereas what will we get from this? CTF and DM and...well that's all, CTF and DM.

So while i'm sure i'll get tons of hate for pointing this out you all KNOW this guys, its the same thing we've seen with every other damned engine release. do I wish it were different? Hell yeah, I would love it if there were a free game built with this that had a rich story, interesting characters, something that would really spark some interest in FOSS gaming, but instead what we'll get is the FPS equivalent of Tux Racer, just the same old same old. And please, for the love of the FSM no more damned Q3 Arena copies, okay? I mean we already have a fricking bazillion MP only FPS games, we really don't need anymore.

Re:I'm a dumbass- (3, Insightful)

Smauler (915644) | more than 2 years ago | (#40511993)

Content is the most difficult thing about games now. Seriously. The engine is not where most of the resources go.

It's a hell of a lot more difficult creating a decent in game universe than creating an engine. Think about it - games now require _loads_ of textures someone has to paint. Loads of voiceovers someone has to do. Loads of text someone has to write. And debug, optimise, etc. The engine is not the tough bit. A lot of it is dull, dull work.

That being said, there are success stories, but they are few and far between. Fall from Heaven (civ4), Magna Mundi (EU3) - (though look at how that has turned out now), quite a few for X3, and obviously the old poster boy, counterstrike. These mods relied upon a large initial userbase.

Seriously, content is king now, and it's hard to do without loads of work.

Re:I'm a dumbass- (2)

savuporo (658486) | more than 2 years ago | (#40513101)

If i had mod points .. What a lot of people don't realize is that direct coding budget is often less than 10% of any major title nowadays. A chunk goes to middleware licensing, and the rest is all pretty much content creation, be it story writing, 3d/2d artwork, audio, acting etc.

Hint (0)

Anonymous Coward | more than 2 years ago | (#40509177)

"Under this perspective idTech3 is a mini operating system providing system calls to three processes"
Uh, yea, we call them things an API framework.

Re:Hint (1)

drzhivago (310144) | more than 2 years ago | (#40510107)

I laughed when he said the first striking thing was that the solution had multiple projects in it.

Is the second striking thing that id used an existing 3D API for rendering?

Re:Hint (2)

UnknownSoldier (67820) | more than 2 years ago | (#40510611)

The third striking thing where he he discovered "circular buffers" but calls them "Array index cycling." Are programmers really that clueless that they don't realize MOD N can be optimized with AND N-1 ??

http://fabiensanglard.net/quakeSource/quakeSourceNetWork.php [fabiensanglard.net]
arrayIndex = (oldArrayIndex+1) % 64 ;
arrayIndex = (oldArrayIndex+1) & UPDATE_MASK;

Which came from:
Network Model (Part 3 of 5)
The array cycle with the famous binary mask trick I mentioned in Quake World Network (Some elegant things).

Re:Hint (1)

Anonymous Coward | more than 2 years ago | (#40512055)

Are programmers really that clueless that they don't realize MOD N can be optimized with AND N-1 ??

you forgot about the part where gcc compiles both variants to exactly the same assembly...

Re:Hint (1)

taxman_10m (41083) | more than 2 years ago | (#40513345)

Not a programmer. Did gcc do that back in the Q3 days or does it do it now?

Re:Hint (1)

UnknownSoldier (67820) | more than 2 years ago | (#40513521)

Correct.

Compilers do it NOW but they didn't always use to UNLESS you turned optimizations on. Debugging un-optimized code is a lesson in pain. Especially when you are trying to debug a real-time system and can't due to performance issues.
 

Re:Hint (1)

Thiez (1281866) | more than 2 years ago | (#40517889)

That trick is only guaranteed to work if N is a power of two. It's much better to just use mod and let the compiler figure out how to optimize, lest you run into mysterious bugs when someone changes N.

What's the point of this system? (2)

loufoque (1400831) | more than 2 years ago | (#40510435)

From a quick reading, I don't get the point of this system.
Couldn't they just compile their C code to a dll normally and then load that dll and call vmMain?

I don't see what those "virtual machines" are bringing.

Re:What's the point of this system? (1)

Andor666 (659649) | more than 2 years ago | (#40510645)

RTFA:
http://fabiensanglard.net/quake3/qvm.php [fabiensanglard.net]

Re:What's the point of this system? (3, Interesting)

loufoque (1400831) | more than 2 years ago | (#40510665)

I wrote this very comment *because* I read that article.

Re:What's the point of this system? (1)

purpledinoz (573045) | more than 2 years ago | (#40510685)

I was thinking the same thing. But I would imagine this was done to restrict what the code run by the VM can do. This way, the code is guaranteed to not to interfere with the core engine. Imagine what would happen if all the Quake 3 modders out there were able to do anything they wanted in C code. Invariably, most mods would probably have bugs in them that would cause the game to crash all the time. And I guess this wouldn't apply just to the modders, but also other game developers building on top of the Quake 3 engine.

Re:What's the point of this system? (1)

loufoque (1400831) | more than 2 years ago | (#40510699)

I see, so the whole system exists for sandboxing.
But then why not do a simpler approach where each module runs in its own process and communicates with the master through an IPC mechanism (sockets, shared memory, named pipes...)?

Re:What's the point of this system? (1)

purpledinoz (573045) | more than 2 years ago | (#40510831)

My guess is performance. It's probably faster to have code running within the same process, rather than having the IPC overhead. You have to remember how slow the hardware was when Quake 3 was released. I'm impressed at how smooth that game ran on that slow hardware.

Re:What's the point of this system? (1)

loufoque (1400831) | more than 2 years ago | (#40511267)

Whatever overhead an IPC mechanism would have would be insignificant compared to the overhead of running interpreted code as was initially desired.

Re:What's the point of this system? (3, Informative)

purpledinoz (573045) | more than 2 years ago | (#40511373)

Apparently, he got around this by compiling the bytecode to x86 code on the fly:

Moreover their design is much more elaborated: They combine the security/portability of Quake1 Virtual Machine with the high performances of Quake2's native DLLs. This is achieved by compiling the bytecode to x86 instruction on the fly.

And here's the evolution of this:

Trivia : The virtual machine was initially supposed to be a plain bytecode interpreter but performances were disappointing so the development team wrote a runtime x86 compiler. According to the .plan from Aug 16, 1999 this was done in one day.

Re:What's the point of this system? (1)

loufoque (1400831) | more than 2 years ago | (#40511453)

This was decided later. It still doesn't explain why they'd think their system would be faster than inter-process communication.

Re:What's the point of this system? (1)

Anonymous Coward | more than 2 years ago | (#40511199)

Security. Viruses can't be implemented in mods if they run on a VM.

Re:What's the point of this system? (1)

gl4ss (559668) | more than 2 years ago | (#40512543)

simplicity, reproducibility, not needing the level scripters & etc to constantly be compiling the engine itself.

anyhow, you can do .dll mods for q3.
but unless I'm totally mistaken, only the other type of mods which are ran in the vm thingy can be loaded on the fly from the server.

Re:What's the point of this system? (1)

loufoque (1400831) | more than 2 years ago | (#40513835)

Linking a DLL does not require recompilation.

Re:What's the point of this system? (2)

Drinking Bleach (975757) | more than 2 years ago | (#40512599)

Portability is a HUGE advantage to the VM architecture. Quake 3 has been ported to many OSes and CPU architectures that didn't even exist when the game first came around (or many of the mods). With the QVM, it's no problem to have a native Quake 3 port to Linux x86_64 and still run all the old mods without having to rebuild them. Additionally, ports to Android (Qauke 3 on ARM) also don't affect mod compatibility.

I think it's a huge step back that they regressed on the role of the VM in Doom 3.

Re:What's the point of this system? (1)

loufoque (1400831) | more than 2 years ago | (#40513843)

What kind of advantage does that have over recompiling the mods for a new architecture?

Re:What's the point of this system? (1)

Dog-Cow (21281) | more than 2 years ago | (#40516205)

Um, is this question for real?

Only a few handfuls of people on the planet will have access to the source for the vast majority of mods. Who's going to recompile your favorite mod for you for some new Android toy when the mod hasn't been updated at all in 4.5 years?

Re:What's the point of this system? (1)

loufoque (1400831) | more than 2 years ago | (#40516321)

So essentially the advantage of this virtual machine is that it forces mod providers to provide a retargetable source of their mods?

THE DIET SOLUTION (-1, Offtopic)

madelyndanford (2674749) | more than 2 years ago | (#40514951)

THE DIET SOLUTION Stop Dieting...Start Eating...and Start Living 3 Principles 1. Know the exact foods that cause accelerated fat burning in your body 2. Know the particular foods that are preventing fat burning 3. Put the right foods together in a certain way to create the FAT BURNING EFFECT Don’t Worry, this is NOT * Another crash diet * Another crazy diet scam * Another sales pitch for weight loss pills * Another starvation diet BUT this is REAL information you can use RIGHT NOW!! http://ow.ly/bJN9o [ow.ly]

makes sense (1)

Captain.Abrecan (1926372) | more than 2 years ago | (#40516173)

Video game engines are pretty intense. I can't imagine what the code for engines that utilize multiple graphics cards and multiple processing cores looks like.
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>