Jump to content

CnCNet Forums

Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Nyerguds

Creating a mission height map for C&C64

Recommended Posts

With Kamuix writing a guide on inserting maps into the N64 version, I got busy looking into how it would be possible to more-or-less automatically generate height maps of C&C maps, so inserted maps actually look good in N64.

It took me a couple of tries, but finally I managed to create a set of tools to convert maps to height maps. All of these are contained inside the CnC64 File Converter. (v1.0.3 or higher)

 

The basics:

C&C terrain is not three-dimensional, but gives an illusion of 3D with the images on the cliffs. However, this illusion falls flat (literally) in a real 3D environment. To remedy this problem, they added greyscale images to the missions in N64 that indicate the elevation of the terrain (brighter = higher). So if you want to import maps into an N64 ROM and have them actually look good, they are going to need a height map too.

Elevation is not done per cell, but on the four corners of each cell. Because of this, the height map images have a size of 65x65, whereas C&C maps are only 64x64 cells. However, the converter takes care of that automatically, so we'll just focus on making a 64x64 height map.

The basic steps to make an image using the CnC64 File Converter:

  • Open a map file, and convert it to a basic terrain levels image. This image will contain only the cliffs of the map.
  • Save the terrain levels image and edit it in an image editor, and fill areas surrounded by cliffs with the colour for that level. If multiple levels are needed, use the brighter colors in the image's palette. There are 4 elevation levels that can be used.
  • Open the map in the File Converter again, and generate the height map, using the terrain levels image you created.
  • Convert the final image to 65x65 height map, and save it as paletteless N64 IMG format.

The detailed steps:

 

1. Convert a map to a basic levels image:

Open the map you want to make a height map for. The process works best if there's a .ini file with it that tells the program which theater the map is, and how big the actual used area on the map is. The ini file itself will not be accepted by the program, so open either the .bin file, or the already-converted .map for the N64.

Open the "Convert" menu, go to "Height map generation", and select "To basic levels image (from map)". This option will only work if you have a map loaded.

guide_01_map_to_levels.png

You will end up with an image which has a dark gray background, and only the cliffs on it, in a slightly brighter gray. Note that this is a paletted image with five colours; even if the image is later saved as high-colour, it will be matched back to these five colours to be interpreted as height levels.

guide_02_basic_levels.png

As you see, the image has some modifications compared to the original; the conversion takes the last terrain types encountered at the edges of the actually used portion of the map, and stretches them to the full frame. This is done so cliffs placed outside a map's border to control reinforcements would not influence the height map.

Note that the image is not saved yet at this point, so press Ctrl+S and save it to disk.

 

2. Create the height levels image:

Now the real work. Open the saved image file in your favourite image editor, and connect the cliffs to form closed areas. To do this correctly, open the map itself in a map editor so you can see the directions of the cliffs, and see what kind of elevation each area should have. Here's my process in a few steps:

making_levels_image.gif

It doesn't matter if the image is saved in high colours, but as noted before, the converter will match it back to the five colours in the original image's palette, so there's no use in making detailed slopes in this. Its only function is to separate the terrain into levels.

For the record, the grey tints used for the five levels are:

  • #000000 (R=0, G=0, B=0) : Pure black. Shouldn't be used, since water creates a slight depression into terrain, and you can't do that on the lowest level.
  • #404040 (R=64, G=64, B=64) : Basic terrain. This will be the starting level on the image, and should be seen as lowest level you can use.
  • #808080 (R=128, G=128, B=128) : Cliffs elevation #1
  • #C0C0C0 (R=192, G=192, B=192) : Cliffs elevation #2
  • #FFFFFF (R=255, G=255, B=255) : Cliffs elevation #3. Note that this is the highest possible level, and no more terrain details can be put on top of this. Rivers should work, though, since they decrease the terrain.

Anyway, with that done, we end up with our terrain levels image:

guide_03_levels_filled.png

 

