MrFlibble Posted September 23, 2009 Share Posted September 23, 2009 On a slightly related note, I noticed that the Saboteur, when you just put him on Guard, attacks nearby enemy stuff by shooting at it, just like the normal soldier ;DI first learned that from this FAQ: http://db.gamefaqs.com/console/genesis/file/dune_ii_battle_for_arakis.txtAlthough it's for the Sega version, it's got plenty of interesting stuff that applies to the PC version as well :) The other Dune 2 FAQs at GameFAQs are also useful. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted September 23, 2009 Author Share Posted September 23, 2009 There's a HTML version of that FAQ here:http://ledmeister.com/dunexref.htm :P Quote Link to comment Share on other sites More sharing options...
Skrilax_CZ Posted September 28, 2009 Share Posted September 28, 2009 Is it known where this is handled?Harkonnen WOR (from level 2, upgrades in 4, instead of 5 and 6)Ordos Siege Tank (from level 7 instead of 6) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted September 28, 2009 Author Share Posted September 28, 2009 I think Segra found some stuff about that kind of exceptions, yes. It's pure code-based; actual programming instructions. Nothing I can put in my editor. Quote Link to comment Share on other sites More sharing options...
Skrilax_CZ Posted September 29, 2009 Share Posted September 29, 2009 Do we have the addresses of those exceptions for The WOR for Harkonnen and Light Factory for Harkonnen (pls. including comments about the stack variables / register values or is the whole disassembly somewhere availabe)?Just want to play with those for my custom Sardaukar, Mercenary, Fremen tech trees, in the SuperDune Classic (btw. the offsets are -0x50 in the super.exe executable, was it reflected into *.asm code file?). Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted September 29, 2009 Share Posted September 29, 2009 Here you go:is the heavy factory techlevel2 skipping Ordos only?essentially...if(ordos && heavy factory && techlevel == 2) techlevel = 3;seg007:02B1 26 80 7F 08 02          cmp  es:[bx+_buildingGame.houseID], 2seg007:02B6 75 1F              jnz  short loc_17A87seg007:02B8 C4 1E C0 84           les  bx, buildingGamePtrCurrentseg007:02BC 26 80 7F 02 04          cmp  es:[bx+_buildingGame.TypeIndex], 4 ; Heavy factoryseg007:02C1 75 14              jnz  short loc_17A87seg007:02C3 C4 1E C0 84           les  bx, buildingGamePtrCurrentseg007:02C7 26 80 7F 4E 02          cmp  es:[bx+_buildingGame.techLevel], 2seg007:02CC 75 09              jnz  short loc_17A87seg007:02CE C4 1E C0 84           les  bx, buildingGamePtrCurrentseg007:02D2 26 C6 47 4E 03          mov  es:[bx+_buildingGame.techLevel], 3theres a bunch more too, except they're located in a different function (called right after the code above)Hark / Hi-techseg010:2618 26 80 7F 08 00          cmp  es:[bx+_buildingGame.houseID], 0seg010:261D 75 0F              jnz  short loc_1CA5Eseg010:261F C4 5E 06             les  bx, [bp+buildingGamePtr]seg010:2622 26 80 7F 02 05          cmp  es:[bx+_buildingGame.TypeIndex], 5 ; Hi-Tech Factseg010:2627 75 05              jnz  short loc_1CA5Etheres a WOR factory check just below this too, if you like give me a list of specifics i should be looking for and ill try track the code down for youHarkonnen Light Factory is managed here (in the structureCreate function itself)seg010:00F1 83 7E 0A 00           cmp  [bp+houseID], 0          ; Compare Two Operandsseg010:00F5 75 0D              jnz  short loc_1A534          ; Jump if Not Zero (ZF=0)seg010:00F7 83 FE 03             cmp  si, 3               ; Compare Two Operandsseg010:00FA 75 08              jnz  short loc_1A534          ; Jump if Not Zero (ZF=0)seg010:00FC C4 5E FC             les  bx, [bp+gameObjectPtr]       ; Load Full Pointer to ES:xxseg010:00FF 26 C6 47 4E 01          mov  es:[bx+_buildingGame.techLevel], 1 Quote Link to comment Share on other sites More sharing options...
segra Posted October 4, 2009 Share Posted October 4, 2009 Nyerguds, got a few more fields for youStructures: Unknown 35 - 36 (anim0)Unknown 37 - 38 (anim1)Unknown 39 - 40 (anim2)These are offsets (dwords), which point to the animation frame data for each "frame mode" of a structure. quick example,the exe im looking at: const yard anim0 comes to 0x3A900below data appears as 'ZYYY'Z is the function to execute Y is the dataZ indexs: ( field is shifted right 12 bits before use )0: Remove structure from map, clear the anim cell data struct1: clear the anim cell data struct2: not sure3: set a wait + random time4: reset to step 05: play a sound effect6: set the frame number (based in the icon data)7: decrease step by "8: change the gfx id (this id would be set initially to the construction yard id (17) in this case)9: calls 0flapping of the flag on the const yard:seg123:0000 02 60          dw 6002h                   seg123:0002 1E 30          dw 301Ehseg123:0004 03 60          dw 6003hseg123:0006 1E 30          dw 301Ehseg123:0008 00 40          dw 4000h0: set frame to 21: wait 0x1e + (seed & 3)2: set frame to 33: wait 0x1e + (seed & 3)4: set step to 0       (infinite loop) Quote Link to comment Share on other sites More sharing options...
segra Posted October 5, 2009 Share Posted October 5, 2009 theres also a few fields which are not used (editing them is pointless, as the game overwrites during runtime)Structures:Unknown 24: Used inbetween the game and the Choam screen, is set to 1 if the structure can be built, -1 if an upgrade is needed, and 0 if dont showUnits:Unknown 21: Same as Structures Unknown 2422-23 i believe are used similar Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted October 5, 2009 Author Share Posted October 5, 2009 the exe im looking at: const yard anim0 comes to 0x3A900Huh, how does that translate? The actual data in the exe is "00 00 2A 90". It also seems that the final actual offset is 2F500You know, with this data, I'm tempted to put a script editor for this in my editor.. thought that'd be tons of work. Might have to add a "level 5" in the internals (for scrolling and selecting items - 1=types list, 2=items list, 3=options list, 4=editing mode list) :P Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted October 5, 2009 Share Posted October 5, 2009 0: Remove structure from map, clear the anim cell data struct1: clear the anim cell data struct2: not sure3: set a wait + random time4: reset to step 05: play a sound effect6: set the frame number (based in the icon data)7: decrease step by "8: change the gfx id (this id would be set initially to the construction yard id (17) in this case)9: calls 0flapping of the flag on the const yard:seg123:0000 02 60          dw 6002h                   seg123:0002 1E 30          dw 301Ehseg123:0004 03 60          dw 6003hseg123:0006 1E 30          dw 301Ehseg123:0008 00 40          dw 4000h0: set frame to 21: wait 0x1e + (seed & 3)2: set frame to 33: wait 0x1e + (seed & 3)4: set step to 0       (infinite loop)Hm, this reminded me of the stuff at the beginning of BUILD.EMC. Actually, I think it might very well be the same thing :) Quote Link to comment Share on other sites More sharing options...
segra Posted October 6, 2009 Share Posted October 6, 2009 Huh, how does that translate? The actual data in the exe is "00 00 2A 90". It also seems that the final actual offset is 2F500not sure exactly, but i use it like thisword *cResourceExe::animPtrGet( size_t pAddress ) { byte *test = _bufferExe + (pAddress >> 12) + 0x4C00; return (word*) test;}0x4C00 is start of segment 0 in this particular exeHm, this reminded me of the stuff at the beginning of BUILD.EMC. Actually, I think it might very well be the same thing :)your close ;) (the var name 'frame' in the building stuff is misleading, however it was named in the emcpack tools years ago... so ive left it as is)but at the start of build.emc is a script which is executed by all buildings when placed on field.it flickers between the construction frame script, which is number -1 (255) which only displays 1 frame, the construction frameand the buildings "anim0" frame scriptstart of the script,Push        255Execute      SetFrame AddSP       1Push        15Execute      Delay AddSP       1Push        0Execute      SetFrame Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted October 6, 2009 Share Posted October 6, 2009 So is there a way to determine what Unknown 006 bit 6 is about? I keep wondering why it's off for all units in v1.0 and on for everything except projectiles in 1.07. Could it be that this has something to do with units getting stuck at map borders? In v1.0, Carryalls sometimes get stuck at the border of the map when bringing in reinforcements, and I suspect this happens to Frigates as well. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted October 6, 2009 Author Share Posted October 6, 2009 0: Remove structure from map, clear the anim cell data struct1: clear the anim cell data struct2: not sure3: set a wait + random time4: reset to step 05: play a sound effect6: set the frame number (based in the icon data)7: decrease step by "8: change the gfx id (this id would be set initially to the construction yard id (17) in this case)9: calls 0What exactly do you mean with #1 and #7, and what's the difference between 4 and 9? Quote Link to comment Share on other sites More sharing options...
segra Posted October 6, 2009 Share Posted October 6, 2009 an array using the following structure,00000000 struc_13    struc ; (sizeof=0x11)00000000 timer     dd ?00000004 foundationSize dw ?00000006 houseID    db ?00000007 tileFrameCount db ?00000008 structGfxID  db ?00000009 tileAnimData  dd ?0000000D posX      dw ?0000000F posY      dw ?00000011 struc_13    endsis used at runtime for every "map cell animation" thats running (atleast one for each structure)#1, clears the structure in the array (stops the animation)#7, the current 'step'/'tileAnimData' ptr is reduced by X (X is supplied as the data)(these are what i meant by steps)seg123:0000 02 60         dw 6002h                  seg123:0002 1E 30         dw 301Ehseg123:0004 03 60         dw 6003hseg123:0006 1E 30         dw 301Eh9 does the same as 0, removes the structure animation from the screen and wipes the data struct4 goes back to the start of the animation Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted October 6, 2009 Author Share Posted October 6, 2009 So 7 is just a manual and more detailed way of looping, where 4 is the automated full loop? Right, I think I get it now. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted October 7, 2009 Share Posted October 7, 2009 Hm, it appears that even if you activate the "Can target air units" bit on Troopers in v1.0, they still don't attack the player's 'Thopters. Guess there has to be something in UNIT.EMC as well to enable suchlike behavior. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted October 7, 2009 Author Share Posted October 7, 2009 It's probably because of the weapon switch exception. Quote Link to comment Share on other sites More sharing options...
Will Posted October 8, 2009 Share Posted October 8, 2009 I have a question. I'm trying to turn the IX into an AI-controlled Starport (as inspired by Dune2EX, the Ordos & Mercs have access to a starport instead of a factory). The way I want to do this is to turn the IX into a factory that LOOKS like the starport but acts as a heavy factory (and is obviously only controllable by the AI). The graphic switch succeeded, but I can't get the AI to use it to produce units. I set "has a build screen" to YES, but it still doesn't work.When I give myself one of these buildings, it has the build unit icon of a carryall (which does nothing), and I can't enter the building's construction screen. Did I miss something? Do I have to change something in build.emc? Quote Link to comment Share on other sites More sharing options...
Daelin Posted October 8, 2009 Share Posted October 8, 2009 The fact that the build screen is activated is just a graphic/interface tweak. It does not actually ALLOW the building to "build stuff" or even access a build menu for the building. This menu is hardcoded somewhere else "probably in BUILD.EMC".-Daelin Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted October 8, 2009 Share Posted October 8, 2009 The fact that the build screen is activated is just a graphic/interface tweak. It does not actually ALLOW the building to "build stuff" or even access a build menu for the building. This menu is hardcoded somewhere else "probably in BUILD.EMC".Hardcoded, yes, but not in BUILD.EMC - it's in the EXE. We discussed it with segra a while ago:I think this is worth mentioning. I've been playing around with structure editing and, among other things, tried converting the House of IX into a factory-type structure. I copied all the data from WOR and later Hi-Tech Factory using Nyerguds' editor, and although the IX structure got a clickable icon and an option to build a Carryall (no matter what actual units I specified in the build list), I couldn't either open the actual build menu by clicking on the icon, or produce anything: the production of a Carryall could be started by clicking on the "Build It" icon, and it would reach 100% and say "Complete", yet the Carryall would not come out of the structure at all. I thought the data defining if a structure can produce units or not is defined via BUILD.EMC, but found that the part of the script referring to the IX structure is identical to that of WOR - reveal terrain, play animation, nothing else.Does it mean there are other places in the EXE where data concerning such things as described above is stored?Kinda doesn't surprise me, all throughout the game code exists segments such as thisseg007:05B6 C4 1E C0 84           les  bx, buildingGamePtrCurrentseg007:05BA 26 80 7F 02 0A          cmp  es:[bx+_buildingGame.TypeIndex], 0Ah ; Barracksseg007:05BF 74 72              jz   short BarracksWORseg007:05C1 C4 1E C0 84           les  bx, buildingGamePtrCurrentseg007:05C5 26 80 7F 02 07          cmp  es:[bx+_buildingGame.TypeIndex], 7 ; WORseg007:05CA 74 67              jz   short BarracksWORseg007:05CCThe "TypeIndex" field is actually the index into the data table (this code jumps to a location if its in the WOR/BARRACKS data position)... alot of code is like this Quote Link to comment Share on other sites More sharing options...
segra Posted October 9, 2009 Share Posted October 9, 2009 build menu is generated when you click the choam button, it uses the various hardcoded datafields, as well as some runtime onesthe code is similar to this, map< word, sData* > buildList; dword structs = houseGet()->structuresHaveGet(); dword structsNeeded; word ax; switch( typeGet() ) { case _StructureType_LightFactory: case _StructureType_HeavyFactory: case _StructureType_HiTech: case _StructureType_WOR: case _StructureType_Barracks: for( word si = 0; si < 8; ++si ) { ax = dataGet()->constructOpt[si]; if(ax == 0xFFFF) continue; if(ax == 0x0D && scriptDataGet()->stack[0x0F] == 2) ax = 0x0E; sUnitData *unitData = engineGet()->resourcesGet()->unitGet( ax ); short int di = (short int) unitData->UpgradesNeeded; if( ax == 0x0A && scriptDataGet()->stack[0x0F] == 2) --di; structsNeeded = (structs & unitData->PreReqs); if( structsNeeded != unitData->PreReqs) continue; word dx = (1 << scriptDataGet()->stack[0x0F]); if( !(unitData->Owner & dx )) continue; if( _techLevel >= di ) { buildList.insert( make_pair( 1, unitData ) ); continue; } if( _techUpgradeProgress == 0 ) continue; ax = _techLevel + 1; if( ax < di ) continue; buildList.insert( make_pair( 0xFF, unitData ) ); } return buildList; case _StructureType_IX: case _StructureType_Windtrap: return buildList; case _StructureType_ConstYard: for( word si = 0; si < 0x13; ++si ) { sStructureData *structData = engineGet()->resourcesGet()->structureGet( si ); word di = structData->Techlevel; structsNeeded = structData->PreReqs; if( si == _StructureType_WOR ) { if( _house->houseIDGet() == eHouse_Harkonnen ) if( engineGet()->missionNumberPreviousGet()Â >= 1 ) { structsNeeded &= 0xFFFFFBFF; // fixme? di = 2; } } structsNeeded = (structs & structData->PreReqs); if(structsNeeded != structData->PreReqs) { if( houseGet() == engineGet()->houseHumanGet() ) continue; } if( houseGet()->houseIDGet() != eHouse_Harkonnen && si == _StructureType_LightFactory ) di = 2; ax = di; --ax; if( ax > engineGet()->missionNumberPreviousGet() ) continue; ax = structData->Owner; word dx = (1 << houseGet()->houseIDGet()); if( !(dx & ax )) continue; ax = structData->CYUpgradesNeeded; if( ax <= _techLevel || _house != engineGet()->houseHumanGet() ) { buildList.insert( make_pair( 1, structData ) ); continue; } if( !_techUpgradeProgress ) continue; ax = structData->CYUpgradesNeeded; if( ax > (_techLevel + 1) ) continue; buildList.insert( make_pair( 0xFF, structData ) ); } return buildList; case _StructureType_Starport: buildList.insert( make_pair( 0xFF, (sData*) 0x0 ) ); return buildList; default: return buildList; } Quote Link to comment Share on other sites More sharing options...
segra Posted October 9, 2009 Share Posted October 9, 2009 also, from the anim data modes above,mode 2 is almost a match to mode 6, however it checks the fog of war status for the particular map position firstif the fog is on for the tile, it doesnt do anything Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted October 9, 2009 Author Share Posted October 9, 2009 Man, why on earth didn't they put a building construction type in the building stats and make the case check on that? -_-Hmm... you know, with the leftover blank bytes we got from some 2-byte bit flags that use less than 8 bits, we could theoretically squeeze that in there :)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 Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted October 9, 2009 Share Posted October 9, 2009 On a vaguely related note, segra, is it possible to fix the flashing item selection box on build lists for the new sides? Normally, the selection box that indicates the currently selected item flashes and has the current House's color; with the new sides in Super Dune II, the selection box is always white:EDIT: File type 6 seems to mark PAK files that are absolutely necessary for the game to run, and without which the game will refuse to load at all.Also, it makes the game freeze while reading a Mentat database entry if a MENTAT?.ENG file edited with SSTEditor is inside ENGLISH.PAK :) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted October 9, 2009 Author Share Posted October 9, 2009 Nice info on the PAK types.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. 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.