Homesource Forums

Homeworld Source Editing Talk
It is currently Sat May 27, 2017 4:55 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Repair corvette docking
PostPosted: Mon Mar 05, 2007 2:57 pm 
Offline
coder

Joined: Mon Jan 29, 2007 2:45 pm
Posts: 61
Has anyone else been annoyed by the difficulty of getting repair corvettes to dock where you want them? Double clicking orders them to support, so you can only try to move them close to the desired carrier or mothership and hit d.

The cursor turns into a docking symbol when you have repair corvettes selected and point at a carrier or mothership. This suggests that a double click would be interpreted as a docking command, but it is not. I have a small patch that fixes this: it causes the double click to be interpreted as a docking command if you have repair corvettes (and possibly other small crafts) selected and click on a carrier or mothership. You can always use z to support.

If you double-click on any other type of ship the repair corvettes will support it. Also, if you have a support frigate selected in addition to the repair corvettes and double click on a carrier or mothership, the entire group will support.

Unfortunately the cursor shape and actual mouse click actions are controlled by entirely separate logic, making discrepancies likely. My patch does not affect the cursor shape, only the actions.

Any objections if I commit this smallish UI change? Anyone gotten so hard-wired to using double click that they cannot learn to use z-click instead?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 3:26 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
shevek wrote:
The cursor turns into a docking symbol when you have repair corvettes selected and point at a carrier or mothership. This suggests that a double click would be interpreted as a docking command, but it is not.

This is a bug - it works fine on Mac OS X. Any dockable ship (fighter, corvette, resource collector etc) will dock with the vessel underneath the double-arrow dock cursor. The vessels ordered to dock will quickly flash lighter in colour to indicate successful issuing of the dock command. However, if you have a lot of vessels in the docking group it may look as though the command failed even if the vessel-to-dock-with flashes because it takes a certain amount of time for them to be added to the docking queue and actually proceed to their destination.

What happens exactly when you issue a double-click docking order?

shevek wrote:
Anyone gotten so hard-wired to using double click that they cannot learn to use z-click instead?

Quite the reverse actually! I always support with control-Z (to take advantage of band-boxing groups) and generally dock with a double click (since a dock order may split my ships into disparate fleets which are more easily picked off).

It did take me a while to learn that control-Z is not the same as control-G when it comes to support vessels though! :D

_________________
MacHomeworld | HomeworldSDL.org


Last edited by lmop on Mon Mar 05, 2007 5:07 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 4:45 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
The code that handles double-click docking is handled here:

mainrgn.c
mrRegionProcess()
L3888 case RPE_DoubleLeft:

mouseLDoubleClick() handles the case of "inverse docking" where a larger dock-capable vessel is asked to support a smaller vessel. In these cases, the large vessel moves towards the smaller vessel's location so that it can quickly dock and be repaired (supported).

In the normal case of a group of small ships being asked to dock with a larger vessel, mouseLDoubleClick() does nothing, returns FALSE and the rest of the case block in mrRegionProcess handles the docking using the DOCK_AT_SPECIFIC_SHIP flag so they go to the same destination.

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 6:09 pm 
Offline
coder

Joined: Mon Jan 29, 2007 2:45 pm
Posts: 61
lmop wrote:
In the normal case of a group of small ships being asked to dock with a larger vessel, mouseLDoubleClick() does nothing,

Unless some of the selected ships happen to be repair corvettes. These are ordered to support. If they were the only ships selected, mouseLDoubleClick returns true and processing stops there: the corvettes will support and not dock. Otherwise it returns false and mrRegionProcess makes all the ships dock, including the repair corvettes (you may hear: "Support command acknowledged", then they dock anyway).

What a mess. Why did they have to split the double click processing to two different places? I am also quite confused about the roles of selSelected and mouseCursorSelect.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 05, 2007 7:49 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
shevek wrote:
Why did they have to split the double click processing to two different places?

Judging by the amount of commented out code and what it refers to I suspect that the original implementation/intention of mouseLDoubleClick() was to handle double clicks no matter where they occurred in the game. It makes it easy to debug double-click behaviour with a one-stop shop but they evidentally came to a more logical viewpoint: context is everything...

shevek wrote:
Unless some of the selected ships happen to be repair corvettes.

Having played around with ship combinations it seems that the bug is really that repair corvettes have been lumped in with support frigate behaviour. The current behaviour is correct for support frigates since they can never dock again, so support is their only order possibility. Repair corvettes can both dock and support. I'd have said that repair-corvette "contaminated" selections of fighters/corvettes should all dock (which is what the mouse cursor shows). If you want the repair corvette to support instead you have the option of control-Z; the alternative behaviour (ship-specific docking) has no keyboard equivalent.

So then we have the more interesting case of fighter/repair corvette/support frigate/whatever combinations. I'd say that anything able to dock in the selection should dock and everything else should be filtered out. Support frigates should retain their previous orders, not change to support the Mothership/Carrier. It's not what the mouse cursor indicates will happen and there shouldn't be any secondary side effects. A support order would have to be made more explicitly.

(On a personal note, thanks for bringing this topic up as it's allowed me to understand the exceedingly annoying behaviour of a support frigate continually driving around through my fighter squadrons when I issue a support order on them. I expected the frigate/capital repair beam support behaviour to kick in, not the drunk driver chaos that currently ensues...)

shevek wrote:
I am also quite confused about the roles of selSelected and mouseCursorSelect.

I believe selSelected is just intended for transferring MaxSelection data around. This is not an isolated instance; there are lots of globally accessable buffers of various types throughout the codebase. I can only assume that Relic had major memory problems or wanted to limit the potential for creating memory leaks but I'm just guessing here. As it is, I've seen at least one bug caused by code reading one such global buffer, storing a temporary value into it and then reading it back again assuming it was still the original value... Having said that, in this particular case, selSelected may be a storage area dedicated to filtering operations so that original selections (in this case mouseCursorSelect) are not corrupted during processing.

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 2:44 am 
Offline
coder

Joined: Mon Jan 29, 2007 2:45 pm
Posts: 61
OK, I committed the fix. It is not exactly what you describe but at least it fixes the immediate problem of the targeted docking command not being available at all for repair corvettes.

By the way, it's z, not control z. At least on the PC you don't need to press control. Similarly for g.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 06, 2007 4:30 am 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
shevek wrote:
By the way, it's z, not control z. At least on the PC you don't need to press control. Similarly for g.

I wondered if anyone would notice my mistake. Force of habit due to attack band-boxing :D

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group