Orbital Drydock should repair ally ships

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderator: Oberlus

Message
Author
User avatar
swaq
Space Dragon
Posts: 384
Joined: Tue Aug 20, 2019 1:56 pm

Orbital Drydock should repair ally ships

#1 Post by swaq »

Currently the orbital drydock will only repair your own ships but snubs your allies' ships. This makes a coordinated attack with multiple allied empires cumbersome because you need to have a separate planet for each empire each with its own drydock to fall back to for repairs. I feel like it would be better for gameplay (and make more sense) if drydock repairs could be shared between allies.

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Orbital Drydock should repair ally ships

#2 Post by Oberlus »

Related to this:

The techs Fleet Repair and Advanced Damage Control does not apply their on-supply effects while on allied supply.
So, you can replenish fighters and fuel from your ally supply, but can't do repairs. I consider that a bug.

Edit: I guess all this is processed in SupplyManager:Update()?

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Orbital Drydock should repair ally ships

#3 Post by Ophiuchus »

Oberlus wrote: Sat Dec 14, 2019 10:01 am
Edit: I guess all this is processed in SupplyManager:Update()?
The question is if you should "always" be supply connected if you are allied-supply-supply-connected or not.

I think this should be decided case to case in FOCS. There might be things which should only count if in your own supply. Of course allied-supply-connected could be taken as default.

Someone should enumerate all the in-supply cases and propose a solution.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Orbital Drydock should repair ally ships

#4 Post by Oberlus »

Another in-supply effect, that is working in a confusing fashion right now regarding allied supply, is connection to a source of species for colony buildings/ships.
In current game, when trying to build in a supply group A a species that you have in a supply group B, both groups not directly connected but connected through a supply group of an ally, sometimes we can build the colony building and sometimes we can't. Maybe the logic underneath is that in some occasions your supply groups are actually connected directly (but you don't see your supply color in between because your ally's supply is stronger in some starlanes, although your supply does propagate) and you can build the colony, and sometimes your supply groups are not connected themselves and the species source requirement is not shared among allies.
I don't have a strong opinion on what should happen in that case. Maybe current mechanic is good enough if we don't want to allow direct sharing of species among allies, but empires can in any case gift colony ships and colonies to their allies, so not allowing direct species sharing means we do allow it only through micromanagment. So maybe it would be easier to just share species through allied supply. However, I think that could be rather difficult regarding how supply groups work if it implies considering the supply group of two empires the same one (would then thay share the tech effects of the other empire? and problems like that).

But I am sure not sharing repairs is a bummer and dificults coordinated attacks of allies quite a bit, both in terms of coordination and attack power. If we do want to give that kind of advantage to single empires versus allied empires (because we think otherwise the allieances are OP), then it's ok, but if we find out that alliances of small empires versus big single empires are UP then we should share supply for repair and the drydock repair effect. The above mentioned problem regarding supply management could also apply here.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Orbital Drydock should repair ally ships

#5 Post by Geoff the Medio »

Oberlus wrote: Sat Dec 14, 2019 11:57 amMaybe the logic underneath is that in some occasions your supply groups are actually connected directly (but you don't see your supply color in between because your ally's supply is stronger in some starlanes, although your supply does propagate)...
That doesn't happen. Only one empire can supply each system. Supply doesn't propagate where it's not shown; empires' supply blocks other empires' supply from propagating, or is blocked by it.
But I am sure not sharing repairs is a bummer and dificults coordinated attacks of allies quite a bit, both in terms of coordination and attack power. If we do want to give that kind of advantage to single empires versus allied empires (because we think otherwise the allieances are OP), then it's ok, but if we find out that alliances of small empires versus big single empires are UP then we should share supply for repair and the drydock repair effect. The above mentioned problem regarding supply management could also apply here.
I'd be inclined to have allied repair / resupply be a policy card. ie. if you adopt this policy or policies, then your allies can repair in your supply network (or perhaps both you can in their network and they an in yours if you have adopted the policy).

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Orbital Drydock should repair ally ships

#6 Post by Oberlus »

Geoff the Medio wrote: Sat Dec 14, 2019 2:35 pm I'd be inclined to have allied repair / resupply be a policy card. ie. if you adopt this policy or policies, then your allies can repair in your supply network (or perhaps both you can in their network and they an in yours if you have adopted the policy).
I love that idea.

Meanwhile, for current master, make allied repair the default (same as fuel/fighter resupply).

