segra Posted August 17, 2009 Share Posted August 17, 2009 far as I can tell Dune2 is just C, nothing resembles anything ive seen in newer compiled c++ code... but who knows with an old school compiler?theres no vftables, so id assume its only CSome people like to digg into EXE's and disassemble them ? ;)Bingo :) its just a hobby, theres something interesting in pulling apart a game you used to love and figuring out its internals. done about 5 of em so far, havnt got over it yet :P Quote Link to comment Share on other sites More sharing options...
mvi Posted August 18, 2009 Share Posted August 18, 2009 Just a random comment which might be of interest. Dune 2000 was made in C++ Lite with minimal inheritance. I would wager that Dune II is straight C, from my impression from talking with a former Westwood employee. Quote Link to comment Share on other sites More sharing options...
XTF Posted August 18, 2009 Share Posted August 18, 2009 from my impression from talking with a former Westwood employee.Who did you talk to?Dune 2000 is based on the TD/RA engine AFAIK. Quote Link to comment Share on other sites More sharing options...
stefanhendriks Posted August 18, 2009 Share Posted August 18, 2009 C++ Lite, is that the Atari version which is basically just C with some improvements and some premade engine? I hope not, it sounds almost too unimpressive for Westwood. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 18, 2009 Author Share Posted August 18, 2009 Dune 2000 is pretty different from the C&C engine though. It wasn't even made by the same team. It doesn't use any of the typical C&C/Dune2 file or archive formats. Quote Link to comment Share on other sites More sharing options...
stefanhendriks Posted August 18, 2009 Share Posted August 18, 2009 Meh, it is a shame that Westwood (or was it EA really?) did not really did their best to create D2K.I always had the idea of improving D2TM in such a way, that I can create my own D2K one day (D2KTM ;)). Quote Link to comment Share on other sites More sharing options...
XTF Posted August 18, 2009 Share Posted August 18, 2009 Why? What advantage would the Dune 2000 version of TM have over the Dune 2 version? Quote Link to comment Share on other sites More sharing options...
stefanhendriks Posted August 18, 2009 Share Posted August 18, 2009 Why? What advantage would the Dune 2000 version of TM have over the Dune 2 version?We're kinda hijacking this thread;But, the first reason would be because it is fun to do (ie, some like hacking EXE's, some like creating remakes ;)).Second reason is because D2K seems to be quite tough to mod (especially Single Player).Third reason, because technically D2K is not all that different from D2TM i think. Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 18, 2009 Share Posted August 18, 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.I share this philosophy as well :) Actually, I'm pretty much a retro gamer ;) Besides, none of the Dune II clones have as yet been able to recreate the game with 100% accuracy. Quote Link to comment Share on other sites More sharing options...
stefanhendriks Posted August 18, 2009 Share Posted August 18, 2009 Besides, none of the Dune II clones have as yet been able to recreate the game with 100% accuracy.Danger, this is very subjective! :DBut i do get what you mean. I've actually played the original Dune II again, only a little bit (sorry, did not try any of the patches here) though. And it just has a certain feel in it. It actually made me think that any remake with a higher res of 320x200 will fail ::) Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 18, 2009 Share Posted August 18, 2009 In fact, I do doubt there's a real need to make a 100% accurate recreation, since DOSBox/VDMSound remove most compatibility issues. Remakes should add new stuff :) However, if somebody made a "Dune II Gold" similar to C&C Gold (higher resoltuion without any real additions - maybe only the multiple unit selection box) would be nice.I still believe any remake should emulate certain aspects such as unit behavior, movement and combat as close to the original as possible. Quote Link to comment Share on other sites More sharing options...
mvi Posted August 18, 2009 Share Posted August 18, 2009 Second reason is because D2K seems to be quite tough to mod (especially Single Player).It's not that difficult to mod, I'm working a series of tools which I will be releasing. Mission modding has come a long way in the last few weeks, we now understand much of the structure, and how these files were created. Hopefully we will understand a lot more of these files once the original gameplay programmer is tracked down and I'm able to ask a few questions.I don't know anything about the other Westwood games file formats, so I couldn't say how D2k files compare. Quote Link to comment Share on other sites More sharing options...
Gobalopper Posted August 18, 2009 Share Posted August 18, 2009 As has been hinted at Dune 2000 and Emperor were programmed by the guys at IG in London. From my recollection the engine itself had no relation to anything WW had done in fact I believe they were at one point trying to convince WW to use an updated version of their engine for future C&C titles. So it is unlikely you will find many similarities between the code structure of those games and the other WW titles. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 18, 2009 Author Share Posted August 18, 2009 We're kinda hijacking this thread;I don't mind, I'm involved and thsi stuff makes a good discussion. Some mod could split it if he wants, but tbh, I don't really care. I won't be working on the editor again until after my 2nd try exams are over anyway.I don't know anything about the other Westwood games file formats, so I couldn't say how D2k files compare.They kinda don't. The only file formats which are the same between the C&C and D2k engines are VQA videos and the AUD music. For example, in all C&C games up to RA2, the missions are in simple INI format, and all sprites are in a file format (SHP) that puts specific graphics of one unit, building or animation in one single file (SHP format). In Dune II, SHPs were usually a collection of graphics put in one file, but in C&C and the later games, each game object has its own separate graphics files (usually several ones, to put each specific animation of that object in a different file).As far as the Dune 2000 archive format has been uncovered, it just seems to contain one giant list of frames of all graphics ingame, kinda like Dune II's UNIT*.SHP files. The big drawback to this is that you can't change the amount of frames. In all C&C games, the amount of frames of the buildup animation can be adjusted simply by giving it a buildup animation which has a different amount of frames. And then I'm not even talking about advanced stuff you can do in C&C1, like telling a building to act like a rotating turret, or giving a unit a walk animations. That also requires you to change the graphics to correspond to that format. Al of this stuff seems impossible to do in Dune 2000.As has been hinted at Dune 2000 and Emperor were programmed by the guys at IG in London. From my recollection the engine itself had no relation to anything WW had done in fact I believe they were at one point trying to convince WW to use an updated version of their engine for future C&C titles. So it is unlikely you will find many similarities between the code structure of those games and the other WW titles.Emperor? That game was made on the first version of the W3D engine later used for Renegade... Quote Link to comment Share on other sites More sharing options...
mvi Posted August 18, 2009 Share Posted August 18, 2009 For example, in all C&C games up to RA2, the missions are in simple INI formatI'll have to look into these, it may help me a little with working out the D2k mission files.As far as the Dune 2000 archive format has been uncovered, it just seems to contain one giant list of frames of all graphics ingame, kinda like Dune II's UNIT*.SHP files. The big drawback to this is that you can't change the amount of frames. In all C&C games, the amount of frames of the buildup animation can be adjusted simply by giving it a buildup animation which has a different amount of frames. And then I'm not even talking about advanced stuff you can do in C&C1, like telling a building to act like a rotating turret, or giving a unit a walk animations. That also requires you to change the graphics to correspond to that format. Al of this stuff seems impossible to do in Dune 2000.I'm still looking into the R8 and R16 files, my editor/renderer/converter is still in its early stages, but should be finished in a week or two. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 18, 2009 Author Share Posted August 18, 2009 Siberian GRemlin made such a tool for the R8 files, but personally I know nothing about the actual format. Do the internal frames/framesets actually have some identifier linked to them, or are they just indexes? See, in C&C, the filenames of all files in a .mix archive are encoded to 4-byte codes, kinda like CRCs of the strings. But they DO have filenames. Quote Link to comment Share on other sites More sharing options...
stefanhendriks Posted August 18, 2009 Share Posted August 18, 2009 I would be interested in the R16 files. I had a tool that could extract BMP files from R8 files. But R16 still seems to be a mystery.They kinda don't. The only file formats which are the same between the C&C and D2k engines are VQA videos and the AUD music. For example, in all C&C games up to RA2, the missions are in simple INI format, and all sprites are in a file format (SHP) that puts specific graphics of one unit, building or animation in one single file (SHP format). In Dune II, SHPs were usually a collection of graphics put in one file, but in C&C and the later games, each game object has its own separate graphics files (usually several ones, to put each specific animation of that object in a different file).This sounds like a quick and dirty way to code a game to me. Actually, I always thought that Dune 2000 was using an 'upgraded' version of the RA1 engine. But, now I know it is a completely different engine, I am even more dissapointed.I bet the RA1 engine could be easily modified to create Dune 2000 as equal or even better than the one released now. Quote Link to comment Share on other sites More sharing options...
mvi Posted August 18, 2009 Share Posted August 18, 2009 I would be interested in the R16 files. I had a tool that could extract BMP files from R8 files. But R16 still seems to be a mystery.My friend and I worked out the R16 format a while back, it's rather simple :)Please read my tutorial on converting R16 to TGAs here. I have since subsequently used the same technique to convert them to BMPs, and have both working in a tool I'm developing. There is also information on the tilesetspec I started writing here. Please ignore any mention of R8 files on that spec, as only the R16 information was tested and it turns out some of the R8 assumptions are wrong.Nyerguds, I believe there is again a four byte identifier, and what you say about this identifier being encoded would make sense. Again I believe there are filenames somehow attached to the Data.R8/R16 files, but my research into it is still ongoing. (I'm trying to research so many aspects of Dune 2000 right now, heh.) Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 18, 2009 Author Share Posted August 18, 2009 well if they have filenames, those should be in the exe somehow... and debugging the game could lead you to finding the method the game uses to convert the filenames to these name IDsOf course, it's always worth checking if it's not simply one of the same functions used in one of the C&C games... Olaf's XCC code should have those :P Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 19, 2009 Share Posted August 19, 2009 Back to the subject matter, I think it would be nice if the part(s) of the code that define additional House tech tree differences (e.g. the fact that the HK Light Fctry always comes already upgraded; HK WOR having tech level 2; OR always replacing Trikes with Raider Trikes on the production list; OR Heavy Fctry skipping level 2 upgrade etc.) were found. A I also wonder if suchlike changes could be furthered and applied to other Houses/factions as well. Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 19, 2009 Author Share Posted August 19, 2009 well, as for the editor, I'm definitely going to add the Houses into that. but these side-specific construction limits, well, I haven't even found that stuff in C&C1. You could get it by looking for that structure's ID number in the disassembled code, but even then it's usually hard to find. Quote Link to comment Share on other sites More sharing options...
segra Posted August 19, 2009 Share Posted August 19, 2009 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 you Quote Link to comment Share on other sites More sharing options...
Nyerguds Posted August 20, 2009 Author Share Posted August 20, 2009 eh, in that second bit you didn't add the piece of code that actually DOES anything... :P Quote Link to comment Share on other sites More sharing options...
segra Posted August 20, 2009 Share Posted August 20, 2009 if it helps,seg010:2629 33 C0              xor  ax, axthen it returns :)all calls to this function seem to be used to determine the value for buildings field_4f, which gets either a 0x64 or a 0think this field is the tech-upgrade %, but havnt done any debugging yet Quote Link to comment Share on other sites More sharing options...
MrFlibble Posted August 21, 2009 Share Posted August 21, 2009 Thanks for the info, segra :) I wonder if suchlike code can be replicated for other Houses/sides... Probably not, right?Also, I've noticed that bit 6 of Unknown 06 is set to NO for all units in v1.0, and set to YES for all units but except projectiles in v1.07 (all releases). I have no idea what it actually does though. 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.