Will Posted November 13, 2009 Share Posted November 13, 2009 Thanks Nyerguds, I actually have some extremely basic knowledge of assembly and managed it myself. I also successfully removed the code that turned squads into single soldiers at 50% hp (I replaced the single soldiers with the Fremen&Sardaukar troopers :) ), keeping the retreat check. I was quite proud of that one. :DBut trying to answer Flibble's post I realize I actually don't have a clear idea of what changes I'd like to do yet. For now I wanted to make the Sardaukar light factory start upgraded just like the Harkonnen (and also keep the harkonnen upgraded light factory). With or without trike doesn't matter. But the other tech tree stuff in that post seems to be aimed at not displaying the upgrade button if certain conditions are met (that's just a guess, I really can't make much of assembly code)I'll probably have to replace one of the other exceptions but I'm sure I'll find one suitable for that.I am very interested in this. I should *really* learn how to do ASM... Quote Link to comment Share on other sites More sharing options...
jordos Posted November 14, 2009 Share Posted November 14, 2009 I can also find no plausible reason for this. No other unit is handled like that in the game. Perhaps it allows to avoid some side-effects we're still unaware of?Anyway, would be nice if you posted this code exception here (I think it's not mentioned in Segra's posts, unless I'm missing something) :)Luckily Segra also found this exception, it's in the StructureBuildListCreate functionseg010:1D5D loc_1C18D: ; CODE XREF: structureBuildListCreate:loc_1C188jseg010:1D5D 83 7E EE 0D cmp word ptr [bp+buildingDataPtr2+2], 0Dh ; constructOptNseg010:1D61 75 0F jnz short loc_1C1A2 ; Jump if Not Zero (ZF=0)seg010:1D63seg010:1D63 loc_1C193: ; Load Full Pointer to ES:xxseg010:1D63 C4 5E 06 les bx, [bp+buildingGamePtr]seg010:1D66 26 83 7F 47 02 cmp word ptr es:[bx+47h], 2 ; Compare Two Operandsseg010:1D6B 75 05 jnz short loc_1C1A2 ; if(constructOpt == trike)seg010:1D6B ; constructOpt = raidertrike;seg010:1D6D C7 46 EE 0E 00 mov word ptr [bp+buildingDataPtr2+2], 0EhIf the item is a trike (0D) and house is ordos (02) then use the raider trike (0E) instead. I'm going to replace this one with a sardaukar quad, and use nyer's editor to add the raider trike for house ordos instead. Will let you know if anything weird happens when playing house ordos.edit: well guess I'm doing something wrong. I change the 2 (house ID) to 3 and 0E (unit ID) to 0F, but nothing happens against an AI sardaukar and if I set the sardaukar as Human instead of CPU in the scenario the game crashes. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted November 14, 2009 Share Posted November 14, 2009 man, I find all these comments in Segra's DB such a mess... in my own DBs I just show the commands, and nothing more. Quote Link to comment Share on other sites More sharing options...
jordos Posted November 14, 2009 Share Posted November 14, 2009 It probably doesn't help that the alignment is messy even inside the code tags :)edit: Ok, I've looked into the problem with the sardaukar quad (it was late when I posted yesterday), looks like the problem is that it still checks the tech prerequisite after replacing the unit in the build list. So an unupgraded light factory with a trike replaced by a quad will just get that unbuildable carryal instead. I'll have to find another solution for the sardaukar quad :( Anyway, I found no problems using the settings in nyer's program to give the raider trike to house ordos, so if you have another idea for this exception, here is the hex string you need to search for:0D 75 0F C4 5E 06 26 83 7F 47 02 75 05 C7 46 EE 0E0D: the trike unit ID. I suppose you could change it to 0F to replace the quad instead. Edit2: or any unit really, looks like there is no 'factory check' beforehand!02: house id, 0=harkonnen, 1= atreides, 2=ordos, 3=fremen, 4=sardaukar, 5 = mercenary (not sure about those last three)0E: unit ID to replace it with (to get the number, count the unit list in nyer's editor, thopter is 0, carryall is 1 etc etc... Then convert to hex). Just make sure the unit 'upgrades needed' setting matches the unit you're replacing. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted November 14, 2009 Author Share Posted November 14, 2009 Thanks for posting the code, Jordos :)0D: the trike unit ID. I suppose you could change it to 0F to replace the quad instead. Edit2: or any unit really, looks like there is no 'factory check' beforehand!True. Actually, any unit can be produced from any factory/barracks if assigned to it via settings editable by Nyerguds' editor. The only condition is that the factory has been upgraded as many times as specified by the "number of required upgrades" variable in the unit's profile. This is how I found out that the Raiders were a code exception in the first place, when I made a single Vehicle Factory in a release of Dune 2 eXtended: the game refused to allow production of Trikes for the Ordos even if they were switched to a Heavy Factory, and the unit itself was enabled for the House (I made the Sardaukar Trooper unit from the Raider). Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted November 15, 2009 Author Share Posted November 15, 2009 Recently I've been browsing through my old Dune II savegames from v1.0, and noticed that sometimes one of my buildings would explode several seconds after the game was loaded, for no particular reason. Even though this might be a side effect caused by Minniatian's patch (I remember I used it with my v1.0, while now I tested the saved games on a "clean" version), this passage from the Dune II manual came to my mind:Beware, for some Houses booby-trap their own structures in case they fall into enemy hands. These structures may self-destruct right away or they might wait awhile.As far as I remember, I've never witnessed this in action. I wonder if the code for this is present in the game... Judging by what Segra uncovered about the "special" blooms, and the fact that there are no parameters to define booby-trapped structures in the scenario files, maybe this feature would depend on the map seed number and the position of each structure (and perhaps by some House characteristic)? Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted November 19, 2009 Author Share Posted November 19, 2009 TrueBrain of the OpenDUNE project has recently posted some interesting info at the OpenDUNE Forums:[blog 2009-11-16] Dune2 and its code weirdness[blog 2009-11-16] Structure_Place()[blog 2009-11-18] AI and structure rebuildTake a look, there's a lot of new information :) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted November 21, 2009 Share Posted November 21, 2009 He missed the ball on the concrete bug though. The current Dune allows 4 bits, but the correct amount should be 6 bits for all houses, not 3. Quote Link to comment Share on other sites More sharing options...
TrueBrain Posted November 21, 2009 Share Posted November 21, 2009 He missed the ball on the concrete bug though. The current Dune allows 4 bits, but the correct amount should be 6 bits for all houses, not 3.Nope, you can't do math ;) But okay, lets not do this conversation in two forums, shall we? :) Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted November 23, 2009 Author Share Posted November 23, 2009 Nope, you can't do math ;)What Nyerguds meant is that of the four sides that have no problems with concrete placement, only three are originally playable. Only the Mercenaries and the Sardaukar have the concrete bug. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted November 23, 2009 Share Posted November 23, 2009 Turned out it was just a similar-but-different piece of code, and that I was thinking of the global settings I see in the editor all the time, and not the ownership of one object. Meh. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted November 24, 2009 Share Posted November 24, 2009 Hmm, doesn't this mean that the wall placement bug still exists in the new SD2? Quote Link to comment Share on other sites More sharing options...
TrueBrain Posted November 24, 2009 Share Posted November 24, 2009 Hmm, doesn't this mean that the wall placement bug still exists in the new SD2?Possible; but it is hard to exploit, so I think not many people will notice :) In the worst case, when the A/O/H/S builds a wall, the owner becomes F/M. so it has less impact than the concrete bug. Quote Link to comment Share on other sites More sharing options...
Skrilax_CZ Posted November 24, 2009 Share Posted November 24, 2009 btw. there is a bug with minimaps and new houses colors:on small map -> all new houses (Sardaukar = ground, Fremen = sand, Mercenary = spice)on big map -> Mercenary only (have sand color) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted November 25, 2009 Share Posted November 25, 2009 Possible; but it is hard to exploit, so I think not many people will notice :) In the worst case, when the A/O/H/S builds a wall, the owner becomes F/M. so it has less impact than the concrete bug.Ehh, the point is, you play with the extra sides in SD2. Won't that affect them when trying to build walls? Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted November 25, 2009 Author Share Posted November 25, 2009 Hmm, doesn't this mean that the wall placement bug still exists in the new SD2?I haven't noticed anything like that: with the fix, walls are built and placed down normally for the new sides.More stuff at the OpenDUNE Development Blog:[blog 2009-11-24] GameLoops[blog 2009-11-22] GameLoop_House[blog 2009-11-22] Scripting Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted November 25, 2009 Author Share Posted November 25, 2009 It is interesting to note that the Light Factory tech level is 3, yet this is only true for House Harkonnen. Every other house and side, including the unplayable ones, get to build the Light Factory starting with mission 2. I wonder how they did that, with 5 code exceptions for each House or what? ;D Quote Link to comment Share on other sites More sharing options...
Daelin Posted November 25, 2009 Share Posted November 25, 2009 Actually I think a comparison with Harkonnen followed by a JNE (jump not equal) instruction is performed.Probably equivalent in C is something likeif (house!=Harkonnen) //allow build Light-Factory[obviously only for level 2]-Daelin Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted November 26, 2009 Author Share Posted November 26, 2009 I also thought this would be an optimal solution, but I hoped someone would point to the exact part of the code ;) Quote Link to comment Share on other sites More sharing options...
jordos Posted November 26, 2009 Share Posted November 26, 2009 Here you go :) (in the structurebuildlistcreate function)seg010:1C74 loc_1C0A4: ; Check Houseseg010:1C74 26 80 7F 08 00 cmp es:[bx+_buildingGame.houseID], 0seg010:1C79 74 08 jz short loc_1C0B3 ; Jump if house=harkonnenseg010:1C7Bseg010:1C7B loc_1C0AB: ; Check building typeseg010:1C7B 83 FE 03 cmp si, 3seg010:1C7E 75 03 jnz short loc_1C0B3 ; Jump if building is not light factoryseg010:1C80seg010:1C80 loc_1C0B0:seg010:1C80 BF 02 00 mov di, 2 ; Change tech level to 2Pretty much exactly what Daelin suggested. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted November 27, 2009 Author Share Posted November 27, 2009 Thanks! :)(I moved this to the DUNE2.EXE editing thread, as it seems more on-topic here) Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted December 6, 2009 Author Share Posted December 6, 2009 I've posted some info about Saboteurs' (buggy) behavior at the OpenDUNE forums:http://forum.opendune.org/viewtopic.php?p=111#p111 Quote Link to comment Share on other sites More sharing options...
TrueBrain Posted December 17, 2009 Share Posted December 17, 2009 I wonder about two things, one of you might be able to help out with.First, the CY, Heavy Factory, ... have an icon you can click, which allows you to select something to build. In Dune2 there is also code for units, where that icon becomes clickable. Is there any unit which allows this? The unit can't build something, it only allows clicking the image which brings it to something (no idea what, as I can't find a unit which does that ;)).Second, the repair facility now shows this weird ugly icon of the unit it is repairing. There is lots of code to make it behave the same as CY and stuff, where you can even put the repair on hold. This code of course is never really called, but all of it is still in Dune2. Is there any version which has this? Or maybe it is some switch?Well, I hope any of you ever encountered either of the above. Any feedback would be appreciated. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted December 17, 2009 Author Share Posted December 17, 2009 First, the CY, Heavy Factory, ... have an icon you can click, which allows you to select something to build. In Dune2 there is also code for units, where that icon becomes clickable. Is there any unit which allows this? The unit can't build something, it only allows clicking the image which brings it to something (no idea what, as I can't find a unit which does that ;)).No, there are no such units, unto my knowledge. Maybe some value modifiable by Nyerguds' editor can switch this on for a unit, but to behave like a production facility (and not only have an icon on the sidebar you can click with a mouse), there has to be a separate chunk of code: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 thisSecond, the repair facility now shows this weird ugly icon of the unit it is repairing. There is lots of code to make it behave the same as CY and stuff, where you can even put the repair on hold. This code of course is never really called, but all of it is still in Dune2. Is there any version which has this? Or maybe it is some switch?That's a very interesting find, indeed. However, none of the versions known to us so far allow to pause unit repairs. Maybe Segra documented this feature in his database? Quote Link to comment Share on other sites More sharing options...
Daelin Posted December 17, 2009 Share Posted December 17, 2009 I doubt that is actually possible. The "clickable icon" thingy is building-related. If by messing with a certain byte you actually got the mentioned behavior it would be awsome to actually mention it. :)And as for "repair hold".... I wonder if this can't be achieved by some sort of scripting in an EMC file or something (if I'm not mistaken that's how the "always return to repaired units to previous position on the map" and the "turret increased range" thingies were solved).-Daelin 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.