Jump to content

Dune II editor with 1.07 support


Recommended Posts

Posted

Don't diss the Text UI - I've wanted to make something like this ever since I saw Mix Manager, and this was my chance to do it ;D

I just wish I could compile it as true DOS exe, so you could use it on real DOS or in DOSBox, but TP7 doesn't accept functions that return a custom data type :-

(all my internal traffic uses an array of 4 bytes as data type)

I might fix that once I find a good way to split 32-bit integers into bytes in pascal, but the fact you can't make those unsigned makes that REALLY annoying.

Or I could cheat and use the first 4 bytes of a string to carry binary data... :P

Nyerguds, maybe you'd also add support for my Super Dune II SE executable (SD2SE.EXE). It's based off US DUNE2.EXE (v1.07), but even after I rename SD2SE.EXE to DUNE2.EXE, your editor doesn't seem to recognize it - probably it's been too heavily modified :)

It recognises the game on the position of the internal "DUNE2.EXE" string... you modified that. Doesn't SD2 work without modifying that string?

Posted

I might fix that once I find a good way to split 32-bit integers into bytes in pascal, but the fact you can't make those unsigned makes that REALLY annoying.

Why do they have to be unsigned?

Could you export all data to a web page, so it's easy for everyone to look at it?

Posted

Why do they have to be unsigned?

With unsigned you can just divide by 256 each time to get the next byte... it's easier.

Could you export all data to a web page, so it's easy for everyone to look at it?

what, all the unit/struct data in Dune II? what's the use of that? Anyone with a Dune2.exe can download the tool and look up anything they want in seconds.

Posted

With unsigned you can just divide by 256 each time to get the next byte... it's easier.

what, all the unit/struct data in Dune II? what's the use of that? Anyone with a Dune2.exe can download the tool and look up anything they want in seconds.

For example, it's not easy to compare all values in a single field, as you can only show one unit at a time.

BTW, does anyone know how to position a turrent ona  body? Just drawing them on top doesn't work well and just centering them isn't enough either I think.

Posted

It recognises the game on the position of the internal "DUNE2.EXE" string... you modified that. Doesn't SD2 work without modifying that string?

No, the EXE doesn't work if its actual name is different from the internally defined one. Thanks for the info anyway :)

Olaf, here's a Dune II stats file I compiled a while ago. It's not 100% complete (meaning not all variables are present), and the unit sight values are inaccurate (because I used the old Dune II editor), but it's something to start with I guess.

dune2stats.txt

Posted

Olaf, here's a Dune II stats file I compiled a while ago. It's not 100% complete (meaning not all variables are present), and the unit sight values are inaccurate (because I used the old Dune II editor), but it's something to start with I guess.

Nice, that's what I meant. I guess I'll just write an exporter myself to export it all to a nice web page.

BTW, does the HS Dune 2 still run under Windows XP? IIRC I did have a version that run under XP, but the HS one just freezes. Maybe it's a setup setting I missed.

Posted

Normally, if you put the first sound option on sound canvas (6) and the third on Sound Blaster Pro (3), and tell it to use XMS, it should work...

Apparently the generated sound effects like the Sonic Tank's weapon don't work if you put the second option on SBP... I tried every option, but the best option was the crappy MIDI (so also 6-Sound Canvas) one :(

Oh, if you don't have the 3-language setup with all sound options enabled... it's here:

http://nyerguds.arsaneus-design.com/dune/dune2fun/d2setup_3lan.zip

For example, it's not easy to compare all values in a single field, as you can only show one unit at a time.

Eh, have you tried my editor? All you need to do is scroll down on the units list and look at the option's value that changes in the 3rd section. It's really handy for comparing values, and you even have a hexadecimal mode for better insight in the byte storage.

BTW, does anyone know how to position a turrent on a  body? Just drawing them on top doesn't work well and just centering them isn't enough either I think.

Not a clue, sorry... that's probably a question for Stefan or some other people who made a D2 remake :-\
Posted

Just follow the good old Norton Commander style - everyone knows it ;)

You know - blue/white cyan/black and so on.

Unfortunately I switched to VB before I could get my hands on a TP7 but I did manage to make a few pretty cool text-based window interfaces in TP6 before I went graphic. Those neat animated popup/push-back windows that Symantec used back then in the Norton Commander and Norton Integrator products. Granted it costs a lot more code/data to have them but they look nice :)

Just a thought ...

Posted (edited)

Eh, I'm not adding mouse support you know... and my editor doesn't need any buttons tongue.png

NC scheme? Hm... black on cyan might be better for the selection.

Also, this is made in Dev-Pascal, which uses the FreePascal compiler. It has the advantage that it allows stuff like functions that return custom defined data types.

[edit]

Dammit, for some reason a load of colours (LightCyan, white, DarkGray...) don't work correctly when used as background colour... and the dark cyan doesn't really look good for this.

This is the closest I can get...

image.png.e6d8be204877305e41cc9c628e95e266.png

