FreeOrion battle mechanics: questions

For topics that do not fit in another sub-forum.

Moderator: Oberlus

Message
Author
Lord Hong
Space Floater
Posts: 18
Joined: Tue Apr 14, 2020 12:42 pm
Location: Sagittarius A*

FreeOrion battle mechanics: questions

#1 Post by Lord Hong »

Hi, guys!

Thanks to Corona, I've just discovered FreeOrion for me, and I'm already playing my second game. It's great, I'm totally hooked!

And now I've started to wonder how to be smart when constructing new ships, and when going into a space battle. I did several searches on this forum, on the Wiki (https://freeorion.org/index.php/Main_Page) and then on the rest of the Internet for (freeorion) battle guide / mechanics / tactics. But I found only some bits here and there.

First two general questions:

Question 1: is there anywhere a description / guide / explanation of FreeOrion battle mechanics? Or any other source that I can use?

Question 2: does the game produce battle logs that I can access?

And now for some more specific questions:

Question 3: I understood that each battle turn has 3 rounds. Right?

If so, then let's assume we have ship A (30 structure / 5 damage / 0 shield) versus ship B (30 structure / 12 damage / 0 shield). The battle would only have one turn and would work out somewhat like this:

Round 1: A -> 18 structure | B -> 25 structure
Round 2: A -> 6 structure | B -> 20 structure
Round 3: A -> minus 6 structure | B -> 15 (20?) structure

=> Ship A is destroyed, B wins with 15 (or 20?) structure remaining.

Am I right so far?

Question 4: Interceptors, fighters, bombers vs. shields:

I understand that fighters etc. won't get a shields deduction from their damage when attacking a shielded ship. But are they programmed to go against shielded ships first, or will they randomly attack ANY ship in a fleet, with or without shields?

So if the other guy's got 3 unshielded ships and 1 with shields, and I've got (let's say) one bomber carrier and three destroyers without fighters: can I be sure that my carrier will definitely go against the other guys shielded ship first, or will that be a totally random choice?

Question 5: Flak cannons vs. interceptors, fighters, bombers:

Will flak cannons only defend the ship they're mounted on; or only the fleet of which their carrier is a part; or any other of my own ships during a battle? I'm asking this because I had the idea that I could specialize my fleets, like: building 10 big gun-only destroyers without flak, and then adding a specialized super bad ass flak ship, lets say a fractal hull with 5 armor platings and 9 flak cannons.

What will that flak ship defend during a battle: only itself, the other ships in its fleet, or any other of my ships during a battle?( And see question 4: having no shields itself, will it be attacked by enemy fighters at all?)

OK that's a lot of questions, and there are some more where those came from. But let's leave it at that.

I'd really be grateful for any answers!

Greetings :)

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

Re: FreeOrion battle mechanics: questions

#2 Post by Geoff the Medio »

Lord Hong wrote: Tue Apr 14, 2020 1:38 pmdoes the game produce battle logs that I can access?
Yes...
accessing combat log from sitrep
accessing combat log from sitrep
combat log.png (799.4 KiB) Viewed 2795 times

Lord Hong
Space Floater
Posts: 18
Joined: Tue Apr 14, 2020 12:42 pm
Location: Sagittarius A*

Re: FreeOrion battle mechanics: questions

#3 Post by Lord Hong »

Hell yeah! I had never clicked on that ...

Thanks!

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

Re: FreeOrion battle mechanics: questions

#4 Post by Oberlus »

Welcome, Lord Hong.
Lord Hong wrote: Tue Apr 14, 2020 1:38 pmQuestion 1: is there anywhere a description / guide / explanation of FreeOrion battle mechanics? Or any other source that I can use?
I don't know. If there isn't (wait for other answers) it would be nice to have one.
Question 2: does the game produce battle logs that I can access?
Yes. You can click in in the word "combat" in the SitRep windows to access the combat results. It has two tabs, the second one is the comprehensive log.
Question 3: I understood that each battle turn has 3 rounds. Right?
Yes. That can be changed in configuration, but it is not advisable.

[...]
Ship A is destroyed, B wins with 15 (or 20?) structure remaining.
Yes. And 15.
Shooting is simultaneous for all combatants (order is not relevant). So if a ship survives to the start of a new combat bout/round, it will use all its weapons even if it gets destroyed in that new bout.

Question 4: Interceptors, fighters, bombers vs. shields:

