Open bertyhell opened 3 years ago
These files appear to just be raw image data. There isn't any file header, so I presume the image dimensions are hard-coded in the binary.
An example python PIL script showing this would be:
from PIL import Image
with open('TERRAN00.SLV', 'rb') as f:
data = f.read()
image = Image.frombytes('RGBA', (512,256), data)
image.save('TERRAN00.png')
Which produces:
As you can see, there are duplicate regions here, so the mode/format ('RGBA'), and dimensions (512,256) are likely incorrect.
I can also recommend using the kaitai web ide if it is not only a bitmap in some format. It won't view the bitmap, but it you can easily guess data structures...
@Andoryuuta Yes, looks like there might be rgb data in there but just each channel as a grayscale image next to each other. The top one looks like a heightmap. Since the long stream is a river. And the bottom image in your screenshot shows the water as white. In the top image the river is wider, so that's probably the river and the beach on the sides of the river being the same height.
Also the dots in the bottom image are colored, so I assume those are enemy locations and houses/trees indicated by a pixel.
I'll keep investigating.
with this setting I'm getting some airplane silhouettes at the bottom i think :p
width: 1024,
height: 1024,
channels: 1,
i extracted the 6 identifiable regions in the above image.
ive named them as followed: | col1 | col2 | |
---|---|---|---|
row1 | height1 | height2 | |
row2 | color1 | color2 | |
row3 | tree1 | tree2 |
height1:
height2:
color1:
color2:
tree1:
tree2:
names are only for ease of reference, they do not reflect what is in the images.
Some interesting notes: When you take the diff of the images in a row you get some interesting results:
diff of height images. my suspicion, these images are the same, the developer just shifted them over 1 px by accident?
diff of color images. eg:
diff of tree images.
I've added some stuff to your reddit post but I'll just add some notes here. You are getting duplicate maps because you don't have the correct width/height and are taking every second pixel to create a second map. Easiest way to tell this is that your map looks squished. I've identified 3 terrain maps so far. 1 the Heightmap, 2 the Unit map 3 coloured map Since the colour map is just bytes that means there has to be a colour palette somewhere to match it to. Either in the map data or somewhere else in the game. You can tell this last map is using a colour palette by cycling through colours and seeing that specific shades would be consistant with specific colours.
cool, Yes that makes more sense:
The smaller images seem to be detailed maps of the main objectives in the game, since there are so many units there that they start to overlap in the world map:
This image contains the color data:
By using my old stitched image
i was able to decode with which color each greyscale value matched:
This is really great work so far. This is still my favorite game. Playing it on my old chromebook pixel running mint and dos emulator :) Have you been able to make any more progress or moved onto other things?
I can start helping as well if needed.
i'd still like to continue it, but i lack the time. Last thing i worked on was getting the buildings to explode into pieces when shot.
I totally understand that. Is your latest code uploaded? I didn't see any buildings or weapons when I tried the code here. I'm going to see if I can make sense of any of it and see what I can contribute
@bpvarsity I've added them to the main branch. If you want a tour of the code, let me know through email and we can go over it on a call.
@bpvarsity I've added them to the main branch. If you want a tour of the code, let me know through email and we can go over it on a call.
Thank you will do!
I'm trying to recreate an old game from when I was young, since it doesn't run anymore on modern machines. And the emulator I've setup runs it at about 13 fps.
Here is a gameplay clip: https://www.youtube.com/watch?v=uH99WZHe3rk
I've recreated the first level of the game using minimap screenshotting and stitching, but this is a very laborious process and not very accurate. You essentially fly around with the chopper and record the screen. Then extract all the screenshots. Crop to the minimap area and stitch those minimaps back together to get a full top side view of the map.
frames:
stich attempt 1:
final texture
heightmap:
This works fine as an initial version of the map:
But extracting the other 36 levels this way makes me want to pull my hair out.
The original game files have files that are clearly named after the levels:
https://github.com/bertyhell/swiv3d/tree/feature/extract-terrain/extract-terrain
These files must contain the heightmap and maybe also the texture map. They are all very similar in size so I assume all level dimensions are the same. The small changes between the files are probably due to different textures/more/less mountains.
I've tried extracting the data using IDA Pro. But it all seems to be gibberish.
The exe file can be followed a little bit. eg: I find some references to DEMO.SLV and %.SLV where the levels are presumably loaded. But nothing indicating how the data is structured in those SLV files.
I'm not sure how to proceed with extracting the terrain data. Hopefully they haven't saved the terrain as a valley of points in between which a curved surface is calculated.
Any hints on how to proceed would be greatly appreciated.