Edited by Nyerguds
Posted

Dammit, for some reason a load of colours (LightCyan, white, DarkGray...) don't work correctly when used as background colour... and the dark cyan doesn't really look good for this.

Hehe, that's because there's only 3 bits available, so only 0 - 7 work.

Posted (edited)

All right... I'm sticking with this colour scheme.

v1.9.0

-Fixed a bug which caused the program to turn any negative integer input into -1. The fact this went unnoticed for so long is simply because Dune II doesn't use any negative values besides -1. Still, better to have it fixed :)

-Added coloured interface

http://nyerguds.arsaneus-design.com/dune/dune2edit/d2editor_v1.09.0.zip

Besides a bunch of unknown entries, I guess this is it...

Edited by Nyerguds
Posted

eh really? That's odd. It works for foreground colour...

That's because there are 4 bits available for it. Well, actually even 5.

Posted

I've completed my analysis of the ICON.MAP file and updated my documentation of the file. Nyerguds has already mapped the EXE file for the data needed to handle the contents in the ICON.MAP file. The EXE should contain the tile dimensions for each structure and there might be a reference in there for the number of frames in each structure.

It turns out that ICON.MAP actually is a 743 entry file of integers/words.

More info at www.junkyard.dk ... (note: I'm soon moving the site to www.dune2.dk - just awaiting the access codes).

Posted

The actual number of building frames and their usage is probably hardcoded somewhere else... since it can get quite different for each building. It's also linked to the building's specific function (refinery, starport, repair)

I don't think any of the games I've modded has ever allowed me to modify the number of frames and their usage from the structures' default data.

But if we can modify that icon.icn and adjust the icon.map, we CAN correctly change building foundations now :)

A few notes though...

1. The entire icon.map explanation on your site doesn't mention icon.icn ANYWHERE... better fix that.

"That means the following 27 entries are the pointers to tile sets found in the file"

but it never says which file the TILES are in :P

2. You say that entry 8 and all entries starting from 11 are buildings, but entry 6 is actually also a building... the wall :P

3. Your "sample decoding" is actually a sample ENcoding. Decoding would be starting from the indexes and creating the final frame from it. In fact, I think it'd be better if you switched those 3 columns around.

4. could you add a few more samples like that, like one of the animation frames of the weapons factory, and a buildup or rubble frame that partly uses frames from another one? Just to get a more clear view on how tiles are recycled.

5. Did you mess with the palette for these tiles? The normal default house colour for Dune II is red... I can't check it because you optimized their colour depth so they lost their original palette :-

And what's with the House of Ix frames? It seems that no matter who extracts them from the icon.icn file, these top colours are always wrong...

Posted

I'm planning a seperate page for ICON.ICN since it's a totally different format. Remember that the ICON.MAP file only maps the tiles needed to display the different structures, landscapes and walls - it's only a tile reference handler.

Nyerguds: You have already found the double-byte entry in the .EXE that contains the foundation size: 1x1 / 2x2 / 3x2 / 3x3. This information can be used to calculate how many tiles are used for each frame. Since ICON.MAP contains pointers to the entire frame set it's simply a matter of calculating the number of frames. Take the House Palace for example: You'r editor shows that the House Palace has a foundation size of 3x3. My reference page describes that the House Palace has 36 tile indexes in its list. 3 * 3 = 9 tiles ~ 36 / 9 = 4 frames. The foundation size is all that's needed compared to what's found in the .MAP file. Simple math :)

1. I can see what you mean - I'll update the info to include info that the tiles are in the ICN file.

2. I'm aware of this fact but since the walls don't follow the same "frame-structure" as the other structures does I've chosen to exclude the walls from that info.

3. It shouldnt be a problem reversing the sample but it's still a decoding of Westwood's format into something we can handle - encoding it would be going from a tile setting of our own into the format Westwood uses - but that's a different discussion :)

4. I'll setup a complete sample list for one of the structures including all the frames.

5. I've used IBM.PAL as my palette reference since this is the game palette. When extracting the tiles "raw" from ICON.ICN they use the Fremen color set as their house reference color for tiles above index 210 - a brownish set of colors. In all my sample icons I have optimized the colors for the tiles for quicker download (some are still on dial-ups). I've replaced palette index 0 (which is black and Westwood treats this color index as "transparent") with color index 239 which is magenta. Tiles 0 to 124 show this replacement to allow viewing of the fog-of-war tiles among others. I've also replaced the Fremen colors with the Ordos colors in order to make flags and other house specific features more visible.

My IX tiles show the same color errors as the other extraction samples I've seen so I'm guessing that I got the decompression about right. The wrong colors make up three dark brown colors which should be replaced with three blue shades to make the tiles look right. Tiles 286 to 290 should have colors 200, 201 and 202 replaced with colors 152, 153 and 154 in that order - this fixes the brown dots on the IX tiles.

