Jump to content

[1.10.x] EasyBoard v1.10 : Board key works as a toggle


Dizor

Recommended Posts

  • 4 weeks later...
  • 2 weeks later...

I have found a minor problem with EasyBoard: boarding from a ladder onto a ship that has its brakes engaged disengages the brakes. Note that approaching the hatch while in the "wants to board" state (boarding mode) does not disengage the brakes, it is only when pressing B to board and already in the hatch collider that the problem occurs.

On a helpful note, I have worked out why: stock behavior for the B button is to not board until the B-key is released (ie, the action is on button release, not on button press). The problem is that EasyBoard goes into boarding mode on button press. If you change EasyBoard such that the state toggle is on button release, then the problem should go away.

Here is a save file with a minimal ship for testing: it is parked on the runway with the brakes applied. With EasyBoard installed, EVA then board disengages the brakes. Without EasyBoard installed, the same action does not disengage the brakes. More importantly, the edge-triggering can be observed. While the save does list a huge pile of mods (due to hunting down the issue), it was saved in a pure stock+EasyBoard environment.

Edited by taniwha
Link to comment
Share on other sites

On 12/24/2016 at 2:19 AM, Loren Pechtel said:

However, I think the range needs to be increased.  At one point I actually hit the hatch with the Kerbal's feet and it wasn't close enough.

The mod allows to board vessel when kerbal has 'airlock' property assigned (by game). I can't just increase the range, the only range i can change is for boarding command seats.

1 hour ago, taniwha said:

I just checked both your code and the Unity docs: using GetKeyUp instead of GetKeyDown should fix the problem.

Thank you for the detailed report. Yes i also thought about using GetKeyUp :)

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

Awesome mod, but I had some major fps decrease near a big vessel (200 parts or more) when easyboard was active. Pressing b again and thus deactivating the auto-board feature restored fps. Is there any cyclic method call active that might look through a huge amount of parts on each fixedUpdate? 

Link to comment
Share on other sites

@Blackline: it would not surprise me if EB checks all nearby parts instead of using OnTriggerStay as that would require a fair bit of setup to get working (custom module on the kerbal). However, I think it would be worth the effort as it would take advantage of the work Unity (and thus KSP) is already doing to display the "{B}: Board" message.

Edited by taniwha
Link to comment
Share on other sites

On 04.05.2017 at 7:23 PM, Blackline said:

Awesome mod, but I had some major fps decrease near a big vessel (200 parts or more) when easyboard was active. Pressing b again and thus deactivating the auto-board feature restored fps. Is there any cyclic method call active that might look through a huge amount of parts on each fixedUpdate? 

 

21 hours ago, taniwha said:

@Blackline: it would not surprise me if EB checks all nearby parts instead of using OnTriggerStay as that would require a fair bit of setup to get working (custom module on the kerbal). However, I think it would be worth the effort as it would take advantage of the work Unity (and thus KSP) is already doing to display the "{B}: Board" message.

Partially true. Actually EB detects nearby airlock very quickly with the least effort. The main reason of FPS loss issue for large vessels is a complex way to find available external command seat. Long story short: getting loaded vessels, then getting nearest vessel, then searching for empty command seats on this vessel, and finally getting nearest command seat in boardable distance. All this repeats per every frame and causes FPS loss for large vessels.

Unfortunately i don't know easier way to find nearest empty seat :(

Link to comment
Share on other sites

@Dizor: ah, hmm.

Here's something to try: a part module placed on the command seat part that creates a sphere trigger collider tuned to catch only kerbals (using the appropriate layer, which I don't know, sorry, but I do know it exists because it is used to prevent wheels and legs reacting to kerbals). The part module would have an OnTriggerStay that detects when a kerbal enters and does the auto-board if appropriate. The part module can even disable the collider if the seat is occupied.

Unity seems to be happy with even dozens (maybe hundreds) of simple (sphere, capsule, box (NOT mesh)) colliders in a scene. Take advantage of the engine :)

Link to comment
Share on other sites

1 hour ago, Dizor said:

 

