Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sigvatr

Things about Doom you just found out

Recommended Posts

Guest Unregistered account

I played Doom95 recently for no reason and was surprised to hear that the Lost Soul charge sound, in particular, sounds much better and tougher.

Yep, we could certainly do with that port, Platinum Shell.

Share this post


Link to post

I probably vaguely knew this at some point, but I was just reminded that in 1994 when people were first developing Doom editing utilities, id Software's legal counsel actually drafted a contract that they insisted that the authors of the utilities sign before releasing the utility to the public.

Spoiler

Data Utility License



This Data Utility License (the "License") describes the only terms by
which Id Software, Inc., ("Id") a Texas corporation doing business
at 18601 LBJ Frwy., Suite 615, Mesquite, Texas 75150, authorises the use
of the Trademark in connection with promoting the distribution of a
software utility (the "Utility") that manipulates data from the
registered version of the software game entitled DOOM (the "Program").

"Distribute" means to distribute for money or other consideration or for
free. It includes copying onto magnetic disks, CD-ROM's, or any other
tangible medium now or subsequently known, and distribution by retail
rack, direct mail, catalog, advertisement, or trade show.

The Program is currently distributed by Id, and its authorized licensees,
under the trademark DOOM (the "Trademark"). In connection with this
License, Id will allow Licensee to use certain software code (the
"Binary Space Partition") in NEXTSTEP Objective C, to be delivered
"as is" and without warranty, either express or implied.

"You" shall mean the licensee ("Licensee") shown on page 2 hereof,

1) LICENSE: Id Software hereby grants Licensee and Licensee hereby accepts
a non-exclusive, non-assignable, and non-sublicensable right to use the
Trademark solely to promote the Utility during the term hereof. Id Software
hereby grants Licensee and Licensee hereby accepts a non-exclusive,
non-assignable, and non-sublicensable right to use the Binary Space
Partition for purposes of developing the Utility.


2) OWNERSHIP RIGHTS: You acknowledge that Id owns all right, title, and
interest, including all copyrights, trademarks, trade secret rights, in
and to the Binary Space Partition and the Program and all elements
comprising the Binary Space Partition and the Program, including, but not
limited to, the characters, images, scenes, artwork, events, storyline,
and sound depicted therein and the routines, subroutines, techniques,
algorithms, and other such elements, and all right, title, and interest
including all copyrights, trademarks, and trade secrets in and to the
Trademark. Except as otherwise licensed by Id in writing, Id reserves all
right, title and interest to market, sell, and distribute the Program, to
utilize the Trademark, and to utilize the Binary Space Partition.


3) AUTHOR'S DUTIES: You, the author of the Utility, may use the Trademark
to promote Distribution of the Utility on a non-exclusive basis and may
use the Binary Space Partition to develop the utility during the term of
this limited License so long as you:

a) Execute this License and promptly deliver an executed original to Id;

b) Certify that your Utility doesn't work with the shareware version
of the Program;

c) Do not Distribute the Utility with any other product;

d) Make distribution copies only using high quality disks and
duplication technology and comply with all laws, treaties,
ordinances and regulations which relate to the production,
marketing and distribution of the Utility; and

e) Conspicuously place the following on the packaing and in the text
for the Utility: "DOOM (tm) is a registered trademark of Id
Software, Inc. The DOOM (tm) characters and the Id Software logo
are trademarks of Id Software, Inc. DOOM (tm) Copyright (R) 1993.
Id Software, Inc. All rights reserved. This utlity product is
not a product of Id Software, Inc... and has not been approved by
Id Software, Inc. Id Software will not provide technical suport
for this product. The purchaser of this utility product may not
distribute for money or other consideration any software data
created and/or modified by the use ot this utlity product.



4) RESTRICTIONS ON USE AND ASSIGNABILITY: The reverse engineering,
decompiling, disassembling, or modification of the Program is prohibited.
You rights under this License are personal to you and are not assignable
or in any way transferable. This License shall inure to the benefit of Id
and its assigns and successors and Id may assign its rights hereunder.
Any Distribution by you or anyone that buys the Utility from you of the
data manipulated by the Utility is prohibited.


5) NO WARRANTIES: ITS YOUR OBLIGATION TO OBTAIN A COPY OF THE PROGRAM
AND YOU ACKNOWLEDGE THE PROGRAM IS PROVIDED "AS-IS". NO WARRANTIES OF
ANY KIND, EITHER EXPRESS OR IMPLIED, ARE MADE AS TO IT, THE BINARY
SPACE PARTITION OR ANY MEDIUM THEY MAY BE ON. ID WILL PROVIDE NO REMEDY
FOR INDIRECT, CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES ARISING FROM
THE PROGRAM OR THE BINARY SPACE PARTITION, INCLUDING SUCH FROM NEGLIGENCE,
STRICT LIABILITY, OF BREACH OF WARRANTY OR CONTRACT, EVEN AFTER NOTICE
OF THE POSSIBILITY OF SUCH DAMAGES. ID MAKES NO WARRANTIES OF ANY KIND
UNDER THIS LICENSEE.


