the Phrozen Forums
  Mod Making Tools
  Ds1 to Dt1 relations (Page 2)

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone!
This topic is 3 pages long:   1  2  3 
next newest topic | next oldest topic
Author Topic:   Ds1 to Dt1 relations
Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 04 April 2002 09:42     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
Warning : a giant's step is done : I made the scene of Tristram with the walls and floors, and it's pretty good (except 1 corner's tile in the upper part of the town, *sight*). Here's the jpeg to look at (860 kB, the original pcx was 14 MB) : http://paul.siramy.free.fr/_divers/ds1/ds1layer.jpg . But here's a preview with a zoom of 20% :

Now, infos that all users of islweo's ds1 editor will apreciate : In tristram, here are the meaning of the 7 layers ("map") :
* layer 0 : Walls 1
* layer 1 : Orientation of Walls 1
* layer 2 : Walls 2
* layer 3 : Orientation of Walls 2
* layer 4 : Floor 1
* layer 5 : Floor 2
* layer 6 : empty

The game draw the layers in that order : Floor 1, Floor 2, Walls 1, Walls 2. Look at that screenshot :

See the shadow on the wall ? there is a tile with 2 wall's layer to do this : 1st the wall itself, then the tree. hence the 2 layers of floors. If there was only 1 floor, we couldn't have the tree AND the floor at that particular tile (I mean "cell" in ds1's editor). Check the ds1's editor, layer 2 and 3 : this is infos for trees, while layer 0 and 1 are for the stone walls.

Now, remember the functions "nb layers = x2 + (x3 * 2) + x4" I talk about in the topic "more infos on ds1" ? In tri_town4.ds1 x2 = 0, x3 = 2 and x4 = 2. We have 2 layers of floors and 2 layers of walls. I'm sure that the x3 is the number of wall's layers (hence the *2 : 1 layer for orientation and another one for index of graphism itself), and x4 = number of floor's layers. Now, there are only x1 and x2 to be discovered.

Ok, need some rest, today was a good day.

[This message has been edited by Paul Siramy (edited 04 April 2002).]

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 04 April 2002 11:27     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
I resolved my bug of the upper-left corner of house, or fence. But it's strange at first. Here's the tip : Look in the ds1 editor the layer (map) 1 : these corners are value 3. It don't means to draw the tile of the dt1 whith orientation 3, well not only. It also will draw another wall *at the same place* just after !

This time I have draw as usual the tile with orientation 3, but right after, at the same place I draw the tile with orientation 4. If you check the ds1 editor, in the corner's layer, you won't see some cell with the prop1 equal to 4, despite in the dt1 there ARE some walls with orientation 4. So, when you see such a corner (prop1 = 3) in the ds1 editor, that means the game will draw 2 tiles :
* orientation = 3, main_index = layer0.prop3 / 16, layer0.sub-index = layer0.prop2
* orientation = 4, main_index = layer0.prop3 / 16, layer0.sub-index = layer0.prop2

The use of "3" corners involve the draws of 2 dt1's tile, you must be careful with this.

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 05 April 2002 01:28     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
We're getting more and more close to a true level editor. I found 2 other things. Let's take Duriel's Lair

1) In the "lvltypes.txt", we see that "act2-tomb" have all this dt1 :

* Act2/Tomb/Tomb.dt1
* Act2/Tomb/Columns.dt1
* Act2/Tomb/Things.dt1
* Act2/Tomb/Statuerm.dt1
* Act2/Tomb/Treasure.dt1
* Act2/Tomb/Stairs.dt1
* Act2/Tomb/Duriel.dt1
* Act2/Tomb/Tombsteps.dt1
* Act2/Tomb/Secret.dt1
* Act2/Tomb/Talrasha.dt1
* Act2/Tomb/Serpent.dt1

Now, open the "lvlprest.txt". "Act 2 - Duriel's Lair" have 639 in "dt1mask". In binary this number is 1001111111 (higher bits on left, lower bits on right). That's indicating which dt1 are to be take for this ds1 : there are zero at position 8 and 9 (counting from right), so we won't take the dt1 8 and 9, hence we won't take the "Act2/Tomb/Tombsteps.dt1" nor "Act2/Tomb/Secret.dt1" files. If we do take them, we'll have tiles's conflict, so follow this rule for the good choice of dt1.

2) Now, let's draw the duriel's lair as I said before (images have a zoom of 50 %) :

You see there are some problems. I found why, correct my prog, and get :

In fact, the main-index in the ds1 layer is split into prop3 and prop4. Prop3 is the low nibble of the main-index, and the prop4 is the high nibble (a nibble is 4 bits, or half of a byte if you prefer). This encoding reminds me of the one used in the d2s (savegame) files for items.

