FreeOrion battle mechanics: questions

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

Moderator: Oberlus

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

Re: FreeOrion battle mechanics: questions

#16 Post by Oberlus »

Lord Hong wrote: Tue Apr 14, 2020 9:13 pm 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 ...
You can find them here: https://github.com/freeorion/freeorion/ ... ShortRange
Those are from latest weekly test build. Change "weekly-test-builds" to "master" for the latest (although they are identical right now).

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

Re: FreeOrion battle mechanics: questions

#17 Post by Lord Hong »

Oberlus wrote: Tue Apr 14, 2020 10:26 pm You can find them here: https://github.com/freeorion/freeorion/ ... ShortRange
Those are from latest weekly test build. Change "weekly-test-builds" to "master" for the latest (although they are identical right now).
Thanks a lot. At first glance, the syntax and everything else looked just like in the 0.4.9 files, and I'm sure it WOULD HAVE worked. But now this problem: I'm having the snap installation of FreeOrion. And there seems to be some security thing with snap that won't allow me to change ANYTHING in this folder - even as root! Something about the "file system", it says. WTF?!! Couldn't find a way to get around that :(

I had already been surprised that snap gets its own top-level folder (in / !). That's a hell of a privilege. Seems to me that snap is doing some stuff on my system that I'm not really sure I want as a Linux user. Maybe an issue with its "sandbox" concept...?

Now that was a cold one. And I was so close. I don't like snap :(

But once more, thanks! Especially to Oberlus.

This thread has now branched off into a detail problem. However, I'm not yet closing it, as I might have some more questions about battle mechanics later on! But for now, don't let the bedbugs bite ;)

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

Re: FreeOrion battle mechanics: questions

#18 Post by Oberlus »

About snap problems try posting at its dedicated thread in this forum. Ophiuchus might be able to help.

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

Re: FreeOrion battle mechanics: questions

#19 Post by Lord Hong »

Oberlus wrote: Tue Apr 14, 2020 11:24 pm About snap problems try posting at its dedicated thread in this forum. Ophiuchus might be able to help.
OK, when I'm not so pissed off anymore, I'm going to try that ... Thank you once more. But for now, trying to not loose my fun with FreeOrion, I'm getting back to battle mechanics:

Questions 6: About species with piloting skills:

I recently "welcomed" the Mu Ursh into my empire (plus 2 piloting skill). If I produce my ships on their world, I'll get them as crew and have these bonuses:
  • Plus one flak shot per skill level. That's clear: flak cannons will now have 3+2=5 shots each.
  • Big guns -> plus "one level" damage (?) per piloting skill level. I guess that means when I'm having Death Ray 2, it's like already having Death Ray 4. But what would that mean when you are already having Death Ray 4? Would you now get, like, a virtual Death Ray 6? Shot damage of 40?
  • Fighters on a Mu Ursh ship: will they also get some kind of bonus, like additional damage or attacks etc.?
Questions 7: About flak cannons:
  • Flaks will have 3 shots. 3 shots per battle turn, or 3 shots per battle round (=> 9 shots per battle turn)? So, how many fighters will they take down during one turn - 3 or 9?
  • Will every single flak shot be a hit, or is that subject to randomness?
  • Is a single flak hit enough to take out a fighter?
  • Will an AI ever use flak cannons in its ship designs? In my present game, I don't see any.

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

Re: FreeOrion battle mechanics: questions

#20 Post by Oberlus »

Lord Hong wrote: Wed Apr 15, 2020 12:02 am OK, when I'm not so pissed off anymore, I'm going to try that ...
BTW, I use in Linux FO compiled from source (using git) and weekly test builds when in Windows.
trying to not loose my fun with FreeOrion
Please, don't, I expect you'll be able to join multiplayer games. Way more fun and competitive than against AI.

Big guns -> plus "one level" damage (?) per piloting skill level. I guess that means when I'm having Death Ray 2, it's like already having Death Ray 4. But what would that mean when you are already having Death Ray 4? Would you now get, like, a virtual Death Ray 6? Shot damage of 40?
Yes.
Big guns' bonuses per level of pilot skill:
MD: +1
Laser: +2
Plasma: +3
DR: +5

