VGMaps

General Boards => Map Requests => Topic started by: Mikemc on April 11, 2021, 03:30:48 am

Title: Solar Winds Sector size [Map Request or Mapping Tips?]
Post by: Mikemc on April 11, 2021, 03:30:48 am
I periodically go back to trying to map out Solar Winds, but it's hard to determine how big a sector is when the background is mostly black :/.
Does anyone know how many pixels a sector is in Solar Winds (Epic Megagames)? I have been using tSearch to try replicating the random stars, planets, or anything where pixels can be seen.

I suppose I could go Mythbusters and measure the time it takes to fly over a planet, then compare with flying between 2 sectors..
Title: Re: Solar Winds Sector size [Map Request or Mapping Tips?]
Post by: DarkWolf on April 22, 2021, 12:38:15 pm
Have you done a search for an incrementing/decrementing value as you move the ship in one direction? They may have used a separate variable to keep track of the sub-sector position, or used a fixed precision number where some of the bits represent the sector and the others the sub-sector. Just a guess though.

Also, do you need the map to be pixel perfect? I thought about mapping this game before, but I felt like there would have been a lot of empty space and the scale of planets and ships would be weird, especially for the second game. Even though I have nostalgia for these games, looking at it today, it kind of wasted the open space feature with a very linear story line. I have always been curious if there were any secret areas though. Wonder where the object locations are stored...
Title: Re: Solar Winds Sector size [Map Request or Mapping Tips?]
Post by: DarkWolf on April 22, 2021, 02:03:04 pm
I didn't have a ton of time to dig into it, but I did find something interesting. It looks like the bh_start.dat contains a save game file that is loaded at the start of a new game. So a lot of the game's data can probably be found here. The positions of ships would pretty much need to be stored here, so the planets might be as well. You can even find text for the SCIENCE option on the objects.

Also my worries about the size/scale might be off. I had misremembered the sector size being larger than it is.
Title: Re: Solar Winds Sector size [Map Request or Mapping Tips?]
Post by: DarkWolf on April 24, 2021, 12:58:35 am
Here's what I've found. The bh_start.dat and save games have object locations.

First, how the game stores object positions in these files. Each object has 8 bytes that determine the X/Y coords for sector, and 2 bytes for sub-sector.

All objects have positions stored as:

X4 Y4 X3 Y3 X2 Y2 X1 Y1 XS YS - each of these being a byte

Calculate sector X Position as seen in game display:
Code: [Select]
((X4 - 127) * (1 << 24)) + ((X3 - 127) * (1 << 16)) + ((X2 - 127) * (1 << 8)) + (X1 - 127)
Calculate sector Y Position as seen in game display:
Code: [Select]
((Y4 - 127) * (1 << 24) * -1) + ((Y3 - 127) * (1 << 16) * -1) + ((Y2 - 127) * (1 << 8) * -1) + ((Y1 - 127) * -1)
Note that the 4 and 3 bytes are only used by the game to move ships temporarily out of the play area. At the start of the game the Rigian scout and Nightshade ship are located way out of the play area since they appear after triggers.  Not sure why numbers are stored this way instead of 32-bit signed integers, but maybe this is some coding strategy I'm not aware of. I'm sure this math can also be simplified but I couldn't be bothered. ;)

The sub-position of each sector is represented by XS and YS and these are unsigned bytes.

The player's ship position is stored at: 0x0321 and is 10 bytes long, matching the byte pattern from above.

Immediately after this starting at 0x032B starts a chunk of data that contains the positions for planets and NPC ships. These records are 13 bytes long. The first 10 bytes represent the position of the object as described above, the last three bytes are as follows:

Byte 11: Controls the graphic the object uses, also determines the mini-map colors
Byte 12: Not sure exactly
Byte 13: Something to do with the SCIENCE descriptions

I'm attaching an raster of an SVG I put together using the data from the starting save game file. Limited to the first solar system. Note that objects are scaled larger than what they would be in a sector. A 1:1 scale of the planet sprites to the sector size was too small. The largest planet takes up about 75% of a sector when it would only take up 25% in-game.

Anyway, hope that helps if you still decide to do a raster map. I will probably file this SVG version away for the moment, as I'm not 100% happy with the outcome and have other things I should be getting done.

Attachments and image tags don't seem to be working. Here's a link:
http://garoux.net/forum/swtest.png

*EDIT*
I only tested this out on the first game, although I imagine the second one would be similar if not the same.

I also forgot to mention that I didn't find interesting in the way of secrets in the first game. You can teleport your ship to the far-off stars that you can see on the furthest scan level that you normally don't get to travel to in the game, but there's no planets or anything. There's also a lone asteroid, but based on its location I think the X coordinate was just screwed up in development and it actually belongs in the belt with the others.
Title: Re: Solar Winds Sector size [Map Request or Mapping Tips?]
Post by: Mikemc on January 17, 2022, 12:53:04 am
Kewl.

That's a lot of technical jargon, but I'm certain it will be useful some day. The test image is the only map I know of now :).
I figured for a galaxy in a DOS game, the sprites would be stored off-screen until their numbers came up. Where did you get 127 in your equations from?

Huh. I installed HxD and the BH-EXPL.dat file has a pattern of an explosion when Bytes Per Row is 128. It's the only file with a clear image.. ???

(https://i.ibb.co/pL8x9pf/Screenshot-2022-01-17-012838.jpg)
Title: Re: Solar Winds Sector size [Map Request or Mapping Tips?]
Post by: DarkWolf on January 17, 2022, 10:32:37 am
I submitted the ships and planet sprites from the second game to TSR some years ago: https://www.spriters-resource.com/pc_computer/solarwindsuniverse/

One day I need to finish the rest of the graphics if no one else does. My guess is that the file you're looking at probably has some small amount of header information to give the number of sprites and then there's probably a height & width value for each frame. The ships and planets use run-length encoding if I remember correctly. I didn't figure out the communication portraits, but I am guessing they're similar.