I understand that fighters etc. won't get a shields deduction from their damage when attacking a shielded ship. But are they programmed to go against shielded ships first, or will they randomly attack ANY ship in a fleet, with or without shields?
Each weapon (including fighter's weapon) will aim at one valid target picked randomly among all valid targets.

Valid targets of each weapon:

Mass Driver, Laser, Plasma, Death Rays: ships and planets.
Arc Disruptor: fighters (in general), ships and planets (i.e. anything).
Flak Cannons: fighters (in general)
Heavy Bombers: ships and planets.
Bombers: ships.
Fighters: fighters (in general) and ships.
Interceptors: fighters (in general).

/Edit: above applies to latest weekly test version, v0.4.9 release did not have the same behaviour/
Question 5: Flak cannons vs. interceptors, fighters, bombers:

Will flak cannons only defend the ship they're mounted on; or only the fleet of which their carrier is a part; or any other of my own ships during a battle?
They will target any enemy fighter, regardless of what are the targets of those enemy fighters. So you can be unlucky and have a flak cannon shooting at enemy interceptors (that would not attack any of your ships, only aim at your own fighters, if any) and skip bombers that would be killing the very ship with your flaks.
This means you can use interceptors not only to take down enemy fighters but also to smokescreen your own fighters, bombers and heavy bombers.
I'm asking this because I had the idea that I could specialize my fleets, like: building 10 big gun-only destroyers without flak, and then adding a specialized super bad ass flak ship, lets say a fractal hull with 5 armor platings and 9 flak cannons.
Totally doable. But keep in mind that then, if your flak ship dies, you lose all PD defence against enemy fighters.

Lord Hong
Space Floater
Posts: 18
Joined: Tue Apr 14, 2020 12:42 pm
Location: Sagittarius A*

Re: FreeOrion battle mechanics: questions

#5 Post by Lord Hong »

That made quite a lot clear to me, great, thanks!
Oberlus wrote: Tue Apr 14, 2020 2:16 pm Valid targets of each weapon:
(...)
Interceptors: fighters (in general).
(...)
enemy interceptors (that would not attack any of your ships, only aim at your own fighters, if any)
My present enemy (or prospective victim ;) ) posted a defense fleet in front of my own planet, containing 416 "fleet fighters" - ALL of them being interceptors. So a tailor made invasion fleet wouldn't actually need any flak cannons or own interceptors, because those 416 units won't be attacking my ships at all. Instead I'd concentrate my production on big guns with shields, in order to blow down the carriers themselves and all the rest, and then go for planet defenses. Like ignoring the flies, and clean out the trash itself...?

I've been taking a quick look around, and all of my AI "friends" seem to use ONLY interceptors as fighters-general (no bombers, no fighters-proper). (Can't the AI handle other fighter types?) So for the time being, I can stop producing ships with flak cannons & interceptors / fighters-proper, and concentrate on big guns. I'd need that stuff only if I had to use bombers to get through their shields. But then I'd have to add so much flak and stuff to shield those bombers, it would probably give better damage-per-PP value to just stock up on big guns to overcome their shields.

I may or may not be right in this particular game - but does that train of thought make any sense, or did I miss a point here?

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

Re: FreeOrion battle mechanics: questions

#6 Post by Oberlus »

Lord Hong wrote: Tue Apr 14, 2020 3:35 pm My present enemy (or prospective victim ;) ) posted a defense fleet in front of my own planet, containing 416 "fleet fighters"
Which FO version?
Previously, interceptors also attacked ships, and cannons attacked all fighters (which was a waste of damage output).

You can check it by looking at the FOCS file of interceptors: default/scripting/ship_parts/FighterHangar/FT_HANGAR_1.focs.txt
If it says

Code: Select all

    combatTargets = And [
        [[COMBAT_TARGETS_VISIBLE_ENEMY]]
        Fighter
    ]
then your enemy is screwed.
If that is not there, then you might have a tough battle ahead, if your (non-flak) cannons are going to target interceptors as well. That was the behaviour in v0.4.8, and changed only recently because the smokescreen that fighters could develop made shields and direct damage cannons pretty UP.
I've been taking a quick look around, and all of my AI "friends" seem to use ONLY interceptors as fighters-general
In current version that is still a problem, but being addressed. The AI team had some MIA members and it is taking time for the remaining champions to catch up with changes in code. v0.4.10 is expected to go out soon and it will most probably have that issue fixed.

Lord Hong
Space Floater
Posts: 18
Joined: Tue Apr 14, 2020 12:42 pm
Location: Sagittarius A*

Re: FreeOrion battle mechanics: questions

#7 Post by Lord Hong »

Oberlus wrote: Tue Apr 14, 2020 2:16 pm
Valid targets of each weapon:

