Jump to content

Inserting C&C1 maps into C&C Nintento '64


Kamuix

Recommended Posts

Thanks to the lead programmer at http://www.goldeneyevault.com and to Nyerguds it is now possible to add your Command & Conquer 1995 map to the four years newer Command & Conquer 1999 that was redone in 3D for the Nintendo 64.

To start off I'll note that I was surprised to learn that the file formats for the mission INI files are the exact same! And thanks to a tool that Nyerguds has made up for us we can easily convert the .bin maps to .map (which is what C&C64 uses instead of the bin, since its .bin files are music). There's also an additional file for maps that has a .IMG extension, and which is responsible for the 3D terrain effect seen on the C&C64 that you'll see in the images below. I'll also note that it's not essential to have the .IMG file to play your map; you just won't have the 3D terrain effect. In fact, it's not even essential that you have the .map file either, so you can play maps that are clear of terrain other than trees / tiberium / buildings / units / triggers etc. I'm not an experienced tutorial writer, so bear with me!

Also, before I start I want to say that almost all the Covert Operations missions are in the Command & Conquer '64 game/ROM, but are not playable unless you hex edit the ROM (which is easy to do, and I might actually show you how to do that here as well). For more information on the hidden secrets of the N64 game, read here:

https://tcrf.net/Command_and_Conquer_(Nintendo_64) (written mostly by Nyerguds)

To start off, you'll need these tools to do this awesome process:

First the main tool called Universal N64 Compressor:
http://www.goldeneyevault.com/viewfile.php?id=213