I'll explain all this on my ICON.ICN page when I finish it. At the moment I'm in the process of restructuring the pages and moving them to my new domain. Once I have everything moved to the new domain I'll upload complete sets of tiles - a "raw" extraction from the ICON.ICN files and a few sets of patched tiles to make them look right.

Thanks a bunch for the feedback Nyerguds - greatly appreciated :)

edit: My guess is that it might be possible to extend the ICON.MAP file to include more tile index references - say add a few more animation frames to a given structure. If for example the 4 frames for the House Palace is extended by another 9 tiles and the rest of the pointers are moved acordingly it might be possible to add another frame to the House Palace animation - say to include a frame from the Starport. I have not tried modifying the ICON.MAP file - it's just a guess. Given that there doesnt seem to be a frame-count reference anywhere I'm guessing that Westwood simply calculates the number of frames for each structure given the number of tile indexes found in the ICON.MAP file.

I've updated my ICON.MAP page and I've added the last three frames for the House Palace at the bottom of the page.

Posted

My IX tiles show the same color errors as the other extraction samples I've seen so I'm guessing that I got the decompression about right. The wrong colors make up three dark brown colors which should be replaced with three blue shades to make the tiles look right. Tiles 286 to 290 should have colors 200, 201 and 202 replaced with colors 152, 153 and 154 in that order - this fixes the brown dots on the IX tiles.

Isn't IX right on this one?

http://xhp.xwis.net/temp/dune2_icons_2.png

There is an issue with the hi-tech factory though. For some reason the open dome isn't shown.

Posted

Yes - the colors on the IX structure are correct on that image and yes the open dome images are missing on that image. I'm setting up the Hi-Tech factory frames on my ICON.MAP page right now - just to show another structure that has more frames.

Posted

Nyerguds: You have already found the double-byte entry in the .EXE that contains the foundation size: 1x1 / 2x2 / 3x2 / 3x3. This information can be used to calculate how many tiles are used for each frame. Since ICON.MAP contains pointers to the entire frame set it's simply a matter of calculating the number of frames. Take the House Palace for example: You'r editor shows that the House Palace has a foundation size of 3x3. My reference page describes that the House Palace has 36 tile indexes in its list. 3 * 3 = 9 tiles ~ 36 / 9 = 4 frames. The foundation size is all that's needed compared to what's found in the .MAP file. Simple math :)

I wasn't talking about the tiles - my point was that there's no place to adapt the number of FRAMES a building uses. You need to know it has four frames to do that calculation.

edit: My guess is that it might be possible to extend the ICON.MAP file to include more tile index references - say add a few more animation frames to a given structure. If for example the 4 frames for the House Palace is extended by another 9 tiles and the rest of the pointers are moved acordingly it might be possible to add another frame to the House Palace animation - say to include a frame from the Starport. I have not tried modifying the ICON.MAP file - it's just a guess. Given that there doesnt seem to be a frame-count reference anywhere I'm guessing that Westwood simply calculates the number of frames for each structure given the number of tile indexes found in the ICON.MAP file.

I've updated my ICON.MAP page and I've added the last three frames for the House Palace at the bottom of the page.

This will not work... I tried giving the palace a 2x2 foundation, in which case it would have far more tiles for animation frames. But it doesn't use any more. It just creates its frames with the information that is there, assuming it has a 2x2 foundation, meaning it just displays all the wrong tiles.

After all there is no real separation between the tilesets of different frames of a single building.

The actual number and function of the frames is an entirely different matter, which, as I said, is often related to the function of the building, and thus probably very hard to edit.

Posted

Yes - the colors on the IX structure are correct on that image and yes the open dome images are missing on that image. I'm setting up the Hi-Tech factory frames on my ICON.MAP page right now - just to show another structure that has more frames.

In that case I think there's a bug in your decoder. ;)

I'm wondering why the hi-tech factory is wrong. I only hard-coded foundation size and frame count for each building.

Posted

Nyerguds:

I see your point.

Hmmm ... assuming Westwood used a common function to handle the structures there should be a frame count reference somewhere. It might be combined with a reference to the number of animation frames for flags, open/close, direction. Maybe some of those unknown entries in the EXE are actually these references.

Olaf:

There might be a bug in my ICN decompressor - I can't say for sure. I've CRC32 compared ICON.ICN and ICON.MAP from the 4 different versions of the game that I have - there are no differences between the 1.07-* versions but theres a difference in size of the ICON.ICN file in version 1.00 - have a look :

Version 1.00:

ICON.ICN: 54,231 bytes (CRC32=E120B498) - ICON.MAP: 1,486 bytes (CRC32=0F8F7909)

Version 1.07-US/EU/HS:

ICON.ICN: 52,893 bytes (CRC32=899F52EC) - ICON.MAP: 1,486 bytes (CRC32=B0667D96)

If there is a bug it might just be a question of realigning the reference pointers to the remap table in the ICN file to get the correct tile graphics. I'm not done figuring out how the ICN compression works - I'm hoping I'll be able to figure it out and realigning the decompression to get the correct graphics.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.