Mass Driver, Laser, Plasma, Death Rays: ships and planets.
Bombers: ships.
Fighters: fighters (in general) and ships.
One more thought about that:

So Comsats might be extremely useful to smokescreen a planet or a defense fleet, right? And for offensive purposes (attacking a large fleet), I'd use their cheapest movable version, Mini-Asteroid Swarms. Mixing my 50-ship invasion fleet with 50 MAS (26.7 PP a piece => 1.335 k PP) would be like having a disposable single-use shield for my whole fleet, statistically reducing the damage he inflicts on me by half and saving me a lot of own losses (military power AND PP). In a two-turn fight I'd probably lose only 75% of my asteroids, so the PP-loss for that would only be about 1 k, saving me much, much more in ship-PP.

That's what I had in mind when I wrote I wanted to do battles the smart way ...

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

Re: FreeOrion battle mechanics: questions

#8 Post by Oberlus »

Lord Hong wrote: Tue Apr 14, 2020 3:51 pm So Comsats might be extremely useful to smokescreen a planet or a defense fleet, right?
Yes. How much is the base cost of your comsats? (I really need your FO version!)
Comsats have been updated from UTTERLY CHEAP to reasonably expensive, plus they now count for the fleet upkeep (cost of new ships goes up the more ships you have), and now exploiting comsats is not mandatory any more. Before that, any losing empire could stand a nice defense using just comsats and some armed ships.
And for offensive purposes (attacking a large fleet), I'd use their cheapest movable version, Mini-Asteroid Swarms. Mixing my 50-ship invasion fleet with 50 MAS (26.7 PP a piece => 1.335 k PP) would be like having a disposable single-use shield for my whole fleet, statistically reducing the damage he inflicts on me by half and saving me a lot of own losses (military power AND PP). In a two-turn fight I'd probably lose only 75% of my asteroids, so the PP-loss for that would only be about 1 k, saving me much, much more in ship-PP.
Indeed. We call that chaff: cheap hulls either empty or with some armor (that can be good sometimes, depending on damage of main weaponry of your enemy, if you get twice the chaff shots for less than twice the chaff cost).

Lord Hong
Space Floater
Posts: 18
Joined: Tue Apr 14, 2020 12:42 pm
Location: Sagittarius A*

Re: FreeOrion battle mechanics: questions

#9 Post by Lord Hong »

Oberlus wrote: Tue Apr 14, 2020 3:50 pm
You can check it by looking at the FOCS file of interceptors: default/scripting/ship_parts/FighterHangar/FT_HANGAR_1.focs.txt
If it says

Code: Select all

    combatTargets = And [
        [[COMBAT_TARGETS_VISIBLE_ENEMY]]
        Fighter
    ]
then your enemy is screwed.
If that is not there, then you might have a tough battle ahead, if your (non-flak) cannons are going to target interceptors as well. That was the behaviour in v0.4.8, and changed only recently because the smokescreen that fighters could develop made shields and direct damage cannons pretty UP.
I'm having 4.9 here. In my installation, FT_HANGAR_1.focs.txt contains this:

Code: Select all

    combatTargets = OrderedAlternativesOf [
        // Target Bombers and Heavy Bombers first
        And [
            [[COMBAT_TARGETS_VISIBLE_ENEMY]]
            Fighter
            Or [
               DesignHasPart name = "FT_HANGAR_3"
               DesignHasPart name = "FT_HANGAR_4"
            ]
        ]
        And [ [[COMBAT_TARGETS_VISIBLE_ENEMY]]  Fighter ]
        // if no fighters: target enemy ships
        And [ [[COMBAT_TARGETS_VISIBLE_ENEMY]]  [[COMBAT_TARGETS_NOT_DESTROYED_SHIP]] ]
    ]
Am I wrong, or does this here tell the AI fighters to attack my ships if I have no fighters of my own?

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

Re: FreeOrion battle mechanics: questions

#10 Post by Oberlus »

Lord Hong wrote: Tue Apr 14, 2020 4:05 pm Am I wrong, or does this here tell the AI fighters to attack my ships if I have no fighters of my own?
Yes. So those fighters are going to hit you. Not hard, though, they have low damage.
Real problem is what are going to target your weapons. Check out the .../ship_parts/ShortRange/SP_WEAPON_*.focs.txt files to be sure.
If there is no "combatTargets" entry, that means "target anything, without any special priority".

Lord Hong
Space Floater
Posts: 18
Joined: Tue Apr 14, 2020 12:42 pm
Location: Sagittarius A*

Re: FreeOrion battle mechanics: questions

#11 Post by Lord Hong »

