Jump to content

Recommended Posts

Posted

Here you can download the Dune II Unit Editor that I use (bottom of the list). It works with Dune 2 v1.0 only, but allows to edit most, if not all, stats for units and buildings (except building frames I think). If I have time to type all the data I found by analysing DUNE2.EXE with the help of this editor, I'll send it to you, should you need it. You know what, perhaps it would be better if I did so, to spare your time.

EDIT: I've typed in the results of my analysis, and attached them here. Hopefully it'll be helpful :)

D2UnitCode.txt

Posted

Ohh, you already got pretty much everything :)

This is a lot more than I was expecting, tbh. And the editor is really nice, too.

If the data types are comparable to C&C, this will be easy to figure out. And once I find the data in the file I can probably use UGE to create a Dune II 1.07 editor. UGE can't do things like make nice lists of the required buildings 'n' stuff though. But I guess it beats bare hex editing.

As for the exceptions... there's probably little I can do about that. C&C has a few annoying ones like that too, like the fact the helipad can't be built by Nod in single play unless the player captures a GDI construction yard. This stuff is done somewhere outside the normal unit data, and is pretty much impossible to find without very thorough disassembling.

I don't know exactly what you mean by the 'concrete' bug, but I know that in C&C, wall types are buildings with VERY special properties, and basically shouldn't be touched.

Do you have MSN? Mine is just my nickname at hotmail

Posted

I can probably use UGE to create a Dune II 1.07 editor. UGE can't do things like make nice lists of the required buildings 'n' stuff though. But I guess it beats bare hex editing.

That would be excellent ;D

The concrete bug is a nasty thing that prevents the Mercenaries and Sardaukar from placing concrete foundations properly (well it's not exactly a bug, since these sides were not supposed to be playable). Normally, you can place concrete slabs one next to another so far there's buildable rock, and then place the buildings whereever you wish near/on that concrete. The Mercs and Sardaukar can't do this, since they can place slabs and buildings only next to other non-slab and non-wall structures. This is very annoying, as you can't spread out building foundations normally, having to build on incomplete foundations and waste money on repairs. Also, it is almost impossible to leave spaces between buildings for the units to move around, which is also inconvenient when you have a large base.

asd2slabnormrj8.pngbsd2slaberrorvq1.png

a. Normal concrete placement

b. Concrete placement error due to the bug

In other words, the effect is that the game treats the walls and slabs owned by Sardaukar and Mercenary players as "enemy" structures (as if owned by someone else).

I'm still not sure if this problem is not rooted back to EMC files. I'm sure it's not in the BUILD.EMC, but maybe in TEAM.EMC? I don't know if it defines houses (as teams) or in-game teamtypes used by the AI ???

More on EMC files (by Minniatian, who decoded the format):

http://xhp.xwis.net/cgi-bin/forum.cgi?a=26;mid=6089

http://forum.dune2k.com/index.php?topic=7607.msg109611#msg109611

Do you have MSN? Mine is just my nickname at hotmail

I used to, but it's not too convenient for me, because I get online irregularly and only for short periods of time. That's why I prefer e-mail. I can PM you my address if you wish :)

Posted

UGE has on disadvantage though.. it displays everything in decimal values. That's why I made that ownership table in decimal too.. it's just an adapted version of the C&C one I use for UGE.

Posted

I don't want to appear completely ignorant, but what exactly is UGE? ??? BTW, have you noticed that there are 8 unknown/unused unit sections (at least, in DUNE2.EXE v1.0)? What do you think they could be?

Posted (edited)

UGE, the Ultimate Game Editor, is basically a customizable savegame editor, where you can mark addresses in a file, give them a description and assign them to a certain data type (1-byte, 2-byte, 4-byte, ascii text). You can create different data sets or 'modules' for different games.

Now, if you link it to an exe file instead of a savegame, it becomes a pretty handy tool for making your own exe editor for games like C&C or Dune II.

image.gif.d8da4800394b32f63104f2bf40d45252.gif

I originally found it when looking for a decent C&C95 editor. Since it had the huge advantage of not being a normal uncustomizable game editor, I could add tons of information to it and create a true C&C95 editor. I think more than 75% of the stuff in the current C&C95 UGE modules is added by me.

http://www.cncforums.com:80/new/local_links.php?action=ratelink&linkid=177&catid=69

btw, I've now disassembled the uge exe file to remove an annoying shareware message it normally shows ;D (Though the cncworld download doesn't have that yet. The new beta version does, however. But its C&C95 editing documentation is horribly incomplete atm)

The only annoying thing is that I'll need to add the data entries one by one, for each unit and structure. Because this will probably bee more than one UGE list can handle (about 400 data entries I think), I'll make 2 separate lists; one for units and one for structures.