6) TERM AND TERMINATION: This License shall begin on the date Id Software
executes this Licensee, and shall expire two (2) calendar years from the
date Id software executes this License. This License shall be
automatically extended for successive one (1) calendar year periods
beginning on the original expiration date, unless either party hereto
terminates this License. This License shall terminate upon 30 days prior
written notice by either of us to the other. Termination will be
effective on the thiertieth (30th) day following delivery by the
non-terminating party of the written termination notice. You shall have
no rights to use the Trademark following termination or expiration of
this License. Notwithstanding the foregoing, if the License is
terminated by Id by such notice, you may use the Trademark for
purposes of marketing the Utility until the earlier of thirty (30)
days after the termination date in the notice, or completion of the
distribution of the Utility copies you have in stock. Sections 2, 5, 7
will survive the termination or expiration of this license. In the event
you breach this License, Id may pursue all remedies against you to which
it is entitled under applicable law. You agree that your sole and excusive
remedy for any breach of this License by Id to terminate this Agreement.

7) MISCELLANEOUS PROVISIONS:

a) You agree that Id will be irreparably damaged if Sections 2., 3., or 4.
of this License are breached by you. In the event of your breach, Id will
be entitled without bound, other security or proof of damages, to
appropriate equitable remedies, including but not limited to injunctive
relief, with respect to breaches of such sections, in addition to such
other remedies as Id may have under this License of under applicable law.
In the event of any breach by you of this License, any exercise by Id of
any of its rights or remedies shall not constitute a waiver by Id of any
other right or remedy.


b) You will hold and agree to hold harmless and indemnify Id, its
shareholders, officers, directors, attorneys, accountants, affiliates,
subsidiaries, agents, employees and independent contractors from damage,
loss and expense, including attorney's fees and costs of court, asrising
directly or indirectly from your acts and omissions in using the Trademark,
using the Binary Space Partition or developing, copying, distributing and
selling the Utility. You agree to promptly notify Id of any unauthorized
use of the Program or the Binary Space Partition.

c) With respect to every matter arising under this License, you consent to
the exclusive jurisdiction and venue of the state and federal courts
sitting in Dallas, Texas, and to service of process by certified mail,
return receipt requested, or as otherwise permitted by applicable law.
The laws of the state of Texas and applicable federal law shall govern
this License.

d) You acknowledge the terms of this License have been freely negotiated
and the preparation of this License by counsel for any party will not be
material to the construction hereof. The terms of this License shall not
be strictly construed against such party and this License represents the
entire understanding between parties hereto regarding the subject matter
of this License.

e) You warrant and represent that you have full legal rights and
authority to enter into this License, and to perform your obligations
hereunder, and that by entering into this License and performing
hereunder, you are not in default under any agreement with any third
party, you are not violating the rights of any third party and you are
not creating rights in favor of any third party.

f) Unless otherwise directed in writing by the parties hereto, all notices,
requests, consents and other communications under this License shal be in
writing and shall be deemed to have been delivered on the date personally
delivered or on the date deposited in the United States Postal Service,
postage prepaid, by certified mail, return-receipt requested, or
telegraphed and confirmed, or delivered by electronic facsimile and
confirmed. The adresses shown below, unless otherwise directed in
writing by the parties hereto, shall be the proper adresses for all
notices.

The undersigned do hereby agree to the terms and conditions of this License.

AGREED: AGREED:

"LICENSEE" ID SOFTWARE, INC.
__________________________


BY:_______________________ BY:__________________________
ITS:______________________ ITS:_________________________
EXECUTED ON:______________ EXECUTED:____________________
ADDRESS:__________________ ADRESS: 18601 LBJ Frwy.,
__________________________ Suite 615
__________________________ Mesquite, Texas 75150
TELEPHONE:________________ TELEPHONE:___________________
TELECOPIER:_______________ TELECOPIER:__________________

This is especially interesting to me now after having gone to law school. The contract itself is not terribly well written - there's some spelling errors and other basic flaws, defined terms are used before their definition is given, etc. The contract seems to be specifically in regards to the source code of id's node builder, which id was allowing programmers to see in order to more easily make their own node builders; however, it seems like the lawyer is not terribly technologically proficient, as it keeps referring to "the Binary Space Partition" almost as if the lawyer thought that Carmack had come up with the whole concept of a BSP or something.

