Jump to content

[0.25] Kerbal Warp Drive! Procedural systems from a seed you choose! v1.1.0, 16 Nov.


English Mobster

Recommended Posts

here we go...

First, everything hinges on planetary generation, using Perlin Noise or something. Good luck. If you accomplish that then....well....KSP explodes!

1. Distance Scalar: Add that to your seed. Lock out people (us) from modifying the system seed, and use Fibonacci sequence or something as the seed to generate your systems. Then, add a distance scalar to the different systems. Remove the seed input from your warp engines, instead enter coordinates for the system. If your warp drive can reach the system, you go there and Fibonacci(for example) generates the system for you.

This would make your mod, and KSP in general, into a Star Control type map. Would work online, since everyone would have the same seed generators. The distance scalar, to determine 'location', can be based off different things. You can use another procedural seed to populate the universe.

Polar coordinates for the system's location relative to each other, with Kerbol in the center, would be most realistic, but would have laaaaarge coordinates eventually, unless you capped the maximums initially. And you would have to make sure you can reach the different systems some how, and we don't hit dead ends and are unable to jump further.

An X-Y-Z coordinates would work, but would make the universe look like a giant rubic's cube, with Kerbol being in the center, and each system being a different cube radiating outward.

Or a vector system, with lines branching off from Kerbol SOI. Kinda like a starfish (Kerbol) with the lines radiating out to other starfishes(systems). Would work but overlap and the connection of nodes might be a problem with different systems that generate close to each other.

So...now we have a galaxy map! By just adding a distance scalar to your seed generation.

other things for flavor:

2. Different warp drives that can be unlocked for different distances.

3. Put the warp activation tied to a maneuver node, so an intrepid modder can add a 'black hole' effect for your ship to fly into lol.

4. Make activation of warp be outside the soi of the systems sun. For multiplayer

5. Make warp drives use a resource that is a pain to refine(He3 or whatever). But have a few systems that have it in abundance...which leads to supply routes and commerce.

6. Make the distance/connection information available in a raster form, to make maps.

7. Include a way to find out information about the systems we explore. For instance, you enter a new system, launch probes, and they give information(atmosphere/gravity/delta-v requirements/etc) on the different planets so you can decide which ones look interesting to explore...or exploit for resources.

8. Multiplayer. Man, if you could transfer funds for different resources, it would create a crazy thing. People would be heading out to different systems for 3 main reason: Explore, Exploit, or Exterminate. Craziness would commence!

Just thinking about this it would be AMAZING. This is why I love our modding community...this is an idea that was completely out of the scope or thought process of the stock game and English Mobster could have possibly made interstellar colonization possible...and in multiplayer!

Link to comment
Share on other sites

It works as advertized, but I seem to be getting an awful lot of random atmospheres with an asl pressure of zero, a scale height of zero, and an asl temperature of zero.

Hmm. Might be that the RNG decided it didn't have an atmosphere. Hit Alt + F2 to open the Debug log and look for the planet in question. There should be a line that says "Atmosphere: false" if a planet doesn't have an atmosphere. If it says "Atmosphere: true," send me the seed and I'll see if I can work out what's going on.

Link to comment
Share on other sites

I will do my best to continue supporting this mod until I am happy with the feature list. At the very least I'm going to continue working on it until all the items on my wishlist are finished. I may add a few more as I go along as well.

Yay! Other mods you may want to look at, for ideas or collaboration:

Would leaving Kerbin alone (not modifying its parameters) fix the launching bug? Because that would be a perfectly acceptable tradeoff for me.

Link to comment
Share on other sites

Yay! Other mods you may want to look at, for ideas or collaboration:

Would leaving Kerbin alone (not modifying its parameters) fix the launching bug? Because that would be a perfectly acceptable tradeoff for me.

I believe leaving Kerbin alone will fix the launching bug, yes. I actually had it fixed initially, but something I did before release broke it. It has something to do with orbits, I'm sure. I'm presently refactoring the code right now to make things more easily extensible (and understandable!) in the future, but once that's complete I'm going to see if I accidentally fixed the bug or not.

Link to comment
Share on other sites

