Jump to content

Extract Heightmap from created map?


Recommended Posts

I know the editor does not have a function to export a greyscale HM at present, but I am wondering if there is some alternative way to export the height data? And yes, I really wish this functionality would be implemented in the editor. It would make changes to elevation coding a breeze and I believe it is quite a simple thing to program as the editor already can take greyscale HM as input. Would just need an output function.

Link to comment
Share on other sites

  • 5 weeks later...

Solving this could benefit all titles players. I fantasize to run a program that imports the btt then exports a topographic map file/image for my battle. This could be saved as an image or modified with text and typical map features and sent with the scenario. 

Can we assemble a team to tackle this? I volunteer. I offer my time, curiosity, persistence, sense of humor and bartending skills (virtual). 😉 

Edited by kohlenklau
Link to comment
Share on other sites

I will try to reverse engineer some btt files. Dial down to 208x208. I guess that is a 26x26 array? Compare files in HxD to see what changes with going from 208x208 to 208x216 or 20m to 21m or changing grass to pavement.

Try to see where the elevation data is...

Alcohol addled brain...go go go

Link to comment
Share on other sites

oh lordy. I tried but am definitely in an area I have no idea what I am doing. sorry. I made 2 files and all that was different in the editor was one was dirt and one was grass but in HxD they had maybe 2% the same (in the header area) and the rest was totally different. I thought somehow I would see intense similarity and spot the differences. OK...nope. nope. I will slither back to my little desk and crayons. 

Link to comment
Share on other sites

This probably isn't possible without a decrypt tool.. 

One glimmer of hope may be the campaign extraction tools.

The campaign extraction tools manage to extract scenarios from campaign .cam files. I looked at a campaign, the header isn't encrypted, but the rest of it clearly is... - and yet the campaign extractor will parse it into separate scenarios and the decision trees. Maybe a campaign file is made of a lot of individually encrypted files and the tool doesn't actually decrypt anything. The source code is included, im having a quick look at the parser code now but I'm don't really know how to read code, well not computer code anyway.

Link to comment
Share on other sites

I was thinking (dangerous activity) that the mdr files were somehow ALSO like these btt files and now we are importing them into Blender. But maybe they are apples and oranges? @sbobovyc wrote the Python script so that Blender could read the mdr files. But maybe?/probably? this is not at all related to trying to "crack" the btt files and "see" the height info to make/export a topo map as a playing aid...? "Help me Obi-Stan Kenobi, you're my only hope"

Stan is probably the man. Here is his btt mutator Python script that he was working on...although looking at it with my untrained eyes it seems it may only have been a tool to try and make a CMRT map be rewritten so it could open in CMBS (for example), in other words just the header and not our encrypted main area of the btt.

https://github.com/sbobovyc/CM2Tools/blob/master/btt_mutator.py

Edited by kohlenklau
Link to comment
Share on other sites

Having had a quick look, the campaign files do appear to contain separate, individually encrypted, scenarios. I don't think the tool decrypts anything, it just parses headers and splits the large file into individual scenarios.

 

I would quite like a tool that could import export from scenarios, stuff like AI plans, map data, etc.

Edited by Jace11
Link to comment
Share on other sites

I'd be really interested in this.  Unfortunately, my engineering skill set solely lies in physically performing topographic surveys and then taking the data back to the office.  There I would reduce the field notes, plot the data and interpolate the contours by hand.  I understand they have computer programs that do this stuff these days...  AMAZING!

Kidding aside, it really is tedious taking screenshots of the elevation data in CM, pasting all the screens together and drawing the contours (again, by hand) in PS.  But, all I can for this project is offer moral support.

Link to comment
Share on other sites

Here is another fantasy...

Like with BETA testers (I guess, I am not one), BFC gets a trusted, capable and mature community volunteer (  @Kevin2k ....?) and has them sign an NDA and then provides them the sufficient necessary insider knowledge and lets them do all the work to produce this "REZTOPO" or "CMTOPO" or "topo tool" or whatever for the community. We all enjoy it and the encryption is all safe and sound. 

Link to comment
Share on other sites

  • 5 months later...
On 12/9/2021 at 7:23 PM, SchnelleMeyer said:

as the editor already can take greyscale HM as input

Er, it can? I mean, like in having a height map and importing this into the editor? How? I was in the process of thinking about how to do this with screen-reading / manipulating in python which is probably painfull but if such a thing already exists...

Link to comment
Share on other sites

There is laborious way to extract height data from an existing CM map without performing going into Battlefront's code.

1. Open the map in the Scenario Editor

2. Optional: To make the next steps easier, remove ALL features from the map except roads and rivers, so all that remains is the ground.

3. Display a portion of it (start NW corner) at largest magnification

4.Select 'Elevation' mode to display the black box highlighted values that were used to create the maps contours (do not use the 'E' key method)

5. Take a screen shot/grab (I use either Fraps or the inherent Win10 Prt Scrn

6. Scroll around and repeat the foregoing until you have screen grabbed the whole map

7. Load the grabs into your favourite graphics program; I use the free paint.net

8. Reassemble the grabs into a single map.

9. modify the map to black and white only and save it as a .bmp file

10. Now the labour: Connect all the similarly numbered squares with smooth flowing black lines ('play connect the dot' :) )

11. Pretty it up to taste (i.e. adjust any lines that seem odd)

There you go. You now have a topo map which can be printed or saved as a 'special editor overlay.bmp' to  use in any one of the CM series games.

Link to comment
Share on other sites

44 minutes ago, WimO said:

There is laborious way to extract height data from an existing CM map without performing going into Battlefront's code.

Go to editor, load a map go to 'elevations'. Can you see any problems with that?

Link to comment
Share on other sites

Your suggestion is perfectly good if they just want to modify existing topography and mod a map map within the CM product in  hand.

I understood, perhaps incorrectly, that the original poster wanted to 'extract' a topo data from existing scenarios for use in other CM products, eg. from CMBN to CMFI. This would require creating a special editor overlay. Maybe I am way off the rails.

 

Link to comment
Share on other sites

  • 2 weeks later...
On 6/15/2022 at 10:18 PM, WimO said:

Your suggestion is perfectly good if they just want to modify existing topography

You can make a screenshot of the elevations and in a photo, editor make a topographic map. TBH I see it as a non-existent solution. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...