Jump to content

[INDEV]-[1.4.3] - To Boldly Go | An external application designed to procedurally generate an entire galaxy for KSP.


daniel l.

Recommended Posts

3 hours ago, seanth said:

Dearest Koogie,

One of the unreported bugs has been that there are rare instances where two different stars have the same name. Based on the name generation code I explained in a previous letter, it's bound to happen. I was working on fixing that problem today and have a working solution that also avoids the bug where a generated star name matches an existing template name (like 'Jool' or 'Sun' or 'Mun'). This method will also avoid the wasteful reading of files every time a star name needs to be generated

QB64 apparently doesn't have lists, so I've been using arrays. But I also can't do a sort of boolean query and say "is X in array Y" without looping over the array. What I have done is made a blank array that has as many elements as star names the app will need. Next, it uses the Prefix and Suffix files to make a random star name.

Now we loop over the names of template planets that are in TBG_Planet_Templates.csv. If the star name happens to match a planet template name, "o'" (as in "of" or "of the") is added to the end and another suffix is chosen. This method results in names like "Joolo'turus".

Next we do a similar loop where we see if the proposed star name has already been added to the array of star names. Instead of "o'", "a'" is used...just to provide some variety. This way we get extended star names like "Kerurya'in". There is the possibility that the extended star name has been used. When that happens, another "a'"+suffix is added. So we might see star names like "Rananta'unea'daa" or even "Joolo'turusa'lou".

You get the idea.

I'm too lazy to do the probability of star names repeating--and the probability will change if the player ad/removes prefix/suffix/template names--but I generated 900 stars and 146 of them had to have their names modified as I explained.

Until next time.

-seanth

Who's Koogie?

Link to comment
Share on other sites

I found a bug when using this mod. When I load a savegame, it starts the loading thing with the spinning planets, and sits there. I can hear the ambient sound (crickets, birds) meaning that the world should be loaded, and my blizzy toolbar is loaded fully. Some screens I can interact with, such as the remote tech settings, or the extra planetary launchpads window, or the kos thing. I can also press esc and the kerbal alarm clock will flash red which means it is correctly responding to pausing the game, but the pause window won't show, but i can still click on the buttons, but have been unsuccessful in exiting the save and have only been able to resume. I can also press alt + f12 to pull up the cheats menu, but i can't see it. I have narrowed the problem to this mod by painstakingly removing and adding mods back into my game. I can't post screenshots, because i don't know how to. I can however give the file i think are helpful in here. I will try the new 0.3 version and see if that works.

Galaxy.cfg

ksp.log

output_log.txt

EDIT: 0.3 seems to have fixed it. I have my 3 different galaxies and i can see everything.

Edited by Bedrockbreaker
Update on v .3
Link to comment
Share on other sites

Hi,

I've been picking through th esource of this mod (specificallly the GalaxyGen.bas).

I'm thinking I could probaly make a few improvements, and I was wondering whether you'd mind if I had a go?