So, hum, sure, but if you go to ANOTHER ksc on one of these "Kerbin" planets, what if you destroy it? Can you even do that if you have destructible buildings enabled or are they indestructible? Also can you actually use these space centers, so say if you crash and you say go back to KSC, are you going to go to the system's space center, or back to Kerbol?

Link to comment
Share on other sites

How do you plan on handling the persistant for the different systems? Could you just create a different save for each system you visit, and when you re-enter it, it syncs the persistant save time to your current 'master' time? Dark Multiplayer mod has a sync function, maybe you can borrow that? That would just leave unloading/loading your current ship separate from the persistant file.

Link to comment
Share on other sites

So, hum, sure, but if you go to ANOTHER ksc on one of these "Kerbin" planets, what if you destroy it? Can you even do that if you have destructible buildings enabled or are they indestructible? Also can you actually use these space centers, so say if you crash and you say go back to KSC, are you going to go to the system's space center, or back to Kerbol?

At the moment, you destroy your own space center. All I'm doing is modiying Kerbin's orbit and various properties about the planet -- I don't actually copy the planet or anything. When you destroy KSC and jump back to Kerbin, at the moment you just destroyed your own KSC as well. I plan to fix this in the future, but it might be another update away.

How do you plan on handling the persistant for the different systems? Could you just create a different save for each system you visit, and when you re-enter it, it syncs the persistant save time to your current 'master' time? Dark Multiplayer mod has a sync function, maybe you can borrow that? That would just leave unloading/loading your current ship separate from the persistant file.

Well, here's what I was thinking about doing. I have no clue if this will actually work or not, as it was just an idea I had.

When you jump away from a system, I take the current persistence file and rename it to <seed>_persistence.sfs. I then look for a persistence file named <new seed>_persistence.sfs -- if it exists, I rename it to persistence.sfs and load it. If not, I'll allow the game to make a new "blank" persistence file. Since the current craft is loaded into physics, I believe the only thing in the new file will be the current craft.

Since the file itself is renamed, I'll be able to tell if you exited the game without going back to Kerbin, say due to the game crashing. There would be a file named 0_persistence.sfs (Kerbol's persistence file) if you didn't go back to Kerbol before the game ended, while 0_persistence.sfs would not exist if you did (because I would rename it to persistence.sfs).

Here's an example. Say I boot up the warp drive in orbit around Kerbol and go to coordinates 123. Before anything gets randomized at all, the game takes the current persistence file and renames it to 0_persistence.sfs. It then looks for a file named 123_persistence.sfs -- if none exists, it will do nothing and allow the game to create a new one.

After you explore a bit, you decide you want to go home to Kerbin. The game will first rename the current persistence.sfs file to 123_persistence.sfs. Next, it will look for a file named 0_persistence.sfs. It should find the one we renamed before we ever jumped in the first place and rename it to persistence.sfs. This makes Kerbol the "primary" persistence file once more, and restores all your other vessels.

Now, say you want to jump to the coordinates qwerty. You make the jump, Kerbol's persistence file is renamed to 0_persistence.sfs, a new persistence file is generated, and then the power goes out and your computer powers down (or your laptop's battery dies). Now the persistence file is set to the "wrong" system.

When you reboot KSP and load your save, first the mod makes sure that 0_persistence.sfs does not exist. If it exists, that means something went horribly wrong and we never got to go back to Kerbin.

I plan to keep the current seed somewhere on file (it may not be the persistence file) -- from here, the game can work out what was the seed of the last system we visited, before the game closed. It's just a matter of renaming the current persistence file to that seed's name and restoring the "default" persistence file.

Again, I have no clue if this will work. But it's a general idea I have.

This is awesome. 10/10, would donate. Haven't even tested yet x3 Seriously though, just made this account to say this. Jus saying.

Honestly, I would try it out and make sure you like it before donating anything. And although I kind of need the money, I would feel guilty accepting donations for something like this. If you want to donate, donate on my behalf to Child's Play or my local children's hosptial.

Edited by English Mobster
Link to comment
Share on other sites

