SpiralOut

No idea where to start! (IVA Node Editor)

Recommended Posts

Background:
I've been using RasterPropMonitor (and other mods that use it) for a while now, in an attempt to get as close to a 1st-person "space sim" experience as possible in KSP. However, a notable hurdle to flying 100% IVA missions is the inability to create and edit maneuver nodes from the cockpit. RPM's FAQ implies that the principal obstacle to making an IVA maneuver node editor is design-related, not technical. I happen to be a web/UI/UX designer, so I took a stab at mocking up a workable interface:

5cCcqj7.png

kO30EF5.png

vC87mSR.png


The Problem:
I'm completely in over my head! I'm fluent in Javascript and have a working knowlege of PHP, so I'm not completely in the dark when it comes to programming, but I've never worked with C# before, so I have no idea where to begin. I have hacked together a few Module Manager patches for personal use, but I've never done anything quite this extensive before.

Most of the tutorials I'm seeing on the forum seem to relate to making new parts, which this is not. What I'm aiming for is something similar to Nav Utilities or DPAI, which integrate seamlessly into RasterPropMonitor.

Can anyone nudge me in the right direction to get me started? Or even, would anyone with more development experience care to collaborate with me? Once I'm on the right track, I'm sure I could figure out the details by reading code, reference docs, Googling, etc., but I need a jump-start...

  • Like 6

Share this post


Link to post
Share on other sites
5 hours ago, SpiralOut said:

Can anyone nudge me in the right direction to get me started? Or even, would anyone with more development experience care to collaborate with me? Once I'm on the right track, I'm sure I could figure out the details by reading code, reference docs, Googling, etc., but I need a jump-start...

Your best bet for a starting point may be to look at what NavyFish did with DPAI, and how it integrates with RPM.  There are two parts involved:

The integration part is in GameData/JSI/RPMPodPatches/BasicMFD/MFD40x20.cfg:

BACKGROUNDHANDLER
{
    name = DPAI_RPM
    method = DrawDPAI
    buttonClickMethod = ButtonProcessor
    pageActiveMethod = pageActiveMethod
    multiHandler = true
}

This snippet is the part that tells RPM that it needs to look for methods called "DrawDPAI", "ButtonProcessor", and "pageActiveMethod" in a DLL called "DPAI_RPM".  DrawDPAI is the method that RPM calls when that page is active, and it needs rendered.  ButtonProcessor handles the button events, and pageActiveMethod is used to tell DPAI when its page is in use.

The functional part involves looking at DPAI's code to see what DrawDPAI does - that's going to be the part that draws everything on screen.  I haven't looked at it myself, so I can't really tell you what to expect.  The ButtonProcessor in DPAI ties in with the button names and numbers in the PAGEHANDLER right above the BACKGROUNDHANDLER in the config file.

I'd suggest a good first step would be to look at how DPAI works its magic in DrawDPAI, and see if you can get a simple project set up that draws something on an RPM screen using a plugin draw method - even if it's just a simple texture, or some text. I don't have the spare time to work on it substantially, but I'm more than happy to help with suggestions and possibly some code snippets once you're down to the interface with KSP for setting / getting maneuver node info.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks so much, this is exactly the sort of info I was looking for! I'll dig into this tonight and see what I can make happen. :)

Share this post


Link to post
Share on other sites

I would still really love to get this thing working. After my last post here, I took a look at the code MOARdV referenced above and realized I was 100% lost. Web development did NOT prepare me for this, lol. However, I've acquired some experience with Unity/C# in the intervening eight months, so I'm reasonably confident that if I gave it another go I could potentially make something happen. At the very least I'm in a much better position to get a grasp on the basics. However, I have serious ADD and I know for a fact that if I manage to get this thing released, I'm going to be terrible at keeping it up to date. :/ It is still definitely something that I would love to make happen though. After a long break I'm reinstalling KSP right now, so hopefully I can work up the motivation to take another look at this in the coming weeks. :) 

  • Like 2

Share this post


Link to post
Share on other sites

That's a really nice design, and it would be cool to see it in-game. I did a text-based RPM UI for my mod, so I may be able to supplement MOARdv's advice by fielding the simpler/easier questions.

rpm-display.png

Here's the cfg file I used. I had to use ModuleManager directives (the '@[]:' stuff) to inject my page into the default configuration, which is also what Nav Utilities does. Note that I used PAGEHANDLER instead of BACKGROUNDHANDLER because I only needed text, not graphics.

https://github.com/HebaruSan/Astrogator/blob/master/assets/AstrogatorRPM.cfg

And this is the C# class that builds the display, again specialized towards text:

https://github.com/HebaruSan/Astrogator/blob/master/src/AstrogatorMenu.cs

Edited by HebaruSan

Share this post


Link to post
Share on other sites

Hello, are there some news about your project?

It would be amazing if you could make this mod

Share this post


Link to post
Share on other sites
6 minutes ago, Boudouyou75 said:

Hello, are there some news about your project?

It would be amazing if you could make this mod

Did you notice that the last post was a year and a half ago?

Share this post


Link to post
Share on other sites

I still get notifications about this every once in a blue moon and it makes me sad because I never mustered the motivation to do this. But I still think it would be really cool. One of these days.... 

FWIW I'm a much more competent developer now, so I'm pretty confident I could do it if I found the time to sit down and work on it. 

Share this post


Link to post
Share on other sites

Hi SpiralOut, I hope that you'll find the motivation, it's already a big thing that you continue to think of this mod, truly, i didn't think you would answer after 1 year since last post on this topic, but you did it, it's fantastic.

 

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