the shortlist I've come up with is something like this..

  • generate a set of planets per star that are in the same acretion disc i.e have similar inclinations, but allow for captured rogue planets at low probablitlies that have any inclination and excentric orbits
  • make most planets have relatively circular orbits (again allowing for a few oddities)
  • re-factor code to use subroutines (there's a lot of duplicaiton in there) this should make it much more maintainable/extendable.
  • support a larger set of planets in a single star system (currently it's upto 5?) possibly up to 20 (but limit how many gas giants and kerbol-like planets are created)
  • weight planet numbers, orbits  and types based on simulated  spudo real-world distrobutions, eg, gas giants tend to clear a wide orbital range round a star whereas small rocky planets are loser togeather. 
  • weight moon number and size dependant on their host planet's size and mass. (eg gas giants tent to have lots, some which are big, and dwarf planets none)
  • a scale factor (user input) to set the star density. I'm sure some folks would like to get to their destinations quicker :wink: 
  • I've not looked at resource/sciecne mapping yet, but if it's not in there I think biomes and resource maps etc, should ultimately be supported.

What do you think?

Is there a github or other similar source repoistory for this mod?

I'm currently running the 0.3 release candidate that you posted yesterday btw..

 

Edited by bunjatec
saved too soon
Link to comment
Share on other sites

1 hour ago, bunjatec said:

Hi,

I've been picking through th esource of this mod (specificallly the GalaxyGen.bas).

I'm thinking I could probaly make a few improvements, and I was wondering whether you'd mind if I had a go?

the shortlist I've come up with is something like this..

  • generate a set of planets per star that are in the same acretion disc i.e have similar inclinations, but allow for captured rogue planets at low probablitlies that have any inclination and excentric orbits
  • make most planets have relatively circular orbits (again allowing for a few oddities)
  • re-factor code to use subroutines (there's a lot of duplicaiton in there) this should make it much more maintainable/extendable.
  • support a larger set of planets in a single star system (currently it's upto 5?) possibly up to 20 (but limit how many gas giants and kerbol-like planets are created)
  • weight planet numbers, orbits  and types based on simulated  spudo real-world distrobutions, eg, gas giants tend to clear a wide orbital range round a star whereas small rocky planets are loser togeather. 
  • weight moon number and size dependant on their host planet's size and mass. (eg gas giants tent to have lots, some which are big, and dwarf planets none)
  • a scale factor (user input) to set the star density. I'm sure some folks would like to get to their destinations quicker :wink: 
  • I've not looked at resource/sciecne mapping yet, but if it's not in there I think biomes and resource maps etc, should ultimately be supported.

What do you think?

Is there a github or other similar source repoistory for this mod?

I'm currently running the 0.3 release candidate that you posted yesterday btw..

 

Yeah, there is a github: https://github.com/kjoenth/To-Boldly-Go

The 0.3 candidate is the McMahon branch.

After 0.3 will make a switch in focus. When I started helping @daniel l., I began by economizing code into functions and subroutines (0.2.5) and then redid star generation so it's all procedural (0.3). Next up is revamping planet-related code by moving the planet code to use subroutines (like you suggest), make sure moons are below a threshold mass compared to their parent body, etc. 

So, your short list is pretty similar to things I'm interested in going next :). I'd say fork away. Maybe PM me and we can divide up tasks so we aren't stepping on each other's work?

I think @daniel l. has specifically said he wants to maintain planets being able to have the erratic orbits, but I was thinking having an option where the user could use disc vs erratic orbits.

Link to comment
Share on other sites

4 hours ago, seanth said:

I think @daniel l. has specifically said he wants to maintain planets being able to have the erratic orbits, but I was thinking having an option where the user could use disc vs erratic orbits.

Actually, that's not what I meant. IMO Star systems form differently, so each system should have a different plane. All Planets in the system should follow that plane.

Edited by daniel l.
Link to comment
Share on other sites

All sounds good. I started pulling things apart last night to make a bit more sense of it.

 

I'm not  VB native, I'm more used to C++ so it' staking a bit longer than I'd like to figure out how I want to fix things.. :)

One thing I've done is to pull the subroutines for planet and moon formation into separate files as it makes navigating much easier, but I'm still looking into how to 'include' them back in in VB (in C/C++ this would be easy..)

Have you guys considered porting to C++ or Java or another fully object orientated language? (I appreciate you probably don't want to re-invent the wheel here, there's plenty of good work gone into your original code)

 

Daniel, 

I totally agree that each star should have it's own orbital plane, and most of the planets should orbit roughly within that plane, but that each star's planetary plane can be totally arbitrarily orientated. 

similarly the moons of each planet should be pretty much in the same plan as the planets solar plane (having formed from the same accretion disk) but all this there should be a low probability of bodies being knocked into a weird orbit too.

seanth,

Thanks I'll look into that tonight, probably do a pull request and work from there.

 

Edited by bunjatec
Link to comment
Share on other sites

14 minutes ago, bunjatec said:

I'm not  VB native, I'm more used to C++ so it' staking a bit longer than I'd like to figure out how I want to fix things.. :)

One thing I've done is to pull the subroutines for planet and moon formation into separate files as it makes navigating much easier, but I'm still looking into how to 'include' them back in in VB (in C/C++ this would be easy..)

Have you guys considered porting to C++ or Java or another fully object orientated language? (I appreciate you probably don't want to re-invent the wheel here, there's plenty of good work gone into your original code)

The very first language I learned was basic on a C64, but these days I'm more of a python and fortran guy. It didn't take me long to catch on to qb64, though I am sure I am doing some things "wrong".

I agree that having subroutines be grouped in separate files would make the code easier to read, but I couldn't figure out how to do it in qb64. I spent maybe 15min looking, and then decided my time was better spent writing code.

When I first started, I wrote a python version of what daniel had done, and I used it as the basis for the first round of code optimization. I had optimized the creation of planets, but haven't moved that code over because of the nebulous "roadmap" in my head about what should be focused on. If you look at https://github.com/kjoenth/To-Boldly-Go/blob/967752d955c311224d0a9e900b9f75d2bdbb25a7/python version/GalMake.py you'll see the functions "makeABody" and "PENABLEISYES" are the functions for making planets. It just hasn't moved back to qbasic.

I'd still like to provide a headless python version, but I'd like to see the qbasic version function complete first. If you look at the code, my comment style has been '#. That's with the expectation that I'll move the code over to python. Qbasic uses ' to mark comments, and python uses #. :) This is @daniel l.'s baby, and he knows qb64, so I'm inclined to keep the main thing as qb64 for now.

Link to comment
Share on other sites

My 1st language was BBC basic about 36 years ago... still holds fond memories. 

I don't want to upset the apple cart here, as there's some good work gone into this, so I'll have a look at what you've got and perhaps do some tweaks, and dig into whether VB can be made more modular for the sake of my own sanity :)

I get the feeling that some kind of project plan may be worth sticking into the repository, something as simple as a task/feature checklist with an idea of what is currently in progress and what's awaiting attention.

Defining the interface between each module should then allow us all to work on different parts of the code simultaneously, if it's in different files.. (I think this means I should really look into the possibility of VB library/include files as most of what I'm talking about relies on it..) 

