DMagic

KSPedia Creation Tutorial

Recommended Posts

4 minutes ago, DMagic said:

@micha Creating sprites at runtime is definitely expensive, but if done in Unity it's already taken care of by the time it's displayed in KSP.

I've done some more testing and while the filesize is definitely smaller with textures, the display of the images is less sharp than if you import the image as either "Editor GUI and Legacy GUI" or as "Sprite". Adding them as "Image" or "Raw Image" doesn't seem to make a difference here (although obviously if you use "Image" then you have to import as "Sprite").

But nothing I do seems to make the images properly sharp like in your KSPedia entries.
 

4 minutes ago, DMagic said:

For lines like these:

<snip>

I just do them in Photoshop with the the line tool. You can hold ctrl, or alt, or something to make them snap to 45o increments. They don't always come out perfect, if you look closely you can see the gaps between some of the segments, and it's also a pain because any time you need to move the text you have to move the lines around, too, but it works well enough for me.

Yes exactly :)

Hmm, ok, but how do you line them up with the text? I've had a look at your GitHub repo for the images and yeah, you just have the lines as part of your images, but that must have been a royal PITA to line up...?  I guess it is what it is..!

Share this post


Link to post
Share on other sites
On 06/09/2017 at 7:06 PM, DMagic said:

Keep in mind that this does not update any actual text changes in the final KSPedia entry. I think this is mentioned briefly in the tutorial.The Part Tools reads the actual text from an XML file in your Unity project folder (I'm not sure about the exact name or location of the file). The only way to update the XML file without going through the whole process with setting up the KSPedia pages is to manually update the text in the XML file.

<...>

It's possible that this is fixed in the 5.4 Part Tools.

I haven't worked out when it works and when it doesn't, but sometimes text changes are applied and other times not. It's very frustrating. And no, it's not fixed in the latest PartTools.

EDIT: Ok, so it looks like the following happens:

When you first create an entry in the KSPedia using the KSPedia tool, it sets up the information in the XML file, and copies any text into the XML.  But if you change text in an existing item, it does not get updated!

However; if you delete all the <text>...</text> tags out of the XML, it will now take the text directly from the prefab when re-generating the AssetBundle. Of course, this only applies for existing items; any new items have the same issue as above.

TL;DR: After adding any new entries using the KSPedia tool, open the kspedia XML file and delete all <text> tags out of it to ensure the text is taken directly from the prefabs.

 

On 18/11/2017 at 5:49 PM, micha said:

<...>
But nothing I do seems to make the images properly sharp like in your KSPedia entries.
<...>

Looks like my main issue has been not capturing sharp-enough images from the game itself. They looked fine in-game, but were horrible in the KSPedia.  I've since been paying more attention to the quality, and there's a particular zoom-level in-game where the textures suddenly "snap" into focus. My new captures have been at that zoom-level and they look much better in KSPedia.

So to re-cap, in my experimenting I've found that for the smallest KSPedia filesize and best image quality, you will want to import your images as "Editor GUI and Legacy UI", then add them to your prefab as "Raw Image". This can more than halve the final size compared to importing the images as Sprites, regardless of whether you then use the Sprite texture as a "Raw Image" or an "Image" in your prefab.  I've also got up to half-a-dozen or more separate images on a page instead of using DMagic's method of combining them all onto one big image. The benefit, apart from being able to freely re-arrange them in Unity, is that you can re-use them on other pages without them taking up more resources.

There may be benefits to doing it DMagic's way though; I haven't actually profiled the game while it's running.

Edited by micha

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