Page 6 of 12
Re: Galaxy seeds and system properties
Posted: Mon Jun 18, 2012 3:58 pm
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.
Re: Galaxy seeds and system properties
Posted: Mon Jun 18, 2012 7:19 pm
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!
Re: Galaxy seeds and system properties
Posted: Mon Jun 18, 2012 11:18 pm
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.
Re: Galaxy seeds and system properties
Posted: Mon Jun 18, 2012 11:24 pm
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!
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 2:49 am
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.)
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 6:49 am
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.)
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 8:13 am
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.
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.
Ahruman wrote:But it’s fun! (svn blame <file> does most of the work.)
Lol very true in this case!
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 8:48 am
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.
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 9:04 am
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.
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 12:06 pm
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.
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 12:10 pm
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.
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 12:48 pm
by Smivs
Galaxy four has no Dictatorships
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 12:59 pm
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.
Re: Galaxy seeds and system properties
Posted: Tue Jun 19, 2012 5:22 pm
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.
Re: Galaxy seeds and system properties
Posted: Thu Jun 21, 2012 12:05 pm
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
) with the way the systems are generated from the galaxy seed...