Just as a matter of interest, what timezones are you in? I'm in the UK and have a normal workday so I'm usually only kerballing in the evening UK time.

 

Link to comment
Share on other sites

Just now, bunjatec said:

Just so I don't get this wrong.

you're using quickbasic64?(http://www.qb64.net/wiki/index.php/Main_Page)

In which case I think we can pull the major subroutines into separate files using this construct (http://www.qb64.net/wiki/index.php/Libraries)

Am I on the right track?

Yes. QB64 has been used in development of TBG since nearly the beginning. I actually started writing TBG in Quickbasic 4.5 on an old laptop running Windows 98. It was easy to port though.

Link to comment
Share on other sites

Wish I knew a bit more about coding so I could contribute more, sadly my knowledge of coding begins and ends with Matlab. 

As for 0.3.0, having trouble getting it to load up for me.  Can't seem to get to the start screen.  That was with my main build of KSP though, which is very heavily modded.  However, when I copied it over to the clone test client I made (this is the build that I got that one test version working in), which is substantially less heavily modded, same thing.  Gonna give it a few more tries, might just be one of those things that takes a few tries to get working.

Link to comment
Share on other sites

15 minutes ago, The_Right_Arm said:

Wish I knew a bit more about coding so I could contribute more, sadly my knowledge of coding begins and ends with Matlab. 

As for 0.3.0, having trouble getting it to load up for me.  Can't seem to get to the start screen.  That was with my main build of KSP though, which is very heavily modded.  However, when I copied it over to the clone test client I made (this is the build that I got that one test version working in), which is substantially less heavily modded, same thing.  Gonna give it a few more tries, might just be one of those things that takes a few tries to get working.

Start screen? As in the main menu? You see. Kopernicus generates cache files for every object, the more there are, the more cache files are needed. Usually this would take a mere matter of minutes or even seconds. But TBG generates hundreds of objects. With each cache file being about 0.6 megabytes, this can total into hundreds of megabytes of data. As you can see, this would take a long long time to generate. Just have patience, from my experience, sometimes it's taken nearly half an hour.

Link to comment
Share on other sites

17 minutes ago, The_Right_Arm said:

As for 0.3.0, having trouble getting it to load up for me.  Can't seem to get to the start screen.  That was with my main build of KSP though, which is very heavily modded.  However, when I copied it over to the clone test client I made (this is the build that I got that one test version working in), which is substantially less heavily modded, same thing.  Gonna give it a few more tries, might just be one of those things that takes a few tries to get working.

How big of a galaxy did you make? If you send me info on the seed you used and your settings, I can replicate what you made and test.

Link to comment
Share on other sites

11 minutes ago, daniel l. said:

Kopernicus generates cache files for every object, the more there are, the more cache files are needed. Usually this would take a mere matter of minutes or even seconds. But TBG generates hundreds of objects. With each cache file being about 0.6 megabytes, this can total into hundreds of megabytes of data. As you can see, this would take a long long time to generate. Just have patience, from my experience, sometimes it's taken nearly half an hour.

Yup. I second this. If you watch the file count in GameData/Kopernicus/Cache and the file count keeps increasing while your load screen seems stuck, just be patient. Grab a book or something. Think about the Old Days when it could take 15min for a computer to boot up.

Edited by seanth
Link to comment
Share on other sites

Hi Guys,

Just pushed a mod, sadly I made a propper noob error and pushed to the master branch, not my own.. :/

For some reson it wouldn't let me push back into my branch?!

 

I did manage to get asteroid generation into a seperate file and it appears to be working ok.

I branched from the McMahon branch (becasue it seemed to be the most recently updated) 

 

Let me know how I can redeem myself and I'll fix it.. 

If I've started on the wrong branch let me know.. 

 

I think from this point on I could quite quickly (free time allowing) pull most of the planetary generation into bite sized blocks in a simliar way.

Let me know what you think.. 

 

Link to comment
Share on other sites

Version 0.3 is released!

Credit goes mostly to Seanth.

  1. [@seanth] Redesigned stellar generation algorithm to follow the Hertzprung Russel scale,
  2. [@seanth/@daniel l.] Fixed Kerbin Reparenting issues,
  3. [@daniel l.] Added more Prefixes and Suffixes to the random name generator,
  4. [@daniel l.] Added custom loading screen tooltips via 'LoadingTipsPlus',
  5. [@JadeOfMaar] Replaced old Corona textures with custom ones.

Enjoy!

Edited by daniel l.
Link to comment
Share on other sites

Just now, daniel l. said:

Also @seanth sorry if you were not involved in the final release of 0.3 :) I managed to fix the bug we were dealing with, so I decided it was ready :wink:

