Galaxy seeds and system properties
Moderators: winston, another_commander
Re: Galaxy seeds and system properties
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!
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!
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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Re: Galaxy seeds and system properties
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...
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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
- Tricky
- ---- 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
From txtelite.cPleb 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?
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);
}
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.
Re: Galaxy seeds and system properties
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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
- Griff
- Oolite 2 Art Director
- Posts: 2483
- Joined: Fri Jul 14, 2006 12:29 pm
- Location: Probably hugging his Air Fryer
Re: Galaxy seeds and system properties
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"Tricky wrote:...I just wish I could remember the source.
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.
Wiki homepage for my OXP: http://wiki.alioth.net/index.php/Griff_Industries
Re: Galaxy seeds and system properties
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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Re: Galaxy seeds and system properties
Does Galaxy 9 look suspiciously similar to Galaxy 1, though?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...
Re: Galaxy seeds and system properties
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...
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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Galaxy seeds and system properties
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.Pleb wrote:...I was messing with a save game in galaxy 1(0), changed the value to galaxy 8(7) in notepad...
Commander Smivs, the friendliest Gourd this side of Riedquat.
Re: Galaxy seeds and system properties
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 ) 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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
- SandJ
- ---- 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
Use the galaxy generation algorithm outside of Oolite to generate what the galaxy would look like. Ditto for the system names.Pleb wrote:TOf course there must be a way to do this though...
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
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
Dropbox referral link 2GB of free space online + 500 Mb for the referral: good for securing work-in-progress.
Re: Galaxy seeds and system properties
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?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).
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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Re: Galaxy seeds and system properties
Oh, it's not that it's impossible. There are two problems:Pleb wrote:But if they managed to produce 9 galaxies in ElitePlus surely with enough code modifying you could do the same in Oolite?
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.
Re: Galaxy seeds and system properties
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: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.
Lol I would imagine this would be quite a task, as there are hundereds of files in the source!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.
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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4
Re: Galaxy seeds and system properties
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!
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
Laptop PC: CPU: Intel i5-10300H Quad Core 4.5GHz (Turbo-Charged) GPU: Nvidia GeForce GTX 1650 RAM: 32GB DDR4