Jump to content

[WIP] Part Select Window - Prototype 7 - 2 November


Crzyrndm

Recommended Posts

Discontinued


I'm really not a fan of the stock part selection window. The part ordering based on load order rather than any gameplay element, little pictures for the buttons which all tend to look very similar, and while the tooltip window itself is "ok" I could really do without it following my cursor into the window itself where it obscures other parts.

My aim with this mod is to be able to create a selector window where I can think "I want a 1.25m LF+LOx fuelled engine", and be able to go directly to that set of items. Better yet, have each set of parts respond intelligently to a search function (searching "100" will sort any visible engine directory by thrust differential from 100kN, fuel tank directory by capacity differential from 100 units, etc.).

Mod support is fluky unless otherwise specified, career mode currently doesn't work(I forgot to lock parts based on tech...)

Prototype v7 available on github now under license CC BY-NC-SA 4.0

Feedback very much appreciated

Mod Integration:

FAR

Realchute

Near Future packs

Edited by Crzyrndm
Link to comment
Share on other sites

Hold on. Squad are redesigning this right now. Wait until the next update; you might be wasting time.

Why ? The release is not for tomorrow, and even if creating a plug-in which is doomed to be "useless" (but we know nothing yet about what Squad will do EXACTLY) can be depressing, it is also a way to learn, if relevant.

Link to comment
Share on other sites

Basically, Squad has already thrown out all of the old Editor code and is redesigning it from the ground up to be a lot better, which includes a new, better sorting system. While I agree that Crzyrndm should keep working on this, don't expect it to be "a groundbreaking new mod that should totally be stock!" since stock will include something like this when 0.90 comes out.

It's good for 0.25, maybe not so much for 0.90 and beyond.

Link to comment
Share on other sites

Hold on. Squad are redesigning this right now. Wait until the next update; you might be wasting time.

Already knew that, doing it myself is much more interesting though. We don't even know how Squad's updated one will function. If I like the new one better than this, then I can just reuse code from this to create improvements for that. If I don't, then I've already got a working system that'll just need updating (some serious updating if they are totally overhauling it).

Plus, this is way more fun than waiting another 2 odd months for something that may or may not be great.

don't expect it to be "a groundbreaking new mod that should totally be stock!" since stock will include something like this when 0.90 comes out.

Thats some unrealistic level of expectation for something that isn't even publicly available yet :sticktongue:. I don't even know if anyone other than me will like it yet :D

I'm making this because I want to. I like solving problems, I like learning new things, and it's way more fun making something where I'm not just echoing someone elses work. If this is irrelevant come next patch, then so be it. I still got plenty of enjoyment out of making it.

EDIT

Just as an example of something that I'm very unsure about whether Squad will be comparable, I chose to make it so that all parts are assigned to every valid location in the structure. This means that hybrid parts can show up in every place that is applicable (RAPIER (jet and rocket when I get that far), LFB (rocket and fuel tank), etc.).

It was the best solution I could think of that would work well no matter how a mod part was structured. The function switching used by B9, various wacky parts that don't match standard rule sets, doing it this way I can most likely accomodate all of them.

Edited by Crzyrndm
Link to comment
Share on other sites

Basically, Squad has already thrown out all of the old Editor code and is redesigning it from the ground up to be a lot better, which includes a new, better sorting system. While I agree that Crzyrndm should keep working on this, don't expect it to be "a groundbreaking new mod that should totally be stock!" since stock will include something like this when 0.90 comes out.

It's good for 0.25, maybe not so much for 0.90 and beyond.

wait, 0.90? It took long enough to get from .24.2 to .25. .90 will be a long way down the line. Half of us will die from old age before then.

Link to comment
Share on other sites

wait, 0.90? It took long enough to get from .24.2 to .25. .90 will be a long way down the line. Half of us will die from old age before then.

0.24.2 to 0.25 was pretty short compared to previous releases. Seems like they are moving along updates faster than before. Also, next version will be 0.90.

Link to comment
Share on other sites

wait, 0.90? It took long enough to get from .24.2 to .25. .90 will be a long way down the line. Half of us will die from old age before then.
0.90 is the name for 0.26 to mark it as entering beta release stage

Correct, 0.26=0.90. There was a whole article on the update and KSP's future starting next update.

LINK: "Beta Than Ever" (in case you didn't see Crzyrndm's link)

Definitely keep at it! Problem solving is the way I learned programming to the extent that I do without any formal training.*** It's really exciting when you figure out how to do new things on your own. :D

*** I'm not a programmer by trade, it's just a hobby I picked up four years ago. I'm working on a standalone game with Helldiver (KSOS guy) but college for Aerospace Engineering is keeping me busy.

Link to comment
Share on other sites

A mostly functional prototype is now available for download here, distributed under GPLv3 as a default