A couple other minor things I noticed:

"Make distribution copies only using high quality disks and duplication technology" - wtf? id Software was apparently concerned you would distribute your level editor on cheap floppies or something?

"This License shall begin on the date Id Software executes this Licensee" - heh, harsh

Also I havent researched it (and I'm not about to), but I'm not sure how much caselaw, if any, there was in America (and Texas especially) regarding reverse engineering of software. It seems "obvious" that if you have a (legal) copy of a compiled program, and you manage to figure out how it operates and make a utility that can produce files that program can use, that's perfectly legal. But this wasn't really codified until 1998 with the DMCA so I don't know what the legal status of such things would have been considered to be in 1994.

Share this post


Link to post

Haha - nice flashback... I guess Wilbur was in a hurry to make it to the local steak house or strip club.
Legend has it that he was just wearing a cowboy hat and a tie when typing those legendary lines on his 700lb laptop.

On the other hand it's understandable that they wanted to protect their, at the time, unique technology as much as they could.
Folks not into tech would never be able to tell that basic algorithms used in the program are nearly as old as computing itself and its their proficient application that's making the difference.

Share this post


Link to post

I was always puzzled as to why the Tower of Babel was so short, and why you started out already inside of it. But now I realize.

The fight with the Cyberdemon takes place on top of the tower.


Makes me wonder what the rest of the tower was like, and in an unrelated note, makes me wonder what the Cyberdemon fight would have been like if the courtyard (?) had been a pristine garden as opposed to a gravel pit.

Share this post


Link to post

I just found out that Heretic has some flats that are 64x65, because its scrolling algorithm sucks and leaves gaps. Scrolling with a normal 64x64 flat creates tutti-frutti type lines. This is also probably why Hexen has some 64x128 flats.

Share this post


Link to post

Didn't old versions of Doom refer to it as the "DOOM operating system" on start up? I Might be remembering wrong.

Share this post


Link to post
Doomkid said:

Didn't old versions of Doom refer to it as the "DOOM operating system" on start up? I Might be remembering wrong.


Yeah something like that, but this version came out of a compiled executabe so it refers to the variables with
those %i things... to put it in a stupid way.

Share this post


Link to post

I just found out that if you delete Map01 from the Doom 2 IWAD, the game will enter a special "store demo" mode where it will just loop through the demos and ignore all input.

Share this post


Link to post

Three things I didn't know about the Icon of Sin:

1) The spawn cubes telefragging the player is not a special property of the spawn cubes themselves; it's a special property of the map! Turns out that the code has a check that prevents monsters from teleporting to a spot if there is already something there. For Doom 2, they simply added in a check to see if the game was on Map30, and if so, allowed monsters to telefrag. This means that a) boss spawners won't work right on any other map, because monsters can get stuck in other monsters if they spawn on top of each other, and b) on Map30, monsters can actually go through normal teleporters and telefrag things!

2) The spawn cube doesn't actually care about where its spawn target is. I always assumed that the game code had some check for when the cube was touching the target and only then would it spawn the monster. What actually happens, though, is that when the spawn cube is created, the game gives it a countdown timer that's equal to a calculation of how long it ought to take to reach the spawn point (distance divided by velocity), then the spawn cube "dies" and spawns the monster.

3) I knew about the bug where if a spawn point was directly to the left or right of the spawner, the spawn cubes would never actually spawn a monster and instead would just fly endlessly, but I didn't really know why. (yes this is largely explained on the doom wiki but I didn't look it up until after I had figured this all out.) It's because the game code takes a shortcut in determining the distance and velocity of the cube: it only uses the y component! So the countdown timer is initialized to 0, because there's 0 y-distance to travel. (as an aside, it's lucky that the game uses a chopped down floating point table, or else it would crash with a divide-by-zero error since the cube would have 0 y-velocity.) So why doesn't this make the monster spawn instantly? Because the check to see if the countdown is finished goes:

if (--mo->reactiontime)
return;	// still flying
It decrements the value before even checking it! So on the first check, mo->reactiontime (the variable used for the countdown timer) is already -1, and C interprets any negative number as "true". In the original game, "reactiontime" is stored as a signed (16-bit?) integer. Doom seems to handle integer overflows by wrapping them around to the other side, so since the boss cube logic is updated every 3 tics, boss cubes might actually not last forever, but end up spawning their targets about 65536*3/35/60 = about 93 minutes later.

I just checked this in PrBoom-plus by making a custom Map30 and a custom DEH that only spawns a single cube, then sped up the game and let 93 minutes pass by. And yup, a monster spawned!

Share this post


Link to post
Linguica said:

I just checked this in PrBoom-plus by making a custom Map30 and a custom DEH that only spawns a single cube, then sped up the game and let 93 minutes pass by. And yup, a monster spawned!


This is quite a systematic proof. Great scientific work. Congratulations.

Share this post


Link to post
LigH said:

This is quite a systematic proof. Great scientific work. Congratulations.

Well, that just means it happens in prboom-plus, I am not sure if it would also happen in doom2.exe. I don't really feel like opening dosbox and waiting for an hour and a half to check.

Share this post


Link to post
Linguica said:

the boss cube logic is updated every 3 tics, boss cubes might actually not last forever, but end up spawning their targets about 65536*3/35/60 = about 93 minutes later.

Well, that's quite different from Gez's 12 years, fun to know I guess. :)

