Jump to content

Dune II editor with 1.07 support


Recommended Posts

As for the blinking colours, not sure if that can be fixed. My experience from C&C and RA1 tells me that every blinking colour is an actual palette entry that does that. So I kinda doubt these extra sides will have such a colour on the palette.

I think it just cycles through the colours from the remap part designated for each House. The only blinking colour in Dune II palette I know of is the one used for the Windtrap animation.

I've attached the files HOUSE.INI PROFILE.INI as they are presented inside the Dune: The Battle for Arrakis ROM. Those might be of interest, although most stats are identical to those in the official release (but some are not, e.g. the sandworm had 2000 hp as opposed to 1000). Another file is the stats from the Genesis game itself. Notice that most structures' hp are doubled compared to their PC counterparts. The only exclusion to this is the Repair Facility with its 1800 hp, which would mean a hefty 900 in the PC version, whereas it actually has only 200. I still wonder why both the Heavy Factory and the Repair Facility have such low hp in the PC version (200 each), while lower tech structures like the Barracks, WOR and the Light Factory have more than this figure. At the same time, these two have unprecedentedly high "threat rating" of 600.

Another thing that feeds my suspicions about the hp is this description of the Heaavy Factory by the Atreides Mentat:

The Heavy Factory produces all large vehicles, like the harvester and the heavier machines used for defensive purposes. The building itself is extremely well armored.

This might be a thing they changed while testing and then removed, bu still it seems kinda logical if the Heavy Factory had more hp.



Link to comment
Share on other sites

That byte just before the infantry spawn chance isn't actually used anywhere, right? Just included in the 2-byte value for the bit flags before it ;D

seems to be the case yeah, it is part of the structure options word but doesnt seem to ever be checked

Link to comment
Share on other sites

build menu is generated when you click the choam button, it uses the various hardcoded datafields, as well as some runtime ones

the code is similar to this,


Did you convert that code by hand, or did you generate it somehow? It's quite readable IMO.

Link to comment
Share on other sites

Theres another animation system here fairly similar to the other one, but its for single map cell animations instead of multi-cell, it also uses SHP images instead of tiles

(weapon impact anims, smoke, sandworm, deviator smoke, others)

it begins at

dseg:3206 00 00 A3 3B      off_46626      dd word_3BA30

dseg:320A 00 00 A4 3B                      dd word_3BA40

this is a table of pointers to the animdata, commands are stored the same way (zXXX) as the other anim system, however the function calls are different and this time there is 15 of them

one of these pointers,

dseg:323A 00 00 BE 3B                      dd word_3BBE0

leads us to here (the sandworm)

seg146:0000 DA 10            word_3BBE0      dw 10DAh

seg146:0002 0F 20            word_3BBE2      dw 200Fh

seg146:0004 DB 10            word_3BBE4      dw 10DBh

seg146:0006 0F 20            word_3BBE6      dw 200Fh

..... and so on

10DA << select SHP frame 0xDA (worm eat anim #1)

200F << sleep 0x00F Ticks

heres a rough attempt to document what they do

ive got no idea what field_8 does, havnt seen it used anywhere but when its set below

0: clear the anim data ptr (stop the anim)

1: set shp frame to 'x' and field_8 to 0

2: wait 'x' ticks

3: wait 'random' ( 0 to X ) ticks

4: set shp frame to 'x' and field_8 to 1

5: set step to 0

6: add 'x' to our map pos x/y

7: same as 6

8: check for no fog of war, then checks tile type (no  wall, no spice, no concrete), does some other stuff... then checks if its hit a bloom

9: play SFX 'x'

10: check no fog of war, then do -unknown-

11: check for building at this location, do nothing if there is one, otherwise create a multi-celled animation (not sure what tiles are used for this yet)

12: Stop anim, calls function for id0

13: Check if we hit a spice bloom, delete unit if we did

14: same as 12

Link to comment
Share on other sites

Are there any references to that table of pointers in the unit/structure/etc data?

The problem with making editor support for stuff like this is the fact the end of the scripts is hard to determine. I can go on the 'end commands', but then if someone shortens a script there's no way of letting the editor know there's more space available for expanding it again later.

The only way around that is by hardcoding all script locations and lengths into the editor, which isn't too handy either.

This is pretty much the same dilemma I got with the structure foundation shape definitions in C&C1. They're a single reference to a list of occupied cells, ending on FFFF, but the variable list length means there's no handy way to add any kind of editor support for stuff like that, except if I move all the existing lists to a place where there is tons of space to expand them (which is tons of work).

As for the Dune II editor (more in relation to the previous building anim scripts then), the most I can do for this data type is show a box in which to edit the address the reference goes to, and once that is confirmed, shows the commands at that given address. So kinda like I did for the string references, only it'll show a list of commands in the typical scrollable list structure. Of course, selecting items on that list won't be useful, but it can still be implemented. That way, (just like with the C&C1 foundation lists), people can still kinda edit it by making scripts only start after 2 or 3 commands.

As for editing the scripts, does the game actually care about these sections once it's reading data? Would it be possible to throw out duplicate scripts and write new scripts in the salvaged space, even if it transcends the exe section borders?

Link to comment
Share on other sites

Scripts are implemented :)