Some forewarning if you want to try it out:

  • Use with mods at your own risk. It "mostly" handles stock parts (I got to the point where I realised I needed to redo the part sorting logic and gave up...) but is entirely untested past that (If you do test it with a part heavy modded install, I would greatly appreciate feedback about performance. I had some issues earlier and I think I dealt with it, but a large part load may bring it back).
  • To deal with part window clickthrough I've been hiding the stock parts browser when the GUI has mouse focus. It slides back out for access to the non-part selection functionality (if only I could hide only the part select area...:mad:)
  • All nodes are being sorted by dry mass, which leads to some odd ordering, particularly with the solid boosters in the engine tab.
  • There is a pair of nullref exceptions that I have been unable to track down that popup while browsing between parts.
  • There is no way to disable it at the moment as this build is just for mucking around with. I'll add it to the app launcher at some point (like, when it's actually properly functional :D)

So one of the best things about prototypes is they show you all the things you didn't thing of initially. The need for a way to quickly collapse some/all open nodes for instance. Any feedback about functionality (good or bad) is appreciated a million times over because it means I will have less reworking to do later when doing so is harder.

EDIT

LFB uses the incorrect attach node size?

Edited by Crzyrndm
Link to comment
Share on other sites

Filtering to get a specific size of engine (to use your example) is something Simple Part Organizer does today. (It's in the links in my signature.) That said, there are two reasons I am in favor of you doing this mod:

1. It might be better than mine and then I can drop mine and use yours. :)

2. What Squad makes in the next rev might not support the features we want. Look at Crew Transfer for example. I wanted a UI but instead I have to search my craft looking for hatches, and sometimes I have "internal" modules that have no hatch, or a hatch I have intentionally obstructed/covered. I still need Crew Manifest. We may still need a mod like yours even after Squad does their version.

Edited by Felbourn
Link to comment
Share on other sites

Filtering to get a specific size of engine (to use your example) is something Simple Part Organizer does today.

I think that the main difference between this and Parts Organiser is that I want a large portion of the functionality to be automated. For example, opening an engines tab and having it already sorted by TWR (or whatever your engines default is), while fuel tanks are sorted by mass, while rover wheels are sorted by driving speed (or some thing of the like). At the same time, having several alternative options available (eg. thrust, mass, ISP for engines) and a (hopefully) smart search function that can do things like order parts based on the difference between the value you enter and the parts value (eg. Thrust: 210 -> LV-T30 tops the list (difference of 5), LV-T45 next (difference of 10)...), not just ascending and descending sorts.

The last thing is that it's all in a scrolling window so I can have a couple of high access sections readily accessible at all times, no matter which category those parts are in.

2. What Squad makes in the next rev might not support the features we want. Look at Crew Transfer for example. I wanted a UI but instead I have to search my craft looking for hatches, and sometimes I have "internal" modules that have no hatch, or a hatch I have intentionally obstructed/covered. I still need Crew Manifest. We may still need a mod like yours even after Squad does their version.

There is that, and there's the fact that me developing this at this time is totally coincidental (reading this weeks dev notes after making this thread was hilarious). Been kicking the idea around and making little prototypes of each major function block (loading parts, tooltip on hover (non-existent hover detection in Unity :mad:), creating new parts without destroying the editor (multiple root parts, floating parts that are "attached" to the ship, etc...)) since before 0.25. Just haven't had the time to seriously attack it until a few days ago.

New development aims

  • A button which follows your cursor on the left hand side of the screen which can be used to quickly collapse sections
  • Proper sorting functionality according to tab
  • A better backend part allocation system that is less awful (seriously, expanding what exists is just impossible)
  • Proper implementation of size nodes that supports any part/node size
  • Some GUI work (In particular, making headers stand out a little more from parts and each other)
  • Expansion to full screen height and integration of all stock functionality (symmetry/attach mode, funds, mass/lift/thrust overlays) so I don't have to keep bringing the stock GUI out of hiding.

Edited by Crzyrndm
Link to comment
Share on other sites

So basically context sensitive sorting. That sounds great, especially if you make it customizable & saved too. That would be better than mine. I find that most things for me sort into wet mass properly. Thrust on engines for example typically goes up as mass goes up, so to sort by thrust I just sort by mass. That said, it's not perfect, and sorting by custom context sensitive filters would be better.

Link to comment
Share on other sites

Just a few small features away from another prototype build to play with.

In addition to whats in the video, the next version will have have some (fixed) context sensitive sorting and subcategories for fuel tanks and possible engines depending on what fuel type(s) they provide/use

Link to comment
Share on other sites

Prototype v3 available

Now with app launcher support so you can turn it off and go back to the stock parts window. Just a blank white icon for now, because an off switch was too important to wait :D

Most of the other changes were backend again, moving towards user configurable directories and nodes (The directories are there, but all you can do at the moment is remove them)

Link to comment
Share on other sites