So maximum damage with the greatest pilot species (Misiorla, +3 levels) is 9, 17, 27 and 45, respectively.
Fighters on a Mu Ursh ship: will they also get some kind of bonus, like additional damage or attacks etc.?
I can't remember how was that on v0.4.9 release. Let's check it out:
  • Go to https://github.com/freeorion/freeorion
  • Select Release-v0.4.9 branch instead of default master (which takes us to https://github.com/freeorion/freeorion/ ... ase-v0.4.9)
  • Navigate to the scripting folder: default -> scripting (everything related to FOCS is within that folder).
  • Species pilot trait should be somewhere in the species folder: https://github.com/freeorion/freeorion/ ... ng/species
  • All those files in there are for each species, what we are looking for won't be in any of those, but let's see Mu Ursh anyway:

    Code: Select all

         [[GREAT_WEAPONS]]
    That's a macro for the code of great pilot trait (it seems it was named "weapons trait" in the past and got renamed to "pilot" at some point).
    The macros are included from other files (include clauses at the end of each file):

    Code: Select all

    #include "common/*.macros" <-- This one is the "common" folder within default/scripting/species
    #include "/scripting/common/*.macros" <-- This one is is referred to default folder, for macros common to all FO and not only species
    Since pilots is a species trait (and not general to all FO) lets go to species/common folder
  • Another big bunch of files in there. But the one we are looking for is easy to spot: https://github.com/freeorion/freeorion/ ... ons.macros
  • In that file we have the macros for BAD_WEAPONS... GOOD_WEAPONS... GREAT_WEAPONS (this is it):
    For SR_WEAPONS_*_1 (specified in "activation") we see it is adding +2, +4, +6 and +10 (in "effects"), which are the +2 levels we already know.
    For fighters (i.e. FT_HANGAR_*) we get this:

    Code: Select all

               effects = [
                    SetMaxSecondaryStat partname = "FT_HANGAR_1" value = Value + 1
                    SetMaxSecondaryStat partname = "FT_HANGAR_2" value = Value + 2
                    SetMaxSecondaryStat partname = "FT_HANGAR_3" value = Value + 3
                    SetMaxSecondaryStat partname = "FT_HANGAR_4" value = Value + 5
                ]
    That "SetMaxSecondaryStat" is less informative than the "SetMaxDamage" we see for the big guns. No, it's indeed confusing, because it actually refers to the damage of the fighters. You have to browse the C++ code to know it, but in short: SetMaxDamage adjusts shot damage for big guns, and number of fighters per hangar for fighters, while SetMaxSecondaryStat adjusts number of shots per combat bout for big guns, and shot damage per fighter for fighters.
    So we see they are getting +1, +2, +3 and +5 damage from the great pilot skill. Who is getting what? I often forget which fighter name corresponds to each hangar number. Let's check out the English stringtable in default/stringtables/en.txt and search for FT_HANGAR (we skip a few entries that are about Pedia pages and we get to the Ship Parts section):

    Code: Select all

    FT_HANGAR_0
    Decoy Hangar
    [...]
    FT_HANGAR_1
    Interceptor Hangar
    [...]
    FT_HANGAR_2
    Fighter Hangar
    [...]
    FT_HANGAR_3
    Bomber Hangar
    [...]
    FT_HANGAR_4
    Heavy-Bomber Hangar
    
    OK, so from 0 to 4 they are Decoys, Interceptors, Fighters, Bombers and Heavy Bombers (Decoy and Heavy Bomber not used in this version).
So GREAT_WEAPONS is giving Interceptors +1 damage (x4 interceptors that you have in an hangar), Fighters get +2 (x3), and Bombers get +3 (x2). Not bad during early game, but rather mild damage increase compared to what they get from late game tech upgrades (which you can see in https://github.com/freeorion/freeorion/ ... s/fighters).

Flaks will have 3 shots. 3 shots per battle turn, or 3 shots per battle round (=> 9 shots per battle turn)?
Here (in FO) we talk about Turns (game turns), and Combat Bouts/Rounds (each phase during a combat, that by default have 3 phases, so 3 bouts/rounds). Avoid calling it "battle turn".
And so the answer is 3 shots per bout (or round).
So, how many fighters will they take down during one turn - 3 or 9?
Well, since fighters are launched during first bout (or more specifically they get into combat at the end of first bout, so can't shoot or be targeted until second bout), flaks can't shoot at fighters during first bout. So flaks can take down 6 fighters per combat.
Also keep in mind this:
  • Interceptor Hangars have 4 Interceptors. Launch Bays can launch 4 Interceptors per bout.
  • Bomber Hangars have 2 Bombers. Launch Bays can launch 2 bombers per bout.
  • Fighter Hangars have 3 Fighters. Launch Bays can launch only 2 Fighters per bout.
So you may want to mount 3 Launch Bays for each pair of Fighter Hangar (some ship hulls are good for this).
Will every single flak shot be a hit, or is that subject to randomness?
Random. One flak could target the same fighter more than once, more than one flak could target the same fighter.
Is a single flak hit enough to take out a fighter?
Yes. All fighters will be dead on first scratch.
Will an AI ever use flak cannons in its ship designs? In my present game, I don't see any.
Dunno. I've seen AI designs full of flaks in the past, but can't remember if that was a thing before fighters came into play on v0.4.8 (IIRC). Arguably, in that version with the smokescreen effect against big gun shots, Interceptors are better except in rare occasions.

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

Re: FreeOrion battle mechanics: questions

#21 Post by Ophiuchus »

Lord Hong wrote: Tue Apr 14, 2020 11:14 pm I had already been surprised that snap gets its own top-level folder (in / !). That's a hell of a privilege. Seems to me that snap is doing some stuff on my system that I'm not really sure I want as a Linux user. Maybe an issue with its "sandbox" concept...?
I think snaps do not fit your use case on multiple levels. They are intended to auto-update. FOCS files are currently part of the "binary" side of the snap distribution, by which I mean your changes would be overwritten if i push a release to that channel. Although rest assured that wont happen often if at all for the 0.4.9 channel. But it certainly would matter if you subscribe to the weekly (latest/beta) channel. Note also that you can have multiple freeorion channels at the same time. E.g. while playing multiplayer i had a freeorion subscribed to that version and a freeorion_edge i used for testing the weekly releases.

About top level I think that is probably KISS it is intended to be distribution independent. Snap also needs root rights for installation. Flatpaks can be installed for a user with user rights. But somebody would need to step forward to provide flatpak configuration and provide the builds. We got an initial contribution with a working snapcraft.yml (probably sponsored by ubuntu) and I picked it up from there.

We started thinking of allowing overlays/looking for a plugin mechanism which would also work with the snap distribution. But I do not see that anytime soon.

Also if you only change the targeting conditions AI will be f* as would be greatly overrating interceptor effect. So in a sense you try to cheat ;)
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!

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

Re: FreeOrion battle mechanics: questions

#22 Post by Lord Hong »

@Oberlus: Thanks! I checked it out on Github, and I could follow that - I'm surprised myself ;)
Oberlus wrote: Wed Apr 15, 2020 8:04 am
So, how many fighters will they take down during one turn - 3 or 9?
Well, since fighters are launched during first bout (or more specifically they get into combat at the end of first bout, so can't shoot or be targeted until second bout), flaks can't shoot at fighters during first bout. So flaks can take down 6 fighters per combat.
Will every single flak shot be a hit, or is that subject to randomness?
Random. One flak could target the same fighter more than once, more than one flak could target the same fighter.
Let me now do a rough calculation - not really doing the maths thoroughly, just with some guess work: if you have 30 flak cannons in your fleet for 90 fighters in your enemy's fleet, that gives on average a 50% chance of hitting each fighter in round 2, and again 50% in round 3 => 75% take-down chance for each fighter in the first turn of a battle. So for my enemy's 484 fighters-strong fleet I should take along about 180 flaks to reduce the chaff to about 20-25% after the first turn.

Which would still leave me with about 100 pieces of chaff shielding my enemy's 75 ships, still leaving the effectiveness of my firepower at only about 40% in the next turn. (I haven't been taking into account that my enemy's fighters will be present only in each 2nd round, and reach full strength only in each 3rd round. And of course, I may have shot down some of his carriers already in round 1.)

That really tells me that I need to have fighter chaff of my own, or I'll be owned! And no bombers or fighters-proper, but interceptors, because it's only the numbers that count. (And because interceptors will, well, intercept, so they're also having a flak function themselves.)

I just hope that in the afterlife I won't be visited by the ghosts of all the computer game guys that I got killed in my life, because as a player of 4x games, I'd be totally f...ed then ...

OK, now for question 8: fighters are just numbers, they aren't assigned to a particular carrier, so if I shoot down a couple of carriers, their surviving fighters will be absorbed by the surviving carriers at the end of the turn, up to the maximum hangar capacity. The surplus surviving fighters will be lost then - right?

I'm just glad this fighter issue will be fixed in 0.4.10. The way it is now, interceptors are an exploit, and the AI forces you into using that exploit yourself. Also: I know FO is not a battle simulator, and space battle is only a sort of fantasy. But setting that all apart, in FO it should be a little bit more realistic. You know, realistic the way they do it in Star Wars where the august Emperor's Star Destroyers wouldn't waste their big-gun fire on the rebel scum's X-Wings, but take out their mother ships first. Just saying ;)

Greetings!
Last edited by Lord Hong on Thu Apr 16, 2020 1:26 am, edited 1 time in total.

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

Re: FreeOrion battle mechanics: questions

#23 Post by Lord Hong »

@Ophiuchus: I understand that using snap installations make it easier for people to just download and play FO, and that's OK as long as you don't want to go into its entrails.
Ophiuchus wrote: Wed Apr 15, 2020 8:18 am Also if you only change the targeting conditions AI will be f* as would be greatly overrating interceptor effect. So in a sense you try to cheat ;)
Yeah, I can see that. I'm just pissed that I came to understand that only after I've sunk 1000s of PP into my big, bad-ass, chaff-less invasion fleet :x
Ophiuchus wrote: Wed Apr 15, 2020 8:18 am About top level I think that is probably KISS it is intended to be distribution independent.
I have to say I'm not much into these things, but I always thought that snap is not much used outside Ubuntu anyway...? In that case, wouldn't it be better (and even more convenient for users) to distribute also the current dev version in the official repository? I mean, there'd be regular updates here, too. And users could be told before download that this is just the beta, so nobody could complain.

Well, I've made up my mind that my next game will be on the 0.4.10 beta.

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

Re: FreeOrion battle mechanics: questions

#24 Post by Oberlus »

Lord Hong wrote: Thu Apr 16, 2020 1:02 am[...]
That really tells me that I need to have fighter chaff of my own, or I'll be owned! And no bombers or fighters-proper, but interceptors, because it's only the numbers that count. (And because interceptors will, well, intercept, so they're also having a flak function themselves.)
When playing that version I liked fighters a lot. With late game hulls I used very often 3 fighter hangars and 4 launch bays, so putting into play 8 fighters for bout 2 (and one more fighter for last bout). That was quite more expensive than 2 interceptor hangars with 2 launch bays, for almost the same chaff effect (a tiny bit more for third bout with the fighters), but since they would be targetting ships as well as fighters, they would also take down enemy gunner ships in bout 2 that won't be shooting at me at bout 3.
When facing a fleet with a great ration of interceptors/ship, interceptors were probably better, but since it was most often rather easy to be ahead of the AI production/research/population, the lesser efficiency of my ship designs was compensated by the bigger size of my fleet. However, when facing fleets with small fighter(whichever)/ship ratios, the fighter builds were obviously better for the much larger damage they could deal to enemy ships.
I just hope that in the afterlife I won't be visited by the ghosts of all the computer game guys that I got killed in my life, because as a player of 4x games, I'd be totally f...ed then ...
:lol:
fighters are just numbers, they aren't assigned to a particular carrier, so if I shoot down a couple of carriers, their surviving fighters will be absorbed by the surviving carriers at the end of the turn, up to the maximum hangar capacity. The surplus surviving fighters will be lost then - right?
Right.
I'm just glad this fighter issue will be fixed in 0.4.10. The way it is now, interceptors are an exploit, and the AI forces you into using that exploit yourself.
I remember the versions with fighters prior to the v0.4.9 release had the opposite problem: AI didn't abuse fighters (any type) and by (ab)using them you would have an (even) easier game in single player.
Also: I know FO is not a battle simulator, and space battle is only a sort of fantasy. But setting that all apart, in FO it should be a little bit more realistic. You know, realistic the way they do it in Star Wars where the august Emperor's Star Destroyers wouldn't waste their big-gun fire on the rebel scum's X-Wings, but take out their mother ships first. Just saying ;)
That's the way it's done in v0.4.9+ (the change was done shortly after stable release). So yes, you'll have a better experience as soon as you finish your current game and update FO to latest weekly test version.

Regarding realism and Star Wars (hehehe): the moment you put dogfights in space you are waaaaaaaay out of realism. The very concept of "fighters" (with cocky fighter pilots and the corresponding bulky life support systems) approaching huge hull ships defended with strong shields and thick armors to shoot at them their tiny fighter weapons makes little sense. Then you add the dogfight thingy with ships slow enough to not make pilots into blobs of fluids at the turn forces required to dodge weapon beams that should have relativistic speeds, and it instantly sinks deep into the abyss of ridiculous nonsense. And the fighters doing actual damage to the super star destroyers: facepalm. And then those huge ships inexplicably close to each other start falling into each other just because (without any apparent source of force to change their actual course): facepalm. In that movie where some "bombers" have to put themselves right over the imperial destroyers to launch their free fall bombs: HUGE FACEPALM. The whole Star Wars series should be called Second World War (Pacific Chapter) in Space - Magical Edition. It belongs to the Fantasy+Nonsense gender more than SciFi. I enjoy those movies though, as well as I enjoy The Room. So many laughs!

Realistic space battles would take place with enemy fleets far away from each other, at light-seconds, to the point that no "pilot" would ever see* an enemy ship, only watch at their sensor systems, shooting their weapon salvoes while doing random movements and screaming in terror waiting for the arrival of the enemy salvoes, because heavy armor would never make any sense and most ships would be done with the first energy beam, shrapnel or missile that impacts them.
(*) except hours later, if they survive and decide to risk their life once again by approaching the area of expansion of the debris left by the enemy fleet to watch the remainders.
The Expanse (TV series) is quite more realistic.

Now I feel better :lol:

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

Re: FreeOrion battle mechanics: questions

#25 Post by Lord Hong »

Oberlus wrote: Thu Apr 16, 2020 6:59 am[...]
... the dogfight thingy with ships slow enough to not make pilots into blobs of fluids ... The Expanse (TV series) is quite more realistic.
The Expanse: I just remembered the scene where that Belter guy "entered" the Ring with his racer ship at max speed. That kind of fluid. Epic! :D

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

Re: FreeOrion battle mechanics: questions

#26 Post by Ophiuchus »

Lord Hong wrote: Thu Apr 16, 2020 1:24 am I'm just pissed that I came to understand that only after I've sunk 1000s of PP into my big, bad-ass, chaff-less invasion fleet :x
Just add some chaff of your own. E.g. small asteroids 5PP each. Also flak with great piloting species is not so bad, it gets two extra shots (taking down five fighters per turn for 20PP).
Lord Hong wrote: Thu Apr 16, 2020 1:24 am
Ophiuchus wrote: Wed Apr 15, 2020 8:18 am About top level I think that is probably KISS it is intended to be distribution independent.
I have to say I'm not much into these things, but I always thought that snap is not much used outside Ubuntu anyway...?
Not sure what you are implying. I will answer in three ways.

Well, an unstable thing like dev branch has nothing to do in a stable distribution. If someone wants the dev branch without snap on ubuntu amd64 there is o01egs ppa.

Also snapd is available in all major distributions and then some. My main system is a fedora and i usually test the snaps on this system.

Most people playing freeorion via snap are using ubuntu on amd64. About ten or so play on i386
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!

Post Reply