A Command & Conquer 64 ROM: (I'm using the US version)
http://romhustler.net/rom/n64/command-conquer-1

Project 64 version 1.7 or above: (Right now I prefer 1.7)
http://www.pj64-emu.com/downloads/project64/binaries/

Nyerguds's Engie File converter:
http://nyerguds.arsaneus-design.com/project_stuff/2018/EngieFileConverter/release/ (Take the latest version; the one at the bottom)

RTool 64: (this is v2.07. Some newer v3 betas are available in the same folder)
http://n64.icequake.net/mirror/www.dextrose.com/files/n64/transfer_tools/bb-rt207.zip

HxD Hex Editor: (or some other hex editor, if you have one)
http://download.cnet.com/HxD-Hex-Editor/3000-2352_4-10891068.html

The reason why I listed Project 64 was because it's the only emulator that comes with the working Glide64 video plugin which is the only plugin that runs C&C64 properly. You could download the 1964-ultrafast emulator that overclocks the emulator which makes C&C64 not lag at all except the only problem is is that the video plugin it uses doesn't quite run it as well everything is dimmed for some reason but you can try it out if you want. Also I couldn't get the Glide64 with that emulator or any other emulator.

You can download 1964-ultrafast here:
http://www.emulation64.com/files/info/944/1964-ultrafast.html/

 

Before we open the Universal Decompressor we'll want to open Nyerguds's Engie File Converter so that we can convert your map's .bin file to a .map file. Simply drag your .bin file in there and it should correctly identify the map as being Temperate or Desert. You can see that from the colour it gives to the clear terrain on the map. If the automatic identification is not correct, make sure the .ini file is in the folder with it so it can read the correct theater from there.

s9JHuIFm.png
The tool, with a Temperate map loaded into it (though here you see it with an N64 map)

When it's loaded, and you see it as image, just go to File -> Quick Convert, and it'll offer to save it as N64 C&C .map file. 

 

One more thing we'll need to do before getting to the Universal Decompressor is to open and use RTool to make sure the ROM is in an editable format. So extract that somewhere and open it.

What we need to do is make sure the ROM is in the format "SP64/WC/Z64". Some ROMS out there are in the format "Doctor 64", and if they are, all bytes in it are switched per two, which makes it really annoying to edit.

q4Quc1Zg.png

So select your C&C64 ROM, check the format, and if it's "Doctor 64" you click "change image format" to fix it. I think if the ROM is compressed you'll also need to use the "decompress" function there, but I haven't seen any compressed ROMS so far.

Now you'll want to extract Universal N64 Decompressor somewhere, and have your C&C64 US ROM ready, preferably in an empty folder, so, yes, create a folder and put your C&C64 ROM in that folder first. You'll see why in a moment. Now open GEDecompressor.exe and you'll see where you can select a range of games, so select "Command and Conquer" of course:

WLSUyiT3.jpg

After that, just next to that, click 'Load/decompress game', go to the folder you created and select your C&C ROM. Now you'll see a loading bar as a bunch of files pour down the menu screen. Wait for it to finish. When it's done, scroll to the right side in the listing to see the filenames:

IpZxJPVv.jpg

Now scroll down until you reach the mission .ini files (the typical SC?##EA format), and from there it's almost as simple as selecting the map file you want to replace with whichever map you want to insert there, except that there are size limits for each map, especially when dealing with the ini's. Luckily when you hit "Inject file into ROM", if the file you are trying to insert is bigger than the file you're replacing it with, it will warn you if you are replacing a file that is smaller than the one you're inserting.

cwJy1nYl.jpg

So if that comes up you're usually best to hit 'no' and find another file to replace that has enough room for the map you're inserting, otherwise part of your map will get cut off and you'll find that out ingame.

Note that a lot of ini files contain a lot of stuff that really isn't necessary, like unused keys in the Basic section, and information for the player sides Special / Multi1-Multi6. So you can remove that to make your ini smaller.

Assuming you have a .ini and a .map to insert, once you have found slots to insert them in where there's no size problems, take note of which file names they were that you replaced. It's also important to note that the original name of your map files that you insert don't matter, since they'll take the name of the file you replace in the ROM. The only filename you need to remember is the one you replaced. So let's say, for example, you chose to replace scg15ea.ini with your ini and scb07ea.map with your (converted) map file (for future reference).

Now click 'save ROM' and save it somewhere, preferable outside the folder which is now littered with extracted files.

Now that your map is inserted we need to make it playable, so open the hex editor I linked you to (or any hex editor you may already have; should be similar enough) and open your N64 ROM that has the maps inserted. One thing you'll want to do is this: at the top, go to 'Search' and go down to 'Goto' and type in the address "20D4EA". It should bring you to a large list of map filenames seen here:

(You can expand your view to 48 which is what I use to make it easier to see)

RhcONcMp.jpg

So let's say your mission is a Nod mission, so let's use the slot that's for NodSpecOps1, so change 'SCB21EA' to 'SCB45EA' for example, since we know that filename is not used. If it's a GDI mission you have to change 'SCG30EA' to 'SCG45EA'. Note that the number 45 in your filename dictates the build level. So, yes, the build level option in your ini file is ignored in the N64C&C for some reason. So all filename numbers that are 15 and above are buildlevel max which is 15 (Construction yard vehicle buildable).

It's also important to note that the G and the B in the map filenames dictates whether you get a Nod or GDI sidebar, with yellow or red units. The minimap also changes: it always gives desert terrain for Nod and temperate terrain for GDI. So if you insert a Nod map and call it 'SCG20EA' You'll be playing as Nod but with a GDI sidebar, with yellow icons for the buildings/units, and green minimap terrain, no matter what theater the map really is :P

Anyway, moving on, we need to get to the next list of filenames so we can line up the maps we inserted with the SCG/B45EA names we chose, so now under search click 'Goto' again and go to this address: "461449" you'll see a different list of filenames now, and my maps I've inserted are 'scg15ea.ini' and 'scb07ea.map', so we need to find those and rename them to the map filename we chose above, which was 'SCG45EA' (or 'SCB45EA'). So in this case, it should look like this for mine:

JzzjUaoU.jpg

See how the slots where my maps were inserted are now changed to match our Special Ops slot and map name. Now all you have to do from your hex editor is save your ROM and load it up in Project64, go to the SpecOps slot you used and play it (or if you chose a mission map slot between 1-15 just go to that map and play).

Oh, one last thing in Project 64! Go to settings and change your video plugin to this Glide64 like this:

1nxQEenF.jpg

It runs the game almost perfectly, and all other video plugins seem to have problems.

There were more details I wanted to get into, especially with what you can do with the hex editor, so I may edit this tutorial in the future.

I hope I didn't miss anything and I hope I detailed everything well enough for people to follow. If you have any questions, feel free to PM me anytime if you happen to be confused about something. Cheers!

Here are some pictures of inserted custom missions:

JxurN8A9.png

d608sBy9.png

Here's an example of a tiny map and what it looks like in the map editor vs in the game:

hXFMptx4.jpg

Link to comment
Share on other sites

Well it's a game port, so that's not too surprising. It's basically the same engine adapted and converted to work on the N64 hardware. Graphics and sounds are all system-specific, so all of that changed, but anything purely for internal use can usually stay the same. In this game, that's the mission .ini scripts and the .eng strings files. The missions' terrain maps were redone to better suit the optimized graphics storage they use for the map tiles.

 

I did find some files in the PC C&C terrain tile format, but I'm not sure if they're used because there were far too few of them to be the full terrain, and they only seemed to be clear terrain.

Link to comment
Share on other sites

It's technically possible to edit the files table (shown at the end of the tutorial) to clear up space by 'removing' files, by making the game think they're 0 bytes long and moving their address to the same address of some other file. The format of the entries in that index is:

offset length  function
00      12     filename
12      4      offset to data
16      4      decompressed size
20      1      compression format {0x00: uncompressed, 0x11: 8bit LZ, 0x22: 16bit LZ}
21      3      compressed size
(all values not prefixed with 0x are decimal)

So if you change the compressed and decompressed size to 0, the compression format to 'uncompressed', and the offset to the same as some other existing file, it'll be seen as a 0-byte file put just before that other file in the listing, meaning you effectively removed the object from the files table, and can combine the space it used with that of the other files near it to insert larger files.

 

Note that I haven't tested this yet; this is purely theoretical. I'm not sure how the extractor will react to 0-byte files in the listing. If this doesn't work, you can also just reserve a small section of freed up space and give all such 'deleted' entries a single byte there. but then you'll need to figure out the actual offsets to change, of course.

 

It's also possible you'll have to actually change the size of the larger entry you're trying to create too to make the extractor accept it as larger available space. If you do that, it's best to change both the compressed and decompressed size of that expanded entry to the new larger available space, and put the compression to "uncompressed" so the extraction process doesn't fail on the decompression step (since the data in there will obviously be corrupted if it tried to decompress it all as one file).

Link to comment
Share on other sites

I just went over the list that maps the N64 tile IDs to their PC equivalents, and found exactly which tilesets are missing in it. Note that this does not mean my mapping is incomplete; a tileset being missing from the mapping means it was not found in any of the maps in the ROM, since I scanned them all to build these mappings, and from our tests, this seems to mean these tiles are simply not in the N64 ROM at all, and thus, they can't be used.

 

Temperate:
BRIDGE1D (bridge NE -> SW, destroyed)
BRIDGE2D (bridge NW -> SE, destroyed)
D30 (road 'Y', SE -> N+W )
D40 (road 'Y', SW -> N+E )
D43 (road 'Y', NE -> S+W )

Desert:
B4 (small rocks)
B5 (small rocks)
B6 (small rocks)
BR5 (purple square; some debug tile)
BR10 (2 purple square; some debug tile)
D19 (road '+' crossroads)
D33 (road 'Y', NW -> S+E )
D43 (road 'Y', NE -> S+W )

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...