Okay just as a proof-of-concept, the following instructions made to the source (I used the current 1.79 trunk code) enables 16 galaxies in an OXP'able way, with the option of enabling or disabling this feature:
First open the OOTypes.h file in the src\Core directory, and look for the following code on line 208:
And replace it with the following code:
Then open the Universe.m file in the src\Core directory and look for the following code, starting on line 7166:
Code: Select all
gnum++;
g0.a = rotate_byte_left(g0.a);
g0.b = rotate_byte_left(g0.b);
g0.c = rotate_byte_left(g0.c);
g0.d = rotate_byte_left(g0.d);
g0.e = rotate_byte_left(g0.e);
g0.f = rotate_byte_left(g0.f);
And replace it with the following code:
Code: Select all
gnum++;
if (gnum == 8)
{
Random_Seed new_galaxy_seed;
new_galaxy_seed = RandomSeedFromString([planetInfo oo_stringForKey:@"galaxy_9_seed"]);
g0.a = new_galaxy_seed.a;
g0.b = new_galaxy_seed.b;
g0.c = new_galaxy_seed.c;
g0.d = new_galaxy_seed.d;
g0.e = new_galaxy_seed.e;
g0.f = new_galaxy_seed.f;
}
else
{
g0.a = rotate_byte_left(g0.a);
g0.b = rotate_byte_left(g0.b);
g0.c = rotate_byte_left(g0.c);
g0.d = rotate_byte_left(g0.d);
g0.e = rotate_byte_left(g0.e);
g0.f = rotate_byte_left(g0.f);
}
if (gnum == 0)
{
g0.a = 74;
g0.b = 90;
g0.c = 72;
g0.d = 2;
g0.e = 83;
g0.f = 183;
}
Then go to line 7190 in the same file and you will see the same code. Replace it with the code above as before.
Now open up the PlayerEntity.m file in the src\Core\Entities directory and look for the following code, starting on line 6213:
Code: Select all
galaxy_number++;
galaxy_number &= 7;
galaxy_seed.a = rotate_byte_left(galaxy_seed.a);
galaxy_seed.b = rotate_byte_left(galaxy_seed.b);
galaxy_seed.c = rotate_byte_left(galaxy_seed.c);
galaxy_seed.d = rotate_byte_left(galaxy_seed.d);
galaxy_seed.e = rotate_byte_left(galaxy_seed.e);
galaxy_seed.f = rotate_byte_left(galaxy_seed.f);
And replace it with the following code:
Code: Select all
galaxy_number++;
// check if planetinfo.plist has more than 8 galaxies enabled:
BOOL extra_galaxies = ([[UNIVERSE planetInfo] oo_boolForKey:@"extra_galaxies_enabled"]);
if (extra_galaxies)
{
// make sure galaxy number goes back to 0 (galaxy 1):
if (galaxy_number > 15)
{
galaxy_number = 0;
}
// when jumping to galaxy 9 generate new galaxy seed to generate 8 new galaxies:
if (galaxy_number == 8)
{
Random_Seed new_galaxy_seed;
new_galaxy_seed = RandomSeedFromString([[UNIVERSE planetInfo] oo_stringForKey:@"galaxy_9_seed"]);
galaxy_seed.a = new_galaxy_seed.a;
galaxy_seed.b = new_galaxy_seed.b;
galaxy_seed.c = new_galaxy_seed.c;
galaxy_seed.d = new_galaxy_seed.d;
galaxy_seed.e = new_galaxy_seed.e;
galaxy_seed.f = new_galaxy_seed.f;
}
else
{
galaxy_seed.a = rotate_byte_left(galaxy_seed.a);
galaxy_seed.b = rotate_byte_left(galaxy_seed.b);
galaxy_seed.c = rotate_byte_left(galaxy_seed.c);
galaxy_seed.d = rotate_byte_left(galaxy_seed.d);
galaxy_seed.e = rotate_byte_left(galaxy_seed.e);
galaxy_seed.f = rotate_byte_left(galaxy_seed.f);
}
// when back at galaxy 1 reset galaxy seed to original seed:
if (galaxy_number == 0)
{
galaxy_seed.a = 74;
galaxy_seed.b = 90;
galaxy_seed.c = 72;
galaxy_seed.d = 2;
galaxy_seed.e = 83;
galaxy_seed.f = 183;
}
}
else
{
// if extra galaxies are not enabled ensure player can only visit the original 8 galaxies:
galaxy_number &= 7;
galaxy_seed.a = rotate_byte_left(galaxy_seed.a);
galaxy_seed.b = rotate_byte_left(galaxy_seed.b);
galaxy_seed.c = rotate_byte_left(galaxy_seed.c);
galaxy_seed.d = rotate_byte_left(galaxy_seed.d);
galaxy_seed.e = rotate_byte_left(galaxy_seed.e);
galaxy_seed.f = rotate_byte_left(galaxy_seed.f);
}
Now finally, open up the planetinfo.plist file in the Resources\Config directory and add the following two lines of code:
Code: Select all
// Set to yes if you want to enable extra 8 galaxies:
extra_galaxies_enabled = yes;
// Seed used for galaxy 9 and for subsequent 7 turns to generate galaxies 10-16:
galaxy_9_seed = "177 86 161 69 177 103";
These two functions added to the planetinfo.plist file will now allow you to either enable to disable the extra galaxies, and define the seed used for galaxy 9.
Tricky wrote:
Surprisly not. I've used Ian Bell's
Text Elite to generate 1024 systems without changing the base code. The
Random Number Generator can create up to 32768 systems per galaxy (with caveats).
Ah, so for my next trick...