For the moment, I still haven't had the chance to look into the exe file. The data structure seems different from C&C, since in C&C the data is actual program code, with instructions in between. From what I see in your txt file this seems to be a data section outside the game code itself. Though as the ownership byte proved, the data types seem to be similar.

As for the extra units... add em to some build list, make em buildable, and try it out?

I'll look into it ASAP, but I can't promise anything. School projects and stuff like that are taking up most of my time, and my girlfriend usually makes sure she gets the rest. And I can't blame her, either :P

***

btw, off topic.. how do you get that flag under your name? I don't have one, and I didn't find it in my profile options :(

[edit]

Oh, can you take either the Dune 1 merchand or Gurney Halleck as Mercenary mentat? They both look so devious ;D

Or will you keep the fremen woman for that?

[edit again]

OK, I've looked at it... well, once I disassembled it in IDA it wasn't too hard to link your info to the first unit (carryall), and put it in UGE. Now I got one complete unit data structure done, the rest will be peanuts :)

I might even be able to identify some of the unknown stuff after finishing the list.

I'll finish the complete units list first, and then move on to the structures.

Edited by Nyerguds
Posted

OK, here's my first result... the Carryall data put into UGE.

Now, from what I've seen, the data seems to differ from unit to unit sometimes. I can't be sure my estimate of the in-between data is correct; some of the 2-byte values I put there might be two one-byte values instead. But anyway, we'll see.

One note: NEVER change the two code references in there (Name code ref. & WSA file code ref.)

They're internal addresses in the exe that tell the game where to find the internal name (as used in missions) and the unit's WSA filename respectively. From my experiences with C&C I know that when you mess with these, the game will no longer see the modified unit in savegames or missions, and it will probably crash when trying to display the unit's WSA screen.

BTW, the four unknown entries I marked as "weapon balance?" remind me a LOT of how C&C balanced its weapon warheads vs armour types. But I'm not entirely sure if that's correct, especially since I've only really looked at it on the Carryall which doesn't have a weapon.

Talking about armour types... normally the game has about 4. The stuff seen as "Armour" in the editor is actually "Hit Points".

See, in C&C you got units, weapons, warheads, and armour types. C&C has 6 armour types, represented by a value ranging from 0 to 5. (though 4 and 5 are never used)

The warheads balance each weapon type to each of the 6 armour values by giving a damage percentage for each armour level to be multiplied with the basic damage value. These percentages are represented by a byte, so the value should be divided by 256.

This way you can have specific armour-piercing or anti-infantry weapons.

(Note that this method has a bug with 100% values, since they're 255/256. The result gets rounded though, which means that this bug is only noticeable on very high damage values)

For example:

C&C1 warhead: Hi-Explosive

vs armour 0 - 224 ( = 7/8)

vs armour 1 - 192 ( = 3/4)

vs armour 2 - 144 ( = 9/16)

vs armour 3 - 64 ( = 1/4)

This means that a weapon of type "Hi-Explosive" that does a basic damage of "100", when used against a tank with armour level "3", will do 100 * 64/256 damage. This is 100 * 1/4 or 25 damage.

This is the way C&C reduces damage to more highly armoured targets.

Considering the fact the weapon is built into the unit in Dune II, it's perfectly possible that the weapon's warhead is built in too. If this is the case, all that's left to do is find the actual armour value in the unknown data.

D2uge.zip

Posted

Wow, you've done a lot of research... Cool! :) I'll try your work out ASAP ;D

btw, off topic.. how do you get that flag under your name? I don't have one, and I didn't find it in my profile options

You need to place a pin on the Member Map to show your (approximate) current location, and then you'll get the country flag. AFAIK that's the only way to do it.

Posted (edited)

oh, btw, I found your extra units... they're in fact the weapon projectiles.

After the MCV you got the Death Hand, Rocket, ARocket, GRocket, MiniRocket, Bullet, Sonic Blast, and then it goes on with the Sandworm and Frigate.

(you know, these Code References I mentioned? My disassembler automatically shows what string they link to, making data VERY easy to identify ;))

This is kinda odd, because it means the weapons are actually unselectable flying units that act kinda like a Saboteur that travels to his target and then explodes.

One more important side of this is probably that this means that weapons might have an owner, which means it might be possible (for some disassembler more experienced than me) to fix the Ordos deviator bug, by setting the side of the affected unit to the side of the projectile that affected it, rather than just "Ordos". After all, it also has to take the weapon damage value 'n stuff from the object, so if the program is written somewhat object-oriented, porting the ownership value should be possible too.

Another fun side effect of this is that it may be possible to make a unit spawn other units as "projectiles", lol :P

