Jump to content

Beginning of a Mod: The Kerbal Biographier


JOHNMKNIGHT

Recommended Posts

Hello all!

So far I've made a part mod, contributed to a mod, and created an extension to a mod, but I've never really made a true, in game mod that really interacts with the game per se.
The mod/extension I've spent the most time on is my KSP-PAO - Public Affairs Office, which creates a NASA/TV like experience for your missions in real time. This mod relies exclusively on the the AWESOME Telemachus mod to pull KSP data from the game and provide it externally over http.  While designing new features to KSP-PAO, I realized that some of them I had been planning on being part of the externalized portion of the code in JavaScript - I realized that  I could include some of it IN GAME as another mod so that other people could use it, and I could get some new experience.

The functionality I've started playing with is a kerbal biography generator. The game keeps interesting stats on Kerbals that my KSP-PAO should talk about, but what about... where they were born? or went to school.. or what degree(s) they obtained?

The next version of KSP has been Internationalized and localized (a process which I have professional experience with) and I wanted to create a way todynamically and consistently create Kerbal biographies in ANY language. So, I've started designing the code to be able to just that. Eventually this mode will allow you to look at the mini-biographies of any of your Kerbals and utilizing the string tables for localized versions for all the KSP supported languages.

The Kerbal Chronicle contest really got me thinking about the backgrounds and back stories of not only the four veteran Kerbals, but all of the Wily, Thermin and Belka Kermins out there!

I'll be documenting the development of the mod here on the forums.  All that being said, when the next version of KSP comes out, I'd like to know how/learn to to....

  1. get the list of all the localized name pre-fixes and suffixes, and their appropriate enumerators.
  2. get the list of all the localized location names in KSP (DSN names and contract locations)

Also, I'll be asking for help with:.

  1. getting some localized grammar structures for three or four sentences I'll be heavily reusing.
  2. ...and eventually some great suggestions and additions to the list institutions of higher learning I've started. The list currently includes:
  • Kerdue University (more Kerbonauts have graduated from here than any other school!)
  • The Kerbin Institute of Science
  • Joolian Polytechnic.

I'll be also be learning how to create/use some in game UI elements for the first time. Eventually, my KSP-PAO will use this mod, via Telemachus, to read out the biographies of Kerbals from time to time, during a launch or EVA. 

Link to comment
Share on other sites

6 minutes ago, cratercracker said:

Wow! outstanding idea sir! perhaps you can add random generator for randomly generated kerbals! 

I can actually help you with Russian localization!

Yes! The idea is that my mod would generate the biography for ALL randomly generated kerbals! There will be special cases for the current four veterans. I will also create biographies for tourists as well.

Link to comment
Share on other sites

@JOHNMKNIGHT While I have no suggestions on your mod itself, could I ask you to start a thread in the Plugins sub-forum about your experiences with (and how to) localize KSP?

That's something I want to look at supporting in my mods, but I don't have the faintest idea where to start and I (and probably others) would appreciate any help you could give us.

D.

Link to comment
Share on other sites

6 hours ago, Diazo said:

@JOHNMKNIGHT While I have no suggestions on your mod itself, could I ask you to start a thread in the Plugins sub-forum about your experiences with (and how to) localize KSP?

That's something I want to look at supporting in my mods, but I don't have the faintest idea where to start and I (and probably others) would appreciate any help you could give us.

D.

SCANsat does this, at least to a limited extent (the next version of Contracts Window + will also do this, but it will work with all of its text; most of its text comes from the contracts in-game, but this works for everything else).

It allows for replacing the text for all of its tooltips (its setting menu uses many long tooltips as a help function to explain the purpose of all the options) with text read from a config file.

In its simplest form, just replacing static text on screen, this isn't too hard. The config file is just a series of repeated config nodes, each with different translations for all the strings. You just have to choose which config node to use, then use those strings in your UI in the place of hard-coded text.

https://github.com/S-C-A-N/SCANsat/blob/dev/SCANsat/SCAN_UI/UI_Framework/SCANlanguagePack.cs

You can run into complications when you want things like string formats, where you have a hard-coded string with some dynamic element included, like the name of a vessel or celestial body, but that file has methods for loading in curly braces from the strings in the config file (adding curly braces directly to a config node would break it, since KSP would read that as having closed the node).

There are instructions for how to create new translation nodes in the SCANsat wiki; aside from the translating part it isn't that hard.

Link to comment
Share on other sites

15 hours ago, DMagic said:

SCANsat does this, at least to a limited extent (the next version of Contracts Window + will also do this, but it will work with all of its text; most of its text comes from the contracts in-game, but this works for everything else).

It allows for replacing the text for all of its tooltips (its setting menu uses many long tooltips as a help function to explain the purpose of all the options) with text read from a config file.

In its simplest form, just replacing static text on screen, this isn't too hard. The config file is just a series of repeated config nodes, each with different translations for all the strings. You just have to choose which config node to use, then use those strings in your UI in the place of hard-coded text.

https://github.com/S-C-A-N/SCANsat/blob/dev/SCANsat/SCAN_UI/UI_Framework/SCANlanguagePack.cs

You can run into complications when you want things like string formats, where you have a hard-coded string with some dynamic element included, like the name of a vessel or celestial body, but that file has methods for loading in curly braces from the strings in the config file (adding curly braces directly to a config node would break it, since KSP would read that as having closed the node).

There are instructions for how to create new translation nodes in the SCANsat wiki; aside from the translating part it isn't that hard.

@DMagic Thank you for your information. I'm a fan of your work! Handling string replacements as well as sentence grammars is a good part of internationalization enabling localizations. In addition to those items, I'm going to make a concerted effort to address other issues such as non western-alphabets and localized dialog designs that take into account word/character size and left-to-right vs. right-to-left languages. I'd like to follow Squad's lead on how they plan on supporting localized resources. Hopefully they'll use non, compiled resource bundles of some sort. Again, thanks for your post and all your awesome work!

Link to comment
Share on other sites

  • 2 weeks later...

I like this idea! I can contribute bio ideas if you'd like. Not much time to do much else I'm afraid.

One thing which I thought might be a cool idea would be a newspaper story. Once a crew returns (or fails) you get a page with some of the details such as crewmembers involved, how long the mission was, if any were lost, science completed, maybe pics of said mission, etc. Along with a few random generated quotes and typical blah blah filler. 

Link to comment
Share on other sites

20 hours ago, kormath said:

I like this idea! I can contribute bio ideas if you'd like. Not much time to do much else I'm afraid.

One thing which I thought might be a cool idea would be a newspaper story. Once a crew returns (or fails) you get a page with some of the details such as crewmembers involved, how long the mission was, if any were lost, science completed, maybe pics of said mission, etc. Along with a few random generated quotes and typical blah blah filler. 

@kormath Cool ideas! I'm wanting to make the in-game UI very minimal. I plan on trying to expose the info via another plug-in (Telemachus) is possible.

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...