Honestly, I would try it out and make sure you like it before donating anything. And although I kind of need the money, I would feel guilty accepting donations for something like this. If you want to donate, donate on my behalf to Child's Play or my local children's hosptial.

You sir, are a good man.

Current ideas on persistents looks cool. Some ideas (not sure on some stuff though):

Benefits:

1. Backup. Glad you thought of this, saves us players grief from game crashing.

2. Simple to execute, and should work great.

3. FLIGHTSTATE data -should- be different for each system, so you can set up different satellites in different systems, and they wouldn't appear when you went back to Kerbol...and vise/versa.

Drawbacks:

1. If you visit 1,000 systems, you would have 1,000 persistents lol.

2. The time would be static, so if you left for a couple years, when you went back, the planets would of been frozen in place the whole time.

Questions:

1. When you leave a system, and the mod creates a new 'snapshot' persistent, will your current vessel be in the FLIGHTSTATE data? If so, when you return back and the mod loads up the persistent for the system you just left, there will be two of you now?

2. When KSP initializes a save game, it first loads the planets data, at time 'zero', right? Then, it syncs with the time in your quicksave file, FLIGHTSTATE -- UT (which I 'assume' is universal time?), and since the planets are 'on rails', all you need is a specific time to move them to. So, it essentially time warps to the UT time, then, it loads all the position data from your current vessels from the rest of the FLIGHTSTATE?

If this is right...then 'theoretically' you wouldn't need a persistent file for each system you enter/leave, you just need the UT time from where you left to sync to. You could make a 'master' persistent file that is created whenever you leave a system, that has the FLIGHTSTATE data from just the 'current' vessel, and the current UT. Your seed generator generates the system data. All it needs is the UT time to sync on rails to the current master time, and the current vessels FLIGHTSTATE to load in.

Unless there is a way to pull the information you needed from the running memory, instead.

Although, having the same location loaded each time for your vessel could cause problems. Might be better to have the master have a location that is hardcoded to be well away from any possible issues, such as outside sun's soi, or even opposite, in a low orbit next to the sun.

So if you visit a hundred systems, but only leave satellites in ten of the, then that would be ten seperate persistents created. But I don't know if you can create a master persistent, with time and current vessel, by being able to go into the standard persistent and delete all the 'other' FLIGHTSTATE data automatically. Or perhaps go in and edit the UT instead. Dunno.

Example: Player leaves a system, but with no vessels or objects left behind (he was just passing through). Wouldn't need a persistent, since when he re-enters, the seed re-generates the world at time zero, which is then re-synced to the 'master' persistent to get the current time, for when the game loads it. Or perhaps there is a call for the UT at KSC that it can sync with. Dunno.

Example: Player leaves a system with a satellite in orbit. A persistent is created, with the UT and FLIGHTSTATE for that satellite. Player goes back to original Kerbin system. A couple years later, they decide to return to the system where the satellite has been orbiting by itself. So....if this is right...the game loads the planetary information from the seed generator at time 'zero', then it looks at the saved persistent for the UT, and syncs planets orbits to reach that, then it load the FLIGHTSTATE data for the satellite (and maybe a mirror image of you lol), and viola! Your're in. What would be cool, is that after it load the FLIGHTSTATE data, it could then sync -again- with the current time, since the UT it is using is from years ago.

That is where I was wondering if Dark Multiplayer's sync function could work. He figured out how to make current vessels that are loaded to be able to sync forward/backward in time. You could skip a lot of this nonsense, just load a persistent for each system, then sync to current time.

Or perhaps the 'master' could be used to...errr...ugh....

gah, lot of guessing here haha

Edited by bigbadben
grammar
Link to comment
Share on other sites

So..my lot of suggestions :

1. Code the mod so that you can have matching atmosphere color and lighing.

