Doom Comic
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Technical Question Regarding ZDoom
 
Author
All times are GMT. The time now is 05:32. Post New Thread    Post A Reply
DooMBoy
Heh
(but Stupidity still cannot be concealed)


Posts: 8509
Registered: 12-00


I'm just curious, exactly what happens when you load a wad into ZDoom?

__________________
Heh

Old Post 11-25-02 14:50 #
DooMBoy is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Julian


Posts: 2677
Registered: 04-75


err... it loads it? :P

Old Post 11-25-02 15:00 #
Julian is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
DooMBoy
Heh
(but Stupidity still cannot be concealed)


Posts: 8509
Registered: 12-00


Thank you, Julian, for that insightful post, and for telling me exactly what I already knew! :D

__________________
Heh

Old Post 11-25-02 15:10 #
DooMBoy is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Biffy
Forum Regular


Posts: 894
Registered: 02-01



DooMBoy said:
I'm just curious, exactly what happens when you load a wad into ZDoom?
It gets ready to play it for you, er, with you, er, against you. Pfft.

Old Post 11-27-02 02:47 #
Biffy is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
DOOM Anomaly
I am Weird Al


Posts: 3720
Registered: 08-02


Ummmm..DooMBoy, please restate the question and clarify what you are trying to ask here, cause the question seems kinda broad.

__________________
- -This has been yet another senseless post By: DOOM Anomaly- -
Post Helled Thread count -=3=- count Thread Helled Post
*~Scuba Steve is the star in my sky.~*
I Love Picklehammer! Do You?

Old Post 11-27-02 03:57 #
DOOM Anomaly is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
KDarigal
Junior Member


Posts: 159
Registered: 05-02


Step 1: ZDoom opens it using one of the standard C file-open calls (durrr, fopen()?).

Step 2: It reads the first four bytes to ensure that the file is either an IWAD or a PWAD. If not, you get an error and ZDoom probably quits.

Step 3: Having completed step 2 successfully, ZDoom reads the next four bytes to determine the beginning of the WAD directory.

Step 4: Starting at the location in the file just given by the result of step 3 (fseek() this time, I think), it starts reading in the entire WAD directory, which consists of entry-name/location pairs (8 bytes for the entry name, 4 for the location).

...if you need more info, I'll try and figure out what goes on afterwards, but this is enough for now.

__________________
beh to doom - hooray for ddr

Old Post 11-27-02 07:24 #
KDarigal is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
boris
meow


Posts: 3626
Registered: 05-00



KDarigal said:
Step 1: ZDoom opens it using one of the standard C file-open calls (durrr, fopen()?).

Well, I guess ZDoom uses C++ classes and methods to do that.

__________________
this sig is in my pants | WIP - WADs In Progress: post your WADs!

Old Post 11-27-02 11:50 #
boris is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5968
Registered: 08-00


Actually I don't think Randy has cpp'ized the wad code yet. I could check again though :P

Old Post 11-27-02 16:41 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DooMBoy
Heh
(but Stupidity still cannot be concealed)


Posts: 8509
Registered: 12-00


Hey, KDarigal, thanks for the info! I am enlightened! :)

__________________
Heh

Old Post 11-27-02 16:55 #
DooMBoy is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Biffy
Forum Regular


Posts: 894
Registered: 02-01



DooMBoy said:
Hey, KDarigal, thanks for the info! I am enlightened! :)
Of what use shall you now make of your enlightment, DooMBoy? :)

Old Post 11-27-02 18:57 #
Biffy is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
Enjay
ASK ME ABOUT FOOTBALL / STEAM / DEAD CELEBRITIES / THE BLAIR WITCH PROJECT


Posts: 6381
Registered: 12-00



KDarigal said:
Step 2: It reads the first four bytes to ensure that the file is either an IWAD or a PWAD. If not, you get an error and ZDoom probably quits.


Not sure about that one (like I would know) but Zdoom can read other files too. As, apparently can most ports, even the original doom.exe

If you present Zdoom with a file format it understands, it will read it and apply it:

eg, zdoom -file d_runnin.mp3 will happily load an mp3 called D_RUNNIN.MP3 and play it as the music on MAP01

eg2, zdoom -file mapinfo.txt will load a text file containing mapinfo style information and append it to any mapinfo information already present.

etc etc...

In addition, it supports other FPS game files to a certain extent:

It supports Blood format files to load the sounds for the Blood Bath Announcer.

It can read Build format maps and let you inspect them.

__________________
Meek

Old Post 11-27-02 21:28 #
Enjay is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DooMBoy
Heh
(but Stupidity still cannot be concealed)


Posts: 8509
Registered: 12-00



Biffy said:
Of what use shall you now make of your enlightment, DooMBoy? :)
I shall store it away in my brain, so that I might use this info when another person asks this very same question about a year from now :)

__________________
Heh

Old Post 11-27-02 22:10 #
DooMBoy is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Captain Red
Pants


Posts: 5359
Registered: 06-01



Enjay said:
It can read Build format maps and let you inspect them.


I did no know that! How do you load up, say, the first duke nukem 3d map?

__________________
Punch

Old Post 11-28-02 02:27 #
Captain Red is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DOOM Anomaly
I am Weird Al


Posts: 3720
Registered: 08-02



DooMBoy said:
I shall store it away in my brain[...]
..hmph, good luck finding one.

__________________
- -This has been yet another senseless post By: DOOM Anomaly- -
Post Helled Thread count -=3=- count Thread Helled Post
*~Scuba Steve is the star in my sky.~*
I Love Picklehammer! Do You?

