Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! 2.6/7 » The Academy » The galaxy file - bits and bytes
The galaxy file - bits and bytes Wed, 01 February 2006 23:33 Go to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

For any of you out there that have information on the byte structure of a galaxy (.xy) file I'd like you to share your knowledge with me. I want to write a new tool to use with /create galaxy files.

Ptolemy


[Updated on: Wed, 01 February 2006 23:34]





Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: The galaxy file - bits and bytes Thu, 02 February 2006 00:22 Go to previous messageGo to next message
LEit is currently offline LEit

 
Lt. Commander

Messages: 879
Registered: April 2003
Location: CT
You could look at the map2xy code on SourceForge https://sourceforge.net/projects/stars-util

It does decode every planet, but treats the stuff at the front and end as unknown, so if what you want is there, you'll have to look elsewhere, Wumpus (find him on IRC in #Stars!) might be a good person to ask.

Also, if what you want to do fits in with the Map2XY idea, we could modify Map2XY to add your features.



- LEit

Report message to a moderator

Re: The galaxy file - bits and bytes Thu, 02 February 2006 00:34 Go to previous messageGo to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

Thanks LEit, I'll dl a copy. One of the things Im curious about is the wormholes. It would be nice to be able to pre-define them.

Ptolemy


[Updated on: Thu, 02 February 2006 00:34]





Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: The galaxy file - bits and bytes Thu, 02 February 2006 00:49 Go to previous messageGo to next message
Dogthinkers is currently offline Dogthinkers

 
Commander

