Ship PP/RP production and Nanite Swarm/Meteor Blizzard fields

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

Moderators: Oberlus, Oberlus

Post Reply
Message
Author
User avatar
Oberlus
Cosmic Dragon
Posts: 2719
Joined: Mon Apr 10, 2017 4:25 pm

Ship PP/RP production and Nanite Swarm/Meteor Blizzard fields

#1 Post by Oberlus » Tue Jun 16, 2020 8:14 am

Nanite Swarm fields grants +1 PP/turn to each ship that enters the field. Meteor Blizzard grants +1 RP/turn.

Code: Select all

        EffectsGroup    // increase ship structure, grant industry
            scope = And [
                Ship
                WithinDistance distance = Source.Size * 0.9 condition = Source
            ]
            stackinggroup = "NANITE_SWARM_SHIP_REPAIR"
            effects = [
                SetStructure value = Value + 5
                SetIndustry value = max(1, Value)
            ]

Code: Select all

        EffectsGroup    // damage ship structure, grant research
            scope = And [
                Ship
                WithinDistance distance = Source.Size * 0.9 condition = Source
            ]
            stackinggroup = "METEOR_BLIZZARD_SHIP_EFFECTS"
            effects = [
                SetResearch value = max(1, Value)
            ]
The stackinggroup prevents getting the effect more than once.


Issues with the PP&RP effects:
  1. Do not expire after exiting the fields.
  2. Do not stack with other possible RP/PP outputs from hulls, parts, techs or policies, due to the "max(1, Value)".
For (1) I guess there should be some FOCS effect that zeroes ships PP/RP/IP production at start of every turn.
For (2) I guess it would be OK to change "max(1, Value)" to "Value + 1", if solution for (1) above is right.

How/where should I zero the resource outputs of ships?
I can't find a similar effect for planets (resource centers), so I don't really know if that is the right solution. Maybe it is something handled by the backend?

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

Re: Ship PP/RP production and Nanite Swarm/Meteor Blizzard fields

#2 Post by Ophiuchus » Tue Jun 16, 2020 9:09 am

Typically we do this by adjusting target meters in the main effect and having a growth effect to adjust the current value.

Ship.cpp sais the active paired meters are there:

Code: Select all

    AddMeter(METER_TARGET_INDUSTRY);
    AddMeter(METER_INDUSTRY);
    AddMeter(METER_TARGET_RESEARCH);
    AddMeter(METER_RESEARCH);
    AddMeter(METER_TARGET_INFLUENCE);
    AddMeter(METER_INFLUENCE);
Also your suggestion should work
Oberlus wrote:
Tue Jun 16, 2020 8:14 am
For (1) I guess there should be some FOCS effect that zeroes ships PP/RP/IP production at start of every turn.
For (2) I guess it would be OK to change "max(1, Value)" to "Value + 1", if solution for (1) above is right.
Both effects use Value - if i am not mistaken that means the immediate value - so "Value + 1" should not be necessary.

The reset or growth effects for ships could be either added to species (if it is ok to exclude monsters - probably not a good idea), to each hull type (probably not a good idea), or to a base tech, which would be applied once to all ships in the universe. That "once" could be done using a stacking group and/or by activation only for the empire which has the lowest surviving empire id (or something similar). We do not have a place for once-per-universe effect and i am not sure how the client calculation interacts.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Furthermore, I propse... we should default to four combat rounds instead of three ...for the good of playerkind.

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

Re: Ship PP/RP production and Nanite Swarm/Meteor Blizzard fields

#3 Post by Oberlus » Tue Jun 16, 2020 9:40 am

Ophiuchus wrote:
Tue Jun 16, 2020 9:09 am
Typically we do this by adjusting target meters in the main effect
What is "the main effect" in this case? The ones I've quoted?

I don't know if it is possible to control the exit of a ship from a field within the field EffectsGroups, considering that there could be several fields, even overlapping.

Ophiuchus wrote:
Tue Jun 16, 2020 9:09 am
Both effects use Value - if i am not mistaken that means the immediate value - so "Value + 1" should not be necessary.
I don't understand.
Imagine we had a part (or hull, or whatever) that granted research to a ship, say +2, so that ship's research meter is 2. That ship enters a meteor blizzard, which should up the research meter by 1. Applying "max(1, Value)" would make the meter stay at 2, while we want it to be 3.

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

Re: Ship PP/RP production and Nanite Swarm/Meteor Blizzard fields

#4 Post by Geoff the Medio » Tue Jun 16, 2020 12:00 pm

Oberlus wrote:
Tue Jun 16, 2020 8:14 am
How/where should I zero the resource outputs of ships?
I can't find a similar effect for planets (resource centers), so I don't really know if that is the right solution. Maybe it is something handled by the backend?
The resource target meters should be added here so that they get reset every turn, like here for resourcecenters (planets). If the target meters are reset, then the active meters can be modified with standard meter growth / decay effects.

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

Re: Ship PP/RP production and Nanite Swarm/Meteor Blizzard fields

#5 Post by Oberlus » Tue Jun 16, 2020 9:16 pm

Ophiuchus wrote:
Tue Jun 16, 2020 9:09 am
The reset or growth effects for ships could be either added to species (if it is ok to exclude monsters - probably not a good idea), to each hull type (probably not a good idea), or to a base tech, which would be applied once to all ships in the universe. That "once" could be done using a stacking group and/or by activation only for the empire which has the lowest surviving empire id (or something similar). We do not have a place for once-per-universe effect and i am not sure how the client calculation interacts.
Alternatively, and I like it because it makes more sense IMO, we could exclude monsters (owned and unowned) from getting the research/production boosts.
I found there is a "Monster" condition, so I added "Not Monster" to the fields scopes. It seems it works, but I could not test it for owned monsters (yet).
Geoff the Medio wrote:
Tue Jun 16, 2020 12:00 pm
the active meters can be modified with standard meter growth / decay effects.
Thank you.

Post Reply