Galaxy seeds and system properties

General discussion for players of Oolite.

Moderators: winston, another_commander

Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Galaxy seeds and system properties

Post by Switeck »

Does that also handle any problems associated with an out-of-range galaxyNumber value?
This example line doesn't work for that reason:
var jumpDistance = Number(System.infoForSystem(galaxyNumber,system.ID).distanceToSystem(System.infoForSystem(galaxyNumber,player.ship.targetSystem)).toFixed(1));
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Galaxy seeds and system properties

Post by Pleb »

Switeck wrote:
Does that also handle any problems associated with an out-of-range galaxyNumber value?
This example line doesn't work for that reason:
var jumpDistance = Number(System.infoForSystem(galaxyNumber,system.ID).distanceToSystem(System.infoForSystem(galaxyNumber,player.ship.targetSystem)).toFixed(1));
The galaxyNumber range is defined in OOTypes.h under kOOMaximumGalaxyID. So, if you changed kOOMaximumGalaxyID = 7 to kOOMaximumGalaxyID = 15 the range has now been extended to 16 galaxies (as galaxy 0 is galaxy 1, etc...). So when I run a script that will only launch in galaxy 9-16 (which would be 8-15 in the script) it launches successfully without any errors in the log.
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2453
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia
Contact:

Re: Galaxy seeds and system properties

Post by Wildeblood »

Yes, but that doesn't help with creating alternative galaxies at all. You've got the same eight you always had, you're just cycling through them twice before the galaxyNumber resets to 0.
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Galaxy seeds and system properties

Post by Pleb »

Wildeblood wrote:
Yes, but that doesn't help with creating alternative galaxies at all. You've got the same eight you always had, you're just cycling through them twice before the galaxyNumber resets to 0.
No, you can but it involves changing code in the PlayerEntity.m file. In the current code it will reset when going past Galaxy 8 back to galaxy 1, but this can be changed so that when it gets past Galaxy 16 it reverts back to Galaxy 1. Then, by setting a condition that when the player jumps into Galaxy 9 rather than rotating the seed bytes left again and going back to the Galaxy 1 seed, it generates a new defined seed for Galaxy 9. Then when jumping to Galaxies 10-16 it will rotate the galaxy seed bytes left to generate new galaxies. Then another conditional event that when the player gets back to Galaxy 1, it sets the galaxy seed back to the original Galaxy 1 seed so that you can cycle through Galaxies 2-8 again.

It is possible because I've done it, I just don't want to post the code to do it on the forums and risk offending anyone such as those who believe more than 8 galaxies would change the game significantly, and also the people who made the game as I love Oolite and would not want to be kicked off of the forums, lol! I merely experimented with the code to see if it was possible and it is so.

Of course, the problem with adding another 8 galaxies is you have to find a seed that hasn't got vast areas of unconnected systems from the main bulk on the galactic map. Also you'd want to try to avoid a situation where you jump into a system with no Galactic Hyperdrive available to buy and nowhere else to get it nearby and be stuck, like in Galaxy 8! Then, not only would that seed have to be okay but the next 7 seeds after when the bytes are rotated left to generate the next galaxy seeds have to be okay as well. It might take a long time to find the right seed for this, as I have just used a random seed and there issues with several of the new galaxies I have generated for my test...
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

Re: Galaxy seeds and system properties

Post by another_commander »

Pleb wrote:
It is possible because I've done it, I just don't want to post the code to do it on the forums and risk offending anyone such as those who believe more than 8 galaxies would change the game significantly, and also the people who made the game as I love Oolite and would not want to be kicked off of the forums, lol! I merely experimented with the code to see if it was possible and it is so.
Why would anyone be offended for posting code on the forum? And - even more so - why do you think you'd be kicked off the forums for this? Feel free to post your results here, nobody is going to be offended or bite anyone.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: Galaxy seeds and system properties

Post by cim »

Pleb wrote:
It might take a long time to find the right seed for this, as I have just used a random seed and there issues with several of the new galaxies I have generated for my test...
If you haven't already seen it, there's a spreadsheet linked from the [wiki]Oolite planet list[/wiki] page, which lets you specify a new seed and generates the map for you in the "Star chart" tab. Quicker than recompiling and jumping through 8 galaxies every time, anyway.

It doesn't show connectivity, for which the Advanced Nav Array is the best, of course, but it should let you rule out obviously bad seeds a bit quicker. As regards disconnected systems, Oolite treats the block with system 0 connected to it as being the main block on a typical Galjump, so as long as 0 isn't one of the disconnected ones it's not too bad.

I do wonder how many unusable seeds Bell and Braben got through before they found this one, though.
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Galaxy seeds and system properties

Post by Pleb »