I've been sick. It's all good. I'll try and update github with all your changes tomorrow

Link to comment
Share on other sites

Hello everyone.

i loaded 0.3 from

https://github.com/kjoenth/To-Boldly-Go/tree/master

and tested it. can you pls place a zip file in releases category?

I'm glad 0.3 worked on the first attempt even with many other mods installed. KSC is actually visible (in contrary to 0.2.6) and not shattered and perforated by an earthquake (like in 0.2.6.5). Issues i encountered are:

  • other Stars are visible from Kerbin under daylight conditions but should not. don't know if that is mod - or game core - related
  • much too bright "glow" from the galaxy in Tracking Station if zoomed all the way out
  • in Tracking Station, mouse-over-info is only shown for the "core" but actually not for other stars, but again for planets and moons
  • in Tracking Station, double click on a "star" does not select the star but any moon or planet if exist (for kerbol it was always Eeloo)
  • dont know if that is also an issue but Kerbol system (aka "sun") is the most distant system from the galaxy core at least in my game
  • planet "orbits" differ greatly (badly?) from each other, some planets are even counter rotating. something impossible afaik

my creation values:

Spoiler

*****galaxy***** v0.3
Creation Date: 15:24:43 03-29-2017
Generation Mode: c
Seed: 250
Galaxy Type: 0
Galaxy Age: 1
Cluster Number: 0
Planets: y
Asteroids: y
L to Y class (~Brown~): 2
M class (~Red~): 2
K class (~Orange~): 2
G class (~Yellow~): 5
F class (~Yellow-white~): 5
A class (~White~): 5
B class (~Blue-White~): 2
O class (~Blue~): 2
White Dwarves: 3
-----------------
 27 Stars
 52 Planets
 79 Moons
 11 Asteroids
 169  Total
