Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Galaxy seeds and system properties

General discussion for players of Oolite.

Moderators: another_commander, winston

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 don't fully (or even pretend to) understand how the code works in Oolite, but I have been told before that the 0-7 (1-8) galaxies in Oolite are hardcoded, which I actually do understand. But the number range of 0-7, could that be extended easilly to 0-13 for instance? Or would like just cause a system error of some kind?

Also I think that the reason you are having problems Wildeblood is as AC said, the game isn't designed so you can play around with your save game file (even though it is very simple and often tempting for testing/debugging purposes!). It may be a fail-safe feature built into the code to avoid messing with the core game. Thank you again though for sending me that galaxy seed, I can't wait to check it out when I finish work! :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 »

It does work! I won't say how again, but I changed one number value and when I jumped from Galaxy 8 I ended up in Galaxy 9! So it proves it isn't hard to modify the game to allow more than 8 galaxies after all. However, as this had now gone far off topic I will get back to my exploring of "illegal" galaxies... :twisted:
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
Tricky
---- E L I T E ----
---- E L I T E ----
Posts: 821
Joined: Sun May 13, 2012 11:12 pm
Location: Bradford, UK. (Anarchic)

Re: Galaxy seeds and system properties

Post by Tricky »

Pleb wrote:
I don't fully (or even pretend to) understand how the code works in Oolite, but I have been told before that the 0-7 (1-8) galaxies in Oolite are hardcoded, which I actually do understand. But the number range of 0-7, could that be extended easilly to 0-13 for instance? Or would like just cause a system error of some kind?
From txtelite.c

Code: Select all

/**+Generate galaxy **/

/* Functions for galactic hyperspace */

uint16 rotatel(uint16 x) /* rotate 8 bit number leftwards */
  /* (tried to use chars but too much effort persuading this braindead
     language to do bit operations on bytes!) */
{ uint16 temp = x&128;
        return (2*(x&127))+(temp>>7);
}

uint16 twist(uint16 x)
{ return (uint16)((256*rotatel(x>>8))+rotatel(x&255));
}

void nextgalaxy(seedtype *s) /* Apply to base seed; once for galaxy 2  */
{ (*s).w0 = twist((*s).w0);  /* twice for galaxy 3, etc. */
  (*s).w1 = twist((*s).w1);  /* Eighth application gives galaxy 1 again*/
  (*s).w2 = twist((*s).w2);
}

/* Original game generated from scratch each time info needed */
void buildgalaxy(uint galaxynum)
{       uint syscount,galcount;
        seed.w0=base0; seed.w1=base1; seed.w2=base2; /* Initialise seed for galaxy 1 */
        for(galcount=1;galcount<galaxynum;++galcount) nextgalaxy(&seed);
        /* Put galaxy data into array of structures */
  for(syscount=0;syscount<galsize;++syscount) galaxy[syscount]=makesystem(&seed);
}
As Oolite uses this code (or something similar) you can see that 8 galaxies is your lot.

I do remember an interview where Braben and Bell said that originally you could have over 2 billion galaxies, but Acornsoft rightly suggested that they limit that. I just wish I could remember the source.
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 »

Regardless of what that code says, I modified one value in PlayerEntity.m and managed to jump from the 8th galaxy into a 9th galaxy no problem (well there WAS an issue but turns out its with the Trunk - replicated code into source code for 1.76.1 and it was successful!). Literally only one value was changed from 7 to 15... Also, as I said before, even ElitePlus had 9 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
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2478
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: Galaxy seeds and system properties

Post by Griff »

Tricky wrote:
...I just wish I could remember the source.
I think this may be mentioned in the chapter dedicated to the making of Elite in the book "Backroom Boys: The Secret Return Of The British Boffin, by Francis Spufford"
http://www.amazon.co.uk/The-Backroom-Bo ... 0571214967
I'm not entirely sure though, it's been ages since i read it and i think afterwards i went straight into the Craig Revell-Horwood autobiography which acted as a sort of mind bleach
Last edited by Griff on Fri Jun 15, 2012 7:53 am, edited 1 time in total.
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 »

But from what I discovered last night it seems the code is limited by one line in PlayerEntity.m as there is a line that suggests when it gets to Galaxy 7 (8) and tries to jump to the next galaxy it resets itself. But if you change the value to a higher number it keeps on jumping...
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
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:
But from what I discovered last night it seems the code is limited by one line in PlayerEntity.m as there is a line that suggests when it gets to Galaxy 7 (8) and tries to jump to the next galaxy it resets itself. But if you change the value to a higher number it keeps on jumping...
Does Galaxy 9 look suspiciously similar to Galaxy 1, 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 »