Share this post


Link to post

Now make a wad where you can reach secret exit only by arch-vile jump from the 93min cube :/

Share this post


Link to post
Linguica said:

Well, that just means it happens in prboom-plus, I am not sure if it would also happen in doom2.exe. I don't really feel like opening dosbox and waiting for an hour and a half to check.

Record a demo in Prboom-plus, and play it back in Doom2.exe/Dosbox with -timedemo.

Share this post


Link to post

Of course, there will be a difference between 16 and 32 bit integer overflows. This bit may be source port dependent.

Share this post


Link to post

Are integers in the original Doom 32-bit? I mean it's friggin DOS. I wasn't really sure, since I know that C doesn't mandate a specific size for integers (beyond "at least 16 bits"). If that's the case, then yeah, it would take like 12 years in doom2.exe.

edit: oh right, DOS extenders and such. ugh, never thought I would have to think about that again.

Share this post


Link to post

I was going to post "someone should use Cheat Engine and try and make this number overflow" but then I thought, hey I'm someone!!

First a refresher. a 32-bit signed integer, when it drops below zero, goes from 0, which is

0000 0000 0000 0000 0000 0000 0000 0000

to -1, which is

1111 1111 1111 1111 1111 1111 1111 1111

via two's complement arithmetic. So that means that the overflow, which takes place at -2,147,483,648, is at

1000 0000 0000 0000 0000 0000 0000 0000

and then it will overflow to 2,147,483,647, or

0111 1111 1111 1111 1111 1111 1111 1111

I only bring this up because Cheat Engine shows values as unsigned, so what we are really looking for is the value to drop from (unsigned) 2,147,483,648 to 2,147,483,647, and we know that right there is where the number rolled over.

So anyways, here I am, having found the exact memory address where the spawn cube's reactiontime is located. Please note that I am running the actual original doom2.exe in DOSBox so this is the Real Deal. The one caveat is that I used Dehacked to patch the EXE to make the demon spawner only ever spawn a single cube. This makes absolutely no difference to the mechanics of this, it just made it more manageable.



As you can see, I've found the value, and it appears to be a very large unsigned number because of how two-complement works, when in reality it's actually around -1700 or so at the moment.

Now I change the value to (unsigned) 2,147,483,663, which is equivalent to

1000 0000 0000 0000 0000 0000 0000 1111

and therefore -2,147,483,633. Now we just need to wait for the number to keep dropping and roll over to below 2,147,483,647:



It may not look like much, but there it is. I'm probably the first person on the planet to actually see the spawn cube's reactiontime value roll over :) Now I don't really feel like waiting another 6 years to get to the payoff, so:



Et voila!

Share this post


Link to post

Yet another thing I just found out: the Mancubus's first volley has a fireball that goes 11 degrees to the right of the player, but the second volley has a fireball that goes 22 degrees to the left. I always thought they were symmetrical.

Share this post


Link to post

Meant to post this a while ago.
Here's Doom 2's SKY1, (I think manipulated a little, dont have the original on-hand)



Here's the image in negative.



Just a photo of normal clouds or random coincidence?

As a test I found this random image of clouds



negative colors looks like this. Looks pretty close!

Share this post


Link to post

No real surprise. Game graphic designers often have solutions simpler than expected.

Share this post


Link to post
40oz said:

Meant to post this a while ago.
Here's Doom 2's SKY1, (I think manipulated a little, dont have the original on-hand)[...]


Funny, by today standards, that it's so small. Like, 320x200 used to be *whole* screen.

Share this post


Link to post
40oz said:

...


Interesting find - efficiency is key.
The brown sky looked kinda earthly but also kinda off... perfect fit.

Share this post


Link to post
Guest Unregistered account

Doom95, for some reason, cannot withstand screenshots and the palette just collapses for some reason. It looks even uglier than usual with most PC screens.



By the way, what's the deal with Doom95's palette disfiguration? Sometimes it appears looking fine and other times it just looks as though your printer ran out.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×