Jump to content

[Early development, 0.24] Kopernicus Planetary System Modifier


Recommended Posts

*watches tumble weeds roll by* Sorry, couldn't resist xD How goes? If I knew more about what needs doing, I'd be willing to jump in and try my hand at fixing it. Finally took some time and figured out how to set up KSP mods. I've got a good amount of C# experience, been working on a plugin for RaterProp Monitor to add Science Experiment controls, and one for ALCOR to make that fancy life support control panel functional. I just don't know what parts still need done here before it is considered 'feature complete'. If no one comes back with anything, I guess I can look into some implementation of multiple stars; after PF-to-Kopernicus automated conversion, that's what I am most enthusiastic about. (By extension, if people say 'we aren't working on PF conversion any more; it's too hard/impossible/wont work/etc' then I will work on that. Because few things are actually impossible with computers ;) )
Wait, hold the phone... you are working on a mod that enables the life support control panel functions on the alcor pod?! If someone were actually able to pull that off that would be amazing! If you could do that that would be fantastical! :D
Link to comment
Share on other sites

Who exactly developes this mod? Since the OP wasn't active in nearly a month, but Teknoman117 posts as a dev of this too? Are you a team or did the dev changed along the way ?

And Teknoman117: what about some Dev Notes , if you have time for it? Nothing big, just like two sentences like "this and that can already done by config file, and this and that has still to be implemented and we are working on it" Just as a life sign of the Mod.

Don't get it wrong, i'm not asking for 'when its done', i'm familar with software developement and i know you're doing it in free time and not getting money for it, so take your time and don't prioritize this mod over RealLife-concerns.

Cheers

Link to comment
Share on other sites

Who exactly developes this mod? Since the OP wasn't active in nearly a month, but Teknoman117 posts as a dev of this too? Are you a team or did the dev changed along the way ?

And Teknoman117: what about some Dev Notes , if you have time for it? Nothing big, just like two sentences like "this and that can already done by config file, and this and that has still to be implemented and we are working on it" Just as a life sign of the Mod.

Don't get it wrong, i'm not asking for 'when its done', i'm familar with software developement and i know you're doing it in free time and not getting money for it, so take your time and don't prioritize this mod over RealLife-concerns.

Cheers

I'll put some dev notes together the next chance I get

edit - Bryce and I are developing this mod together and both of us have resumed classes at our respective universities, which is where all my time seems to have gone. I put in an hour here, and an hour there where I can. Eventually I'll have enough to warrant the next release.

Edited by Teknoman117
Link to comment
Share on other sites

I've been experimenting with libnoise recently, the C++ library squad uses to make planets. This project has got me interested and I'd like to contribute in some way, I have some experience in C#, Javascript, and C++ but where I have the most experience is in 3d modeling/procedural generation. PM me if interested :)

Link to comment
Share on other sites

I'll put some dev notes together the next chance I get

edit - Bryce and I are developing this mod together and both of us have resumed classes at our respective universities, which is where all my time seems to have gone. I put in an hour here, and an hour there where I can. Eventually I'll have enough to warrant the next release.

Yeah, that's exactly what happened to me. In addition, I am also moving to a new place, and it appears to have had a lot of kerbal construction. (I just attempted to change the bulbs in a fixture and had the fixture fall off the ceiling because it was installed improperly. But luckily they had used a ton of electrical tape so it didn't come crashing down! :sarcasm:) I'm so sorry for neglecting this.

Link to comment
Share on other sites

Don't get it wrong, i'm not asking for 'when its done', i'm familar with software developement and i know you're doing it in free time and not getting money for it, so take your time and don't prioritize this mod over RealLife-concerns.

Cheers

It's kinda sad that you had to write that sentence. A lot of people on this forum suffer from Entitlement Syndrome Syndrome (that is, they accuse others of acting entitled at almost every chance they get).

Link to comment
Share on other sites

Hope that School, moving, and life settles for you both, Bryce and Teknoman. In the interim, being an open source project, I've begun to puzzle through the code. most parts of PF convert 1:1 with Kopernicus, and are quite easy to map. Or are just direct PQSMods which can be read straight in (more or less; they will probably also need some relevant data pulled from a template). The one part I am a bit confused on is PF's "ScaledExport" module. It seems to take a template planet, apply some simple changes and then export a .bin file of the modified planet for use with a custom planet as a sort of 'custom template', but i'm just not sure. It's the only part of their configs that dont seem to map cleanly, anyone able/willing to chat with me about how that part works?

Also, I plan to keep dabbling, but if you would consider a contribution valuable, perhaps myself and whoever else around here who has the skill and time could collaborate on some development? We could work in another fork or forks, and submit pull request(s) in for whenever you guys get back? I'm not trying to steal the project, or anything of the sort, but wasn't half the point of Kopernicus to make it so the community could pick up the slack when the mod's core devs are busy or away? I just want to see this project take off, and what it needs before that happens is PF config comparability and/or be used by RSS. My personal interest is in PF configs. Link here for the mappings I have so far: https://docs.google.com/spreadsheets/d/19pfBcbq5YW69KhZJRXkaFtJxnF-KHqm1D0YMHYPxnrU/

Again, hope that your irl obligations lighten. I dont think I can do as good of a job with this as you guys, but I've got time, skill, and motivation enough. Just want to help!

Link to comment
Share on other sites

I'll accept appropriately tested and functional pull requests to the repository, so yes, contributions are welcome. I get an email notification for pull requests so I should be able to check them fairly promptly. Thanks!

Thanks Bryce! I wouldn't commit anything I hadn't tested fairly well. And when I code I can be a bit of a perfectionist, so the basics should be solid, even if I miss some more optimal part of the API. If anyone knows more about the ScaledExport part of the PF configs/code, post here or PM me! I should be able to figure it out myself sooner or later either way just would save me some time :)

