Jump to content

CnCNet Forums

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

CnC64 File Converter released!

Recommended Posts

I got a present for ya! :commando:

http://nyerguds.arsaneus-design.com/project_stuff/2017/CnC64FileConverter/release/
CnC64FileConverter_v1.0.0.png

This tool can open about any graphically-representable format in the N64 game, and can convert between most of them. This includes images, maps, palettes and tilesets.

Its usage is really simple. Drag-and drop a file in there, or use File-> Open (Ctrl+O) to open a file, and use Save (Ctrl+S) to save it. the Save dialog will give a types dropdown in which you can select the type to convert to.

Note that there is also a Quick Convert (Ctrl+E) option in the menu. This is actually identical to Save, except that it automatically selects the most logical convert type when opening the "Save As" dialog. This means PC images will quick-convert to N64 img format and vice versa, N64 and PC map formats will convert to each other, and palettes will convert between the N64 8-bit and PC 6-bit format.

Tilesets can only be exported at the moment, not saved, because they have a rather annoying format of tiles using sections of a larger colour palette. I might make a converter from and to actual single cells for that later, when I add a 'Convert' menu to the program.

One of the immediate practical uses of this this tool is that it can write the image format used as height maps by the game's missions. These images are paletteless 65x65 images on which each value in the image data represents a height, which is why I display them using a grey palette. This is the "C&C64 paletteless image" type in the save dialog's dropdown. The image needs to be either high-colour or 256-colour to be converted correctly for a height map; if it's 16-colour you'll get a 16-colour paletteless img file, a format which is also used by the N64 game, but not for that :P

I mentioned a 'Convert' menu before... one of the things that'll be in there is an option to automatically convert a map to a rudimentary height map.

Here's the algorithm I'm developing for that, shown on rocks:
heightmap_algo_lg.gif

This isn't programmed yet, but the theoretical algorithm seems to work right. The final conversion will do similar things with beach and water, and then combine them in a logical way.

Share this post


Link to post
Share on other sites

By the way, many thanks to Chad1233 for his help in beta testing this tool. I never even knew CCMap also messed up the 'clear terrain' tiles when saving a map. Seriously, how hard is it to get that right? It's two freaking bytes, and every official map has them! O_o

Share this post


Link to post
Share on other sites

Very nice i downloaded it and it's looking good i cannot wait for the height map generator!

Share this post


Link to post
Share on other sites

It's gonna end up a lot simpler than I thought, lol... I found out the reason my resize method gave odd results was because I apparently used a resize method in Gimp (cubic) that was just not simple enough. I now tried another one, "Linear", and that gives exactly the result I intended. Basic method is just, assign all heights the correct colour, resize to double size (128x128), add a 1-pixel border around it, resize back to half of that new size (65x65) using Linear resize.

 

I might even just add an option to do just the resize itself and, accept already-greyscale images from the user, so they can assign plateaus and such.

 

So all I gotta do now is see how the resize in .Net reacts, and if I can give it different methods. Fairly sure I can, though; if I remember correctly the pixel resize used in the zooming image box already needed a tweak in exactly that code.

Share this post


Link to post
Share on other sites

Found a nice new way of doing things. If the user provides an image based on the cliff formations which divides the map into plateaus, the system can automatically trim the edges of these plateaus to give a better slope on the cliffs.

 

This basically means you need to save the map's image and convert it to these plateaus. At this moment, this approach also means that rocks on the actual map are ignored in favour of the plateaus, though the plateaus are trimmed down at all sides, so small height differences get lost in this method. Because of this, this is really only meant as a tool to help make a height map, and not something to actually automatically generate the heights.

 

The process in action: terrain map / plateaus / combination / applied heights (note the river height change) / conversion to height map

 

7ikWfNN6.gif

 

The plateau image will always be simplified to just five levels; 0, 64, 128, 192 and 255. So when making it, use these values for the gray colours.

 

Plateaus give the basic height, meaning water and beach will be slightly lower than the plateau height. Because of this, the basic level is 64, and not 0.

 

 

Currently I just got this hardcoded to read the same filename as the map file you opened, but with "_lvl.png" added behind the basic filename.  I'll probably make this more use friendly later and actually put a UI for this process in :P

Share this post


Link to post
Share on other sites

Awsome work i've been using this tool all night and a love it! it doesn't make the height maps for you but it get's you started which is still great so thanks again for making this tool! here are some photos of the heightmaps for the covert operations levels i've been working on:

 

he5_zpsvb57kxex.png

he6_zpsii0rzuds.png

he1_zpspozyr4cd.png

he2_zpszn4dv98u.png

he3_zps2559bpz2.png

he4_zpsqkhy5m47.png

 

 

 

Share this post


Link to post
Share on other sites

I just implemented the first rudimentary version of system to convert tilesets to a series of images.

 

