Decouple Assisting from repairing

Decouple Assisting from repairing

Requests for features in the spring code.

Moderators: Moderators, Moderators

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14616
Joined: 17 Nov 2005, 02:43

Decouple Assisting from repairing

Post by Forboding Angel »

At the moment, the engine sees them as one and the same.

canAssist is almost a redundant tag because of this.

Assistance should work if the unit being built was spawned from a nanoframe on that particular build.

There are ugly workarounds (one of which evo is using atm), but repairing and assisting should not be considered to be the same thing.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Decouple Assisting from repairing

Post by jK »

???

you said yourself there are tags for that already, so: what?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14616
Joined: 17 Nov 2005, 02:43

Re: Decouple Assisting from repairing

Post by Forboding Angel »

A unit cannot have repairing removed from it (canRepair = false) and still assist.

Removing repairing removes the ability to assist new construction projects. Assisting and repairing are linked, and they shouldn't be.
0 x

User avatar
Jools
XTA Developer
Posts: 2805
Joined: 23 Feb 2009, 16:29

Re: Decouple Assisting from repairing

Post by Jools »

What does assist mean? Same as guard? Would be nice if someone defined these once and for all.

I take it that guard := stalk, because that's all what it seems to do. You cannot set a cannon to guard a unit, it doesn't even work with canGuard = true.

In OTA that was possible. If the unit was under attack the cannon would shoot at whatever was attacking it. Something like this would be nice.

Also one issue following from what FA writes is that you can't have farks to just patrol to repair stuff, as they will automatically just clump to the nearest factory and stall its production. So yes, +1. Make us feel like running a factory again.
0 x

raaar
Metal Factions Developer
Posts: 824
Joined: 20 Feb 2010, 12:17

Re: Decouple Assisting from repairing

Post by raaar »

Jools wrote:What does assist mean? Same as guard? Would be nice if someone defined these once and for all.

I take it that guard := stalk, because that's all what it seems to do. You cannot set a cannon to guard a unit, it doesn't even work with canGuard = true.

In OTA that was possible. If the unit was under attack the cannon would shoot at whatever was attacking it. Something like this would be nice.

Also one issue following from what FA writes is that you can't have farks to just patrol to repair stuff, as they will automatically just clump to the nearest factory and stall its production. So yes, +1. Make us feel like running a factory again.
i think you can use arearepair + repeat to achieve the same effect.
0 x

User avatar
Anarchid
Posts: 1381
Joined: 30 Nov 2008, 04:31

Re: Decouple Assisting from repairing

Post by Anarchid »

Area repair will also tell units to "repair" any incomplete nanoframes.

Using buildpower to help build nanoframes not started by this constructor = assisting.

Area repairing around factory will still cause a constructor blob ganging up in the factory.
0 x

User avatar
Jools
XTA Developer
Posts: 2805
Joined: 23 Feb 2009, 16:29

Re: Decouple Assisting from repairing

Post by Jools »

I would like to revisit this request:

The problem with repair and assist is that of you try to automate this, eventually all units end up assisting, ie helping building, whereas in some cases repairing has priority to the user.

Would it be possible for example to have each builder with an odd unitnumber to only assist, and the ones with even unitnumber, just repair? Like the way parking is managed on congested streets.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14616
Joined: 17 Nov 2005, 02:43

Re: Decouple Assisting from repairing

Post by Forboding Angel »

First of all repairing needs to be completely separated from assisting, then we can proceed further.
0 x

Google_Frog
Moderator
Posts: 2443
Joined: 12 Oct 2007, 09:24

Re: Decouple Assisting from repairing

Post by Google_Frog »

Define "completely separated". Do you mean you want the tags to be able to control when they are allowed independent of when they other is allowed?
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14616
Joined: 17 Nov 2005, 02:43

Re: Decouple Assisting from repairing

Post by Forboding Angel »

Repairing is repairing something that has already been built.

Assisting is assisting building something but not necessarily having the ability to start the building itself.

Unit A has been built. Takes 50 points of damage. Unit B can repair but not assist. Unit B goes over to unit A, patches things up. Unit c is a builder and starts a construction project nearby. Unit b can repair but cannot assist so therefore it cannot assist in building the project that unit c started.

Unit D can assist but cannot repair. Unit D runs over and helps unit c with it's construction project. Unit E can assist and Repair, so it runs over and repairs unit A along with unit B then turns around and helps unit C finish the construction project.
0 x

Google_Frog
Moderator
Posts: 2443
Joined: 12 Oct 2007, 09:24

Re: Decouple Assisting from repairing

Post by Google_Frog »

That did not entirely answer my question. You gave a set of interactions instead of the mechanics behind the interactions. There are many possible implementations which fulfill a single given example.

Does "completely separated" include three new tags; repairCostEnergy, repairCostMetal and repairTime? These tags would control how much metal, energy and workerTime is required to bring a unit from 0 to full health. In fact this can already be implemented in lua with Spring.SetUnitCosts in UnitFinished. Although, you do not seem to be talking about repair time. But "completely separated" would seem to include tags which let you decouple build time and repair time.
0 x