2. Try to make it compatible with Environmental Visual Enhancements (and with Astronomer's Visual Pack if possible)

3. Make a more polished way of going to the other system, with a giant 50t jump drive one might need to put in space like a space station and stay within 200 meters to calculate the jump. The drive would be probably placed in planetary orbit, but all jumps would always finish somewhere in a solar orbit in the other system.

4. Make an persistent.sfs for each system, each time one world is loaded after being unloaded, KSP calculates the time passed to simulate everything (on rails).

5. There is a very weak chance the system will posess an habitable system.

6. In the VERY FAR FUTURE, incorporate this with multiplayer and Kopernicus (the new Planet Factory), maybe even a better coordinate system.

That was my list of suggestion ! I hope this mod will have a great future and will NEVER be forgotten in the mass of forum posts.

With a little luck, Scott Manley (a.k.a POTT MANLEY) will make a showcase. :wink:

Edited by MegaUZI
Link to comment
Share on other sites

So..my lot of suggestions :

1. Code the mod so that you can have matching atmosphere color and lighing.

2. Try to make it compatible with Environmental Visual Enhancements (and with Astronomer's Visual Pack if possible)

3. Make a more polished way of going to the other system, with a giant 50t jump drive one might need to put in space like a space station and stay within 200 meters to calculate the jump. The drive would be probably placed in planetary orbit, but all jumps would always finish somewhere in a solar orbit in the other system.

4. Make an persistent.sfs for each system, each time one world is loaded after being unloaded, KSP calculates the time passed to simulate everything (on rails).

5. There is a very weak chance the system will posess an habitable system.

6. In the VERY FAR FUTURE, incorporate this with multiplayer and Kopernicus (the new Planet Factory), maybe even a better coordinate system.

That was my list of suggestion ! I hope this mod will have a great future and will NEVER be forgotten in the mass of forum posts.

With a little luck, Scott Manley (a.k.a POTT MANLEY) will make a showcase. :wink:

1. I have to look at KSP's lighting system. I know Unity fairly well, but I'm not sure exactly which lights are actually used to light the planets.

2. I will try to see what I can do about that.

3. I'm going to wind up doing something about the jump so it "feels" like you're jumping away from the system. I'm not sure what that is yet, though. If at all possible, I'd like for the hyperdrive to be just "throw on and go," although I might also consider making something like the mass relays from Mass Effect in addition to the regular stuff. That would be further on down the line, though. Right now the focus is on core functionality.

4. Working on that presently. Will try to have this in the next release (or, failing that, the one after).

5. Define "habitable system." Kerbals never walk around without an EVA suit (outside of the VAB and SPH), and having KSC in another solar system would be weird. I mean, I will likely wind up having a KSC in the other solar system, but I would prefer to have some sort of colony module if at all possible.

6. I'm actually looking at the Kopernicus code presently to see how they handle planets. In theory, it looks like my mod should be compatible as-is (all I do is take whatever the game says and re-arrange the planets), but if I wanted to add additional planets I would need to integrate more firmly with Kopernicus.

And thank you!

Now for a little bit of an update. Three days ago, I pushed a few commits to the main branch of code making things a bit more extensible and easier to read. This took a bit of time, because in the course of doing so I broke everything and had to put it back together again.

For a short period of time, I calculated Hill Spheres for each planet and placed moons in orbit within a Hill Sphere. I also used Kepler's Third Law to calculate orbital periods, and wound up with planets moving either very quickly or very slowly. I'm sure there's probably just some bugginess in what numbers I'm sending into the calulations, but for the time being I reverted back to my old approach just to have something stable again. I haven't released anything yet, but I wanted to give you an update on what was happening to the main branch.

Two days ago, I began work on making persistent systems, since the feature has been the most popular request so far. I created a new branch for it (meaning I'm not modifying the "stable" branch) and wrote something which seems like it would work in theory, but in reality KSP crashes to the desktop. I'm going to keep playing around with it until I at least nail what's causing the CTD issues. I'm pretty sure I'm writing to the persistence file while KSP is reading from it (or something), so I may have to rethink my approach. Does anyone know of any mods that directly write to the persistence.sfs file while the game is running using System.IO?

Yesterday was my 21st birthday, so I spent half the day having a party and the other half at my job. I work at Disneyland, running the Star Tours ride there (as well as crowd control for parades and fireworks). We're approaching the holiday season fairly quickly, which has meant more crowds and more hours that I'm working. The same was true today, and the same will be true tomorrow. Ideally I'll get at least a little bit done, and if I don't get anything done I do have Tuesday (mostly) free.

I'm going to try to post these fairly regularly so you guys know what I'm focusing on and what my status has been. My current priorities are (1.) making sure that solar systems use separate persistent.sfs files and (2.) allowing players to have custom-named planets and systems (which will likely be stored in those persistence files).

Link to comment
Share on other sites

Can you give this ksp-I compatibility? As in you can warp drive to new systems?

I would like for this sort of thing to happen, but from what I can tell KSPI needs to add this PartModule to their warp drive .cfg:

MODULE
{
name = Hyperdrive
}

I don't want to modify their parts for them, of course. And at the moment, warping won't use any of their resources. The only thing I can really do is add an "automatic" warp module that will force a warp when you go above a certain speed (say, 0.5c or something). Then they would need to add that module into their warp drive's .cfg. If a user doesn't have my mod installed, it won't do anything (I believe -- at least it didn't when I was testing). If a user did, however, it would add this hyperdrive into Interstellar's warp drive.

I can't really do anything from my end. The devs are more than welcome to reach out to me and talk about things if they want to implement it. They're also free to fork my source and play around with things -- it's all free to use and modify. Our projects do have different licenses -- I use the GNU GPL, while they use a similar (but not the same!) license. I believe one of the terms of the GPL states that they have to keep a copy of the GPL for any part of the work that they use -- thus applying part of the GPL to their project. I believe I can waive this restriction on a case-by-case basis, as I am the copyright holder. I would be willing to waive that requirement for them and have any modified bits of this project fall under their copyright. However, they would need to talk to me about it.

If they don't want to make any changes themselves, I am more than willing to make any kind of changes or add any kind of extra modules to allow its use within Interstellar. However, I'd also like to be able to have this mod have the ability to stand on its own for those who just want to randomize planets without needing to download Interstellar. This would likely just involve me writing their own special PartModule that would only be used by Interstellar, but as I mentioned before they would need to get into contact with me about it.

Link to comment
Share on other sites

Something like the mass relays from Mass Effect in addition to the regular stuff..

Nice ! I love Mass Effect !

When I said "habitable system" I rather meant "habitable planet" as in a planet with breathable Oxygen. Having an Oxygen atmosphere around any planet is incredibly rare.

Well..happy birthday :) and thank you for the updates ! This mod has infinite pontential ! Good luck !

Oh and last point : I heard you plan to make procedurially generated terrain. That would mean you should do so that most systems will have giant gas near the star. This would be more like real star systems.

Link to comment
Share on other sites

Nice ! I love Mass Effect !

When I said "habitable system" I rather meant "habitable planet" as in a planet with breathable Oxygen. Having an Oxygen atmosphere around any planet is incredibly rare.

Well..happy birthday :) and thank you for the updates ! This mod has infinite pontential ! Good luck !

Oh and last point : I heard you plan to make procedurially generated terrain. That would mean you should do so that most systems will have giant gas near the star. This would be more like real star systems.

Ah, I see. Yes, oxygen atmospheres will be a bit more rare -- there's currently a 2.5% chance of having a planet with a breathable atmosphere (I believe), but I might reduce it a bit more.

Right now, for gas giants I've just been using Jool. I'm not sure how much of Kopernicus I'm going to need to do that -- I'd prefer not to have too many dependencies (more stuff to break). However, it is something I'm going to look at.

I do have something of a breakthrough in that I managed to find a way to stop crashes to desktop! Turns out I had a malformed regular expression that was corrupting save data. I've since fixed it and the problem appears to have gone away. At the moment, I'm able to generate fresh persistence files whenever I want. It's not much, but it's a step in the right direction. There are still bugs in the system (I just accidentally deleted my own save -- whoops!), but I'm working on ironing them out.

Link to comment
Share on other sites

I'm very excited about this ambitious mod. What always stopped me getting Krag's PF was what I had read about the RAM requirements. Am I right in thinking that, because this is adjusting the existing Kerbol system, rather than generating a bunch of new planets, the RAM usage should not be too high?

If RAM is manageable I will definitely give this a go.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...