segra Posted August 15, 2009 Share Posted August 15, 2009 hahah, just to make things really interesting...LemonFactor only seems to be used within the UnitCreate function, and only if MovementType == 1its 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... hmmseg031:0A91 26 83 7F 3C 01 cmp es:[bx+_unitData.MovementType], 1...seg031:0A98 9A 0E 00 B8 39 call mapSeedRandomGetseg031:0A9D 50 push ax...seg031:0AA8 58 pop axseg031:0AA9 3B 87 F2 37 cmp ax, houseData.LemonFactor[bx]seg031:0AAD 73 09 jnb short loc_28E18seg031:0ABD C4 5E F8 les bx, [bp+unitDataPtr]seg031:0AB2 26 81 4F 04 00 04 or word ptr es:[bx+_unitGame.emcData], 400h Quote Link to comment Share on other sites More sharing options...
Daelin Posted August 15, 2009 Share Posted August 15, 2009 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 minsthen 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% hitpointsWell, 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 Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 15, 2009 Share Posted August 15, 2009 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? :) Quote Link to comment Share on other sites More sharing options...
segra Posted August 16, 2009 Share Posted August 16, 2009 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 unitfar 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 > lemonfactorseg031:06D7 26 F7 47 04 00 04 test word ptr es:[bx+_unitGame.emcData], 400hseg031:06DD loc_28A3D:seg031:06DD 74 1F jz short loc_28A5Eseg031:06DF 9A 0E 00 B8 39 call mapSeedRandomGetseg031:06E4 A9 03 00 test ax, 3seg031:06E7 75 15 jnz short loc_28A5Eseg031:06EC B8 01 00 mov ax, 1seg031:06EF 50 push ax ; damageseg031:06F0 FF 76 08 push word ptr [bp+unitGamePtr_Arg+2]seg031:06F3 FF 76 06 push word ptr [bp+unitGamePtr_Arg] ; unitGamePtrseg031:06F6 90 nopseg031:06F7 0E push csseg031:06F8 E8 7D 04 call near ptr objectTakeDamage Quote Link to comment Share on other sites More sharing options...
XTF Posted August 16, 2009 Share Posted August 16, 2009 this is from the 'unitMoveMapTileCheck' function,Did you make up those names yourself? Quote Link to comment Share on other sites More sharing options...
segra Posted August 16, 2009 Share Posted August 16, 2009 lol yes, i do it like that for sorting reasons in the ida windows Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 16, 2009 Author Share Posted August 16, 2009 Obviously. It's not like there's a list of the original function names left inside the program.(Hyper found a list of all RA1 function left in the RA 2.00 exe though... helped us a lot with the C&C1/RA1 disassembly) Quote Link to comment Share on other sites More sharing options...
segra Posted August 16, 2009 Share Posted August 16, 2009 would be nice if the symbols were available thats for sure lol, Nintendo made a similar fuckup with the Wii System Menu, not all symbols are there.. but a hell of a lot are :) Quote Link to comment Share on other sites More sharing options...
XTF Posted August 16, 2009 Share Posted August 16, 2009 I think Westwood did it also with the Renegade Linux Dedicated Server. :P Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 17, 2009 Author Share Posted August 17, 2009 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? Quote Link to comment Share on other sites More sharing options...
XTF Posted August 17, 2009 Share Posted August 17, 2009 Isn't TD a 32 bit app? I think a rewrite made sense. Quote Link to comment Share on other sites More sharing options...
stefanhendriks Posted August 17, 2009 Share Posted August 17, 2009 Dune II could be CPP, as C++ is older than Dune II (way older) : see http://en.wikipedia.org/wiki/C%2B%2B Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 17, 2009 Author Share Posted August 17, 2009 Yeah, TD is indeed 32-bit. Quote Link to comment Share on other sites More sharing options...
XTF Posted August 17, 2009 Share Posted August 17, 2009 16 bit was such a disaster. Disassembling 32 bit is probably easier as well.Given that we've got a few Dune 2 clones though, why are we still concentrating on the original? Quote Link to comment Share on other sites More sharing options...
stefanhendriks Posted August 17, 2009 Share Posted August 17, 2009 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 ? ;) Quote Link to comment Share on other sites More sharing options...
XTF Posted August 17, 2009 Share Posted August 17, 2009 That must be it! :P Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 17, 2009 Author Share Posted August 17, 2009 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. Quote Link to comment Share on other sites More sharing options...
XTF Posted August 17, 2009 Share Posted August 17, 2009 That's great work!Changing the 'display size' kinda changes the gameplay dynamics as well though. Quote Link to comment Share on other sites More sharing options...
stefanhendriks Posted August 17, 2009 Share Posted August 17, 2009 Yes, neat indeed! Actually quite good how you managed to make cnc support a bigger resolution. I do agree with olaf though that for some games, a higher resolution takes away the charm of the game.That is the biggest reason why d2tm is only 640x480 Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 17, 2009 Author Share Posted August 17, 2009 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. Quote Link to comment Share on other sites More sharing options...
XTF Posted August 17, 2009 Share Posted August 17, 2009 I did know about your patch.Didn't know TD Gold had a newer engine than RA. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 17, 2009 Author Share Posted August 17, 2009 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. Quote Link to comment Share on other sites More sharing options...
XTF Posted August 17, 2009 Share Posted August 17, 2009 Yeah, didn't expect TD to have support for multiple resolutions.BTW, wouldn't it be great to have clones of TD and RA1 with a RA2 'style' GUI? Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 17, 2009 Author Share Posted August 17, 2009 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 Quote Link to comment Share on other sites More sharing options...
XTF Posted August 17, 2009 Share Posted August 17, 2009 It's mostly about a better to use UI, not about specific gameplay elements. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.