That could be possible, admitedly because it was late I was messing with a save game in galaxy 1(0), changed the value to galaxy 8(7) in notepad, and noticed when jumping from galaxy 8(7) it now said 'Galactic Chart 9' on long range chart. It could be that if you were in the actual galaxy 8(7) and jumped to galaxy 9(8) it would just look like galaxy 1(0). If so, back the drawing board! (Although to be honest I'm not keen to promote modifying of the source code, I was simply curious for my own reasons!)

Of course there must be a way to do this though...
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
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 »

Pleb wrote:
...I was messing with a save game in galaxy 1(0), changed the value to galaxy 8(7) in notepad...
Aaargh! Never, ever use Notepad! It adds all sorts of unwanted characters to files and can completely screw things up. Use Notepad++ or any other good text editor.
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 »

Sorry I do use Notepad++ - best file editor EVER! But I will explore this possibility when I get home. Again, I must state I do not condone or recommend people mess with the source code as let's be honest, the game is fine as it is just the idea of more galaxies has always interested me and the fact I know I can use Oolite to generate multiple galaxies by modifying either the save game file (with Notepad++ of course :wink: ) or the source code to effect where the player starts. In fact, the code can be modified to make the player start in any system...but again: don't mess with the source code people! Unless you are a developer of course...
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
SandJ
---- E L I T E ----
---- E L I T E ----
Posts: 1048
Joined: Fri Nov 26, 2010 9:08 pm
Location: Help! I'm stranded down here on Earth!

Re: Galaxy seeds and system properties

Post by SandJ »

Pleb wrote:
TOf course there must be a way to do this though...
Use the galaxy generation algorithm outside of Oolite to generate what the galaxy would look like. Ditto for the system names.

That way you could get maps very quickly (and lists of names for putting into a dirty words search, if desired).
Flying a Cobra Mk I Cobbie 3 with nothing but Explorers Club.OXP and a beam laser 4 proper lasers for company :D
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
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 »

SandJ wrote:
Use the galaxy generation algorithm outside of Oolite to generate what the galaxy would look like. Ditto for the system names.

That way you could get maps very quickly (and lists of names for putting into a dirty words search, if desired).
Lol, yes I'm always on the hunt for that 'Arse' system haha... But if they managed to produce 9 galaxies in ElitePlus surely with enough code modifying you could do the same in Oolite?
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
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:
But if they managed to produce 9 galaxies in ElitePlus surely with enough code modifying you could do the same in Oolite?
Oh, it's not that it's impossible. There are two problems:
1) The current galaxy jump algorithm "rotates" the galaxy seed. Like a Thargoid ship, the galaxy seed is octagonal, so after eight rotations the algorithm gives the original seed. This is why Thargoids have such command of witchspace. Anyway, for Galaxy 9 you would need a different way of generating the galaxy seed number, which if it was in the core game would require a decision to be made on what Galaxy 9 should be like.
2) There are probably numerous places in the current code (I can think of several in OXPs, too) which assume in some way that galaxyNumber is in the range 0..7, and that a galactic jump from 7 takes you back to zero. Finding them all would be a significant piece of 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 »

cim wrote:
1) The current galaxy jump algorithm "rotates" the galaxy seed. Like a Thargoid ship, the galaxy seed is octagonal, so after eight rotations the algorithm gives the original seed. This is why Thargoids have such command of witchspace. Anyway, for Galaxy 9 you would need a different way of generating the galaxy seed number, which if it was in the core game would require a decision to be made on what Galaxy 9 should be like.
So in theory when the code calls for the eighth turn to take place, a condition would have to be applied to generate another galaxy seed and then maybe when jumping beyond that reset the seed back to the first one (for Galaxy 1)?
cim wrote:
2) There are probably numerous places in the current code (I can think of several in OXPs, too) which assume in some way that galaxyNumber is in the range 0..7, and that a galactic jump from 7 takes you back to zero. Finding them all would be a significant piece of work.
Lol I would imagine this would be quite a task, as there are hundereds of files in the source!
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 was right and wrong - It is possible to jump from Galaxy 8 and jump into a new Galaxy 9, by adding an IF statement when jumping into the ninth galaxy it changes the galaxy seed to a pre-defined seed. Then it can turn the seed another 7 turns totalling in 16 galaxies! Then, another IF statement to replace the original statement that sets 7(8) as the maximum galaxy and instead resets the galaxy number to 0(1) and sets the seed to Galaxy 1's seed when jumping past Galaxy 16. All of this is changed in one file. You could even keep putting in conditions and new seeds to expand in sets of 8 galaxies at a time!

Edit: By changing another file I have been able to write scripts that now allow the galaxyNumber value in JavaScript to go up to 15 rather than 7!
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