Jump to content

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

Link to comment
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.

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...

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

Link to comment
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
Link to comment
Share on other sites

  • 1 year later...

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. 

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