Technical Information
See also Utilities | Index | Downloads | Patches and versions | Related Websites | Technical Information
Game setup | References | Calculators | In-game information processing and sharing | m and x file management | Online Utilities
Plagiarized from XyliGUN's thread Inside of Stars! Files at HWF
I'll start from the very basic things (that some of you already knows) and then will go deeply into file structure. So, let’s start.
Basics
Stars! stores all game information in several files: game.xy, game.hst, game.m*, game.x*, game.h*, where * is a player number.
- game.xy
- is actually a game configuration file, with very basic information:
- game settings: universe size, planets density, players number (note: there is no details on specific players and their races), distance between players start locations, game options (like public players scores, galaxy clumping and others) and winning conditions
- planet locations and their names (note: there is no planet stats, like minerals concentrations)
- game.hst
- is almost a full state of the game/universe, ‘almost’ except planets locations and their names (which are stored in game.xy only). It includes everything about all players, their planets and fleets. This is a main file, which game engine uses to generate next turn.
- game.m*
- is a sort of filtered game.hst file, which contains only the partial game/universe state known/available to the specific player. There is one thing that present in m file and never present in hst file: game events (like you build X factories on planet Y) and players’ messages. Note: some of these events are not stored in files at all, but generated by game client when turn is opened (like for example: you have found a new planet).
- game.x*
- is a player actions log, which contains log of all actions player performed working on a turn. Compared to m file, which actually contains just a static data (planet x has y minerals), x file actually contains an actions (load x minerals to ship y). Note: even if you will do a number of opposite actions, they won’t be ‘merged’, but all of them will be included into x file (let’s say you check and uncheck explosive minefield continuously 100 times in row, this will results in 200 actions recorded into x file: 100 for check action and 100 for uncheck action).
- game.h*
- is a player knowledge history, which contains knowledge about others players met, planets scanned, designs known, own score and others scores if PPS is available.
General File Structure
In general any Stars! file consists of blocks. All blocks data in any files except the first block in file are encrypted (there is one exclusion, I’ll mention it later). Each block have 2 bytes header followed by data of variable length. Header contains block type and block length. First header byte is a low 8 bits of the block size. Low 2 bits of the second byte is a high 2 bits of the block size and high 6 bits of the second byte is a block type. Each block in file can have up to 1024 bytes of data.
So, here is a header block bitwise: XXXXXXXX YYYYYYZZ
- (XXXXXXXX is a first byte, YYYYYYZZ is a second byte)
Where:
- YYYYYY is a block type.
- ZZXXXXXXXX is a block size.
Here is a list of blocks and their types I found so far. I’ve never met several of them in any game file, which I can access to, but you can try to find them in your own game files using this small command line tool (there is no decryption code, since block headers are never encrypted), and please if you find them let me know:
- FileFooterBlock
- ManualSmallLoadUnloadTaskBlock
- ManualMediumLoadUnloadTaskBlock
- WaypointDeleteBlock
- WaypointAddBlock
- WaypointChangeTaskBlock
- PlayerBlock
- PlanetsBlock
- FileHeaderBlock (unencrypted)
- FileHashBlock
- WaypointRepeatOrdersBlock
- Never met it
- EventsBlock
- PlanetBlock
- PartialPlanetBlock
- Never met it
- FleetBlock
- PartialFleetBlock
- Never met it
- WaypointTaskBlock
- WaypointBlock
- FleetNameBlock
- Never met it
- MoveShipsBlock
- FleetSplitBlock
- ManualLargeLoadUnloadTaskBlock
- DesignBlock
- DesignChangeBlock
- ProductionQueueBlock
- ProductionQueueChangeBlock
- BattlePlanBlock
- BattleBlock (content isn't decoded yet)
- CountersBlock
- MessagesFilterBlock
- ResearchChangeBlock
- PlanetChangeBlock
- ChangePasswordBlock
- FleetsMergeBlock
- PlayersRelationChangeBlock
- BattleContinuationBlock (content isn't decoded yet)
- MessageBlock
- Record made by AI in H file (content isn't decoded yet)
- SetFleetBattlePlanBlock
- ObjectBlock
- RenameFleetBlock
- PlayerScoresBlock
- SaveAndSubmitBlock
Technical Utilities
Stars! Bitmaps
The bitmap resources from the Stars! executable. (aka - all the pics from the game)
StarsFileStat
- download StarsFileStat.zip 36kb
- source: offsite download at DropBox
- author: XyliGUN [1]
StarsFileStat analyses Stars! files and shows what block types are in each of your files, and at the end there will be a note on whether your files contains blocks with any of the 6 remaining unknown ids: 11, 15, 18, 22, 25, 41.
Starstat & Starinfo
- download starstat.zip v1.04c 8kb
- author:Hilton Lange
- download starinfo.zip v1.0 86kb
- author:blprice
Starstat & Starinfo are otherwise identical DOS and Windows programs, respectively, that report on various aspects of the Stars! gamefiles such as the version, the presence of multiple turns in a .m file etc. Both incorrectly, but consistently, report the Stars version for v1.1a(reports 1.2a), v2.0a(2.65), 2.6i(2.81j) and 2.6JRC4(2.83) game files.