Quote

You need to place a pin on the Member Map to show your (approximate) current location, and then you'll get the country flag. AFAIK that's the only way to do it.

Ah, got it! Thanks :)

Edited by Nyerguds
Posted

I'm sorry I didn't answer some of your questions, I've been in quite a hurry lately.

Oh, can you take either the Dune 1 merchand or Gurney Halleck as Mercenary mentat? They both look so devious ;D

Or will you keep the fremen woman for that?

I'm going to keep the female (BTW, she's Bene Gesserit, not Fremen; the palette used for this image is even called BENE.PAL). I've already converted her image and facial animations to the the regular IBM.PAL palette, since using BENE.PAL for mentat briefing/data screen caused certain colors to get messed up.

I think you've already noticed that in the unit data sections that I gave you, there was a mistake, since Quad had two extra bytes (an error that occurred when I was writing down data this summer). All sections have equal length.

BTW, the four unknown entries I marked as "weapon balance?" remind me a LOT of how C&C balanced its weapon warheads vs armour types. But I'm not entirely sure if that's correct, especially since I've only really looked at it on the Carryall which doesn't have a weapon.

I have always thought that in Dune 2, no "rock-paper-scissors" balance model was introduced yet, meaning all units take full damage from all weapons, but this had been neither proved or disproved yet. Therefore, I have no idea about armor type vs. weapon type issues in Dune 2. However, you experience with C&C might be very helpful here.

oh, btw, I found your extra units... they're in fact the weapon projectiles.

Heh, I've come to this conclusion myself today and wanted to tell you :) Certain Dune 2 scenario editors (like this one) allow pre-placement of warheads, although I've never tested this feature.

The question that I'd be glad to know an answer to is that there appear to be certain House-specific "sub-units" seemingly not reflected in the tech-tree structure as it is represented in the unit/building data. These are:

Atreides Light Factory:

  • tech level is 2 (instead of 3)

Harkonnen WOR:
  • tech level is 2 (instead of 5)
  • does not require Barracks as a prerequisite

Harkonnen Light Factory:

  • does not have any upgrades

Harkonnen Quad:
  • does not require the factory upgrade

Harkonnen Hi-Tech Factory:

  • does not have any upgrades

Ordos Light Factory:
  • tech level is 2 (instead of 3)
  • produces Raider Trikes instead of ordinary Trikes

Ordos Heavy Factory:

  • has 2 upgrades (instead of 3)
  • produces Deviators

Ordos Siege Tank:
  • requires 2 factory upgrades (instead of 3)

If this and suchlike data could be modified, then more sophisticated tech-tree setup could be accomplished. I'm thinking about Sardaukar producing Siege Tanks at the same tech level as other Houses produce Combat tanks and so on ::)

Posted (edited)

Hm. This is quite similar to the fact that in C&C1, the GDI side gets the ability to build the Bazooka one lavel later than Nod, unless they capture a Hand of Nod. Nod seems to use the standard value. I never really tried to look at the effects of modifying that though.

Quote

I think you've already noticed that in the unit data sections that I gave you, there was a mistake, since Quad had two extra bytes (an error that occurred when I was writing down data this summer). All sections have equal length.

Hmm... I hadn't noticed this... in that case it might be a lot easier to write my own editor in Pascal or something, since I only have to make it once and then apply it to the start addresses of each unit.

You see, in C&C there really is a difference, since it's program code, and the instruction to push a 4-byte value into the stack is larger than the instruction to push a 1-byte value. This means that values that are under 128 in the data are always 1-byte push instructions, which means they can't be made larger than 127 by editing either :(

I kind of assumed Dune II would have the same problem, but since this is an array dump and not program code it does make sense that all data is the same length :)

Edited by Nyerguds
Posted (edited)

Heehee, I got a first little layout for my editor finished :P

It's not much, but after I figure out a good way to make scrolling lists it'll be really easy to implement all information into this :)

So far you can use up and down to switch between units and structures in the first box, and use left and right to change the focus to the other lists. The second list will contain the actual units/structs, and the third will contain the options to edit. You can already press [enter] or [space] in the last column to bring up the data modification window. [Esc] goes back one level, and quits the editor if you're in the first box.

The unit data is in fact already completely in it; I just need to write the code to make it read dune2.exe

Note that the numbers that appear are the ASCII codes of the keys you type. I needed those values to program the menu navigation. Obviously this'll be removed in the final version ;)

d2editor_v0.01.zip

Edited by Nyerguds
Posted

Hey, that's very nice :) I'll certainly find your tool useful when it's complete ;) ;D

