Galaxy seeds and system properties

General discussion for players of Oolite.

Moderators: another_commander, winston

Post Reply
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: Galaxy seeds and system properties

Post by another_commander »

Pleb wrote:
Was there not, maybe years ago, a way of dumping the galactic data/co-ordinates to the log, or something to that effect?
In the debug console, copy/paste the following while in the first galaxy:

Code: Select all

var galaxyNumber = S.info.galaxyID;
for (var i = 0; i<256; i++)
{
	var si = System.infoForSystem(galaxyNumber, i);
	log("sysinfos", "System: " + si.systemID + " Name: " + si.name + " Government: " + si.government + " Coordinates: " + si.coordinates + " Inhabitants: " + si.inhabitants + " TL: " + si.techlevel + " Description: " + si.description);
}
Gal jump to the next (PS.awardEquipment("EQ_GAL_DRIVE") is your friend here) and re-paste. Repeat for each galaxy and at the end of the exercise your log should contain all info for all planets in the 8.
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 »

Ah I knew it was something involving the debug console, thanks another_commander. I'm also downloading LibreOffice so I can use PhantorGorth's spreadsheet to map out new galaxies quicker to test out new ideas with this concept. I've already tested System Redux by copying and pasting the values for the first 8 galaxies and replicating them for galaxies 9-16.

I also want to test whether the Galactic Hyper Drive OXP can work with the new galaxies, but I need to have the co-ordinates and system numbers, also for testing other OXPs, such as the Galactic Navy. Hopefully the information that the spreadsheet, coupled with the debug console dump to the log, will help with that, but from what I've seen so far all looks fine and dandy! :D
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 »

Okay I managed to open up the spreadsheet okay with LibreOffice, thanks for that PhantorGorth its really helpful and detailed. The first thing I noticed with the seed I had originally chosen for Galaxy 9 was creating a galaxy with systems that only had 4 types of government instead of 8, so 64 of each type instead of 32, so I changed the seed to one that still had all the government types in. The next problem I detected was that, as Wildeblood originally stated when he created this thread, the system properties could not be edited by legacy script or Javascript. At first I thought this was going to be the end of this little experiment, but then I remembered I had seen something in the file Universe.m in the \src\Core directory from line 5822:

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 seeing as it was similar to the code I changed before I realised this is the code that ensures the galaxy seed matches the first 8 galaxy seeds or otherwise locks out all planetinfo.plist, script.plist or any Javascript changes to the system info data. Therefore I changed the above code with the code below:

Code: Select all

		gnum++;
		if (gnum == 8)
		{
			g0.a = 0xb1;
			g0.b = 0x56;
			g0.c = 0xa1;
			g0.d = 0x45;
			g0.e = 0xb1;
			g0.f = 0x67;
		}
		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 = 0x4a;
			g0.b = 0x5a;
			g0.c = 0x48;
			g0.d = 0x02;
			g0.e = 0x53;
			g0.f = 0xb7;
		}
I also changed the code at line 5846, which looks the same to the same to the same code. Now it includes the seed I have used for Galaxy 9 when checking to see if the galaxy seed has been changed. This now makes both legacy script and Javascript accept galaxy numbers 8 to 15 when scripting. It also answers Wildeblood's original question of why the system info data is made read-only when changing the galaxy seed, and how to overcome this issue in the source code.
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: 16055
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Galaxy seeds and system properties

Post by Cody »

Pleb wrote:
The first thing I noticed with the seed I had originally chosen for Galaxy 9 was creating a galaxy with systems that only had 4 types of government instead of 8, so 64 of each type instead of 32, so I changed the seed to one that still had all the government types in.
Good... another G4 would be a trifle boring!
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
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2276
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Galaxy seeds and system properties

Post by Wildeblood »

Pleb wrote:
The next problem I detected was that, as Wildeblood originally stated when he created this thread, the system properties could not be edited by legacy script or Javascript. At first I thought this was going to be the end of this little experiment, but then I remembered I had seen something in the file Universe.m... And seeing as it was similar to the code I changed before I realised this is the code that ensures the galaxy seed matches the first 8 galaxy seeds or otherwise locks out all planetinfo.plist, script.plist or any Javascript changes to the system info data... Therefore I changed the above code... I also changed the code at line 5846, which looks the same to the same code... This now makes both legacy script and Javascript accept galaxy numbers 8 to 15 when scripting. It also answers Wildeblood's original question of why the system info data is made read-only when changing the galaxy seed, and how to overcome this issue in the source code.
I had actually found the galaxy seeds hard-coded twice in Universe.m shortly after I first asked "How is it so?" and was sure it was the source of my frustration, that's why you didn't see any whinging from me about the discussion taking off in a different direction. You have, however, completely ruined my cunning plan to make a heroic re-entrance to the discussion when you got stuck.