Partially true. Actually EB detects nearby airlock very quickly with the least effort. The main reason of FPS loss issue for large vessels is a complex way to find available external command seat. Long story short: getting loaded vessels, then getting nearest vessel, then searching for empty command seats on this vessel, and finally getting nearest command seat in boardable distance. All this repeats per every frame and causes FPS loss for large vessels.

Unfortunately i don't know easier way to find nearest empty seat :(

Suggestion:

The first time you examine a vessel note where there are command seat(s).  AFIAK there is no way for a command seat to become available while the Kerbal is focused--just keep the cached result of the last search.  You only need to recalc on focus change or if something enters physics range.  (Something leaving physics range doesn't really matter, it's too far away to board anyway.)  On each frame you would only need to calculate the distance, you wouldn't need to search.

Link to comment
Share on other sites

6 hours ago, Loren Pechtel said:

Suggestion:

The first time you examine a vessel note where there are command seat(s).  AFIAK there is no way for a command seat to become available while the Kerbal is focused--just keep the cached result of the last search.  You only need to recalc on focus change or if something enters physics range.  (Something leaving physics range doesn't really matter, it's too far away to board anyway.)  On each frame you would only need to calculate the distance, you wouldn't need to search.

You can place command seats in-situ with KIS/KAS!

Link to comment
Share on other sites

8 hours ago, Blackline said:

You can place command seats in-situ with KIS/KAS!

I was thinking that couldn't happen when the Kerbal was focused but now I realize the Kerbal could place the seat.  I wouldn't consider it a big deal if the Kerbal didn't instantly jump into the seat he just placed, though.

Link to comment
Share on other sites

  • 2 weeks later...

@Dizor could you please consider adding checks for Ctrl / Shift / Alt / GameSettings.MODIFIER_KEY and not registering the "B" keypress when occurs together with those?
Easy Board is overriding one of the features of a new mod I'm working on, which would otherwise synergize quite nicely.
Let me know if you need anything from my end. Thanks!

Link to comment
Share on other sites

  • 2 weeks later...
On 25.05.2017 at 3:05 PM, Gordon Dry said:

Crosspost:

 

Can't see an issue/conflict with this mod. As per my testing sometimes EVA Parachutes mod does not work with no other mods installed. Kerbal falls on high speed to the ground with parachute deployed.

Link to comment
Share on other sites

On 06.05.2017 at 2:49 AM, taniwha said:

@Dizor: ah, hmm.

Here's something to try: a part module placed on the command seat part that creates a sphere trigger collider tuned to catch only kerbals (using the appropriate layer, which I don't know, sorry, but I do know it exists because it is used to prevent wheels and legs reacting to kerbals). The part module would have an OnTriggerStay that detects when a kerbal enters and does the auto-board if appropriate. The part module can even disable the collider if the seat is occupied.

Unity seems to be happy with even dozens (maybe hundreds) of simple (sphere, capsule, box (NOT mesh)) colliders in a scene. Take advantage of the engine :)

 

On 06.05.2017 at 3:16 AM, Loren Pechtel said:

The first time you examine a vessel note where there are command seat(s).  AFIAK there is no way for a command seat to become available while the Kerbal is focused--just keep the cached result of the last search.  You only need to recalc on focus change or if something enters physics range.  (Something leaving physics range doesn't really matter, it's too far away to board anyway.)  On each frame you would only need to calculate the distance, you wouldn't need to search.

 

On 17.05.2017 at 9:08 PM, cakepie said:

@Dizor could you please consider adding checks for Ctrl / Shift / Alt / GameSettings.MODIFIER_KEY and not registering the "B" keypress when occurs together with those?
Easy Board is overriding one of the features of a new mod I'm working on, which would otherwise synergize quite nicely.
Let me know if you need anything from my end. Thanks!

Thanks guys! I have made all necessary updates.

New version (1.5) is released.

1. Updated for KSP 1.3.
2. Disabled activation by pressing key with Ctrl/Shift/Alt/Etc.
3. Fixed FPS loss issue with large vessels.

Link to comment
Share on other sites

  • 1 month later...
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...