Oberlus wrote: Tue Apr 14, 2020 4:12 pm Real problem is what are going to target your weapons. Check out the .../ship_parts/ShortRange/SP_WEAPON_*.focs.txt files to be sure.
If there is no "combatTargets" entry, that means "target anything, without any special priority".
Well, the files in .../ship_parts/ShortRange/ where named SR_WEAPON_[0-4]_1.focs.txt, but I guess it's these that you meant.

1_1 to 4_1 (= mass driver, laser, plasma, death ray) do not contain a combatTargets entry, only SR_WEAPON_0_1.focs.txt (flak cannons) have one:

Code: Select all

Part
    name = "SR_WEAPON_0_1"
    description = "SR_WEAPON_0_1_DESC"
    class = ShortRange
    damage = 1
    shots = 3
    NoDefaultCapacityEffect
    combatTargets = And [
        [[COMBAT_TARGETS_VISIBLE_ENEMY]]
        Fighter
    ]
    mountableSlotTypes = External
    buildcost = 20 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_PART_COST_MULTIPLIER]]
    buildtime = 1
    tags = [ "PEDIA_PC_DIRECT_WEAPON" ]
    location = OwnedBy empire = Source.Owner
    effectsgroups =
        [[WEAPON_BASE_DEFAULT_EFFECTS(SR_WEAPON_0_1)]]
    icon = "icons/ship_parts/flak.png"

#include "shortrange.macros"
#include "/scripting/common/upkeep.macros"
#include "/scripting/ship_parts/targeting.macros"
Only they are restricted (to fighters), it seems:

Code: Select all

combatTargets = And [
        [[COMBAT_TARGETS_VISIBLE_ENEMY]]
        Fighter
    ]
So the problem is that my mass drivers, lasers, plasmas and death rays are not restricted by their code and will shoot at everything, including the interceptors, and if my enemy's fleet has, like, 250 of them and 70 normal battle ships, then my ships will try to shoot the chaff first, which puts me at a HUGE disadvantage - right?

Lord Hong
Space Floater
Posts: 18
Joined: Tue Apr 14, 2020 12:42 pm
Location: Sagittarius A*

Re: FreeOrion battle mechanics: questions

#12 Post by Lord Hong »

Actually, I have no problem with the interceptors targeting fighters AND ships, as it seems to be with my version. It kind of gives a Star Wars battle feeling to the game, like "their X-Wings against my Death Star" ;)

But I do take issue with my primary guns (mass drivers to death rays) (and even the f...ing spinal antimatter cannon!! I looked it up!) being programmed to shoot into a cloud of hundreds of small interceptors. It's just nonsense, like Oberlus wrote:
That was the behaviour in v0.4.8, and changed only recently because the smokescreen that fighters could develop made shields and direct damage cannons pretty UP.
It was obviously not yet changed for v.0.4.9 (my version), and as it feels like a bug (not just to me), I'd like to change these four files myself. I understand that I'd have to insert a combatTargets part myself in each of these four files, telling them to only attack the class "ship", and IF there is no ship THEN the class "planet" as valid targets.

I tried to Google search https://raw.githubusercontent.com/freeorion/ for the corrected files in v0.4.10, but couldn't find them. If anyone reading this knows how to exactly phrase the necessary code lines for v0.4.9, please tell me! I'll then insert them into the SR_WEAPON files myself.

Pleeez? :cry:

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

Re: FreeOrion battle mechanics: questions

#13 Post by Oberlus »

Way easier if you just update to latest weekly test version.
Dunno if there is any code incompatibility with the code (some of the FOCS stuff might have needed updates in the backend).

defaultuser
Juggernaut
Posts: 854
Joined: Wed Aug 26, 2015 6:15 pm

Re: FreeOrion battle mechanics: questions

#14 Post by defaultuser »

As a more general point, when you build warships has a lot to do with the type of universe you set up. The greater the spacing, the less likely you will be to need warcraft early except for monsters or defended native planets. That should help guide your research path.

Lord Hong
Space Floater
Posts: 18
Joined: Tue Apr 14, 2020 12:42 pm
Location: Sagittarius A*

Re: FreeOrion battle mechanics: questions

#15 Post by Lord Hong »

Oberlus wrote: Tue Apr 14, 2020 8:30 pm Way easier if you just update to latest weekly test version.
Dunno if there is any code incompatibility with the code (some of the FOCS stuff might have needed updates in the backend).
Well, for now I'd REALLY like to stick with my non-test version. I see you're active on github, too. Maybe you could tell me where to find the current SR_WEAPONS files? I'll just try my luck with Ctrl-C & V-ing those code snippets, and see if it works ...

Post Reply