Home » Stars! Clones, Extensions, Modding » Stars! Extensions » xy modification after game has started
Re: xy modification after game has started |
Sat, 19 July 2014 02:18 |
|
raptor | | | Messages: 138
Registered: June 2014 | |
|
I think I have settled on an optimal way of reading the byte stream. The data I'm after usually comes in 1, 2, or 4 byte chunks (before bit-twiddling to get higher packed data points). Here are the rules I follow:
1. If a single byte, read the byte
2. If two bytes, read them in swapped (little-endian)
3. If four bytes, read them in swapped
You can see how I implement it here:
https://github.com/raptor/stars/blob/master/python/decryptor .py#L253
So basically, instead of bonkers structures that are parsed directly from the byte stream, without swapping, that look like this:
XXXXXXXX YYYYYYXX NNYYYYYY NNNNNNNN
(This is a 4 byte planet chunk from the XY file)
X = X coordinate offset
Y = Y coordinate
N = Planet Name ID
The byte stream now looks like this:
NNNNNNNN NNYYYYYY YYYYYYXX XXXXXXXX
Everything lines up! This makes the decoding code much simpler and easier to follow.
On another note - I find I'm enjoying writing python,so I'm not sure I'll continue with the Java. Also, my time is very limited and porting code like this from decompiled C# is slow-going. Honestly, it's slightly demoralizing that there is source code out there that has most of my work done already, but it was never released (XyliGUN's tools in particular interest me, but they were not written in a language that's easily decompilable).
I encourage anyone who wants to add to my work by either forking the project in github or even sending me other code to merge.
Report message to a moderator
|
|
|
|
|
xy modification after game has started
By: raptor on Sun, 29 June 2014 22:48
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Mon, 30 June 2014 18:33
|
|
|
Re: xy modification after game has started
By: raptor on Tue, 01 July 2014 09:27
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: XAPBob on Wed, 02 July 2014 03:10
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Wed, 02 July 2014 23:35
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: XAPBob on Fri, 04 July 2014 06:52
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Fri, 04 July 2014 22:07
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sat, 05 July 2014 09:39
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sat, 05 July 2014 19:15
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sat, 05 July 2014 21:10
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sun, 06 July 2014 01:55
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sun, 06 July 2014 09:07
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sun, 06 July 2014 16:53
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sun, 06 July 2014 22:56
|
|
|
Re: xy modification after game has started
By: raptor on Mon, 07 July 2014 11:25
|
|
|
Re: xy modification after game has started
By: XAPBob on Mon, 07 July 2014 12:48
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sat, 19 July 2014 02:18
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sat, 19 July 2014 15:20
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sat, 19 July 2014 22:44
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Mon, 21 July 2014 00:22
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: raptor on Sat, 05 July 2014 10:38
|
|
|
Re: xy modification after game has started
By: raptor on Sat, 05 July 2014 12:34
|
|
|
Re: xy modification after game has started
|
|
|
Re: xy modification after game has started
By: ricks03 on Fri, 15 November 2019 12:27
|
Goto Forum:
Current Time: Sun Apr 28 01:24:54 EDT 2024
|