Messages: 1316
Registered: August 2003
Location: Hiding from Meklar
I suspect the wormholes are in the hst file, not the xy (the xy doesn't change from turn to turn, unlike wormholes.)

I always *assumed* the xy was just planet names and locations (I'd be shocked if it contains anything else, as pretty much everything else are variables (even base hab values vary during the game))

Report message to a moderator

Re: The galaxy file - bits and bytes Thu, 02 February 2006 00:53 Go to previous messageGo to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

hmmm - good point. Anybody haave any info on the .hst file structure?

Ptolemy




Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: The galaxy file - bits and bytes Thu, 02 February 2006 05:21 Go to previous messageGo to next message
wumpus

 
Master Chief Petty Officer
Stars! V.I.P
Created tools and utilities to help the Stars! community
Past Weekly Puzzle Master

Messages: 114
Registered: September 2004
LeitW already covered most of it, but:

- Yes, the XY contains little more than the planet locations and names; more specifically, (going from memory here, so no 100% guarantees):

. Basic game parameters (which boxes were clicked in the "new game wizard"); these define stuff like the exact universe size too. The details of the various races are NOT in the XY file, only the HST and partially the M files.
. Game name
. Exact number of planets
. Coordinates and names of all planets

- The coordinates and planet name (identifiers) are unencrypted, the rest is encrypted.

- The encryption is non-trivial, and due to problems with the X file, still not going to be released. I've hit a wall on some of my cheat detection stuff which I'd need to get working before I considered releasing any of the encrypted-stuff code (aside from the fact that some code there, at least in my current versions, is from someone else whose permission I'd need to get first Smile)

If you have specific needs, email me or send me a forum-private-message, and I'll see if I can help.

The HST file is certainly editable (encrypted too ofc, I've got details on most of the underlying data structures), but making stuff like permanent wormholes at fixed locations is probably not possible, since the EXE has the rules on how wormhole stability decays and how they wobble and jump etc.



Michael "Wumpus" Zinn
» Apply magic glue here «

Report message to a moderator

Re: The galaxy file - bits and bytes Thu, 02 February 2006 06:25 Go to previous messageGo to next message
PricklyPea is currently offline PricklyPea

 
Lieutenant

Messages: 534
Registered: February 2005
Capt Maim has done quite a bit of work on HST file and should be able to help you.

I released a version of JRC4 which does not encrypt game files to make it easier to look at structures and modify them etc. You might find this useful. It is also possible to host an unencrypted game.

If you want to fix wormholes, just kill the wormhole movement code in the EXE and edit the wormhole location in the HST file.

Report message to a moderator

Re: The galaxy file - bits and bytes Mon, 06 February 2006 05:53 Go to previous messageGo to next message
PricklyPea is currently offline PricklyPea

 
Lieutenant

Messages: 534
Registered: February 2005
Had a look at wormhole stuff last night and found that it was possible to add additional wormholes. Also, I was able to chain them together (so WH1 -> WH2 -> WH3 -> WH4 -> WH1) but there was a graphical glitch in that the link from WH4 -> WH1 is not shown with a line but the jump still works.

The WH rings also survive jumping around. I can show you how to edit the (unencrypted) HST file to make these changes. However, you will also need to either hack the EXE to stop the WHs jumping OR possibly set a flag for No random events and maybe there will be no WH jiggling.

Report message to a moderator

Re: The galaxy file - bits and bytes Mon, 06 February 2006 07:08 Go to previous messageGo to next message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

OK - explain how to edit the .hst and I'll see what works / doesn't work with the corect .exe.

Ptolemy




Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Re: The galaxy file - bits and bytes Mon, 06 February 2006 09:45 Go to previous messageGo to next message
PricklyPea is currently offline PricklyPea

 
Lieutenant

Messages: 534
Registered: February 2005
I'm at work but will be back later tonight (or tomorrow night) and will give instructions. However, it is more complicated than simple hex editing since the HST structure is not fixed (i.e. you need to know something about how HST files are made up.

You might want to google for STL430.ZIP as I use this to do the editing. I also tried last night to fix wormholes by tricking No Random Events but didn't get this to work (could have been my mistake).

I manage to fix WH locations via EXE hack. To whet your appetite see: http://darkcluster.com/worm/

[note that for some reason I created a 1mb pix in there. I'll try to fix later]

Report message to a moderator

Re: The galaxy file - bits and bytes Mon, 06 February 2006 09:59 Go to previous messageGo to next message
PricklyPea is currently offline PricklyPea

 
Lieutenant

Messages: 534
Registered: February 2005
Actually, I can give you brief instructions from memory. If you open the decrypted HST file, the wormhole information is usually near the end.

You need to look for the string 0x12 0xAC (or it could have been the other way around). 0xAC being the object identifier and 0x12 the size of the object. You will then see something like 0x01 0x40, 0x40 being the wormhole identifier and and 0x01 the ID. There will be one for each WH.

Soon after this you will see the X and Y coordinates in Hex and a bit further on you will see the destination ID e.g. 0x00 0x40 (sending to WH0).

You can play with tweaking the XY coords and the destination without much difficulty.

Adding wormholes is slightly more complicated since you need to modify the number of objects which is specified slightly before the WH parts.

I hope that makes sense to you.

Report message to a moderator

Re: The galaxy file - bits and bytes Mon, 06 February 2006 15:13 Go to previous messageGo to next message
PricklyPea is currently offline PricklyPea

 
Lieutenant

Messages: 534
Registered: February 2005
You can add the below to an STL def file for editing.

/Wormhole
i8 1 Record Length // always 0x12
i8 1 Object Header // 0xAC for object?
i8 1 WormHoleID // 0-5 for standard 3 wormholes
i8 1 Class? // appears to be 40 for wormholes
i16 1 X
i16 1 Y
i16 1 Stability? // just a guess
i8 1 Unknown(visibiltybitfield?) // guessing is player bitfield for knowing dest wormhole
i8 1 Unknown
i8 1 Unknown
i8 1 Unknown
i8 1 DestWormHoleID // Dest wormhole ID
i8 1 DestClass? // 40
i8 1 Unknown
i8 1 Unknown
i16 1 Age

Report message to a moderator

Re: The galaxy file - bits and bytes Mon, 06 February 2006 22:50 Go to previous message
Ptolemy is currently offline Ptolemy

 
Commander

Messages: 1008
Registered: September 2003
Location: Finland

Thanks PricklyPea,

It does indeed make sense to me. I'll see what I can do with it.

Ptolemy




Though we often ask how and why, we must also do to get the answers to the questions.

Report message to a moderator

Previous Topic: Planets in universe
Next Topic: Ending a game by voting
Goto Forum:
  


Current Time: Mon May 06 03:53:00 EDT 2024