Hm. This is quite similar to the fact that in C&C1, the GDI side gets the ability to build the Bazooka one level later than Nod, unless they capture a Hand of Nod. Nod seems to use the standard value. I never really tried to look at the effects of modifying that though.

Then this data is stored somewhere else, right? Is there any chance to find it? I have actually found a piece of code in the exe that resembled a list of units built by a building, with Raider Trike's and Quad's IDs on it, but when I modified it, this did not affect the Ordos' units built in their Light Factory. Must have been a coincidence, although I might double-check that.

My thought is that if such house-specific data is stored in other sections of the exe, there's a chance that the origin of the concrete bug is also there.

BTW, there's a file called HOUSE.INI in the DUNE2.EXE internal game file list, but no such file is found in the actual PAKs. Might be something obsolete, but maybe it could still affect certain House-specific aspects, if only its structure could be somehow made known...

Posted (edited)

As I said, I haven't found anything like it in C&C, so I really don't have a clue :-

Although, in C&C this might be in the section of random values where I found the wooden crate money...

I got a new demo of the proggie finished; all I need to do now is define all different data types and I can add the exe file.

Could you help me with that? These are the types I need lists of:

ownership (got that one)

commands (unit sidebar commands)

Movement types

weapon types

structures (for required structures - is this a bit switch list too?)

units (for construction options of buildings - or are the values the same as the normal unit order?)

So basically, I just need a list of the values, like I did for the Ownership up there.

For movement type I already got

00=foot

01=tracked

02=harv

03=wheeled

04=winged

05=slither

Do you know if this is correct?

Anyway, here's the new demo. As you see I haven't made a data list for the structures yet, but for the rest, all navigation works. The pop-up box will call a different subroutine for each data type; that's what I need these lists for.

Hm... maybe I should make a separate topic for this ;)

d2edit17_demo2.zip

Edited by Nyerguds
  • 1 month later...
Posted

I released a new demo today (attached to the first post of this thread). It shows most of the currently present features, and you can play the entire campaigns, although most missions are "placeholders" taken from the original Super Dune II.

Get the demo here.

The demo must be installed over Dune II v1.07 (either US or European release). It does not replace any original Dune II files, meaning that both games can be played without the need to change anything in the files. Even SD2SE savegames are different from the regular Dune II ones.

More info is in the readme file.

A couple of screenshots from the demo:

sd2demoscn2cd0.pngsd2demoscn1ws3.png

Posted

The problem is that the very same sounds are used by the Mercenary announcer in the game. So if you change "Atreides" -> "Mercenary", then if, as a Mercenary player, you kill and Atreides unit, "Mercenary unit destroyed" will be announced.

Posted

then I'll have to see if I can find the place in the exe where it references to that string... and change the reference :P

btw, this is kinds weird... Ordos?

In fact all of the Fremen briefings give the impression they weren't made for the Fremen. Especially the way they talk about the Atreides.

Also, in a lot of the Fremen missions there are Fremen sandworms, which is horribly annoying.

post-3774-12833239640712_thumb.png

post-3774-12833239640983_thumb.png

Posted

then I'll have to see if I can find the place in the exe where it references to that string... and change the reference :P

Thanks, but be careful. I suspect it might be so that this reference is a "basic" one (meaning that everywhere Atreides is mentioned, this voc file is played). If not, then it'd be great ;D

In fact all of the Fremen briefings give the impression they weren't made for the Fremen. Especially the way they talk about the Atreides.

It's a WIP demo, and therefore I have rewritten only the first two briefings for the Fremen yet (same goes for other sides as well). So it's not all of them are Ordos briefings, unless you think that "Subakh ul kuhar" is a regular formal greeting in the cartel ;)

Also, in a lot of the Fremen missions there are Fremen sandworms, which is horribly annoying.

Most of the missions are placeholders, taken from the original Super Dune II. I didn't have the leisure to edit them. And I agree, the idea with the Fremen-controlled Sandworms (which also have regular vehicles selection sounds) wasn't good. I'm not going to include it in any of the new campaign missions.

Posted

AFAIK, worms have special AI controls, the only command they may interpret is Area Guard, which makes them patrol around their starting position (used in earlier missions). In later missions, the worms are given the Ambush command in the scenarios, but everything else (except Area Guard) will have a similar effect: once discovered, the worm will hunt units across the map regardless of their ownership. Ordering a worm to attack manually will make it try to swallow empty air at the destination point though, but that's it.

Posted

Ordering a worm to attack manually will make it try to swallow empty air at the destination point though, but that's it.

Ehh? I've never seen a worm do that... and all they have is Attack commands.

Posted

Ehh? I've never seen a worm do that... and all they have is Attack commands.

You can change the buttons to show other commands IIRC.

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.