So, now, I'm almost sure the main-index is computed like that :

main-index = (prop3 / 16) + (prop4 * 16)

and the drawing is a lot more correct.

EDIT >>> I have just updated the tristram's jpeg. You don't have to look at it, because it is not perfect. There are some corners problems, the fence is really too much regular (I have to put some random variations into it), and there is still 1 blue square in the river. Still, it's improving. Now, an importnat precision. The formula is not exactly "main-index = (prop3 / 16) + (prop4 * 16)" : the prop4 can have value higher than 127, and it cause problems. So the correct formula is :

main-index = (prop3 / 16) + ((prop4 & 0x0F)* 16)

If you prefer a less "C language" notation :

high-nibble of main-index = low-nibble of prop4
low-nibble of main-index = high-nibble of prop3

I wonder what the high-nibble of prop 4 is... maybe a sort of a sub-sub-index ? maybe the "frame" in the dt1 ? Or just a flag... Have to check it.

[This message has been edited by Paul Siramy (edited 05 April 2002).]

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 05 April 2002 09:46     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
As I suspected, there are some kind of random variations of the graphism in the game. The stonewalls of tristram, some ground... If in the dt1 there are more than 1 tile (block) that have the exactly same combination of orienation / main-index / sub-index, then the gamme will choose 1 of the tile randomly :

