SchnelleMeyer Posted December 9, 2021 Share Posted December 9, 2021 Is there any way to extract the heightdata from a finished map? It would be great to be able to do so to bring the heightmap into a 3d editor to make easy changes to the elevations before rendering out a new heightmap and then re-importing it into the editor. 0 Quote Link to comment Share on other sites More sharing options...
Redwolf Posted December 9, 2021 Share Posted December 9, 2021 Importing and exporting CM maps from an XML file (or whatever) should definitely be a thing. As you say, if it is just for the height then that's a good thing, too. 0 Quote Link to comment Share on other sites More sharing options...
SchnelleMeyer Posted December 9, 2021 Author Share Posted December 9, 2021 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. 0 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 7, 2022 Share Posted January 7, 2022 (edited) 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 January 7, 2022 by kohlenklau 1 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 7, 2022 Share Posted January 7, 2022 @Artkin @Jace11 Do you have any interest in being on this team? 0 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 8, 2022 Share Posted January 8, 2022 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 0 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 8, 2022 Share Posted January 8, 2022 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. 0 Quote Link to comment Share on other sites More sharing options...
Kevin2k Posted January 8, 2022 Share Posted January 8, 2022 Except for the header information, most of the BTT format is an encrypted or compressed block. This includes the height-map, the tile-map, the units, etc. 0 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 8, 2022 Share Posted January 8, 2022 10 minutes ago, Kevin2k said: encrypted Oh. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Artkin Posted January 8, 2022 Share Posted January 8, 2022 32 minutes ago, kohlenklau said: Oh. Thanks Yeah unfortunately I don't know anything about this sort of stuff. I only know the amateur stuff. And that was learned off others, like Kevin. 1 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 8, 2022 Share Posted January 8, 2022 No worry. I got the cat back in the bag. Goodnight kitty. 0 Quote Link to comment Share on other sites More sharing options...
Jace11 Posted January 8, 2022 Share Posted January 8, 2022 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. 0 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 8, 2022 Share Posted January 8, 2022 (edited) 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 January 8, 2022 by kohlenklau 0 Quote Link to comment Share on other sites More sharing options...
Jace11 Posted January 8, 2022 Share Posted January 8, 2022 (edited) 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 January 8, 2022 by Jace11 0 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 8, 2022 Share Posted January 8, 2022 6 minutes ago, Jace11 said: Having had a quick look well, thanks for running that down. 0 Quote Link to comment Share on other sites More sharing options...
Rake Posted January 8, 2022 Share Posted January 8, 2022 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. 0 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted January 8, 2022 Share Posted January 8, 2022 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. 0 Quote Link to comment Share on other sites More sharing options...
Redwolf Posted January 8, 2022 Share Posted January 8, 2022 It is possible to screen-read and OCR the elevation numbers. Writing such software (with support for the required scrolling) is very nasty work. 0 Quote Link to comment Share on other sites More sharing options...
Butschi Posted June 15, 2022 Share Posted June 15, 2022 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... 0 Quote Link to comment Share on other sites More sharing options...
WimO Posted June 15, 2022 Share Posted June 15, 2022 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. 0 Quote Link to comment Share on other sites More sharing options...
chuckdyke Posted June 15, 2022 Share Posted June 15, 2022 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? 0 Quote Link to comment Share on other sites More sharing options...
WimO Posted June 15, 2022 Share Posted June 15, 2022 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. 0 Quote Link to comment Share on other sites More sharing options...
chuckdyke Posted June 27, 2022 Share Posted June 27, 2022 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. 1 Quote Link to comment Share on other sites More sharing options...
kohlenklau Posted September 24, 2022 Share Posted September 24, 2022 @Butschi Sir, can you do the reverse of what you did in the other thread and "read" the scenario map elevation data to make some type of a contour map for players? 0 Quote Link to comment Share on other sites More sharing options...
Butschi Posted September 24, 2022 Share Posted September 24, 2022 41 minutes ago, kohlenklau said: @Butschi Sir, can you do the reverse of what you did in the other thread and "read" the scenario map elevation data to make some type of a contour map for players? I'd better make good on my promise to polish and publish the other tool first. For the reverse direction you'd need decent OCR... the rest should more or less be scrolling around (I can take that from the other tool) and getting the logic correct. Oh well, no promises but if I find the time I'll take a look. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.