It took until the wee hours of this morning, though, for the penny to drop as to "Why is it so?": the galaxy seeds are hard-coded in Universe.m so that the location of interstellar spaces can be calculated. I suspect - I won't bother to check ancient change logs - that the galaxy seeds were added to Universe.m when the devs decided to make interstellar spaces modifiable from planetinfo and javascript, and that prior to that there was no problem applying modifications to the system properties of higher-numbered and alternatively-seeded galaxies. In fact, with a completely unmodified version of Oolite you can set the system properties of higher-numbered galaxies from javascript, and the changes will be duly recorded in local_planetinfo_overides; they just won't be applied to anything, but won't produce any kind of error or warning either.

There's also, slightly further down in Universe.m, a comment left by Kaks, about the difficulty of implementing a function to preview the next galaxy. (The function I fake with an image of the next galaxy in Galactic Hyperdrive OXP.)
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Re: Galaxy seeds and system properties

Post by JensAyton »

Wildeblood wrote:
I won't bother to check ancient change logs
But it’s fun! (svn blame <file> does most of the work.)
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:
You have, however, completely ruined my cunning plan to make a heroic re-entrance to the discussion when you got stuck.
Sorry about that, you would nearly have had your chance as I was getting annoyed that I'd come this far and had seemed to hit a brick wall. However some practical thinking and some testing managed to yield the results I was after. 8)
Wildeblood wrote:
In fact, with a completely unmodified version of Oolite you can set the system properties of higher-numbered galaxies from javascript, and the changes will be duly recorded in local_planetinfo_overides; they just won't be applied to anything, but won't produce any kind of error or warning either.
This was actually what was happening with my modified game, all the system info datas up to Galaxy 8 were still editable but when trying to edit the infos for Galaxies 9-16 the code didn't crash or produce any errors, but it didn't work either. Even if you had a script file that referenced Galaxy 8 and Galaxies 9-16 when changing system info data it would ignore all references beyond Galaxy 8. :?

So now, with the scripting for new galaxies possible and all tests done with OXPs yielding positive results (although I haven't tested the Galactic Hyperdrive OXP yet!) the next step is to find a galaxy seed that has the following criteria:
  • All 8 galaxies should hopefully have all 8 government types, as some can be generated without.
  • Some galaxies should have unreachable (but not necessarily vast) areas of space.
  • All 8 galaxies should have systems that reach Tech Level 14.
  • They should not contain any system names that others might deem offensive (although the Arse system would be funny!).
If anyone can think of any other criteria for new galaxies please let me know. Obviously this is a trial and error task, but it will not be as gruelling with PhantorGorth's brilliant spreadsheet! But its certainly something I'm willing to do now that I've managed to prove that adding more galaxies is possible and practical. :D
Ahruman wrote:
But it’s fun! (svn blame <file> does most of the work.)
Lol very true in this case! :mrgreen:
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
JD
Deadly
Deadly
Posts: 182
Joined: Thu Nov 25, 2010 10:42 pm
Location: London, UK

Re: Galaxy seeds and system properties

Post by JD »

It might just be me, but I like the idea of a galaxy where not all government types are present. A galaxy that was all anarchies and multi-governments could be quite interesting. Or at least one where the safer systems are under-represented.
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 »

JD wrote:
It might just be me, but I like the idea of a galaxy where not all government types are present. A galaxy that was all anarchies and multi-governments could be quite interesting. Or at least one where the safer systems are under-represented.
I did originally think this, but with one galaxy seed I was playing with there were no Communist or Dictatorship systems, making their respective flavour OXPs unused in that galaxy. Another I played with did the same to the Feudal systems and would have made the Feudal OXP unused. It depends on what values are entered into the seed as it uses these to populate the galaxies with the different governments, economies, etc... I wouldn't want to create a load of galaxies that would just leave out people's OXPs, especially the well designed flavour ones.

Another thing I forgot to mention, is whether to allow travel to these new galaxies in the same way you travel now, just instead of jumping back to Galaxy 1 when jumping past Galaxy 8 you instead jump to Galaxy 9, or whether to make travel to Galaxy 9 equipment dependable as I experimented with before, and it can work. You could then either set a price for this equipment, or have it rewarded at a certain level or after a specific mission. This way those who do not want to have more than 8 galaxies in their game could still play unaffected and those looking to expand their game could travel on to the new galaxies.

Edit: The equipment mentioned above could be like in the Galactic Hyperdrive OXP as an upgrade for the Galactic Hyperdrive that is stowed when not in use, but when you purchase a new Galactic Hyperdrive becomes available again.
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: 2276
Joined: Sat Jun 11, 2011 6:07 am
Location: Western Australia

Re: Galaxy seeds and system properties

Post by Wildeblood »

This empty template version of Galactic Hyperdrive XG OXP might be of use to someone. For use only with 16 galaxy versions of Oolite, it has the eight usual destinations arrays and eight empty arrays waiting for you to record your favourite destinations in uncharted space.
User avatar
Fatleaf
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 1988
Joined: Tue Jun 08, 2010 5:11 am
Location: In analysis mode on Phaelon
Contact:

Re: Galaxy seeds and system properties

Post by Fatleaf »

JD wrote:
It might just be me, but I like the idea of a galaxy where not all government types are present. A galaxy that was all anarchies and multi-governments could be quite interesting. Or at least one where the safer systems are under-represented.
I think this is a good idea that could be expanded. The devil is obviously in the detail. But one thought I had was maybe having a galaxy that was under attack by the Thargoids and so you met them on regular occasions.
Find out about the early influences of Fatleaf here. Also his OXP's!
Holds the Ooniversal record for "Thread Necromancy"
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 »

Galaxy four has no Dictatorships :)
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 »