The part about drydock can be done FOCS-only I think.

The issue about species sharing (why sometimes you can build a species you don't have in that supply group, sometimes you can't) is of secondary importance (first we need to have saves to debug it, and you can workaround with colony ships).
The other two would be great to have solved asap for following multiplayer games.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Orbital Drydock should repair ally ships

#7 Post by Vezzra »

Oberlus wrote: Sat Dec 14, 2019 11:57 amMaybe current mechanic is good enough if we don't want to allow direct sharing of species among allies, but empires can in any case gift colony ships and colonies to their allies, so not allowing direct species sharing means we do allow it only through micromanagment. So maybe it would be easier to just share species through allied supply.
There is a difference in terms of game mechnics though: If you allow direct sharing of species among allies, you can't be allied without also sharing your species. If you have to gift a colony or colony ship to whoever you want to share that species with, you have more options: you can be allied, but don't have to necessarily share your species.

The latter is going to be desired in certain cases. You might not always want to share your species with everyone you might want to be allied with.

However, unitl sufficiently differentiated diplomatic options are implemented, for the sake of preventing micromanagement, allowing species sharing with allies by default might be preferred. We just need to be aware of the consequences/limitations/annoyance that comes with that.

User avatar
Vezzra
Release Manager, Design
Posts: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Orbital Drydock should repair ally ships

#8 Post by Vezzra »

Geoff the Medio wrote: Sat Dec 14, 2019 2:35 pmI'd be inclined to have allied repair / resupply be a policy card. ie. if you adopt this policy or policies, then your allies can repair in your supply network (or perhaps both you can in their network and they an in yours if you have adopted the policy).
Sounds like a good idea. However, until that is implemented, allowing allied repair/resupply (which includes letting Orbital Drydocks repair allied ships) should be done. Because I agree, the current inconsistencies when it comes to what works through allied supply and what doesn't can be considered buggy.

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Orbital Drydock should repair ally ships

#9 Post by o01eg »

Vezzra wrote: Sun Dec 15, 2019 2:47 pm
Geoff the Medio wrote: Sat Dec 14, 2019 2:35 pmI'd be inclined to have allied repair / resupply be a policy card. ie. if you adopt this policy or policies, then your allies can repair in your supply network (or perhaps both you can in their network and they an in yours if you have adopted the policy).
Sounds like a good idea. However, until that is implemented, allowing allied repair/resupply (which includes letting Orbital Drydocks repair allied ships) should be done. Because I agree, the current inconsistencies when it comes to what works through allied supply and what doesn't can be considered buggy.
Can we land game rule to manage it in 0.4.9? Maybe even without implementation, just to make it possible later without breaking compatibility in stable release.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Orbital Drydock should repair ally ships

#10 Post by Oberlus »

[15 dic 18:47:05] Oberlus: I'm checking DRYDOCK.focs.txt and the change needed is something to allow for allied ships, instead of current "OwnedBy empire = Source.Owner" in the scope
[15 dic 18:47:37] o01eg: Is there FOCS expression for allies?
[15 dic 18:47:56] Oberlus: I'm afraid there's none, have never seen it
[15 dic 18:52:47] o01eg: There some struct EmpireAffiliationSimpleMatch which uses dimplomacy
[15 dic 18:53:39] o01eg: But it checks status >= DIPLO_PEACE
[15 dic 18:55:27] o01eg: It will work for teamed game because there only war or peace/alliance
[15 dic 18:56:45] Oberlus: good enough for next game then?
[15 dic 18:59:42] o01eg: Yes, but if it's a content changes, not the server-only code, it better to implement before release.
[15 dic 19:10:49] Oberlus: I can't seem to find what would be FOCS keyword to check for allied
OwnedBy is defined at https://github.com/freeorion/freeorion/ ... 1.cpp#L192

It is a combination of five:
https://github.com/freeorion/freeorion/ ... r1.cpp#L94