User avatar
Jools
XTA Developer
Posts: 2805
Joined: 23 Feb 2009, 16:29

Re: Decouple Assisting from repairing

Post by Jools »

Extant.
float energyCostFactor Default: 0.0
How much of the original energy cost it requires to repair something.
0 x

Google_Frog
Moderator
Posts: 2443
Joined: 12 Oct 2007, 09:24

Re: Decouple Assisting from repairing

Post by Google_Frog »

Jools wrote:Extant.
float energyCostFactor Default: 0.0
How much of the original energy cost it requires to repair something.
No, energyCostFactor is a modrule.
0 x

raaar
Metal Factions Developer
Posts: 824
Joined: 20 Feb 2010, 12:17

Re: Decouple Assisting from repairing

Post by raaar »

how about adding a boolean repairPriority unitDef, if true, prioritize fully built units that have been damaged over nano frames.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14616
Joined: 17 Nov 2005, 02:43

Re: Decouple Assisting from repairing

Post by Forboding Angel »

Google_Frog wrote:
Does "completely separated" include three new tags; repairCostEnergy, repairCostMetal and repairTime? These tags would control how much metal, energy and workerTime is required to bring a unit from 0 to full health.
Yes
0 x

User avatar
Silentwings
Moderator
Posts: 3613
Joined: 25 Oct 2008, 00:23

Re: Decouple Assisting from repairing

Post by Silentwings »

What happens when a builder helps with construction of a unit that becomes damaged before being finished?
0 x

User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: Decouple Assisting from repairing

Post by code_man »

Silentwings wrote:What happens when a builder helps with construction of a unit that becomes damaged before being finished?
There is already tag(i dont know the name straight from the head) that allows only units at full health to be considered finished, in which case if it is activated the constructor would continue.
0 x

User avatar
AF
AI Developer
Posts: 20671
Joined: 14 Sep 2004, 11:32

Re: Decouple Assisting from repairing

Post by AF »

Assisting increases build progress
Repairing increases HP

For example in Starcraft, a Medivac can heal marines, it repairs them, but it cannot speed up construction of a building, construction and repair aren't the same thing

Something to note, if 2 units are given 2 identical build orders, they will both carry out said order, and the result is 2 units building 1 thing. Thus, assisting and repairing are already broken apart, the problem is:

- It's not possible for a unit to assist with a unit that it cannot build on its own
- The GUI issues repair commands when you right click with a builder on a unit under construction

We may also want to keep in mind that more flexibility would be good. E.g. in starcraft an SCV can repair a battlecruiser, but not a marine, and a medivac can heal a marine, but not a command centre, and protoss units can't be healed, but their shields can be recharged, and that's just Starcraft
0 x

Google_Frog
Moderator
Posts: 2443
Joined: 12 Oct 2007, 09:24

Re: Decouple Assisting from repairing

Post by Google_Frog »

Assisting increases build progress
Repairing increases HP
What about the case where you want the build progress and HP to increase at the same time (as they currently do).
We may also want to keep in mind that more flexibility would be good. E.g. in starcraft an SCV can repair a battlecruiser, but not a marine, and a medivac can heal a marine, but not a command centre, and protoss units can't be healed, but their shields can be recharged, and that's just Starcraft
I don't think the current build/assist system should be extended with the intention to cover cases such as Starcraft. The current system is so inflexible that I cannot see a reasonable way to extend it beyond its current OTA-like system. Would you have repair classes? Where would they go? What about shields etc..?

Spring already has a system which can handle many target classes: weapons. To make a very flexible repair system I would just make repair another type of weapon. It can probably even be done now with some gadget help. To make repair you would need:
  • The ability to control whether a weapon can target nanoframes (or more generally, the ability to change unit categories on the fly).
  • An instant-hit weapon type that only collides with its target.
  • The ability to give a weapon negative damage (I have not checked if this works currently, it does not sound intentionally supported).
Then on the game side of things:
  • Make an instant hit weapon that can only target friendly, non-nanoframes.
  • Further set up the categories so it can only target mechanical units (for the SCV case).
  • Give the weapon a resource cost.
  • Set a whole bunch of armour types to make each unit heal at the correct rate for its resource cost.
I am unsure whether cost per shot is currently enough to ensure consistent repair costs.

Can units acquire allied targets if they have weapons which can fire at allies? If not this could be added and then we have Starcraft auto-heal and auto-repair as well.

A similar system could be used for assist with a weapon which adds to build progress.. The current assist system has many benefits though, for example you can place two construction orders on the same location and have one worker assist the other. The current construction system would be even harder to replace, especially the UI. Construction units could automatically target the nanoframes but by this point the system becomes messy.

Replacing the current systems is not worthwhile but I think it would be worthwhile to generalize weapons to the extent that they can work well as an implementation of Starcraft repair.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10253
Joined: 24 Jan 2006, 21:12

Re: Decouple Assisting from repairing

Post by PicassoCT »

but they are called weapons..
0 x

Post Reply

Return to “Feature Requests”