Old Post 11-28-02 02:35 #
DOOM Anomaly is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DooMBoy
Heh
(but Stupidity still cannot be concealed)


Posts: 8509
Registered: 12-00


Speak for yourself, you always refer to yourself in the third person like a friggin' caveman.

__________________
Heh

Old Post 11-28-02 22:15 #
DooMBoy is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DOOM Anomaly
I am Weird Al


Posts: 3720
Registered: 08-02



DooMBoy said:
Speak for yourself, you always refer to yourself in the third person like a friggin' caveman.
DooMBoy find wrong with it?

__________________
- -This has been yet another senseless post By: DOOM Anomaly- -
Post Helled Thread count -=3=- count Thread Helled Post
*~Scuba Steve is the star in my sky.~*
I Love Picklehammer! Do You?

Old Post 11-28-02 22:17 #
DOOM Anomaly is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
rf`
Dr. Nosign


Posts: 8206
Registered: 11-01


I am not amused. Seriously, even I don't act that stupid. And mind you, I do have my moments...

__________________
Released wads and other doom crap

Old Post 11-29-02 00:29 #
rf` is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Captain Red
Pants


Posts: 5359
Registered: 06-01


Settle down children. don't make me bring pinky here...

__________________
Punch

Old Post 11-29-02 05:19 #
Captain Red is online now Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DOOM Anomaly
I am Weird Al


Posts: 3720
Registered: 08-02



ravage said:
I am not amused. Seriously, even I don't act that stupid. And mind you, I do have my moments...
Well, not to antagonize anyone here, but, If I actually did care what anyone thinks of me, Do you think I would be like this?? Didn't think so. Warn me as you will, but I go here as I do in everything else: Till The bitter end.

__________________
- -This has been yet another senseless post By: DOOM Anomaly- -
Post Helled Thread count -=3=- count Thread Helled Post
*~Scuba Steve is the star in my sky.~*
I Love Picklehammer! Do You?

Old Post 11-29-02 06:43 #
DOOM Anomaly is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
myk
volveré y seré millones


Posts: 15177
Registered: 04-02


I think you could scare some newbies with that "We are not amused" title. More so combined with the hooded skull avatar.

__________________
Warez All the Data?

Old Post 11-29-02 06:57 #
myk is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DOOM Anomaly
I am Weird Al


Posts: 3720
Registered: 08-02



myk said:
I think you could scare some newbies with that "We are not amused" title. More so combined with the hooded skull avatar.
I have a animated gif of the hereskull Dee-Lee thingy I did, it changes appearances, but I have no where to host it.

But hey, I'd love to scare off annoying newbs, but by doing that I would have to radicate of myself, so, hmm...

__________________
- -This has been yet another senseless post By: DOOM Anomaly- -
Post Helled Thread count -=3=- count Thread Helled Post
*~Scuba Steve is the star in my sky.~*
I Love Picklehammer! Do You?

Old Post 11-29-02 07:13 #
DOOM Anomaly is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DooMBoy
Heh
(but Stupidity still cannot be concealed)


Posts: 8509
Registered: 12-00


Heh, indeed.

__________________
Heh

Old Post 11-29-02 22:02 #
DooMBoy is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
rf`
Dr. Nosign


Posts: 8206
Registered: 11-01



DOOM Anomaly said:
I have a animated gif of the hereskull Dee-Lee thingy I did, it changes appearances, but I have no where to host it.

But hey, I'd love to scare off annoying newbs, but by doing that I would have to radicate of myself, so, hmm...


You don't need a host, check profile options. You can upload directly from your comp. See my new fish?

__________________
Released wads and other doom crap

Old Post 11-29-02 22:10 #
rf` is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DOOM Anomaly
I am Weird Al


Posts: 3720
Registered: 08-02



ravage said:

You don't need a host, check profile options. You can upload directly from your comp. See my new fish?

yes, but then its the matter of, I gotta figure out how.

__________________
- -This has been yet another senseless post By: DOOM Anomaly- -
Post Helled Thread count -=3=- count Thread Helled Post
*~Scuba Steve is the star in my sky.~*
I Love Picklehammer! Do You?

Old Post 11-29-02 23:31 #
DOOM Anomaly is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Filled with the code of Doom


Posts: 7485
Registered: 07-00


1. The source port opens the file for reading. Like Mdenham says, this is done with standard OS calls such as fopen.

2. The 'header' of the file is read. This basically just says the type of wad (IWAD/PWAD), the location of the directory in the file and the number of entries.

3. Part of WAD files is the "directory" which lists all the data which is stored in the file. You can see the directory by loading the WAD in WinTex/NWT. The doom port reads the whole directory into memory. Smart ports store it in a hash table. A hash table is a way of sorting through data such that you can look up things stored in it very quickly. So, if I want to find information about the lump named "TITLEPIC", I can search the hash table for the entry named "TITLEPIC" and find it almost instantly. The original doom used a linear search which is much less efficient (a linear search means searching through every entry in the list until you find the one you want). I believe the boom team quoted something around a 200-300% increase in framerate from just switching to a hashtable. Some ports still use a linear search.

4. Some ports sort things into namespaces (sprites, flats etc) based on the ?_START..?_END lumps and keep different lists for different types of data.

5. Consecutively loaded wads are stored in a "chain". When searching for a lump, the WAD code searches through each entry in the chain until it finds a match. New WADs are placed at the start of the chain. In this way, WADs can be used as "patches" which replace things loaded earlier (like the IWAD).

Last edited by fraggle on 11-30-02 at 23:42

Old Post 11-30-02 23:14 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 05:32. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Technical Question Regarding ZDoom

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.