-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extracting terrain data from the original slv files #1
Comments
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') 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
|
I've added some stuff to your reddit post but I'll just add some notes here. |
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. |
I totally understand that. |
@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.
The text was updated successfully, but these errors were encountered: