segra Posted April 4, 2009 Share Posted April 4, 2009 Btw, that game gamePause? variable... as far as i can tell, is never set to 1 in the gamewhich would seem to indicate its some type of debugging switch... i was actually wondering at one point if it was perhaps a map editor, but i cant seem to find any proof of that Quote Link to comment Share on other sites More sharing options...
segra Posted April 4, 2009 Share Posted April 4, 2009 just found this, skips the intro completely, and the menutakes you straight to the select a house screen (also skips the mentat/mission brief screens)Arrakis: file address: 0x3B7C2dseg:37A2 00 00 introMenuSkip dw 0Dynasty: File address: 0x3AD12dseg:3212 00 00 introMenuSkip dw 0 Quote Link to comment Share on other sites More sharing options...
segra Posted April 4, 2009 Share Posted April 4, 2009 and the word right before introMenuSkipdseg:37A0 00 00 gameImmediateBuild dw 0 Everything builds immediately, but it still costs you the normal amount Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted April 5, 2009 Share Posted April 5, 2009 hehe, crazy beta testing stuff. Found some things like that in C&C1 too. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted April 5, 2009 Author Share Posted April 5, 2009 Cool stuff :) Thanks for the valuable and interesting research, segra! ;DBTW, I still haven't figured out how to skip House endings (if that is possible, of course)... Quote Link to comment Share on other sites More sharing options...
segra Posted April 5, 2009 Share Posted April 5, 2009 Game endings can be removed by noping hereseg023:03B0 9A 20 00 AE 42 call j_gameEndingPlayArrakis: 0x171E0Dynasty: 0x171DFThis whole chunk is run after the final mission (this occurs right before the check to see if we should do the copy protection)seg023:0387 83 3E A6 38 09 cmp missionNumberPrevious, 9seg023:038C 75 35 jnz short loc_225F3seg023:038E 9A 31 01 71 39 call sub_39841seg023:0393 B8 0F 00 mov ax, 0Fhseg023:0396 50 push axseg023:0397 FF 36 2C 3C push word_4704Cseg023:039B FF 36 2A 3C push word_4704Aseg023:039F 9A 00 00 A3 33 call screenFadeOutseg023:03A4 83 C4 06 add sp, 6seg023:03A7 33 C0 xor ax, axseg023:03A9 50 push axseg023:03AA 9A 0E 00 DE 32 call sub_32DEEseg023:03AF 59 pop cxseg023:03B0 9A 20 00 AE 42 call j_gameEndingPlayseg023:03B5 9A 20 00 03 43 call j_gameShutdownseg023:03BA 33 C0 xor ax, axseg023:03BC 50 push ax ; statusseg023:03BD 9A 77 03 00 10 call _exit Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted April 6, 2009 Author Share Posted April 6, 2009 Ooh, thanks one more time ;D I'll implement this as soon as I got time :)BTW, regarding the demo/debug mode you discovered, I think it would be interesting to know if the Dune 2 Demo EXE could be modified the other way round - i.e. make it playable (if you haven't played it, the demo only shows a scripted battle between the Atreides and Harkonnens). I can't be sure, but it seems to me that the Demo EXE contains most of the code required to play the game - and it's a tad different from the final release. Anyhow, just some random thoughts :) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted April 6, 2009 Share Posted April 6, 2009 Concerning the demo mode... from what I've seen, all games since Dune II have a mode to both record and play these demos. It wouldn't surprise me if we could record our own in Dune II too. Quote Link to comment Share on other sites More sharing options...
segra Posted April 6, 2009 Share Posted April 6, 2009 i had a quick look on sunday, and im pretty sure you can play it.. a few variables i was playing with gave me that ideaone in particular when set to 2 would ignore the mouse movement (altho if changed during playback/game it had no effect), but it was set to 2 in the demo when it was playingbut, the house selection/briefing/menu code is all missing. and when i did get the mouse moving (with the playback stopped), i couldnt click on anything (there must be another variable somewhere.. unless the code to interpret clicking is missing altogether)I could use the keyboard commands to change units tho, so it wasnt completely ignoring meperhaps ill try get the demo script playing on the full version and work from there Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted April 6, 2009 Share Posted April 6, 2009 If the future games are any indication, the demo playing should be an entire game mode you can toggle on and off. Quote Link to comment Share on other sites More sharing options...
segra Posted April 8, 2009 Share Posted April 8, 2009 that might be of some help yeahive actually been working on an EMC decompiler/compiler the past few days.. think its done nowit can decompile build, unit and team.. and recompile them to an exact match of the script used to dumpcurrently im unaware of what all the functions called by unit and team do, so its currently using ida func names for alot of them ;)but,From [carryall]... Check if the unit type we're holding is a harvester, if it is.. get the "HarvesterSpiceCapacity" variable... atleast thats what i think this does :) its going to require alot more investigationl1856:Execute GetHoldingType Push 0PushVal 16Evaluate EqualIfNotGoto l1901Execute CheckHarvestReturn from [MCV]l2257:PushReg 0PushVal 12Evaluate EqualIfNotGoto l2266Execute MCVDeploy Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted April 8, 2009 Share Posted April 8, 2009 oh wow. You truly are the master of Dune II modding... if the emc format is completely uncovered, we can mod absolutely everything. Quote Link to comment Share on other sites More sharing options...
segra Posted April 10, 2009 Share Posted April 10, 2009 Don't forget the Deviator only deviating units to the Ordos side instead of the side who owns the Deviator. :)I'm not sure so sure this can be fixed, i have located a variable in the unit struct which when set will cause the unit to become ordos... i think this variable is set to the owner of the deviator unit, but in multiple places, you see thisseg006:0B2A C4 5E DE les bx, [bp+unitGamePtr]seg006:0B2D 26 80 7F 59 00 cmp es:[bx+_unitGame.HouseTemp], 0seg006:0B32 74 05 jz short loc_16909seg006:0B34 B8 02 00 mov ax, 2one function in particular, which is named "UnitHouseIDGet"seg031:363A loc_2B99A: ; CODE XREF: unitGameHouseIDGet+9jseg031:363A C4 5E 06 les bx, [bp+unitGamePtr]seg031:363D 26 80 7F 59 00 cmp es:[bx+_unitGame.HouseTemp], 0seg031:3642 74 05 jz short returnHouseIDseg031:3644 B8 02 00 mov ax, 2 ; Ordosseg031:3647 EB EF jmp short Done_1The top one, when changing it.. will affect the units color on the field.. wonder why they did it this way Quote Link to comment Share on other sites More sharing options...
segra Posted April 11, 2009 Share Posted April 11, 2009 Nyerguds, found some info in the disassembly that might be of use to you and your editorThis is all based on memory accessing ive seen, i havnt actually tested anything as of yet.First, as far as i can tell OptsFiTW is a WORD and begins at +36, not +37.. and the Enum reads as(ive only added a value if a TEST against it exists, added all which ive found)00000002 ; enum _unitOptsFitW (bitfield)00000002 _unitOptsFitW_2 = 200000004 _unitOptsFitw_4 = 400000008 _unitOptsFitW_8 = 800000010 _unitOptsFitW_10 = 10h00000020 _unitOptsFitW_20 = 20h00000040 _unitOptsFitW_40 = 40h00000080 _unitOptsFitW_80 = 80h00000400 _unitOptsFitW_400 = 400h00000800 _unitOptsFitW_800 = 800h00008000 _unitOptsFitW_8000 = 8000hand OptsWocaTuro is also a WORD, but you have it at the correct offset00000001 ; enum _UnitOptsWocaTuro (bitfield)00000001 _UnitOptsWocaTuro_1 = 100000002 _UnitOptsWocaTuro_2 = 200000020 _UnitOptsWocaTuro_20 = 20h00000040 _UnitOptsWocaTuro_40 = 40h00000100 _UnitOptsWocaTuro_100 = 100h00000200 _UnitOptsWocaTuro_200 = 200h00000800 _UnitOptsWocaTuro_800 = 800h00001000 _UnitOptsWocaTuro_1000 = 1000h00002000 _UnitOptsWocaTuro_2000 = 2000h Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted April 11, 2009 Share Posted April 11, 2009 I won't count on that to tell me which bits are used... In C&C1 it frequently does bitshifting on the value to get to the other bits. It's hard to trace.Also, it makes little difference to the editor that they're 2 bytes. To keep the options visible for editing I want to split them up as much as possible, so single bytes are better for that. Even if the game handles 2 of them together, they're still bit switches anyway, so it hardly matters.Ideally I'd want to spread every bit to a separate option line in the editor, but I can't implement that anymore at this point, since it wasn't designed for it. As it is, every entry in the editor needs to have a byte size > 0, so I can't add 8 entries for one single byte. Quote Link to comment Share on other sites More sharing options...
Windwalker Posted April 11, 2009 Share Posted April 11, 2009 Heya guys;I was wondering if there was a possible way that we could add in-game text messages triggered by events or time variables. It could really enhance the storytelling, which is very important for a dune game. This sounds possible as there is the option for in-game messages, like when you select a building for the first time they show up and tell something. And there is that message that tells there is not enough concrete space.I also would like to remove the option that when you are out of harvesters, the game brings one for you. Or at least making it a very late delivery could be wonderfull.I believe both these aspects are buried in exe right?Also, there are crew values for vehicles in the manual. Sometimes when your harvester gets destroyed, a single soldier is given. And when buildings blow up, they leave back random number and hp of soldiers. These could be used to create interesting options. Does anyone have any idea on them? Feels like the more number of crew for a vehicle, the more possibility of a survivor soldier emerging from its ruins. I will check nyerguds editor and try to figure out.Buildings slowly degenerate when without power right? They also degenerate faster when built on bare rock. So there is a kind of degeneration value somewhere. and when you repair a building it regenerates so there is some code about it too. Repair facility repairs vehicles too. Can we somehow make regenerating units or units with a limited lifespan?Spice bloom is also interesting. Does anybode know where are the codes for it and what could possibly be done with it? Maybe we can use it like crates of red alert and similar? -Manual has hints for this. It says it may contain an abandoned vehicle or credits or spice, and if you shoot, you destroy if there was a "prize" and if you walk over you lose your unit if its spice. In the game, there is only spice.Does anyone have any idea to solve the half damage in some directions bug? This is also interesting; how does the game decide to deal half damage? How can we use this? Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted April 11, 2009 Author Share Posted April 11, 2009 I was wondering if there was a possible way that we could add in-game text messages triggered by events or time variables. It could really enhance the storytelling, which is very important for a dune game. This sounds possible as there is the option for in-game messages, like when you select a building for the first time they show up and tell something. And there is that message that tells there is not enough concrete space.segra or Nyerguds may prove me wrong, but somehow I don't think this is possible... Quote Link to comment Share on other sites More sharing options...
segra Posted April 12, 2009 Share Posted April 12, 2009 While it could be done, the amount of work would be substantial... if there is even enough room in the exe, what makes it hard is the use of OVERLAYS. Everytime the game starts, different segments start at different locations... it makes debugging a real pain.But in the long run, you would be better off rewriting the game :) Hint Hint someone? ;)Ive seen the harvester code somewhere, cant remember exactly where.. but u could disable itBloom seems to be loaded into the map pieces array somewhere, this map array uses a bit field which one of the bits is for determining if FOG is still covering it or not Quote Link to comment Share on other sites More sharing options...
segra Posted April 12, 2009 Share Posted April 12, 2009 oh also, in the mission ini loading function... theres a section it attempts to load called SPECIALI tested this out, and the result is interesting :)in the [MAP] section of a mission ini, I added...Special=2407a "Bloom" appeared at 2407, which looked slightly different to the spice bloom. When walking on it, an Orni-Thopter appeared and took off Quote Link to comment Share on other sites More sharing options...
segra Posted April 12, 2009 Share Posted April 12, 2009 Harvesters are checked by this function, to quickly sum it... it returns 1 if it finds a harvester, 0 if it doesnt.it checks all the buildings, except for heavy factorys, then checks the carry alls,then checks all ground unitsif all come up empty, it checks for a refinery if one exists it creates a harvester, returning 1otherwise, it returns 0 ; int __fastcall far unitGameHarvesterFind(int,int,int,int houseID)seg031:21E7 unitGameHarvesterFind proc far ; CODE XREF: sub_2191E+59FPseg031:21E7 ; sub_2216C+APseg031:21E7seg031:21E7 buildingGamePtr = dword ptr -0Chseg031:21E7 unitGamePtrCarryAll= dword ptr -8seg031:21E7 unitGamePtr = dword ptr -4seg031:21E7 houseID = word ptr 6seg031:21E7 arg_6 = word ptr 0Chseg031:21E7seg031:21E7 55 push bpseg031:21E8 8B EC mov bp, spseg031:21EA 83 EC 0C sub sp, 0Chseg031:21ED 56 push si ; intseg031:21EE 8B 76 06 mov si, [bp+houseID]..........seg031:22CA 9A FD 00 8B 1E call buildingGameFindseg031:22CF 83 C4 08 add sp, 8seg031:22D2 89 56 F6 mov word ptr [bp+buildingGamePtr+2], dxseg031:22D5 89 46 F4 mov word ptr [bp+buildingGamePtr], axseg031:22D8 0B C2 or ax, dxseg031:22DA 74 4D jz short RefineryNotFoundModify this JZ to a JMP and it should never create a harvester again...who knows what doing this may do to the game tho :) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted April 12, 2009 Share Posted April 12, 2009 omg, cool... I stumbled upon the unit-spawning blooms before when messing around with the exe, but these only gave Ordos troopers then.As for that function... is that the one for replacing a harvester, for bringing the original harvester to the refinery after building one, or both? Quote Link to comment Share on other sites More sharing options...
segra Posted April 12, 2009 Share Posted April 12, 2009 All it does is check if a harvester is available, anywhere (in a building, or a carryall, or just on the field)... if not, it creates one, if a refinery existsaside from that it just returns 1 if it finds a harvester.. it seems to be called quite regularly.not sure what else its used for Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted April 12, 2009 Share Posted April 12, 2009 oh, I see.Well, I remember the buildings ecm script containing code to automatically bring in a harvester. This is probably used for the harvest replacements you get in the first missions, and for the AI's harvester replacing. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted April 12, 2009 Author Share Posted April 12, 2009 oh also, in the mission ini loading function... theres a section it attempts to load called SPECIALI tested this out, and the result is interesting :)in the [MAP] section of a mission ini, I added...Special=2407a "Bloom" appeared at 2407, which looked slightly different to the spice bloom. When walking on it, an Orni-Thopter appeared and took offWow, that's a really cool find ;D"gameEndingPlay" functionovr185:0000 55 push bp......ovr185:0019 A1 2C 3A mov ax, gameHumanTeamIDovr185:001C 0B C0 or ax, axovr185:001E 74 0C jz short endHarkovr185:0020 3D 01 00 cmp ax, 1ovr185:0023 74 67 jz short endAtreovr185:0025 3D 02 00 cmp ax, 2ovr185:0028 74 3D jz short endOrdosovr185:002A EB 60 jmp short endAtre <<<< If the teamID doesnt match 0,1,2... use Atreidessegra, could you please tell how to make the Harkonnen ending play for the Sardaukar? I have successfully changed the other two endings to the Fremen and the Mercenaries (3D 03 00 74 67 3D 05 00 74 3D), but I don't get it how to change the Harkonnen to Sardaukar and why it is different in the first place...Another thing, I have played with the skip ending segment you have pointed me to, but it skips both the ending cutscene and the credits (the game ends right after the score screen). Is it possible to skip the cutscene only, and leave the ending credits? Quote Link to comment Share on other sites More sharing options...
segra Posted April 12, 2009 Share Posted April 12, 2009 segra, could you please tell how to make the Harkonnen ending play for the Sardaukar? I have successfully changed the other two endings to the Fremen and the Mercenaries (3D 03 00 74 67 3D 05 00 74 3D), but I don't get it how to change the Harkonnen to Sardaukar and why it is different in the first place...ovr185:001C 0B C0 or ax, axovr185:001E 74 0C jz short endHarkas Harkonnen is 0, the result of the OR is zero but Sardaukar is 4. you could just NOP the final jumpovr185:0028 74 3D jz short endOrdosovr185:002A EB 60 jmp short endAtrechange the EB60 to 9090. Probably the easiest approach.Yeah you can stop the movie playing, altho theres no actual skip for it. NOPing over this works just fineovr185:0056 9A 2A 00 F0 42 call j_MoviePlayerArrakis: 0x46866Dynasty: 0x45A06 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.