daniel l.

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

644 posts in this topic

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?

Share this post


Link to post
Share on other sites
16 minutes ago, daniel l. said:

Who's Koogie?

long story short: make-believe person.

Share this post


Link to post
Share on other sites
33 minutes ago, seanth said:

long story short: make-believe person.

24fe4e542d6ee99fc2653e1bf009391e_memes-f

Share this post


Link to post
Share on other sites

Posted (edited)

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
2 people like this

Share this post


Link to post
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

Share this post


Link to post
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.

1 person likes this

Share this post


Link to post
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.

Share this post


Link to post
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
1 person likes this

Share this post


Link to post
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.

1 person likes this

Share this post


Link to post
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.

 

1 person likes this

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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
1 person likes this

Share this post


Link to post
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.. 

 

Share this post


Link to post
Share on other sites

Sorry for the delay guys. @seanth has been sick lately, and we've also been in a pretty tough battle with a bug. I promise you 0.3 will be released hopefully by the end of this week.

1 person likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now