It's really funny to take a closer look at... it shows how 2 of the starport frames are totally unused.

The three animations are Normal, Producing and Production Finished, btw.

At the moment, they can't be edited (yet?), but you can press [enter] to view the whole list of script commands.



Edited by Nyerguds
Link to comment
Share on other sites

ah forgot about that,

units Unknown_44  

theres no real generic use of this however, most of the locations which call the function to start one these anim-scripts are specific to unit type or some other condition (however they can also be started from the UNITS.EMC scripts)

could perhaps replace some of them, but the pointer table itself needs to remain in order as there is a couple of instances where a hardcoded value is used to look into the table

take a look in the db, 'sub_15008' check the references to it, first parameter is the 'index' into that pointer table

Link to comment
Share on other sites

Units: Unknown 29 Bit4:  Causes the "Sand Impact" animation to play upon "unit" reaching its destination  (rockets landing in the sand)

the  "unit" "rate of fire" must be 0, and the unit needs the ExplodeAtDestination bit set

Link to comment
Share on other sites

Unknown 015 for units seems to be the same as "Build order" for structures. At least, they are in the same column in PROFILE.INI.

BTW, some parameters in PROFILE.INI do differ from those in the final release. For example, the Trooper(s) weapon rage was 4 instead of 5, the Saboteur's movement speed was only 20 (movement speed is in the [COMBAT] section), and the Sonic Tank's damage was 50 instead of 65.

Link to comment
Share on other sites

Unknown 015 for units seems to be the same as "Build order" for structures. At least, they are in the same column in PROFILE.INI.

Bizarre that they use one ini format for 2 object types that are so vastly different.

So that would make it some sort of build priority? Kind of an odd thing to put on units...

Link to comment
Share on other sites

So that would make it some sort of build priority? Kind of an odd thing to put on units...

It's not build priority, this value just defines the way in which unit/building icons are listed in the production/Starport menu. IIRC, the higher the value, the closer to the top of the list.

Don't ask me why they didn't just give values like 1, 2, 3 etc., and used weird ones like 18, 24 (I think all of them are divisible by 2, although odd numbers work fine too).

Link to comment
Share on other sites

I think it's time to include a readme with the editor to explain at least some of the parameters that can be modified :)

Hmm, I might just change the type of the descriptions, so that each option has a short list description and a longer help description. This way, I can remove the old Help system. The help system for the editing types isn't too useful anyway.

Though I'm not sure... this could end up taking tons of space, if I add a unit description for every single option.


I went for Help IDs referencing an independent list of help strings. This way I can recycle helps for the different types, and it takes tons less space :)

[edit again]

Can anyone give me a suitable description for the Decay factor?

Link to comment
Share on other sites

Can anyone give me a suitable description for the Decay factor?

I think this is not the rate at which the structures take damage, but the amount of damage done, but I'm not sure. One is certain: the higher this value is, the more damage the House's structures receive from weather-caused deterioration.

Link to comment
Share on other sites

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.

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...