3. Creating the actual (64x64) height map

Now we got our levels image this is fairly simple. Once again, load the map into the converter program. Open the "Convert" menu, go to "Height map generation", and now select "To height map using levels (from map)".

guide_04_to_heightmap_w_levels.png

It will ask you to select the height levels image. Select the final product of our work from the previous step.

Now the real magic happens. It will generate an image that adapts the terrain to the new heights, and if your cliffs match your levels image correctly, it will make sharp elevations for the cliffs and smooth slopes for the openings where the level decreases on non-cliff terrain. Furthermore, the height of rivers and other water will be applied on each specific level.

heightmap_64.png

Once this step is done, feel free to save the image if you want to add some more specific tweaks to it, or fix any errors the generator might have made. If you think the map is good enough, though, you can continue straight to the next step.

 

4. Converting the height map to the final format

So we got a 64x64 height map image now, loaded into the converter. The N64 game not only needs the image to be 65x65, but also needs it saved in the specific paletteless IMG format.

First things first: go to "Convert", "Height map generation", and select the final option: "To 65x65 height map image (from image)". As you see, this is the only option in there that doesn't use a C&C map as input but an image.

guide_05_heightmap_64_to_65.png

Select it, and the 64x64 data will be centered in a 65x65 frame, creating smoother edges everywhere.

guide_06_heightmap_65.png

Starting from v1.04, the image in the editor will automatically identify itself as paletteless N64 image, so all you need to do is press Ctrl+S to save it in the correct format.

...and that's it! You have your height map, ready to insert into the ROM. The name format the game looks for is exactly the same as for the .ini and the .bin, just with .img as file extension.

Share this post