another_commander wrote:
Why would anyone be offended for posting code on the forum? And - even more so - why do you think you'd be kicked off the forums for this? Feel free to post your results here, nobody is going to be offended or bite anyone.
Okay, thank you I just didn't want to have broken any rules! For anyone interested in testing this out, you will need the source code for Oolite and be able to compile it. I used the code for 1.76.1 for my test, but it would probably work with the TRUNK source code as well. Go to the file PlayerEntity.m in the \src\Core\Entities directory and go to line 5045. It should look like this:

Code: Select all

	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 the code above with the code below:

Code: Select all

	// 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)
	{
		galaxy_seed.a = 0x2a;
		galaxy_seed.b = 0x2a;
		galaxy_seed.c = 0x42;
		galaxy_seed.d = 0x01;
		galaxy_seed.e = 0x52;
		galaxy_seed.f = 0xb2;
	}
	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 = 0x4a;
		galaxy_seed.b = 0x5a;
		galaxy_seed.c = 0x48;
		galaxy_seed.d = 0x02;
		galaxy_seed.e = 0x53;
		galaxy_seed.f = 0xb7;
	}
Then go to the file OOTypes.h in the \src\Core directory and look for the code below on line 191:

Code: Select all

	kOOMaximumGalaxyID		= 7,
And replace it with the following code:

Code: Select all

	kOOMaximumGalaxyID		= 15,
Now compile and run Oolite and when you intergalactic jump from Galaxy 8 you should end up in a brand new Galaxy 9. Also because of the change made in OOTypes.h it should be possible to use JavaScript code to launch scripts in the new galaxies. It worked on mine anyways!
cim wrote:
If you haven't already seen it, there's a spreadsheet linked from the  Oolite planet list page, which lets you specify a new seed and generates the map for you in the "Star chart" tab. Quicker than recompiling and jumping through 8 galaxies every time, anyway.
I didn't see this, could be handy to find a seed that would work, much quicker than compiling over and over again as you said! For anyone who wants to change the seed for Galaxy 9, this can be changed by changing the following code in the example above:

Code: Select all

	// when jumping to galaxy 9 generate new galaxy seed to generate 8 new galaxies
	if (galaxy_number == 8)
	{
		galaxy_seed.a = 0x2a;
		galaxy_seed.b = 0x2a;
		galaxy_seed.c = 0x42;
		galaxy_seed.d = 0x01;
		galaxy_seed.e = 0x52;
		galaxy_seed.f = 0xb2;
	}
Each of these values are the galaxy seed numbers, though if you had a specific seed you wished to use you would need a converter to convert the values.

If anyone can find a hole in my theory please let me know!!!
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Galaxy seeds and system properties

Post by Pleb »

Here are the Galactic Charts for my Galaxies 9-16:

Image

Image

Image

Image

Image

Image

Image

Image
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Galaxy seeds and system properties

Post by Cody »

Interesting... I rather like G13.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Galaxy seeds and system properties

Post by Pleb »

El Viejo wrote:
Interesting... I rather like G13.
I know what you mean, I like Galaxies like the current Galaxy 7 that have a group of systems separate from the main bulk, but these are not always accessible unless you modify the planetinfo.plist file.

Of course, if anyone else can find a galaxy seed to generate a further 7 galaxies that are all within a set of rules, such as all systems reachable and no Oresrati tyoe situations where you would be stranded, this would work better than the seed I have provided in the example. As you can see, I just changed a few numbers to generate a random code, but more thought would need to be put into this to generate "perfect" galaxies...
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Galaxy seeds and system properties

Post by Cody »

Nothing wrong with a few 'unreachable' system clusters - they can sometimes be reached via mis-jumps, as is the case with the Riftworlds in G7.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Galaxy seeds and system properties

Post by Smivs »

I like 11. That large area on the right with only two links is full of possibilities. :)
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Galaxy seeds and system properties

Post by Pleb »

Smivs wrote:
I like 11. That large area on the right with only two links is full of possibilities. :)
The only issue I had with Galaxy 11 was that the system that has a green circle around it appears to have no name! Not sure why, could be a bug with that particular seed, which is annoying because as you said it has a lot of possibilities...
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Galaxy seeds and system properties

Post by Cody »

I wonder if a different planet name seed could be used in the extra charts as well - make them even more unusual?
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Pleb
---- E L I T E ----
---- E L I T E ----
Posts: 908
Joined: Sun Apr 29, 2012 2:23 pm
Location: United Kingdom

Re: Galaxy seeds and system properties

Post by Pleb »

El Viejo wrote:
I wonder if a different planet name seed could be used in the extra charts as well - make them even more unusual?
Not sure if that would be possible, as it would affect the names in all the galaxies. But the names it comes up with are pretty odd...and some of the descriptions I have found have been pretty humorous!
Desktop PC: CPU: Intel i7-4790K Quad Core 4.4GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1080Ti RAM: 32GB DDR3

Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Post Reply