Fatleaf wrote:
I think this is a good idea that could be expanded. The devil is obviously in the detail. But one thought I had was maybe having a galaxy that was under attack by the Thargoids and so you met them on regular occasions.
As I said before, I didn't really want to create a scenario where certain OXPs would be excluded from the new galaxies on the grounds they were dependant on system types that were unavailable in the new galaxies. I do like the idea of a much more dangerous universe, were you mainly have anarchy to dictatorship systems, but I am unsure that a seed could be generated in that manner. Of course, I may be wrong but I'm currently at work and unable to test this theory on the spreadsheet.

I also like the idea of increasing Thargoid encounters, but I feel this falls under the category of an OXP more than something that is hard coded into the game. However, somewhere in the code must be the procedure used to put the Thargoids into the game in the first place, so if this could be located and modified then this might be feasible.
Wildeblood wrote:
This empty template version of Galactic Hyperdrive XG OXP might be of use to someone. For use only with 16 galaxy versions of Oolite, it has the eight usual destinations arrays and eight empty arrays waiting for you to record your favourite destinations in uncharted space.
Thank you for this Wildeblood, this will allow me to navigate a bit easier. Whilst I have been exploring new galaxies I have modified my own version's source code to stop the Galactic Hyperdrive being removed every time its used and also increased the amount of fuel a player ship can hold and removed the 7 light year limit rule to enable me to travel insane distances. Obviously this is merely for testing purposes and I would normally consider this outright cheating, so I have another version compiled with just the new galaxies to make sure that everything is still possible under normal rules and conditions.
Smivs wrote:
Galaxy four has no Dictatorships
I know that's why I know its probably impossible to find a seed that generates 8 galaxies when rotating that includes all the goverments. However, as I stated earlier I merely didn't want to exclude any current OXPs and accidently offend someone from having their work omiitted from the new 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
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2412
Joined: Mon May 31, 2010 11:11 pm

Re: Galaxy seeds and system properties

Post by Switeck »

El Viejo wrote:
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.
And special OXPs can be made to reach those "unreachables", so long as they're somewhat close to the rest of the systems. The Riftworlds in G7 are really nice because there's a straightforward way to reach them and leave them without resorting to doing a Galaxy Hyperspace.
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 »

I did some more experimenting with Galaxy Seeds last night, only to discover that the new seed I had chosen to use in the last code I posted in this thread actually causes 2 galaxies to suffer the same fate as Galaxy 4 with only Democracy, Communist, Multi-Government and Anarchy government systems present. Although I would prefer not to have a situation like this, it makes me wonder whether this is an unavoidable scenario as it appears to be a flaw (or feature, depending how you look at it :wink: ) with the way the systems are generated from the galaxy seed...
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