-----------------

great mod so far. keep up the effort!

gotta build a working warp ship now. cu l8r

Link to comment
Share on other sites

41 minutes ago, Altaica said:

Hello everyone.

i loaded 0.3 from

https://github.com/kjoenth/To-Boldly-Go/tree/master

and tested it. can you pls place a zip file in releases category?

I'm glad 0.3 worked on the first attempt even with many other mods installed. KSC is actually visible (in contrary to 0.2.6) and not shattered and perforated by an earthquake (like in 0.2.6.5). Issues i encountered are:

  • other Stars are visible from Kerbin under daylight conditions but should not. don't know if that is mod - or game core - related
  • much too bright "glow" from the galaxy in Tracking Station if zoomed all the way out
  • in Tracking Station, mouse-over-info is only shown for the "core" but actually not for other stars, but again for planets and moons
  • in Tracking Station, double click on a "star" does not select the star but any moon or planet if exist (for kerbol it was always Eeloo)
  • dont know if that is also an issue but Kerbol system (aka "sun") is the most distant system from the galaxy core at least in my game
  • planet "orbits" differ greatly (badly?) from each other, some planets are even counter rotating. something impossible afaik

my creation values:

  Reveal hidden contents

*****galaxy***** v0.3
Creation Date: 15:24:43 03-29-2017
Generation Mode: c
Seed: 250
Galaxy Type: 0
Galaxy Age: 1
Cluster Number: 0
Planets: y
Asteroids: y
L to Y class (~Brown~): 2
M class (~Red~): 2
K class (~Orange~): 2
G class (~Yellow~): 5
F class (~Yellow-white~): 5
A class (~White~): 5
B class (~Blue-White~): 2
O class (~Blue~): 2
White Dwarves: 3
-----------------
 27 Stars
 52 Planets
 79 Moons
 11 Asteroids
 169  Total
-----------------

great mod so far. keep up the effort!

gotta build a working warp ship now. cu l8r

In general, I encourage people to list issues on github since it'll be easier to track. Listing them here is cool, too, since it lets others see what some bugs are. With that said, on to the issues

 

Quote
  • other Stars are visible from Kerbin under daylight conditions but should not. don't know if that is mod - or game core - related
  • much too bright "glow" from the galaxy in Tracking Station if zoomed all the way out

These are related issues. I agree that seeing the other stars during the day is not so cool, and the galactic glow is overwhelming. It's on our mental list of "things to look into" but I'm honestly not sure how to fix it yet. I think someone more familiar with Kopernicus would be able to advise/fork-and-fix this, though.

Quote
  • in Tracking Station, mouse-over-info is only shown for the "core" but actually not for other stars, but again for planets and moons
  • in Tracking Station, double click on a "star" does not select the star but any moon or planet if exist (for kerbol it was always Eeloo)

Not sure there is much that can be done in this. If you click on "Core", mousing over the other stars should give you info. 

Quote

dont know if that is also an issue but Kerbol system (aka "sun") is the most distant system from the galaxy core at least in my game

 

That's by design. We were facing a pretty annoying bug that @daniel l.solved by making Kerbol the furthest star from Core.

Quote

planet "orbits" differ greatly (badly?) from each other, some planets are even counter rotating. something impossible afaik

We laid out a rough roadmap for what we'd like to see leading up to the 0.4 release, and it's pretty much all about planets. Fixing the crazy-time orbits is very high on the list.

 

Glad people are enjoying it. \o/

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...