Prototype v4 available

Getting fairly close to having all initial major features established now. Pv4 includes user customisable part sorting and almost all the backend work required to make the part assignment structure fully customisable. Once the filtering is implemented, it's all go :D

Link to comment
Share on other sites

Get issues with the P4: let the "part window" open and leave editor make the window stay opened outside !

Some exceptions:

NullReferenceException: Object reference not set to an instance of an object

at PartListTooltips.DrawTooltip (Int32 id) [0x00000] in <filename unknown>:0

at UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID) [0x00000] in <filename unknown>:0

at UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) [0x00000] in <filename unknown>:0

when hovering parts

and many error:

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)

bonus: you haven't updated your thread title (it still says "prototype 3")

Edited by Justin Kerbice
Link to comment
Share on other sites

Woops on the not hiding the window on leaving the editor. I'll just go fix that... :sealed:

I know about the nullrefs/errors and the repro steps for them. I even know which section of code causes them (down to about 5 lines). Since they don't actually do anything though, they aren't at the top of the todo list right now (it's from hiding the tooltip on leaving the button, it either does it twice or tries to show it straight after with no part available. Not quite sure which yet).

And thread title updated, ta.

Just as an update while I'm here: v5 won't be out today. I've implemented all the basic functionality required for user customisation (directory structure, folder names, default folder sort, folder sort options) but there's also a major bug in the part assignment logic that basically renders all that useless :mad:

Link to comment
Share on other sites

Prototype v5 available

Note: The old "Parts Viewer" folder is dead. It was the only place I wasn't calling it "Part Select" so it got renamed for consistency.

Prototype v5 finally includes all the basic user customisation I've been working on. There are two main parts to it:

Directory Structure

You would have seen this if you'd gone digging in v4. In the directory "GameData\Part Select\PluginData\PartSelect", there is a text file called directory.struct.

This is a list of all the folders (and their onscreen names) that will be created upon entering a game. With the exception of the keyword "Size", what goes into those folders is customisable via the node.defs file. Size directories are a little different. If that folder type is encountered, folders are automatically created to match the type of part being added.

All folders are always reachable, assuming they have a definition. No need to define all the parent nodes

For example:

Propulsion,Size,Engine

Assuming "Engine" is defined (which it is :sticktongue:), Propulsion will automatically add all parts that match the "Engine" definition.

Node definitions

What is and is not allowed into a folder is defined by the second file: "node.defs"

In here you can find all the various folder definitions that are being used to assign parts.

For example, the "Engine" definition:

NODE
{
name = Engine
sort = Thrust,TWR,ISP,Dry Mass
filters = isEngine
}

This matches to any folder in the directory with the name "Engine". Any folder matching this template will start with all parts ordered by Thrust (first object in the sort list) and will have 4 sorting options present.

Finally, this folder uses the "isEngine" filter to match parts (which returns true if the part has any engine or enginefx modules).

Each of these keys can have multiple entries, seperated by "," characters (eg. "name = Engine,Rocket,Jet" will match to Folders named "Engine" OR "Rocket" OR "Jet"). I don't have an AND operator as yet, so the filter list is a bit hard to work with.

The "name=" line must be the first line of the definition. The other lines are all optional and in any order (although if ou dont include a filter, nothing will be put in it and you wont see it...). The default sort option is "Dry Mass" if no sort options are specified (Other options are: Thrust, ISP, TWR, and Wet Mass. Any other options will be invalid and do nothing).

Adding filters to a folder that its child folders dont have will give you a parts list in that folder (ie. you can define any folder in the directory structure, not just the final folder).

Final Note

No, these aren't (as yet) module manager compatible. It'll happen at some point, but not right now.

Edited by Crzyrndm
Link to comment
Share on other sites

Prototype v6 available

Expanded sorting possibilities (stock wing lift, rover wheel speed and torque), partial support for FAR and Realchute, layer 0 categorisation by stock tabs (if I can't categorise it, it goes in it's stock location), a wing filter, categorising engines by fuel type as well as tanks, plus a few other minor changes I'm probably forgetting.

For exanding mod support, what other common mods add custom part modules? FAR/NEAR, Realchute, DRE, NF, and Firespitter are all that come to mind immediately, but then I don't use a whole lot of part mods.

Link to comment
Share on other sites

Prototype v7 available

Changes include:

Interface overhaul: Each part button now includes the cost and a configurable value such as thrust, mass, or maximum ISP (default is mass)

Integration of all Near Future part modules, engines, and resources

Fix for FAR integration interaction with the "Lift" sort. For the time being, this will return a zero if FAR is installed.

Included an actual applauncher icon :D (Find the button with the pod outline)

Plus whatever else I ran into on the way.

UI changes mean a new video is in order :cool: (Video recorded on a reasonably modified install, FAR, NF, B9, Procedural Fairings, plus a few more)

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