Condition matching comsats

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderator: Committer

Post Reply
Message
Author
Ophiuchus
Vacuum Dragon
Posts: 569
Joined: Tue Sep 30, 2014 10:01 am

Condition matching comsats

#1 Post by Ophiuchus » Mon Aug 27, 2018 5:15 pm

For the targetting preference I'm looking for a good FOCS condition to (not) match comsats.
Any Ideas?
Last edited by Ophiuchus on Fri Aug 31, 2018 7:28 am, edited 1 time in total.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: Condition matching comsats

#2 Post by Geoff the Medio » Mon Aug 27, 2018 6:42 pm

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)?

Ophiuchus
Vacuum Dragon
Posts: 569
Joined: Tue Sep 30, 2014 10:01 am

Re: Condition matching comsats

#3 Post by Ophiuchus » Tue Aug 28, 2018 7:00 pm

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.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: Condition matching comsats

#4 Post by Geoff the Medio » Wed Aug 29, 2018 9:30 am

Ophiuchus wrote:
Tue Aug 28, 2018 7:00 pm
The 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.

Ophiuchus
Vacuum Dragon
Posts: 569
Joined: Tue Sep 30, 2014 10:01 am

Re: Condition matching comsats

#5 Post by Ophiuchus » 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 pm
The 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.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

o01eg
Space Kraken
Posts: 178
Joined: Sat Dec 10, 2011 5:46 am

Re: Condition matching comsats

#6 Post by o01eg » Wed Aug 29, 2018 10:51 am

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 pm
The 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?
Gentoo Linux x64, gcc-7.3, boost-1.65.0
Ubuntu Server 18.04 x64, gcc-7.3, boost-1.65.1
Welcome to multiplayer server at freeorion-test.dedyn.io.Version 0.4.8
Donates are welcome: BTC:14XLekD9ifwqLtZX4iteepvbLQNYVG87zK

User avatar
Dilvish
AI Lead, Programmer
Posts: 4736
Joined: Sat Sep 22, 2012 6:25 pm

Re: Condition matching comsats

#7 Post by Dilvish » Wed Aug 29, 2018 3:46 pm

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.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Morlic
AI Contributor
Posts: 252
Joined: Tue Feb 17, 2015 11:54 am

Re: Condition matching comsats

#8 Post by Morlic » 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.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Ophiuchus
Vacuum Dragon
Posts: 569
Joined: Tue Sep 30, 2014 10:01 am

Re: Condition matching comsats

#9 Post by Ophiuchus » Thu Aug 30, 2018 10:24 am

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
Last edited by Ophiuchus on Thu Aug 30, 2018 10:30 am, edited 1 time in total.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Ophiuchus
Vacuum Dragon
Posts: 569
Joined: Tue Sep 30, 2014 10:01 am

Re: Condition matching comsats

#10 Post by Ophiuchus » Thu Aug 30, 2018 10:26 am

Dilvish wrote:
Wed Aug 29, 2018 3:46 pm
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.
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.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Ophiuchus
Vacuum Dragon
Posts: 569
Joined: Tue Sep 30, 2014 10:01 am

Re: Condition matching comsats

#11 Post by Ophiuchus » Fri Aug 31, 2018 7:29 am

What objects are actually matched by the "Armed" condition?
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

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

Re: Condition matching comsats

#12 Post by Geoff the Medio » Fri Aug 31, 2018 4:38 pm

Ophiuchus wrote:
Fri Aug 31, 2018 7:29 am
What 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.

Ophiuchus
Vacuum Dragon
Posts: 569
Joined: Tue Sep 30, 2014 10:01 am

Re: Condition matching comsats

#13 Post by Ophiuchus » Tue Sep 04, 2018 11:07 am

@geoffthemedio Thanks for the fast help!
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Post Reply