Code: Select all

        owned_by_1
            =   (   tok.OwnedBy_
                 >> label(tok.Empire_)
                ) > int_rules.expr
            [ _val = construct_movable_(new_<Condition::EmpireAffiliation>(deconstruct_movable_(_1, _pass))) ]
            ;

        owned_by_2
            =   tok.OwnedBy_
            >>  label(tok.Affiliation_) >> tok.AnyEmpire_
            [ _val = construct_movable_(new_<Condition::EmpireAffiliation>( AFFIL_ANY )) ]
            ;

        owned_by_3
            =   tok.Unowned_
            [ _val = construct_movable_(new_<Condition::EmpireAffiliation>( AFFIL_NONE )) ]
            ;

        owned_by_4
            =   tok.Human_
            [ _val = construct_movable_(new_<Condition::EmpireAffiliation>( AFFIL_HUMAN )) ]
            ;

        owned_by_5
            =  ((omit_[tok.OwnedBy_]
                 >>  label(tok.Affiliation_) >> empire_affiliation_type_enum
                 >>  label(tok.Empire_)    ) >  int_rules.expr)
            [ _val = construct_movable_(new_<Condition::EmpireAffiliation>(deconstruct_movable_(_2, _pass), _1)) ]
            ;

        owned_by
            %=  owned_by_1
            |   owned_by_2
            |   owned_by_3
            |   owned_by_4
            |   owned_by_5
            ;
EmpireAffiliationSimpleMatch is defined here:
https://github.com/freeorion/freeorion/ ... .cpp#L1165

And more specifically, the part of code that checks for that status >= DIPLO_PEACE is this one, within a switch(m_affiliation) in the operator() definition:

Code: Select all

            case AFFIL_ALLY: {
                if (m_empire_id == ALL_EMPIRES)
                    return false;
                if (m_empire_id == candidate->Owner())
                    return false;
                DiplomaticStatus status = Empires().GetDiplomaticStatus(m_empire_id, candidate->Owner());
                return (status >= DIPLO_PEACE);
                break;
            }
I don't understand the code, at all (what's m_affiliation would be the first question, the second one is what is written in FOCS to get to that peace of C++ code).
Does that really serve our purposes of FOCS checking for allied/peaceful drydocks in the system?
I can't seem to find the FOCS keywords for such condition, something like "OwnedBy Source.AlliedEmpires"

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Orbital Drydock should repair ally ships

#11 Post by o01eg »

I found some usage of it:

Code: Select all

scripting/species/SP_SLY.focs.txt:53:                        Not OwnedBy affiliation = EnemyOf empire = Source.Owner
scripting/ship_parts/Bombard/SP_EMO.focs.txt:19:                    OwnedBy affiliation = EnemyOf empire = Source.Owner
scripting/ship_parts/Armour/AR_ROCK_PLATE.focs.txt:15:                OwnedBy affiliation = AllyOf empire = Source.Owner
scripting/ship_parts/Armour/AR_CRYSTAL_PLATE.focs.txt:15:                OwnedBy affiliation = AllyOf empire = Source.Owner
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Orbital Drydock should repair ally ships

#12 Post by o01eg »

Looks like techs in techs/ship_parts/damage_control can be altered like Drydock building but I cann't found where ships replenish fighters in supply.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Orbital Drydock should repair ally ships

#13 Post by o01eg »

o01eg wrote: Sun Dec 15, 2019 6:56 pm Looks like techs in techs/ship_parts/damage_control can be altered like Drydock building but I cann't found where ships replenish fighters in supply.
Oh, looks like fighters are already resupplied in allies' supply because test is called with ALLOW_ALLIED_SUPPLY argument.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

o01eg
Programmer
Posts: 2004
Joined: Sat Dec 10, 2011 5:46 am

Re: Orbital Drydock should repair ally ships

#14 Post by o01eg »

If I have a boolean rule RULE_ENABLE_ALLIED_REPAIR how can I replace

Code: Select all

OwnedBy empire = Source.Owner
with

Code: Select all

OwnedBy affiliation = AllyOf empire = Source.Owner
if rule is On?
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-03-15.b3de094.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
Oberlus
Cosmic Dragon
Posts: 5715
Joined: Mon Apr 10, 2017 4:25 pm

Re: Orbital Drydock should repair ally ships

#15 Post by Oberlus »

o01eg wrote: Sun Dec 15, 2019 7:07 pm If I have a boolean rule RULE_ENABLE_ALLIED_REPAIR how can I replace

Code: Select all

OwnedBy empire = Source.Owner
with

Code: Select all

OwnedBy affiliation = AllyOf empire = Source.Owner
if rule is On?
Can it be the other way round? Make FOCS check a boolean from the rules to pick one OwnedBy definition.

Edit: the changes in the drydock focs file might not be that easy.
By just changing the scope condition, might we ne allowing for multiple repairs (from multiple allied drydocks)?

Post Reply