With the converted files list, I can confirm that the tile mapping for the map conversion is indeed 100% complete, besides the 16 cells for clear terrain on each theater (and those IDs aren't used on maps anyway).

 

So, yeah, the list I posted earlier about which tilesets are missing from N64 is also complete, with no hope of finding more tiles.

 

[edit]

 

Oh, this is peculiar. The .TL4 / .TL8 files do not contain the N64 map values at all. They contain the PC map values O_o

Meaning, that file accurately links each tile to the cells of its PC version's equivalent.

 

This does mean that contrary to what I expected, the actual mappings of the values used in the N64 maps are somewhere in the ROM code, though, and not easily accessible as file. Strange that they did it this way; surely if they actually use the tileset definitions internally, it'd be easier to just use those on the maps, too...

Share this post


Link to post
Share on other sites

This data is so horribly unoptimized it's not even funny. With a little more effort, the N64 terrain could look ten times better and take less space to boot.

 

There is not a single full tileset in the ROM (meaning a full piece of terrain like a bridge or a piece of cliff or river) that uses more than one palette. Each cell of the graphics inside one tileset consistently uses the same 16 colour palette. In other words, there is no optimization to maximize the amount of usable colours, even though the system perfectly allows this.

 

I'm half tempted to write a graphics optimizer for this stuff and reconvert all graphics form PC, even though I have no idea how to even start on that :P

Share this post


Link to post
Share on other sites

I've done some more heightmaps for the covert operations levels and the playstation levels that needed the terrain 3Dized

 

3_zpsry0qru44.jpg

4_zpsk1gyah9u.jpg

5_zpsrgxwlfo7.jpg

6_zpsftmzbaon.jpg

7_zpsxc8wtywr.jpg

2_zpswsxwex15.jpg

1_zpstenym7q2.jpg

8_zpsfbgzua7f.jpg

9_zps5wn0kx4e.jpg

9_zps5wn0kx4e.jpg

 

SCB20EA # CO: Bad Neighborhood         = Done
SCB39EA   CO: Deceit                   = Done
SCB40EA   CO: Eviction Notice          = Done
SCB31EA # CO: The Tiberium Strain.     = Done
SCB32EA # CO: Cloak and Dagger         = 
SCB33EA # CO: Hostile Takeover         = Done
SCB35EA # CO: Under Siege: C&C         = Done
SCB37EA # CO: Nod Death Squad          = Done
SCB60EA ! PSX Nod Special Ops #1       = Done
SCB61EA ! PSX Nod Special Ops #2       = Done

SCG22EA # CO: Blackout                 = Done
SCG23EA # CO: Hell's Fury              = Done
SCG36EA # CO: Infiltrated!             = Done
SCG38EA # CO: Elemental Imperative     = Done
SCG40EA # CO: Ground Zero              = 
SCG41EA # CO: Twist of Fate            = 
SCG50EA # CO: Blindsided               = 
SCG60EA ! PSX GDI Special Ops #1       = Done
SCG61EA ! PSX GDI Special Ops #2       = Done
SCG62EA ! PSX GDI Special Ops #3       = Done

Share this post


Link to post
Share on other sites

Nice work :)

I'd fix your images, but I can't edit posts yet... forum is still not quite up to specs.

Share this post


Link to post
Share on other sites

Some updates on this...

1. Image copy option. You can now press Ctrl+C (or right-click the image and select "Copy") to copy the currently opened image representation to the clipboard.

2. Support for paletteless formats has been upgraded with the ability to load different palettes than the standard grayscale fade:

bl4WQoA.png

This code is obviously just copied from the font editor, though I still have to do some tweaks to make it react right in all situations.

Palettes on other file formats (which contain colours) are also freely editable now, and these edits will be preserved if you save the result as new file (if the file preserves colours, of course). This means this tool can now also be used as palette editor. (Happy now, Kamuix? :P)

 

3. I added support for opening/converting C&C1 tileset (template) files.

kNKwvxj.png

Haven't written the saving code yet, but the format is dead easy, so yea.

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 default user
      Hi everyone,
      I know there several posts out there on Virtual Machine LAN networking, but I haven't come across any referencing VMware ESXi.  Was hoping I could start one.
      Here's what I'm trying to do...
      I have a ESXi host running vSphere 6.5.  On it are several VM guests running Windows 10 (build 1903).  All VMs are using VMNET3 virtual NICS, w/8GB RAM, and quad core vprocs.
      I'm having a heckuva time getting LAN networking to run for any CNC game (Dune 2000, TD, TS, RA - doesn't matter, symptoms are the same).
      On the VM, all games install successfully using the latest builds.  All will run without error too.  
      On the example below, I'm running Dune 2000.  As you can see in 'screenshot 1', it does not allow me to join or create a new game.  What's interesting is that the IRC client does not appear to load despite being previously installed.   The Windows firewall is turned off.
       
      Now, by contrast, on a regular laptop - the same game installer will allow me to create a new game or join an existing one.
      I welcome your thoughts.

    • By Hejjo123
      When i click full game (for windows) I then click download but, nothing happens. HELP!
    • By scut
      Hi all
      I'm now knee-deep in TD SP mapping and am starting to run into questions that I can't answer via Nyerguds guide, opening the default maps or a lot of googling.
      Is there anyway to improve the AI on gunboats? They seem to find one target and fixate on it until it's dead. If it moves out of range they won't change target to anything else. This is on the "Hunt" AI used by gunboats in all the campaign maps. I've tried putting gunboats in a difference House (Multi3) and using "All to Hunt" on them to refresh their AI state and hopefully get them to re-target, but "All to Hunt" kicks in for every AI unit in every House.
      I've also tried creating them as a teamtype and giving them MOVE-HUNT-MOVE-HUNT instructions to try to refresh their AI (I had hoped they would ignore the move instructions), but that just results in them swanning around in the water in a really weird manner.
      I'm unsure where newly built Orca's will arrive from? I have a House (located SE map corner) where the reinforcement edge is set to South, but Orca's seem to come in from the right side of the map, or from the top-right corner? Do player A-10's always come from the top-left corner of the map? Is there anyway to control this? If Chinooks are buildlevel 98 and so are Wooden Fences, is there anyway to give the player the ability to built Chinooks without Fences, or is that just how it is?
    • By Rapid Spectre
      Hi,
      I've been trying to play Tiberian Dawn in DOSBox and have some questions about it. I'll start with the playlist:
      Is the game supposed to play Act on Instinct at the start of every mission? At the fourth GDI mission this seems strange. I was more expecting the game to play predetermined tracks at the start of new missions.
      Also, I think I noticed the game skipping tracks in the playlist and I saw no reason for that to be happening.

      Thanks in advance
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...