Jump to content

Dune II editor with 1.07 support


Nyerguds

Recommended Posts

hahah, just to make things really interesting...

LemonFactor only seems to be used within the UnitCreate function, and only if MovementType == 1

its compared against a value from the mapSeedRandomGet function, still not sure what this is does exactly...

but, it sets the 0x400 in the EMCDATA field... hmm

seg031:0A91 26 83 7F 3C 01                    cmp    es:[bx+_unitData.MovementType], 1

...

seg031:0A98 9A 0E 00 B8 39                    call    mapSeedRandomGet

seg031:0A9D 50                                push    ax

...

seg031:0AA8 58                                pop    ax

seg031:0AA9 3B 87 F2 37                      cmp    ax, houseData.LemonFactor[bx]

seg031:0AAD 73 09                            jnb    short loc_28E18

seg031:0ABD C4 5E F8                          les    bx, [bp+unitDataPtr]

seg031:0AB2 26 81 4F 04 00 04                or      word ptr es:[bx+_unitGame.emcData], 400h

Link to comment
Share on other sites

essentially tho, theres a couple of checks (not sure what the vars here are used/done with yet..) and mission > 1, then we set "canDecay"

it doesnt hit this very often, perhaps every few mins

then it checks the EMCDATA field for 0x400 (this needs to be investigated, alot of things rely on this flag thro the game)

finally it checks if the building has < 50% hitpoints

Well, of course... have you seen any buildings decaying in mission 1, or under green? That's a thing I noticed about decaying: buildings decay only down to 50% (just before entering yellow). Also, some buildings never decay (ex: Construction Yard). I wonder whether this has something to do with the "foundation requirement" bit. I'll have to check it out too. :)

-Daelin

Link to comment
Share on other sites

Also, some buildings never decay (ex: Construction Yard). I wonder whether this has something to do with the "foundation requirement" bit. I'll have to check it out too. :)

Actually, all pre-placed buildings do not decay (they still get damaged when on low power though). This is why the starting ConYard never decays, but the other ones you might place on the map via MCVs do.

Minniatian was able to turn building decay off by editing BUILD.EMC, yet I have no idea how he did it (check his patch).

So what does LemonFactor actually do? :)

Link to comment
Share on other sites

dunno wasnt really thinking about it actually lol was just commenting the code as i found it... more interested in the 0x400 tho,

this is from the 'unitMoveMapTileCheck' function,

if 0x400 is on, and the mapSeedRandom return value is 3,

it does 1 damage to the unit

far as ive found so far, 0x400 for units is only ever turned on if the unit has movement type TRACKED, and whatever value from the mapSeedRandomGet function is > lemonfactor

seg031:06D7 26 F7 47 04 00 04                test    word ptr es:[bx+_unitGame.emcData], 400h

seg031:06DD                  loc_28A3D:

seg031:06DD 74 1F                            jz      short loc_28A5E

seg031:06DF 9A 0E 00 B8 39                    call    mapSeedRandomGet

seg031:06E4 A9 03 00                          test    ax, 3

seg031:06E7 75 15                            jnz    short loc_28A5E

seg031:06EC B8 01 00                          mov    ax, 1

seg031:06EF 50                                push    ax                                  ; damage

seg031:06F0 FF 76 08                          push    word ptr [bp+unitGamePtr_Arg+2]

seg031:06F3 FF 76 06                          push    word ptr [bp+unitGamePtr_Arg]      ; unitGamePtr

seg031:06F6 90                                nop

seg031:06F7 0E                                push    cs

seg031:06F8 E8 7D 04                          call    near ptr objectTakeDamage

Link to comment
Share on other sites

Hehe. Hyper said that list even helped him with the TS and RA2 functions. The basic system stays pretty much the same through the engine's evolution.

I doubt it'll help for Dune II though - I've got a LOT of information saying they completely rewrote the engine when they made C&C. Is Dune II even OO?

Link to comment
Share on other sites

Given that we've got a few Dune 2 clones though, why are we still concentrating on the original?

Quite interesting question indeed ;)

Although I would be very interested in the original's behavior so we can mimic it as close as possible, I am also not that interested in changing the original's EMC or its EXE file.

I think this is personal interest related. I like to code new things, and learn new things from that. Some people like to digg into EXE's and disassemble them ? ;)

Link to comment
Share on other sites

We just like the classics, that's all. It's more fun playing these old crappy-looking games than any new and smooth remake they could make of it. But we DO like to fix the errors in it, to make the old game "all it could've been" ;)

That'a my philosophy behind C&C95 v1.06, anyway.

Link to comment
Share on other sites

That's great work!

Changing the 'display size' kinda changes the gameplay dynamics as well though.

You didn't know about this patch? It's even been announced on Battlecast Prime (though Apoc horribly mispronounced my nickname :P).

The high resolution is purely optional though. The next version will have it as choice in the installer, together with the language selection.

Also, I didn't really need to do that much for it. Changing the resolution and adapting a few hardcoded offsets (like menus and sidebar buttons) to change dynamically was enough. The basic hacks were all designed by Komfr, before I even knew how to do that stuff. But his hack changed the game permanently. My new one in 1.06 adapts it to the Resolution= value in the config file (which was originally only used to switch between 640x400 and 640x480).

Apparently RA95 is a lot harder. It doesn't have any of the resolution changing code. change the resolution and you still got a small 640x400 box in the upper left corner.

Not surprising though... C&C95 is built on a newer version of the graphical engine than RA95 (remember, C&C95 is the Windows remake of DOS C&C. It was released after RA95). Apparently it already held the basics of what would become TS' full resolution support.

Link to comment
Share on other sites

Well, apparently. Hyper is trying to make a hi-res patch for RA95, and he told me several pieces of code meant to display stuff at higher resolution were simply missing in RA95. Apparently the 640 and 400 values are hardcoded in pretty much every function, instead of using one central value like in C&C95.

Link to comment
Share on other sites

The construction tabs thing? I dunno... not really. Sometimes I even wish they'd kept the Dune II separate-buildings construction format. One of the good points of C&C3, if it wasn't for cranes and cheap CYs causing base crawling stupidity :P

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.

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