[BETA TOOL] Oolite Galaxy Generator

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
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

[BETA TOOL] Oolite Galaxy Generator

Post by Pleb »

So I've been working on something that, admittedly, I originally built a long time ago but lost the code for it and then forgot all about it until I was recently reminded about this by Cholmondely. At present it is pretty basic, but what this tool essentially does is generate up to 8 galaxies worth of up to 256 systems and exports this into a planetinfo.plist file. It is a console application written in C# using .NET Core 5, and although the current release is compiled under Windows 64bit, it may be possible to recompile for Linux and Mac as well (but I don't use either of these so I can't say for certain!).

When you run the tool, it will ask you to enter a starting galaxy number between 0 and 7. This is essentially galaxies 1-8. It will then ask you to enter a galaxy number to finish on between 0 and 7. The number of course has to be greater or equal to the first number you entered! Then it will ask the same again for system numbers, but these are between 0 and 255 (which correspond to systems 1 to 256). After you've entered these 4 numbers, based on the parameters you've entered the application will then generate some systems for you and dump them into a planetinfo.plist file.

Please note that this is a very experimental tool at present and is very random! Whilst the original Oolite galaxies are somewhat balanced, this is purely randomised. You could have loads of anarchy systems that are high tech levels, or no high tech level systems at all! Also I haven't implemented the system descriptions yet either, so these are blank for now.

Future releases will tidy up the standard Oolite galaxies and systems it is currently generating and also implement a system name generator using the same way that Oolite used to randomly generate system descriptions. After that I intend to expand on this to go towards creating a kind of SOTL-like 'total conversion' OXP that will aim to create a new game within the current Oolite engine.

CHANGELOG:
  • v1.0.1 - Brings some of the random values being assigned to the main planets in system and also the sun and other system variables more in-line with Oolite, and also paving the way internally towards starting to split out standard Oolite galaxy generation and alternate galaxy types. Still have not implemented system descriptions, but due to the complexity of this I may leave this for the time being and start on the alt galaxy types instead.
  • v1.0 - Initial release. This allows you to generate a basic Oolite galaxy, with more randomisation than would have usually happened using the old galaxy generation method. Only function currently missing is the system description generator.

Download Oolite Galaxy Generator v1.0.1
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
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

Thank you for this!

Well, I've downloaded it onto my AppleMac (I went for the "OoliteGalaxyGenerator_v1.0.1.zip" option rather than the Source code (zip)/Source code (tar.gz) options).

Expanding it shows one of those .exe things which I'm pretty sure won't work on my marvellous & magnificent machine...

What should I do now?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

Just curious...

Oolite is mostly written in Objective-C (72.5%) & C (19%)

My understanding is that the oxp's override/trump the vanilla game coding thanks to these "spidermoney" tags written into it, which allow the javascript of the oxp to "trump" the vanilla game code.

