Page 1 of 1

Condition matching comsats

Posted: Mon Aug 27, 2018 5:15 pm
by Ophiuchus
For the targetting preference I'm looking for a good FOCS condition to (not) match comsats.
Any Ideas?

Re: Condition matching comsats

Posted: Mon Aug 27, 2018 6:42 pm
by Geoff the Medio
Define "comsats"...

-Has design name "SD_BASE_DECOY"?
-Has hull "SH_COLONY_BASE" and no parts?
-Has any hull and no parts?
-Maybe needs to have an owner (not be monster / independent)?

Re: Condition matching comsats

Posted: Tue Aug 28, 2018 7:00 pm
by Ophiuchus
The idea is to make SH_COLONY_BASE mostly useless as cannon fodder.

Probably SH_COLONY_BASE and no parts would do. But dont know how to script that.

I dont think that owner matters.

Re: Condition matching comsats

Posted: Wed Aug 29, 2018 9:30 am
by Geoff the Medio
Ophiuchus wrote: Tue Aug 28, 2018 7:00 pmThe idea is to make SH_COLONY_BASE mostly useless as cannon fodder.
Just that specific hull, or are there other similar ones that could be used instead if it was an overly specific condition?
Probably SH_COLONY_BASE and no parts would do. But dont know how to script that.
Just checking the hull should be relatively simple... something like

Code: Select all

DesignHasHull name = "SH_COLONY_BASE"
Testing how many parts is a bit trickier. There are conditions for checking if a ship's design has a particular part by name or by class, but not for any part. You can get how many parts are in a ship design using something like (not tested)

Code: Select all

PartsInShipDesign design = LocalCandidate.DesignID
which you can also put into a comparison condition like

Code: Select all

(PartsInShipDesign design = LocalCandidate.DesignID < 1)
Multiple conditions can be combined with And [ ... ] or Or [ ... ] conditions.

Re: Condition matching comsats

Posted: Wed Aug 29, 2018 10:45 am
by Ophiuchus
Geoff the Medio wrote: Wed Aug 29, 2018 9:30 am
Ophiuchus wrote: Tue Aug 28, 2018 7:00 pmThe idea is to make SH_COLONY_BASE mostly useless as cannon fodder.
Just that specific hull, or are there other similar ones that could be used instead if it was an overly specific condition?
Probably only that hull. The problem is that its so cheap to build that its offsets the balance against military ships. But we cant make it more expensive because of the roles it fullfills (mainly troop drops, also outpost/colony base). I am not aware of other hulls having this problem.

Re: Condition matching comsats

Posted: Wed Aug 29, 2018 10:51 am
by o01eg
Ophiuchus wrote: Wed Aug 29, 2018 10:45 am
Geoff the Medio wrote: Wed Aug 29, 2018 9:30 am
Ophiuchus wrote: Tue Aug 28, 2018 7:00 pmThe idea is to make SH_COLONY_BASE mostly useless as cannon fodder.
Just that specific hull, or are there other similar ones that could be used instead if it was an overly specific condition?
Probably only that hull. The problem is that its so cheap to build that its offsets the balance against military ships. But we cant make it more expensive because of the roles it fullfills (mainly troop drops, also outpost/colony base). I am not aware of other hulls having this problem.
What about forbid to build hulls without parts and make a "communicator" part for Comsat?

Re: Condition matching comsats

Posted: Wed Aug 29, 2018 3:46 pm
by Dilvish
Ophiuchus wrote: Wed Aug 29, 2018 10:45 am Probably only that hull. The problem is that its so cheap to build that its offsets the balance against military ships. But we cant make it more expensive because of the roles it fullfills (mainly troop drops, also outpost/colony base). I am not aware of other hulls having this problem.
I am pretty sure we can make it more expensive still, my strong recollection was that the current cost of 3 was considered an intermediate point to try. The colony base hull could still work just fine for outpost bases and colony bases if it were a bit more expensive than now, and I'm not sure we necessarily need to preserve its use for troop drops, not if it's still causing a significant problem for combat ship balance.

I think we could probably increase its cost to 4 without needing to adjust the AI troop drop code, though I should probably look that over a bit more, and then we'd need to pay attention to how it actually worked out.

Keep in mind we also have the compressed energy hull with base cost 5, and small asteroid hull with base cost 6, so for whatever situation you have in mind when you say "I am not aware of other hulls having this problem," might simply shift over to those other hulls if not addressed in a way that includes them.

It sounds pretty clearly like you are thinking the cost increase to three has been insufficient, why don't you make a feedback thread on that issue and clarify just where you are seeing recurring problems.

Re: Condition matching comsats

Posted: Wed Aug 29, 2018 5:24 pm
by Morlic
While it doesn't only affect decoy ships, a more robust approach could be to check if the ship is armed/has fighters... A fuel pod costs 1 PP and would circumvent the no-part approach.

Re: Condition matching comsats

Posted: Thu Aug 30, 2018 10:24 am
by Ophiuchus
Morlic wrote: Wed Aug 29, 2018 5:24 pm While it doesn't only affect decoy ships, a more robust approach could be to check if the ship is armed/has fighters... A fuel pod costs 1 PP and would circumvent the no-part approach.
Thanks, that reminded me looking at the actual costs

Code: Select all

grep -r 'buildcost.*' default/scripting/ship_* |     sed -e 's|[^/]*/||g' | awk '{printf "%-3s %-50s  %s %s %-4s %s %s %s \n", $4,$1,$2,$3,$4,$5,$6,$7}' | sort -n
Maybe the ShortRange weapons should prefer not to shoot at harmless ships, meaning those Ship without Bombard, ShortRange, FighterBay, or Troops parts (maybe also General parts, because e.g. the krill spawner).

Code: Select all

$ grep -ri "class =" default/scripting/ship_parts/ | awk '{print $4}' | sort | uniq 
Armour
Bombard
Colony
Detection
FighterBay
FighterHangar
Fuel
General
Industry
Research
Shield
ShortRange
Speed
Stealth
Trade
Troops

Re: Condition matching comsats

Posted: Thu Aug 30, 2018 10:26 am
by Ophiuchus
Dilvish wrote: Wed Aug 29, 2018 3:46 pmIt sounds pretty clearly like you are thinking the cost increase to three has been insufficient, why don't you make a feedback thread on that issue and clarify just where you are seeing recurring problems.
Not really. It's just a feeling left from the discussion and analysis before that. Didnt have time to thoroughly playtest, so I am not sure how much this still is a problem.

Re: Condition matching comsats

Posted: Fri Aug 31, 2018 7:29 am
by Ophiuchus
What objects are actually matched by the "Armed" condition?

Re: Condition matching comsats

Posted: Fri Aug 31, 2018 4:38 pm
by Geoff the Medio
Ophiuchus wrote: Fri Aug 31, 2018 7:29 amWhat objects are actually matched by the "Armed" condition?
Following the chain of code bits:
https://github.com/freeorion/freeorion/ ... .cpp#L1797
https://github.com/freeorion/freeorion/ ... p.cpp#L247
https://github.com/freeorion/freeorion/ ... ign.h#L530
https://github.com/freeorion/freeorion/ ... .cpp#L1309

It should match ships whose design has direct weapon parts or fighter bay or hangar parts.

Re: Condition matching comsats

Posted: Tue Sep 04, 2018 11:07 am
by Ophiuchus
@geoffthemedio Thanks for the fast help!