Jump to content

Inserting missions into C&C64


Kamuix

Recommended Posts

Please do! I definitely want to mess around with that :D

 

Not really a thing to post in the Extended Operations thread, mind you. I'm splitting this off.

 

Do note, only missions with pure Goodguy, Badguy and Neutral houses will work, and quite some other stuff is missing too (the ARCO civilian 'building', the dinosaurs, the visceroid, the SSM launcher, and the chem warrior's weapon), so it's best to go over that in the guide so people can determine in advance if the mission can be played on N64 in the first place.

Link to comment
Share on other sites

By the way, that strange pattern you see on the default terrain is probably XCC Mixer's fault; it saves blank terrain incorrectly (it uses actual specific tile IDs for clear terrain instead of using the "default terrain" indicator, like the game does), and the converter's database does not contain the necessary values to fix that. I think setting the default terrain low byte and high byte to "FF" and "00" should fix it, though at the moment these fields default to the defaults for converting maps from N64, not to N64.

Link to comment
Share on other sites

Updated the tool with a fix for XCC-saved maps. You can get the new version here:

http://nyerguds.arsaneus-design.com/project_stuff/2013/CnC64MapConverter/release/

 

CnC64MapConverter_1.0.3.png

  • Fixes XCC maps so the blank terrain doesn't corrupt
  • Supports loading the .nms file by drag & drop, and from command line (meaning you can drop a .nms file onto the program icon to launch with it loaded right away)
  • Shows which .nms file is currently loaded

Link to comment
Share on other sites

Right, I've been experimenting with .img files a bit, and I made a little program that can convert a .bin map to a 64x64 representation of its bare terrain. From that, I attempted to make my own height map. Here are the steps:

 

The original (65x65) height map of GDI mission 6. We want to approach that, somewhat.

3AJxU2Op.png

 

Conversion of map to terrain types image (64x64)

52D8d25V.png

The code that does this is currently dumped into my N64 .IMG viewer. I haven't released anything that can do this conversion yet. But, yeah, basically it uses the information from tilesets.ini to identify all cell contents on the map as their terrain type (clear, rock, water and beach), and then writes that as image. (I took GDI 6 because I knew it has beach on it :P)

 

Of course, you can do pretty much the same thing just by opening the map in XCC Editor, disabling all overlays except Template, exporting that as BMP, and then resizing the resulting image to 64x64. Only difference is that using raw terrain types also gets rid of roads.

 

Painting heights on terrain types image (64x64)

9TwtJoim.png

This is all manual work. I didn't really use the original height map as guide for the colours; some missions just have overall higher height maps than others, and I wanted to do this from scratch.

Note that I never used height 0 (black), because it would interfere with the way I was planning to manually convert it later :P

 

Resize the image to twice the size, in pure pixel resize (128x128)

eMUcq87i.png

 

Center the image in twice the dimensions of the final 65x65 (130x130), leaving a 1-pixel border around it.

JwaBu9z4.png

I then painted the 1-pixel border to continue the terrain as it was around it. I also cleaned up the rocks in the sea a bit; they're mostly there for making the scripting work well, and can normally not be seen anyway.

 

Resize to final size, using smooth resize (65x65)

4C5uMWM5.png

This will give a slightly blurrier image, but that's okay. Terrain changes should be gradual.

 

Now... we got our final image. I'll probably make some kind of converter for converting that to img format, but for now, I cheated and did it the manual way. Which means, saving as bare bitmap and just pulling out the raw bytes  :P

 

  • Flip the image. I'm going to save as bmp, and it saves the data differently than the .img format. So flip it.
    n96O73La.png
  • Convert to pure greyscale, and remove the alpha channel.
  • Save as raw BMP. In Gimp, I had to disable the option to save it as "Run-length encoded", and I enabled the compatibility mode to not write color space information because that's less to clean up.
  • Open the image in a hex editor. You should see the file header, followed by the easily identified greyscale palette data; they're triplets of the same value followed by a zero. Find the end of the palette data (should be FF FF FF 00) and delete everything from the start of the file to that point, so only the raw image data remains.
  • Now, images have something called a "stride". Basically this means a line of 65 pixels isn't written as 65 bytes, but as the next multiple of four bytes. So each line in the file is currently 68 bytes instead of 65. If you didn't use any black in the image, you should clearly see triplets of zero bytes (00 00 00) occurring throughout the file at equal intervals, and it should be easy to use Search and Replace to remove then. You should now have a 1081 byte file.
  • The header of an img file is 16 bytes. The type and dimensions of all the N64 height maps are exactly the same, so just copy that 16-byte header from another height map img file and paste it before these 1081 bytes.

 

And boom, that's it. All done.

 

Kamuix, I included the final height map in the attached zip file. Could you try out what the effect is in the mission (SCG06EA)? I want to know whether it's OK or if it totally sucks :D

Link to comment
Share on other sites

Same process on map NES: Vengeance from the Extended Operations pack:

 

ogmmI8a2.png -> oTgkJ1bY.png

 

Unlike the GDI 6 test, which was started with making and filling enclosed areas, this one was just painted over with the paintbrush, so it has less accents on the cliffs.

 

I had to fix this map because it seems a certain road tileset that splits a road from south-east to north and west simply does not exist in the N64 version, because none of the official maps contain it...

 

I really want to see this... the first custom mission actually played in 3D :D

Link to comment
Share on other sites

I really want to see this... the first custom mission actually played in 3D :D

That makes two of us. What happens if you convert a mission that uses tiles unsupported in the N64 version? Does the game crash on the system/emulator or does it simply remove that object? I use the ARCO building type frequently enough, and a lot of my missions are in the snow... They'd have to be converted to temperate maps.

Link to comment
Share on other sites

Eh, the ingame objects that don't exist will simply not appear. The game's ini reader will ignore them.

 

However, when talking about tiles on maps... the problem happens way before the actual game gets involved. These maps need to be converted to N64 format, so it's the converter that has a problem, since it finds tiles on the map that it doesn't have a N64 equivalent for.

 

The converter will always tell you which tiles couldn't be converted. Tiles will be in hexadecimal format, like, "BA04". The first part of that, BA, is the tileset ID. Convert it back to decimal with the windows calculator and you can look it up in the index of tilesets.ini, to see which tileset file it actually is. You can check these tilesets in XCC Editor; it'll give a name in the status bar when hovering over a tile in the sidebar. (though a quick way to see what kind of tile it is is to use XCC Mixer to look up the graphics file of that name in the theater mix files of the game.)

 

http://nyerguds.arsaneus-design.com/junk/tutorials/xcc_editor-tileset-name.png

 

The tile shown on that image (d30) is the one we found missing on N64.

 

Note that I configured the tool now to just substitute unknown tiles with clear terrain. To quickly see which tiles are missing, just convert the map back to .bin and, as the image I linked shows you, you'll see what's gone.

Link to comment
Share on other sites

This is a map taken from the map package from this forum in Single Player maps pinned and called "Extended Operations *OCTOBER UPDATE*" and put into the N64

 

Thanks to Nyerguds i was able to convert the .bin file to a .map file(which is what the n64 uses) also thanks to Nyerguds he was just able to make a custom height map for this map for me which creates 3d terrain like the N64 starndard maps have you can see this in image 2:

 

2_zps02jakhn9.jpg

 

1_zps2adaemwx.jpg

 

 

Link to comment
Share on other sites

Also i am getting around to writing that tutorial, but until then if anyone here wants a map converted into an N64 rom feel free to message me and also send me a message on the forum and if you do ill give you my skype if you want

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...