I may be wrong now, but I think that if in the dt1 the tile have a value of frame not equal to 0 (zero), that indicate this tile is a part of a set of variations. Stangely, I saw some stone walls with 0 and 1 (it's ok), but also with 2... I wonder what this 2 means. And if there's such an information in the ds1.

IP Logged

MPHG
Forum Admin.


MPHG

Posts: 1633
From: simwhere
Registered: Jun 2001

posted 05 April 2002 10:12     Click Here to See the Profile for MPHG   Click Here to Email MPHG     Edit/Delete Message   Reply w/Quote   Visit MPHG's Homepage!
that is sooo great. I'm greatly look forward to this editor any idea when it will be realsed if the current rate of decoding is continued?

------------------
Come stay a night at my Dragon's Inn

Remember to have your Deeds recorded on the Imperial Scrolls of Honor.

IP Logged

Olorin
Honorary Warlord


Olorin

Posts: 471
From: Gardens of Lórien, Valinor.
Registered: May 2001

posted 05 April 2002 13:09     Click Here to See the Profile for Olorin   Click Here to Email Olorin     Edit/Delete Message   Reply w/Quote   Visit Olorin's Homepage!
All I say is wow, and keep up the great work!

------------------
"For I am Olorin! And Olorin means me!"

IP Logged

Alkalund
Honorary Warlord

Posts: 614
From: Florianópolis, Santa Catarina, Brazil
Registered: Apr 2001

posted 05 April 2002 13:32     Click Here to See the Profile for Alkalund   Click Here to Email Alkalund     Edit/Delete Message   Reply w/Quote   
Wow Paul Siramy, I'm very impressed, the dream of a WYSIWYG level editor is slowly coming true by your hands

Keep us informed, it is alway a pleasure to check out your progress

------------------
"Get me a balrog attack-1 hand-to-hand animation, and I want it yesterday, the paladin is almost here!" ---> DMA1HTH @ offset 0006A480h. - Myhrginoc

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 05 April 2002 13:40     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
The prog which I use right now is NOT an editor. It's more or less a beta viewer. In fatc it's more a Scenary Maker : you give the prog the ds1 and each of the dt1 to look for, and it make this whole (geant) pcx. It's for testing purpose. I'm sure I won't make the editor in a straight manner. I see more or less what will be usefull (and I may have to calm down, 'cause if I really make what I'm intented to, I can die peacefully after this), but I don't see how to code it *properly*, cause good coding is an art .

So be prepared for a lot of beta editor (and in full-screen, md-dos, and the very first with only keyboard ). I'm almost sure the first try will just be a viewer, you'll move a square, and you will be able to draw / desactivate the layers. In any case, I will only work in the reading of dt1 in the mpq only at the end, so you'll have to extract all the dt1 and ds1 somewhere on your disk (reserve 161 mB right now )

IP Logged

Olorin
Honorary Warlord


Olorin

Posts: 471
From: Gardens of Lórien, Valinor.
Registered: May 2001

posted 05 April 2002 13:57     Click Here to See the Profile for Olorin   Click Here to Email Olorin     Edit/Delete Message   Reply w/Quote   Visit Olorin's Homepage!
All ready extracted the dt1s and ds1s when I found the keep, in anticipation.

------------------
"For I am Olorin! And Olorin means me!"

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 05 April 2002 14:29     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
Damn, so quick. Ok, I'll give here my "scenary maker", but in order to be usable for anyone else than me it needs some modifications first. I'll give it tomorow I hope.

IP Logged

Olorin
Honorary Warlord


Olorin

Posts: 471
From: Gardens of Lórien, Valinor.
Registered: May 2001

posted 05 April 2002 14:47     Click Here to See the Profile for Olorin   Click Here to Email Olorin     Edit/Delete Message   Reply w/Quote   Visit Olorin's Homepage!
Great stuff! Cheers!

------------------
"For I am Olorin! And Olorin means me!"

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 06 April 2002 05:53     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
Here's the Scene Maker zip I talked about. Just 170 kB.

The random variations of floors / walls is not implemented, and there is still some problems with some ds1. read the Readme.txt and provide me with the results of your tests

EDIT >>> just a small precision : it's not really a scene maker but a viewer : you won't made any ds1 from this prog, you can only see a big preview of the ds1.

[This message has been edited by Paul Siramy (edited 06 April 2002).]

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 06 April 2002 11:20     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
I have just updated the precedent zip. Now it draw the upper part of tent and house correctly :

If a wall's tile have an orientation of 15, then the bitmap must be draw 160 pixels higher. When I mean higher, since the 0 of the bitmap is in the upper part, in fact the y of the drawing must be minus by 160, of course. With that, the buildings in harogath are correct too, as for larzuk (but there are still some problem in there). It does make sense to draw this bitmap higher for me, since they are objects above the floor. This is important for player / wall drawing priority.

I added 3 more .bat files : baal lair, worldstone, 1 variation of nilhatak temple (the biggest of all ds1).

[This message has been edited by Paul Siramy (edited 06 April 2002).]

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 06 April 2002 17:26     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
I found a problem. The roof of tent and house are now good in rogue camp, and most of them in harogath, but ... there are various height to draw this roofs. They aren't all to -160 pixels. If in rogue camp I need to do -160 pixels, in harogath I need both -160 and another unknwon value, and in fortress the roof is -240 pixels. I'm almost sure this height of the roofs have something to do with the "flags" value we can see in the dt1. But I don't understand it all. I tried a thing, and when it was all corect for fortress and rogue, it was wrong in harogath. Another problem to resolved.

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 07 April 2002 06:54     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
I know this is not related to this topic but ... Here's a method to make dt1's walls easily :

Draw your wall as always (flat method), then each 2 pixels in X, move them all by 1 pixel in Y. You better have to draw your wall in true color format, then move the pixels, and only after convert the bitmap to 256 colors.

EDIT >>> This method is not the best for creating bitmaps of good quality, but at least it's easy to make.

[This message has been edited by Paul Siramy (edited 07 April 2002).]

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 07 April 2002 09:22     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
Another little update of the above ds1scene.zip. This time it understand the high of some tiles. It works good in both rogue camp, fortress, and harogath, so I think this problem may be resolved now... except that in the fortress I see something and I still have a little doubt :

Ok, so to put all the drawing infos in one place :

the tiles with an orientation of 0 or 15 must be draw 80 pixels lower than the other ones. That means that the floor and the gfx that are above them (roofs), must be draw lower.

Now, after this first offset, there is another. The data that I used to call "flags" in the dt1 is in fact at least 2 datas. The first 2 bytes are an Y offset for the drawing, and the 2 others are still flags. After the first 80 pixels lower offset checking, you must minus the resulting Y position of the drawing by the value of what I call now "Y delta" (berk), the first 2 bytes of the old "flags" data.

Now, you can have a pretty much more correct drawing of the roofs. But there are still problems in harogath.

Btw, I change a thing, but it won't be very interesting for you I think : now, instead of output the infos on the screen, it output them in the file stdout.txt. And I have reformated the cell infos, so it's easier for me for debuging, when I have to compare my prog's datas with the islveo's ones.

[This message has been edited by Paul Siramy (edited 07 April 2002).]

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 07 April 2002 12:51     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
Just a little info I found in the dt1 format, by chance : the "flags" data, which is now 2 bytes, contain some sort of info of the sound to play when the player goes on it. In docktown of Kurast, act3, the flags value is (in hexa) 0x0080, and it's wood. When I try with 0x0000 I got the same sound as the usual ground (stone), and when trying 0x0090 and 0x0010 I got another ones (my ear and memory are not good enough to tell you what this sounds are).

I think this not the only ones info the "flags" data contain, but at least there is :
* the environment sound of the tile
* a bit is set when the floor is animated.

[This message has been edited by Paul Siramy (edited 07 April 2002).]

IP Logged

MPHG
Forum Admin.


MPHG

Posts: 1633
From: simwhere
Registered: Jun 2001

posted 07 April 2002 13:11     Click Here to See the Profile for MPHG   Click Here to Email MPHG     Edit/Delete Message   Reply w/Quote   Visit MPHG's Homepage!
Paul check your mailbox, I just emailed you with some info, not sure if it may help you at all

------------------
Come stay a night at my Dragon's Inn

Remember to have your Deeds recorded on the Imperial Scrolls of Honor.

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 07 April 2002 14:39     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
Replied. And I think you'll be pleased

IP Logged

Olorin
Honorary Warlord


Olorin

Posts: 471
From: Gardens of Lórien, Valinor.
Registered: May 2001

posted 07 April 2002 16:22     Click Here to See the Profile for Olorin   Click Here to Email Olorin     Edit/Delete Message   Reply w/Quote   Visit Olorin's Homepage!
Zehr kewl. ANd don't worry, folder directories with spaces in their names DO work. Now, need to view more pcx...

------------------
"For I am Olorin! And Olorin means me!"

IP Logged

MPHG
Forum Admin.


MPHG

Posts: 1633
From: simwhere
Registered: Jun 2001

posted 07 April 2002 17:06     Click Here to See the Profile for MPHG   Click Here to Email MPHG     Edit/Delete Message   Reply w/Quote   Visit MPHG's Homepage!
Very good I'm going to go play around tomorrow with a few ideas i have.
Thank you for letting a crazy person play with a crazy idea

------------------
Come stay a night at my Dragon's Inn

Remember to have your Deeds recorded on the Imperial Scrolls of Honor.

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 07 April 2002 19:08     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
quote:
Originally posted by Olorin:
Zehr kewl. ANd don't worry, folder directories with spaces in their names DO work. Now, need to view more pcx...


Just a tought I have : If you want to save some time in the creation of the .bat, you can put more than 1 command line in the bat. So, let's say you make a .bat for all the town, or for a zone of an act... The bat will make a pcx, then the 2nd, and so on ... that can save your time, by not copy / edit ALL the .bat, as I said in the readme.txt.

I'm working right on some "cosmetic" updates of my dt1 tools : my dt1viewer now draw the roof, and split the "flags" data into 4 part. but I'll only update the zip on my website when I'll have modified all my exe. Correct some tiny bug here and there too. Now, I just have finish the dt1viewer, and I'm tired, good night...

IP Logged

Myhrginoc
Honorary Warlord

Posts: 968
From: Percussion U
Registered: Dec 2001

posted 07 April 2002 21:43     Click Here to See the Profile for Myhrginoc   Click Here to Email Myhrginoc     Edit/Delete Message   Reply w/Quote   
If you are updating your dt1tool, would it be possible to have the option to put all information for a block on a single line with comma or tab separators? I have an idea to collect all of the information, like I did with the DCCs and COFs (now posted, btw). But the vertical format in the .ini files is harder to parse.

------------------
“It is an old maxim of mine that when you have excluded the impossible, whatever remains, however improbable, must be the truth.” -- Sherlock Holmes

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 08 April 2002 02:17     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
Of course it is . You're planing to make a .txt readable by excel don't you ? No problem. It just recquire me to work on the output format. Let's say the dt1info.exe will output its info either in its current form, or à la d2'txt, it will be an option on the command line that will make the choice.

IP Logged

Paul Siramy
Knight


Paul Siramy

Posts: 98
From: Gannat, France
Registered: Mar 2002

posted 08 April 2002 04:05     Click Here to See the Profile for Paul Siramy   Click Here to Email Paul Siramy     Edit/Delete Message   Reply w/Quote   Visit Paul Siramy's Homepage!
You might have a problem, if you're planning to make a txt for Excel : Since there's a variable ammount of blocks, and sub-blocks, there are a variable of columns. So a copy / paste of 1 txt in another one (under excel) might bring some conflicts).

What sort of output do you want ? For easier readibilty, I think there will only be the interesting data when in excel mode (not the current output).

Let's say 1 line per block, a fix amount of column for the infos of the block, then a variable ammount of columns : a group of columns for each sub-blocks.

Problem : there are dt1 with more than 60 sub-block (like the worldstone), and then with 9 columns per sub-blocks, that will create near 600 columns, too much for excel.

How do you want to manage this ? Just tell me, I'll do it.


EDIT >>> I can even make a first line with the header's infos, then I skip a line, and then each another line is for each sub-blocks ? I can also provide some "title's line", I mean a line with the description of the column, 1before the header's info, then another one, before the sub-blocks. But will it fit your needs ?

[This message has been edited by Paul Siramy (edited 08 April 2002).]

IP Logged


This topic is 3 pages long:   1  2  3 

All times are Central Standard Time

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | The PhrozenKeep

© PhrozenKeep.com . all buttons made by the Evilenglishman . swords and shields by DigiBO.


Ultimate Bulletin Board 5.47c