Author Topic: Solar Winds Sector size [Map Request or Mapping Tips?]  (Read 841 times)

0 Members and 1 Guest are viewing this topic.

Offline Mikemc

  • Newbie
  • *
  • Posts: 37
Solar Winds Sector size [Map Request or Mapping Tips?]
« on: April 11, 2021, 02: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..
« Last Edit: April 11, 2021, 02:35:01 AM by Mikemc »

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 629
Re: Solar Winds Sector size [Map Request or Mapping Tips?]
« Reply #1 on: April 22, 2021, 11:38:15 AM »
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...

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 629
Re: Solar Winds Sector size [Map Request or Mapping Tips?]
« Reply #2 on: April 22, 2021, 01: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.

Offline DarkWolf

  • Hero Member
  • *****
  • Posts: 629
Re: Solar Winds Sector size [Map Request or Mapping Tips?]
« Reply #3 on: April 23, 2021, 11:58:35 PM »
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:

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.
« Last Edit: April 24, 2021, 12:10:26 AM by DarkWolf »