But, one javascript oxp can override another (eg Spara's SothisTC overrides the original Sothis orbital station, using its textures but adding more "functionality" to the station itself (location tweaks, New Cargoes tweaks, market tweaks etc).

So, my question: if you compose a new page for the initial game choices screen allowing a galaxy creation option, and composed it in Objective-C, could it not just override the vanilla game coding Objective-C in a similar way, without needing to rewrite the game code and create a new version of the game?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
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: [BETA TOOL] Oolite Galaxy Generator

Post by Pleb »

Cholmondely wrote: Sun Aug 15, 2021 9:30 am
So, my question: if you compose a new page for the initial game choices screen allowing a galaxy creation option, and composed it in Objective-C, could it not just override the vanilla game coding Objective-C in a similar way, without needing to rewrite the game code and create a new version of the game?
I'm not entirely sure what you mean? At present this tool just exports the planetinfo.plist file. If you were going to put this in an OXP/Z then it would probably make sense to do it as a scenario in the same way SOTL is set up. Mainly because if you change what all the systems are and where they are, this will make some OXP/Z's not work correctly as they will be expecting the original systems to be there. The disadvantage to this is that you then have to go through and manually edit any OXP/Z's you want to add to your new universe by using the tags function. I think cim has written about this before.
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: [BETA TOOL] Oolite Galaxy Generator

Post by Pleb »

Cholmondely wrote: Sun Aug 15, 2021 1:12 am
Thank you for this!

Well, I've downloaded it onto my AppleMac (I went for the "OoliteGalaxyGenerator_v1.0.1.zip" option rather than the Source code (zip)/Source code (tar.gz) options).

Expanding it shows one of those .exe things which I'm pretty sure won't work on my marvellous & magnificent machine...

What should I do now?
Sorry I missed this! It's currently only compiled to work on Windows but I think I can compile it for Linux and Mac so I will look into that next time I update this! :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
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

Pleb wrote: Sun Aug 15, 2021 5:05 pm
Sorry I missed this! It's currently only compiled to work on Windows but I think I can compile it for Linux and Mac so I will look into that next time I update this! :D
Fair dibs! Currently mucking about with Phkb's Hermitage. Have you given it a spin yet? A brand new game using the Oolite engine.

Reference: http://wiki.alioth.net/index.php/Hermitage
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cmdr James »

Cholmondely wrote: Sun Aug 15, 2021 9:30 am
My understanding is that the oxp's override/trump the vanilla game coding thanks to these "spidermoney" tags written into it, which allow the javascript of the oxp to "trump" the vanilla game code.
This is a bit of a misunderstanding.

The core game is written in Objective C (correct) and it is written in such a way that some properties can be externally modified (ie by javascript).

It isnt about one language trumping the other, but the core game making some things accessible and modifiable. The easiest way to modify something is to provide a plist (a properties list, as an example look here https://github.com/OoliteProject/oolite ... info.plist ) which overrides the default properties.

For example the planets are defined in planetinfo.plist and mucking about with this file will, assuming you dont break anything, change the systems in oolite.

The tool as described spits out a new planetinfo.plist which could replace the existing one.
Cholmondely wrote: Sun Aug 15, 2021 9:30 am
So, my question: if you compose a new page for the initial game choices screen allowing a galaxy creation option, and composed it in Objective-C, could it not just override the vanilla game coding Objective-C in a similar way, without needing to rewrite the game code and create a new version of the game?


I cannot see an easy way to integrate more objective C without making it part of the core game. The OXP/OZP system is set up for javascript, I dont believe it can be readily used as is by objective C.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

Cmdr James wrote: Mon Aug 16, 2021 11:23 am
Cholmondely wrote: Sun Aug 15, 2021 9:30 am
My understanding is that the oxp's override/trump the vanilla game coding thanks to these "spidermoney" tags written into it, which allow the javascript of the oxp to "trump" the vanilla game code.
This is a bit of a misunderstanding.

The core game is written in Objective C (correct) and it is written in such a way that some properties can be externally modified (ie by javascript).

It isnt about one language trumping the other, but the core game making some things accessible and modifiable. The easiest way to modify something is to provide a plist (a properties list, as an example look here https://github.com/OoliteProject/oolite ... info.plist ) which overrides the default properties.

For example the planets are defined in planetinfo.plist and mucking about with this file will, assuming you dont break anything, change the systems in oolite.

The tool as described spits out a new planetinfo.plist which could replace the existing one.
Cholmondely wrote: Sun Aug 15, 2021 9:30 am
So, my question: if you compose a new page for the initial game choices screen allowing a galaxy creation option, and composed it in Objective-C, could it not just override the vanilla game coding Objective-C in a similar way, without needing to rewrite the game code and create a new version of the game?


I cannot see an easy way to integrate more objective C without making it part of the core game. The OXP/OZP system is set up for javascript, I dont believe it can be readily used as is by objective C.
Thank you for this.

So this explains the simpler OXPs: new lasers & missiles, changes in ambience, new ships etc. The core code is constructed in such a way that these can be added to and the vanilla versions overwritten. It is only when you need something new in the core code (such as the ability to have a second light source) that it then becomes impossible to create a binary star system.

But how does Headlights.oxp work then? Is it different that in effect it counts as a brightening of the entire solar system in that view, rather than a second light source is attached to my ship?

And how do overrides work then? Is it that the vanilla game core code allows certain sections of itself to be overwritten (via spidermonkey overwritten in Javascipt, and via other means overwritten in the two legacy scripts), and the overwriting itself can be overwritten in turn?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cmdr James »

Cholmondely wrote: Mon Aug 16, 2021 1:27 pm
But how does Headlights.oxp work then? Is it different that in effect it counts as a brightening of the entire solar system in that view, rather than a second light source is attached to my ship?
There is a property system.ambientLevel which sets the brightness for the whole system, this is simply set in javascript.
Cholmondely wrote: Mon Aug 16, 2021 1:27 pm
And how do overrides work then? Is it that the vanilla game core code allows certain sections of itself to be overwritten (via spidermonkey overwritten in Javascipt, and via other means overwritten in the two legacy scripts), and the overwriting itself can be overwritten in turn?
This is one reason why some OXPs are not compatible.

The way it works is that there are some properties that can be set. If 2 OXPs both try to set the same thing then the behaviour is unpredictable, and most likely whichever runs last will win.

In fact it is quite common for the same property to be reset multiple times, headlights for example allows you to switch them on and off and each time it simply updates the ambientLevel property to either a large or small number.
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

Cmdr James wrote: Mon Aug 16, 2021 3:18 pm
This is one reason why some OXPs are not compatible.
Thanks.

My impression so far (not running many ship.oxp's or mission.oxp's) is that the only area where I have seen legacy scripts fail to work is where they do not specify a market for a dockable. Pre-Cim, this meant that their market was "identical" to the system's orbital. With v.1.79 and later, they fail to have a market at all. What else got nobbled with the upgrades?

Other problems I have seen with older oxp's is a ridiculous number of stations (eg Nuit or Gsagostinho's) around the planet. Or the markets on the stations which are not the main orbital being treated as though they were just the one market, whether you are at a Rock Hermit, a Sothis or a Biodome. I'm not convinced that these are an issue of legacy scripting, though.

Image
3 of Gsagostinho's stations around the same planet!
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Griff »

Oo those look nice, what oxp is adding those star-ish stations Cholmondely? It looks like there might be a problem with the materials/shaders on them, that pink/cyan material in your screenshot is Oolite's 'fall back' material it uses if it can't work out what the author intended ( i think), well i certainly see it a lot when i'm working on something and it's got errors in it :D
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

Griff wrote: Mon Aug 16, 2021 6:36 pm
Oo those look nice, what oxp is adding those star-ish stations Cholmondely? It looks like there might be a problem with the materials/shaders on them, that pink/cyan material in your screenshot is Oolite's 'fall back' material it uses if it can't work out what the author intended ( i think), well i certainly see it a lot when i'm working on something and it's got errors in it :D
Gsagostinho: see here: http://wiki.alioth.net/index.php/Brilli ... _broken... (page links to thread - and download is at bottom of second page of thread)

When I pm'd him he said that he'd moved away from Oolite and was involved with other stuff, but people were welcome to grab his work and finish it off with the usual provisos. There are some interesting comments on his music compositional work on the last page.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

Cholmondely wrote: Mon Aug 16, 2021 6:47 pm
Griff wrote: Mon Aug 16, 2021 6:36 pm
Oo those look nice, what oxp is adding those star-ish stations Cholmondely? It looks like there might be a problem with the materials/shaders on them, that pink/cyan material in your screenshot is Oolite's 'fall back' material it uses if it can't work out what the author intended ( i think), well i certainly see it a lot when i'm working on something and it's got errors in it :D
Griff: I'd like to put these up on a wiki page.

If you have any intention of taking them over, I'll hold fire, since you might wish to rename them and/or change the packaging. Changing the name of wiki pages is a major chore. The projected page name would be Gasgostinho's New Stations.

Please let me know your intentions.
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

2 Questions.

Question One
If I understand correctly, Pleb's OGG does not create new F7 page descriptions, just F6 galaxy maps.

If this is true, is that due to the move in the Oolite game code from random seed generation to everything being written down in plists?

And if that is true, is the original code still present within Oolite to allow random seed generation to be reinstated for Pleb's new galaxies?

Question Two
If someone creates a new galaxy on windows using Pleb's OGG, how do I run it on my AppleMac? What does the new OGG-derived file look like, how is it saved, and what do I do with it?
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
User avatar
Cholmondely
Archivist
Archivist
Posts: 5364
Joined: Tue Jul 07, 2020 11:00 am
Location: The Delightful Domains of His Most Britannic Majesty (industrial? agricultural? mainly anything?)
Contact:

Re: [BETA TOOL] Oolite Galaxy Generator

Post by Cholmondely »

Pleb wrote: Sun Aug 15, 2021 5:05 pm
It's currently only compiled to work on Windows but I think I can compile it for Linux and Mac so I will look into that next time I update this! :D
I can get access to a windows machine - not that I would know too much about how to use it! Is there anything I need to know about running your cosmos creator?

- How do I transfer the new universe to my AppleMac (or upload them to our wiki for others to explore)?

- Can I change the number of systems to a random number less than 256?

- Can I make some of the systems unpopulated?

Again - thank you for this!

Cholmondeley
Comments wanted:
Missing OXPs? What do you think is missing?
Lore: The economics of ship building How many built for Aronar?
Lore: The Space Traders Flight Training Manual: Cowell & MgRath Do you agree with Redspear?
Post Reply