Link to comment
Share on other sites

So, just looking at the PF source, I am having a really hard time figuring out what on earth the ScaledExport stuff DOES. I see it copying a stock planet as a template, taking user/custom config values, altering the mesh, then creating a "_.bin". OK. Then looking at the PlanetFactory.cs, the bin is openned in LoadScaledPlanet (static void function) where it loads the material (colorTexture or "*_map.png") and bumpmap, then calls LoadScaledPlanetTexture which sets textures and such. OK. Next, if the _.bin exists, it fiddles around with the values, does some opperations inside the if context, and finally calls PFUtil.RecalculateTangents (another static void function) using the resulting mesh. OK. Now RecalculateTangents runs a bunch of vector and math, and ends with "theMesh.tangents = tangents" where theMesh is the Mesh object in the GameObject object in from the previous function. I just wish I knew why all this crazyness is necissary or even useful. What do these parameters......DO?

What does taking the template and adding/removing/changing oceans do that is so special? Why remove the Alpha chanel from the template? and most of all what is the use of MapWidth and changing the MaxHeight?

I'm guessing this is some of the crazy hacks that PF had to do to mod the planets at runtime. But how does it translate to the new Kopernicus system? I can see now where the creators of Kopernicus might have had some frustrations here...if anyone has a clue, please let me know. In the mean time I will continue to try to figure this out.

Link to comment
Share on other sites

Kragrathea used "ScaledExport" as a hack to generate a scaledspace mesh, and add a texture. In Kopernicus, they are using a much less hacky method to generate a scaledspace mesh, using in-game mesh wrapper functions. Hopefully that clarifies things

Link to comment
Share on other sites

Kragrathea used "ScaledExport" as a hack to generate a scaledspace mesh, and add a texture. In Kopernicus, they are using a much less hacky method to generate a scaledspace mesh, using in-game mesh wrapper functions. Hopefully that clarifies things

That certainly helps. Says little about how the settings translate, but I think I might have enough now to puzzle that out. Thanks!

Link to comment
Share on other sites

You can also check this section of the RSS codebase; it's more similar to what Kopernicus does, with the exception that Kopernicus creates a fresh mesh and I clone Jool's mesh.

There's two things going on here (well, in that link only 1 gets done; look further down for 2).

1. Creating scaled-space geometry (i.e. "wrapping" the scaled space mesh to the PQS-generated heights

2. Creating scaled-space textures (i.e. map-making, rendering a diffuse and a normal for the body's terrain)

You need to clamp vertex heights if oceans are involved (in 1), and you need to make all below-sea-level pixels ocean-colored rather than normally-colored (in 2).

Link to comment
Share on other sites

Okay,

What does PQS do again?

PQS or Procedural Quad Sphere Is the Terrain mesh and everything a planet is made of, PQS controls allow randomly generated Terrain slippery Ice, for example, gilly Is Procedural.

Link to comment
Share on other sites

You can also check this section of the RSS codebase; it's more similar to what Kopernicus does, with the exception that Kopernicus creates a fresh mesh and I clone Jool's mesh.

There's two things going on here (well, in that link only 1 gets done; look further down for 2).

1. Creating scaled-space geometry (i.e. "wrapping" the scaled space mesh to the PQS-generated heights

2. Creating scaled-space textures (i.e. map-making, rendering a diffuse and a normal for the body's terrain)

You need to clamp vertex heights if oceans are involved (in 1), and you need to make all below-sea-level pixels ocean-colored rather than normally-colored (in 2).

W00t! thanks NathanKell! Picking through three code bases is taking a while to figure out, but I'm starting to get a grasp on this. Another question for you (or anyone else knowledgable), ScaledSpace only impacts the map view/tracking station view, correct? More over, it's basically just render distance and some ocean quirks? If so, it seems this could be auto-generated unless I am missing something? Doesn't seem like custom settings are really necessary here...

EDIT: So.....looking at RSS, you export .png files for the scaled textures/normals not too unlike PF does, but Kopernicus doesnt export files. I am guessing Kopernicus is doing something special with the maps such that exporting is not necessary. Moreover, RSS and PF call CreateMaps, while Kopernicus does not; which seems to imply Kopernicus is using other methods of generating the materials. Will look more...

EDIT 2: OK, far as I can tell, maxHeight and mapWidth are irrelevant to Kopernicus, as it computes these values itself. templateName and removeOcean map cleanly to Kopernicus in the Template (removeOcean inverted). oceanHeight and removeAlpha, however......still not sure if Kopernicus has anything like them implemented. Luckly oceanHeight isnt used too often in PF configs I have seen. For now I will just focus on the PQSMods, meaning I am finally writing code! W00t!

Edited by dreadicon
Link to comment
Share on other sites

Sure! :)

Scaled space is used whenever you're far enough from a planet. That's controlled by the scaled space fader PQSMod (PQS fades out, scaled space fades in). You can see it happen at something like 30-40km in stock KSP I believe. Note that Jool doesn't have a PQS, just a scaled space mesh.

Basically, it replaces the dynamic PQS with a static mesh (hence the need to, on load, make that mesh fit the PQS terrain) which has a diffuse and a normal map. These maps should be pregenerated (hence the 1GB of PNGs that RSS ships...). Usually you'll want to tweak them by hand anyway, but for a base RSS allows you to export the maps based on the PQS itself if you want (using, presumably, the same function call that Squad uses before hand-retouching).

maxHeight just lets you specify how to convert meters-above-sea-level (or above-reference-point) to shade-of-gray. I.e. any height >= this, will be white.

You really never ever want to do map export in real time; it's really, really slow. You want to export it ahead of time and ship the image.

Link to comment
Share on other sites

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