Link to post
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
Sign in to follow this  

  • Similar Content

    • By Hosko21
      Hi fellow C&C fans,
      I've been trying for a couple of days to get C&C 95 working on my Windows 10 Laptop with no luck.
      I've followed FunkyFr3sh's instructions (C&C 1 (Tiberian Dawn) Installation on Windows 10) and downloaded and tried a few different versions i could find of Nyerguds patch with no avail.
      Depending on the settings/compatability modes i try, i get the following outcomes:
      1: Game opens, goes to play the Westwood intro and freezes about 2 seconds in (as some of the ripples appear before the text). No audio plays. Games goes non-responding.
      2: Stops at a black screen.
      3: Opens the main menu instantly, but clicking on any button causes the game to go Non-responding.
      Can someone please help me work out how to get it running?
      If anyone knows how to get the DOS version running through DOSBOX (with full Audio & music) I would be more than happy with that, but ideally the C&C 95 version.
      Thanks in advance!
    • By D3SOL4TE
      Does anyone know how to edit the games sound files? I've found info regarding  Red Alert and later games in the series but not the original Command & Conquer.
      Maybe I'm missing something but you don't seem to be able to with XCC Utilities like you can with some other C&C games.
    • By FunkyFr3sh
      The single player campaign installer "cc95v106c_r3_u4*.exe" was not updated for Windows 8/10 yet, we're waiting for @Nyerguds to update the installer. 
       
      Meanwhile you can update the installation manually to get the game working:
       
      1. Download and install the game
      http://nyerguds.arsaneus-design.com/cnc95upd/cc95p106
       
       
      2. Download the updated config tool and extract the files into your game folder (Use 7zip to open the archive):
      http://downloads.cncnet.org/addons/td-config.7z
       
       
      3. Right click the game executable "C&C95.exe" in your game folder, go to properties->compatibility and make sure everything in there is disabled.
       
       
       
      Note: The multiplayer installer was already updated, there is no need to manually tweak any settings in case you just want to play Online/LAN.
      https://downloads.cncnet.org/TiberianDawn_Online_installer.exe
    • By W1NDW4LK3R
      Registering Your Gamesurge Account on CnCNet
       
      NOTE: At this moment, this does NOT work on the Yuri's Revenge client.
       
      Registering your account on CnCNet is a very simple process, and is recommended. One of the main reasons we recommend registering is that you'll be able to combat potential impersonators. An impersonator is a person who pretends to be someone else for entertainment or fraud. You'll also be able to have awards tied to your account such as the Gold Medal.
       
      Registering is very easy, so here's where we'll begin. Our client is tied with our partners over at GameSurge.
       
      1. Go to: https://gamesurge.net/createaccount/

       
      2. Enter your information here. Your account name is the name that will be displayed when other players perform a whois on you. Your account name will NOT become your display name.

       
      3. Login to your email. Check your junk folder as well, as sometimes your email will put GameSurge's email into the junk folder. The email should arrive in a timely manner, it should not take more than 30 minutes. The instructions are also posted in the email.

       
      4. Start a private message with a bot, or an admin. Enter the command in the chat window. This can also be performed in the lobby as well. I do not recommend doing this as if you mess up, your information will be plastered all over the lobby. I have seen this happen.

       
      The command is:
      /authserv auth <account> <temporary password>
       
      Your temporary password is the password located in the email you received from GameSurge.
       
      5. You will receive a notification from AuthServ stating that your information has been accepted.

       
      You are now logged into your account.
       
       
      Changing Your Password
       
      1. Start a private message with a bot, or an admin. Enter the command in the chat window. You can also enter the command in the lobby.

       
      The command is:
      /authserv pass <old password> <new password>
       
      2. You will receive a notification from AuthServ in the lobby stating that your password has been successfully changed.

       
      NOTE: If you've pasted your account information in the lobby, change your password immediately!
       
       
      Logging Into Your Account
       
      1. Start a private message with a bot, or an admin. Enter the command in the chat window. You can also enter the command in the lobby.

       
      The command is:
      /authserv auth <account> <password>
       
      2. You will receive a notification from AuthServ in the lobby stating that you've been recognized.

       
      You are now logged into your account.
       
      When clicking onto a user, you'll receive information about this user. If this user has logged into their account, you will see a (No Fake) title applied to their name and the account they're logged into.
       

       
      If you have any questions or are unsure on what to do, post a reply below!
    • By FunkyFr3sh
      Command & Conquer 1, Red Alert, Tiberian Sun, Dune 2000 (+ Mods)
       
       
      Linux (Ubuntu) example:
      sudo apt-get install libmono-system-core4.0-cil mono-runtime wget http://downloads.cncnet.org/cncnet-server.exe nohup mono cncnet-server.exe --name "My cool server" --maxclients 200 --port 50001 > cncnet-server.log &  
       
      Note: Newer Mono versions are bugged and can't be used, please stick to 5.14 or below.
       
       
       
      Windows:
      On XP, Vista and 7 make sure .NET 4.0 is installed: https://www.microsoft.com/en-US/download/details.aspx?id=17113
      Download the server and start it: http://downloads.cncnet.org/cncnet-server-gui.exe
       
       
      Note: Servers are chosen automatically by CnCNet and are only used in case 2 players fail to establish a Peer-To-Peer connection.
       
       
       
       
       
      Yuris Revenge (+ Mods)
       
       
      Linux (Ubuntu) example:
      sudo apt-get install default-jre wget http://downloads.cncnet.org/cncnet-tunnel.exe nohup java -jar cncnet-tunnel.exe -name "My cool server" -maxclients 200 -port 50000 -headless > cncnet-tunnel.log &  
       
      Windows:
      Download the server and start it: http://downloads.cncnet.org/cncnet-tunnel.exe
       
       
      Note:  To use a specific server you'll have to select it via the advanced settings while hosting a game room.
       
       
       
       
      Linux autostart
      crontab -e @reboot nohup mono ~/cncnet-server.exe --name "My cool server" --maxclients 100 --port 50001 > ~/cncnet-server.log &  
       
       
      The servers will not show up instantly on the website, it can take up to 30 minutes
       
       
       
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...