sandworm Posted August 16, 2012 Share Posted August 16, 2012 Hey everyone, I had some questions that I wanted to ask because I needed help on certain things for dune 2. I first just wanted to say I am impressed with the effort and work that alot of you have done for a Gem such as dune 2. I have been active on the Dune 2000 editing board but I decided to play around with Dune 2. I know these questions should be asked in the appropriate topic, but they vary from topic to topic that would be easier to put all on one post. So any way here are my dilemmas that I hope you can help me with: 1.) I own the Dune 2: Building of a dynasty US Version 1.07. I downloaded the Dune 2 1.07 fix and copied the contents of the DYNASTY folder. Now I read alot on what It fixed in the game such as the "Team Bug" As well as "Looped Reinforcements". How ever these changes do not take effect. The AI still does not team nor do Reinforcements repeat at all. I edited some Scenario files to show these implications but it dosent seem to have taken effect. I also saw a file called PatchWise.log stating this SETUP.EXE -> Original file CRC error occurred, it has been skipped. SETUPENG.DIP -> Original file CRC error occurred, it has been skipped. ENGLISH.PAK -> Original file CRC error occurred, it has been skipped. SCENARIO.PAK -> Original file CRC error occurred, it has been skipped. DUNE2.EXE -> Original file CRC error occurred, it has been skipped. Im guessing the fix did not work? 2.) I saw some topics on EMC editing here http://forum.dune2k....c-pages-opened/. I tried opening the page with the edited Build.EMC file but the page is down since Im so late in the game. Would any one have information on how to open EMC files with notepad? Or would anyone still have the updated Build.EMC file? 3.) I notice many people were able to decomplie the exe and edit it in C/C++ code. Was the source obtained by someone? I looked at OpenDune but I did not find the original Dune 2 source. Any answers and suggestions is GREATLY appreciated. Thanks for taking the time to read/answer. Quote Link to comment Share on other sites More sharing options...
drnovice Posted August 17, 2012 Share Posted August 17, 2012 Welcome.AFAIK, "Building of a Dynasty" is only v1.00 and only US. "Battle for Arrakis" is v1.07 and it can be found EU or US version.So check the starting screen:You should read V1.0 (on bottom right) if it says "The Building of A Dynasty".About fixes, if you has downloaded this:you should find all versions. So make sure that you have right version.To open ecm files ask to MrFibble or segra or minniat in this forum.I think that TrueBrain works to transform into C-code all dune2 original game. Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 17, 2012 Author Share Posted August 17, 2012 Thank you so much for the reply drnovice.I have checked my version on the screen and I didnt even notice the hard to read numbers in the bottom right corner and I indeed have 1.07. I would like to clarify that the Team bug is actually fixed, which is probably after applying the "dune 1.07 fix".How ever, does the 'looped reinforcement fix' correct the repeating reinforcements? Because after editing several scenarios and apply the 'repeat delivery' option, the reinforcements do not repeat.As for the Emc I will try and message MrFibble, TrueBrain and Segra. Thanks again for the help. Quote Link to comment Share on other sites More sharing options...
drnovice Posted August 17, 2012 Share Posted August 17, 2012 About loop reinforcements:http://forum.dune2k....ns/page__st__20A little fix for you. it should work with all versions,however the scenario files require editing.instead of1=Atreides,Siege Tank,Homebase,1+this needs to be changed to1=Atreides,Siege Tank,Homebase,1,+Find: 168D865EFF509AF83A000083C4088BD88EC2Replace with: 6A006A009090ovr188:0DE3 16 push ssovr188:0DE4 8D 86 5E FF lea ax, [bp+dest]ovr188:0DE8 50 push axovr188:0DE9 9A F8 3A 00 10 call unknown_libname_3 ; TCC/TCC++/BCC++ 16 bit DOStoovr188:0DE3 6A 00 push 0ovr188:0DE5 6A 00 push 0ovr188:0DE7 90 nopovr188:0DE8 90 nopovr188:0DE9 9A F8 3A 00 10 call unknown_libname_3 ; TCC/TCC++/BCC++ 16 bit DOSYou should modify dune2.exe file with a hex editor finding the string that segra has indicated.I think you should replace only first 6 bytes: 168D865EFF50 -> 6A006A009090 Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 17, 2012 Share Posted August 17, 2012 AFAIK, "Building of a Dynasty" is only v1.00 and only US. "Battle for Arrakis" is v1.07 and it can be found EU or US version.So check the starting screen:You should read V1.0 (on bottom right) if it says "The Building of A Dynasty".Nope, this is incorrect, as the US v1.07 is also titled "The Building of A Dynasty". Here's some more detailed info about the differences between the versions that are labelled 1.07:http://forum.dune2k.com/topic/23786-different-versions-amipc1017useuhs/#entry371683So any way here are my dilemmas that I hope you can help me with:1.) I own the Dune 2: Building of a dynasty US Version 1.07. I downloaded the Dune 2 1.07 fix and copied the contents of the DYNASTY folder. Now I read alot on what It fixed in the game such as the "Team Bug" As well as "Looped Reinforcements". How ever these changes do not take effect. The AI still does not team nor do Reinforcements repeat at all. I edited some Scenario files to show these implications but it dosent seem to have taken effect.I also saw a file called PatchWise.log stating thisSETUP.EXE -> Original file CRC error occurred, it has been skipped.SETUPENG.DIP -> Original file CRC error occurred, it has been skipped.ENGLISH.PAK -> Original file CRC error occurred, it has been skipped.SCENARIO.PAK -> Original file CRC error occurred, it has been skipped.DUNE2.EXE -> Original file CRC error occurred, it has been skipped.Im guessing the fix did not work?You've been using a very old version of the fix that relies on a patcher called PatchWise Free. I've updated the fix numerous times since then, and now it just contains modified Dune II. As drnovice pointed out, the downloads for the latest version of the fix are located here:http://forum.dune2k.com/topic/20168-dune-2-v107-fix/It has all the fixes including the looped reinforcements, so you don't need to edit anything yourself after you have installed the fix.2.) I saw some topics on EMC editing here http://forum.dune2k....c-pages-opened/. I tried opening the page with the edited Build.EMC file but the page is down since Im so late in the game. Would any one have information on how to open EMC files with notepad? Or would anyone still have the updated Build.EMC file?Editing EMC files is a pretty advanced type of modding. You actually don't need the edited EMC file from Minniatian's site as it doesn't work well with v1.07 (it was written for v1.0) and may cause instability and weird behaviour in the game. Besides, it introduces changes into the game balance, while the Dune 2 fix is aimed at removing bugs and errors so that the game can be played as it was intended by the developers.If you're still interested, Segra also wrote a utility called Dune 2 Script Tools that also handles EMC files (not sure the download links still work though).3.) I notice many people were able to decomplie the exe and edit it in C/C++ code. Was the source obtained by someone? I looked at OpenDune but I did not find the original Dune 2 source.The original Dune 2 source code was never released. You can only obtain the source for the OpenDUNE project and also Segra's OD2, both of which are results of reverse engineering. They're pretty accurate at reproducing the original game's engine though, so it's the next best thing to the original source code.BTW, sandworm, could you please tell more about your version of Dune II? Is it a CD or a floppy version? Did you have to patch it to v1.07, or did already come patched? And if this isn't troublesome to you, could you please check if the fixed DUNE2.EXE in the DYNASTY folder of the latest release of the fix is identical in size to the original DUNE2.EXE in your version? Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 17, 2012 Share Posted August 17, 2012 He can always do a quick identification by launching my editor in his game folder ;) 1 Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 17, 2012 Share Posted August 17, 2012 Yes, that would be a great idea (if the patcher refused to work with the files in spite of it being the US version, I think there's a possibility that this is a different release of the game). Quote Link to comment Share on other sites More sharing options...
drnovice Posted August 17, 2012 Share Posted August 17, 2012 MrFibble, thanks for the tip on different Dune 2 versions ;)Good idea to use nyerguds editor to know .exe version. Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 17, 2012 Author Share Posted August 17, 2012 @drnovice : Thank you so much for pointing that out! Reinforcements are indeed repeating now. I was using the scenario editor "DuneMaps" which has the option to add a repeating reinforcememnt but it was setting it up as #=House,Unit,Location,Time+. Thanks once again for that.@MrFibble : Thats the page I actually downloaded the fix from, and I was wrong, The patch did actually work, because I did notice the AI using the team-setup as well as some other fixes. As for the EMC, I actually did look at that topic and tried the URL but it was down. The one thing that interested me was the Repair structure function, in that a carry-all would always return a unit regardless of being blocked off by other buildings.@Nyerguds : Way ahead of you. I used your editor many times and its great, I did some modifying using that utility.Now I would love to be able to modify some of the coding in dune. I would love to implement an AI vs AI code that would allow an AI unit be allied to player and construct units/buildings attack etc. I saw the Dune2extended forum discussing this but I didnt see how they were actually able to code it.Thanks again for all your help guys, appreciate it. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 17, 2012 Share Posted August 17, 2012 I would love to implement an AI vs AI code that would allow an AI unit be allied to player and construct units/buildings attack etc. I saw the Dune2extended forum discussing this but I didnt see how they were actually able to code it.So far no one actually succeeded making a fully functional ally AI, but you're welcome to try. Creating an allied side basically just switches the already coded alliance between the Atreides and Fremen in the original game. Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 18, 2012 Author Share Posted August 18, 2012 So far no one actually succeeded making a fully functional ally AI, but you're welcome to try. Creating an allied side basically just switches the already coded alliance between the Atreides and Fremen in the original game.I would figure as much, I guess the real difficulty would be locating that code. Quote Link to comment Share on other sites More sharing options...
drnovice Posted August 18, 2012 Share Posted August 18, 2012 http://forum.dune2k.com/topic/18875-dune-2-exe-editing-programming-issues/page__st__380Here I explain how managed a different AI allied (different to Fremen) whatever is the player (so not only Atreides).Keep in mind that even original game didn't expect a Fremen base in a player Atreides campaign, also because it would limit significantly the gameplay and the player's resources, especially in the later missions where you would like to do a campaign where you find the player going up against 2 or 3 factions on him.If your AI allied takes to you spice and space to start your attacks, gameplay is affected for the worse. Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 19, 2012 Author Share Posted August 19, 2012 Ah yes that was the thread I was looking at. I was wondering what program you used to for editing the Dune files to give you that layout? Its also noted that having an allied faction with the player would affect the players gameplay experience. Since spice does not regenerate like in Dune2000 its a competition between all houses for spice. But never the less I always add many spice fields to each level in the scenario editor to create more longevity to the level :) . Quote Link to comment Share on other sites More sharing options...
drnovice Posted August 19, 2012 Share Posted August 19, 2012 Just open Dune2.exe file with a hex editor and search for hex pattern:11C45E0626807F08037511833E2C3A01or11C45E0626807F08037511833E383A01(it depends to different versions 2C byte reference may change into 38 byte, so if you can't find a pattern try with the other one)and modify the orange/blue bytes with the faction that you decide have the AI allied, and pink bytes with 74 (75 is jnz, 74 is jz).e.g. if pattern found is:11C45E0626807F08037511833E2C3A01and you want play Ordos as human with Mercenary AI that is allied, just change so:11C45E0626807F08027411833E2C3A02then search for this pattern:83FA03740583FB03750E83FA01740583FB01and change orange faction IDs bytes into Mercenary id faction, therefore change blue faction IDs bytes into Ordos di faction:83FA05740583FB05750E83FA02740583FB02IDs factions legend:00 -> Harkonnen01 -> Atreides02 -> Ordos03 -> Fremen04 -> Sardaukar05 -> Mercenary Quote Link to comment Share on other sites More sharing options...
drnovice Posted August 19, 2012 Share Posted August 19, 2012 About Dune different layout, read carefully ALL these topics:http://forum.dune2k....ramming-issues/http://forum.dune2k....tended-project/http://forum.dune2k....th-107-support/ Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 19, 2012 Share Posted August 19, 2012 Ah yes that was the thread I was looking at. I was wondering what program you used to for editing the Dune files to give you that layout?Segra has made a very comprehensive analysis of DUNE2.EXE in the form of an IDA database. You can get it from Nyerguds' website. The database is very handy for locating pieces of the code that perform certain functions within the game. Also, reading the source if OpenDUNE could be helpful as well but personally I've never used that method.Its also noted that having an allied faction with the player would affect the players gameplay experience. Since spice does not regenerate like in Dune2000 its a competition between all houses for spice. But never the less I always add many spice fields to each level in the scenario editor to create more longevity to the level :) .Well you could always cheat a bit to create seemingly endless sources of spice by destroying half-full harvesters on the sand to create additional patches of spice. Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 20, 2012 Author Share Posted August 20, 2012 I cant thank you enough for this info guys. Im going to try play around with some coding and see if I can get it working but ill be back to let you know how it goes and If I have questions I will indeed ask.Well you could always cheat a bit to create seemingly endless sources of spice by destroying half-full harvesters on the sand to create additional patches of spice.Or I could keep destroying my own harvester and aquire 5 solaris every time lol. But I dont think there is enough time in the day for that. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 21, 2012 Share Posted August 21, 2012 Or I could keep destroying my own harvester and aquire 5 solaris every time lol. But I dont think there is enough time in the day for that. Actually, destroying harvesters that are >= 50% full while on sand creates spice patches worth a lot more that they had harvested, and is a long-known valid tactic, even though it's an exploit. Not to mention that if you do that to the AI, you drain its economy that way.Anyway, I've found Minniatian's old EMC patch and EMC editor, which I've attached to the post. Also, I've uploaded the BUILD.EMC version I did for v1.07 as part of the SD2 Classic/DuneX project, but then removed it from the game because people reported unstable behaviour. It only adds the automatic transportation of repaired units back to where they were picked, but please note that a similar result may be achieved by surrounding a Repair Facility with walls or other structures so as to block any ground exit from it:o When a unit has been repaired at a facility which is tightly surrounded by other buildings, walls, or ground units, a carryall will remove that unit and return it to the battlefield. If that unit was originally brought to the facility by carryall, then the carryall which retrieves the repaired unit will attempt to return it to its original location on the battlefield.(from Ledmeister's FAQ which is about the Sega Mega Drive version but most things apply to the PC version as well)As for the structure decay fix, a better solution has been found by TrueBrain of the OpenDUNE project:(..)Does this mean the original game can be modified so that buildings on slabs won't decay at all, while those built on incomplete foundations or without any foundations at all will decay?Yes. You only have to NOP a few instructions. Sadly, I can't tell you where, as the locations in OpenDUNE are already relocated, and do not represent any sane position inside the executable.If I have to make a guess, and based on information I can recover, you will have to search for:C4 5E 06 ; les bx, [bp+06]26 81 4F 04 00 04 ; or es:[bx+4],0400C4 5E FC ; les bx, [bp-04]And you will need to NOP (= 0x90) the second line (for all 6 bytes). Or you can search only for the second line, and then it is most likely the second hit. Of course all references in Dune 1.07eu version ;) Let me know if it works :)EMCPack.zipEMCPatch12.zipBUILD_EMC_SD2.ZIP Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 21, 2012 Author Share Posted August 21, 2012 Actually, destroying harvesters that are >= 50% full while on sand creates spice patches worth a lot more that they had harvested, and is a long-known valid tactic, even though it's an exploit. Not to mention that if you do that to the AI, you drain its economy that way.Yes I know I was joking around with the harvester exploit.I checked out the building decay code, but im not quite sure what to alter around in that post from Truebrain Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 23, 2012 Author Share Posted August 23, 2012 but please note that a similar result may be achieved by surrounding a Repair Facility with walls or other structures so as to block any ground exit from it:Yes I know that, but I find it tedious and a bit of a nuisance especially since the AI value the Repair facility and Heavy Factory at a higher threat level than other buildings, So I like to place them as far behind my base as possible to make them go through my defenses. So it would be great to just have my Carry-All bring the unit right back to where it was instead of constantly returning the unit manually. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 24, 2012 Share Posted August 24, 2012 Yes I know that, but I find it tedious and a bit of a nuisance especially since the AI value the Repair facility and Heavy Factory at a higher threat level than other buildingsI've noticed that two "layers" of walls just in front of a Heavy Factory supported by turrets of any kind work wonders against the AI (you should only worry about Rocket Launchers).OTOH, most missions have sufficient free space to build a Repair Facility that is entirely enclosed by adjacent structures or walls, even in the rear of the base. Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 25, 2012 Author Share Posted August 25, 2012 I've noticed that two "layers" of walls just in front of a Heavy Factory supported by turrets of any kind work wonders against the AI (you should only worry about Rocket Launchers).Indeed. I also switched the threat level on the Turrets to be higher than that of the regular buildings so the AI will work at my turrets first..adds more of a challenge at least. But I like the idea of the carry-all simply returning the unit regardless of the facility being blocked off.About the structure decay, I looked at the post by truebrain but im still quite confused on what values to change. I noticed some values are highlighted in cyan color, were those the values to change? Quote Link to comment Share on other sites More sharing options...
drnovice Posted August 25, 2012 Share Posted August 25, 2012 If I have to make a guess, and based on information I can recover, you will have to search for:C4 5E 06 ; les bx, [bp+06]26 81 4F 04 00 04 ; or es:[bx+4],0400C4 5E FC ; les bx, [bp-04]And you will need to NOP (= 0x90) the second line (for all 6 bytes).search for:C45E0626814F040004C45EFCand change into:C45E06909090909090C45EFC 1 Quote Link to comment Share on other sites More sharing options...
sandworm Posted August 25, 2012 Author Share Posted August 25, 2012 Again drnovice, greatly appreciated. I guess the 90 is the NOP values he meant. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 25, 2012 Share Posted August 25, 2012 Yes, 90 is No Operation. As for the different colours in the code, don't pay attention to them, it's just how the [code] tags process ASM input. 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.