The main problem with the proposed changes so far is that they are strictly weapon based. However, a ship can have very different types of weapons, and when looking at the "maneuvering into optimal position" aspect a ship with very different weapon systems in theory couldn't optimize it's tactical maneuvering for all it's different weapons equally, but would have to prioritize. Simple (extreme) example: consider a ship with a Spinal Antimatter Cannon (to take out big capital ships and planets) and a couple of flaks (to fend off enemy fighters). In a battle attacking an enemy planet, should it try to go after enemy fighters or try to get into position to fire at the planet? It could only optimize one goal. The currently proposed implementation however determines targets on a per weapon basis (if I understand correctly). Which doesn't fit too well with the fluff explanation.

Thats because the implemented battle system is based on (shots of) weapons, not on ships. If you change the battle system to include some notion of location/proximity between ships, weapon priorities would probably not influence movement decisions but target decisions in proximity. So basically i would use the "battle scanner" parts for movement (or we would need to add some conditions for deciding movement). Space boats/launched weapons as a separate systems would still do their own thing.
So in short I agree with you that it makes sense to "bundle" shots of a single ship, but i think it would need a rewrite of the combat system, so its out of scope.

That said, the current combat system isn't any way less crude in the way it abstracts/simulates/approximates things, so your approach is still an improvement, or at least not worse in that specific regard, so that's not really a problem. Also, I don't see how it could be improved without making things a lot more complicated, and if I understand correctly, the purpose here is to improve the current stop-gap solution without going overboard, so to speak.

Jip, thats the scope of the proposal.

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.

What if introduce "target profiles". The one of them is default and available from start. Each weapon part has a targeting described for each profile.

The profiles unlocked by research allows to build a targeting part.

I don't see any need for an extra concept ("target profiles") to be added; targeting parts can be unlocked by whatever means is appropriate, mostly techs, and then adding them to a design would control how ships of that design target their weapons in battle.

I mean profiles to setup targeting before battle so it could be dynamically set without changing ship design.

Sounds too micromanagey to me, to expect players to adjust a battle plan / tactics for each battle. It sounds a bit like what I'm suggesting leaders could do, though, but that is specifically limited to a small number of locations where a player has a leader, of which there might be at most 3 or 4 at any given time. Using parts in a ship design for target prioritization is better, to me, because it requires strategic planning and preparation as part of the (less frequent) ship design process, and doesn't require repeatedly checking each potential battle each turn to make settings adjustments.

I mean profiles to setup targeting before battle so it could be dynamically set without changing ship design.

Sounds too micromanagey to me, to expect players to adjust a battle plan / tactics for each battle. It sounds a bit like what I'm suggesting leaders could do, though, but that is specifically limited to a small number of locations where a player has a leader, of which there might be at most 3 or 4 at any given time. Using parts in a ship design for target prioritization is better, to me, because it requires strategic planning and preparation as part of the (less frequent) ship design process, and doesn't require repeatedly checking each potential battle each turn to make settings adjustments.

I also think keeping the number of possible interactions low is important. Because i think it wasnt mentioned yet - What do you guys think about system preferences? I first thought about having planet focus affect the planets targetting, but if you have more than one planet in a system, probably you would put them all to the same targetting and the switching would be tedious.

But if you could simply give the system a preference that would be probably ok. You will probably have look at the systems where you expect combat to occur anyway. One could also think of an UI interaction where you select a number of systems via drawing a box on the map and set the targetting preference at once.

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.

I don't think it's necessary or good for players to be able to control everything with fine precision at many locations. Planet defenses don't need to be good at everything at once or extremely flexible. Ship weapons don't need to be easily configurable and adjustable to handle any situation. Planets have one focus setting. Government policies will be limited in number, distinct, and set empire-wide. Part of the strategy is dealing with how different things function, their limitations and tradeoffs.

I'd be much more inclined to have a government military policy card that controls how planet defenses function than to have multiple focus setting options available. A card that switches planet defenses from a single big shot to many small shots could work well. A major benefit would be that it wouldn't require frequent tweaking at many locations in the galaxy / UI.

But to be clear what i meant. I didnt mean planetary defenses specifically. I meant setting preferences for all your forces in the system, so all the fleets and all the planets. Something like "Prefer to shoot down troop ships (Stop the invasions)", "Prefer to attack carriers", "Prefer to attack main ships". "Prefer to attack fueled targets (i.e. spread your attacks to hopefully kill all enemies for blockade)".

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.

I don't like the proposal that individual parts types should have a built-in prioritization or restricted target set outside of a few broad but specific cases (eg. fighters don't target planets).

Basically, the entire approach (giving ships/ship parts properties to help determine target selection) tries to determine the combat role/tactical decisions of a ship automatically. Which is the major issue with such an approach: it tries to make tactical decisions for the player.

Our current system "solves" that problem by completely randomizing these "tactical decisions". I can understand why people see that as an even worse approach, and consider the suggested approach an improvement.

I also think the proposed implementation of conditions with various tiers or weights or levels of precision / adherence to priorities or rounds of targeting is overly complicated.

True, but that affects primarily the content scripting. The player would just use the parts and only needs to know that e.g. a Flak has a higher chance to target fighters than e.g. a Spinal Antimatter Cannon (which, admittedly, makes some sense).

The results and distinctions would be too subtle for most players.

That depends on how you set up/balance things in the end. You surely can go overboard easily enough, but I think if you try to keep the rules and numbers reasonably clear, simple and distinct, you could get usable results.

Don't get me wrong, I'm not exactly a huge fan of the proposed system (for the various reasons I already cited in this and earlier posts), but as long as the "probability scewing" effect isn't too strong, it's still an improvement over the current system, which is the intended goal.

My preferred implementation of weapon targeting control would be that weapons will by default target everything, and that players will find this problematic and want a way to fix it.

I probably wouldn't start out quite that extreme. Even at the very start of the game combat shouldn't be an exercise in frustration. Some basic sane behaviour of your combat units should be default, but obviously improvable.

The game would provide this in the form of targeting parts or possibly by having a leader be able to control the targeting. Getting the ability to control the targeting would be a strategic decision [...] Actually adding the controlled targeting to a ship would require planning ahead by adding the part to a design.

That approach, while having the compelling advantage of being able to assign specific combat roles/tactical behaviour to ships while completely avoiding the micromanagement issues if you could/had to do that for each ship in every combat, has huge issues. It works well with single purpose ships (like troop transports), but with general or multi purpose ships things get nasty.

Stellaris works with a system very similar to that, by making the player choose the type of battle computer when making a ship design. The system works to a certain degree, but I wouldn't say it works well. The reason why it works at all is because in Stellaris refitting your ships is something you (have to) do quite frequently (and which is also somewhat managable in that game), and because the selection of combat roles is very limited (basically at what range a ship engages the enemy: point blank, picket, line or artillery). So, if you need to adjust the combat roles of your ships, a quick refit of your fleet will do it. The end result is meh at best. Frequently tedious and annoying. Fun? Not so much.

Now consider how things work in FO. Ships can't be refitted at all, meaning their combat role is fixed. You need to adjust the combat role of your ships, you're in for extensive scrapping and rebuilding. Oh boy.

... This will make ship design decisions more involved / interesting, and pushes ships towards being more specialized / situational.

With all the suggetions you made here, it will also force you to work with a lot more different ship designs, and to micromanage your fleet composition far more carefully. Fixed specialization means it becomes more difficult to adapt to different/changing strategic/tactical situations. And while a certain degree of (fixed) specialization is very important (a single ship type which I could dynamically adjust to fulfill all possible roles would be excessively boring!) to provide proper variety, too much (fixed) specialization can quickly create a lot of micromanagement, and make the task of adjusting your fleets to changing situations very tedious and unfun.

That's not to say such an approach can't work at all. But, as all possible approaches to space combat, it has very distinct advantages and issues, and needs to be designed and balanced carefully, otherwise you just end up with something as unsatisfying as the current system, just a different way of unsatisfying. We'd definitely need to do better than e.g. Stellaris...

I think fleet-based approaches are problematic:
If I want to prioritize fighters with a part of the fleet and capital ships with another part of the fleet, then I would have to create 2 (or in general N) fleets. I will then have to make sure all these N fleets move synchronously through the galaxy map. So I have to give N move orders instead of only one, I have to make sure all the fleets have the same speed etc

Well, the classic fix for this problem is to introduce a two-tiered system (usually "fleets" and "task forces"). On the lower tier you'd group your ships according to their intended roles, and on the higher tier you'd put together those groups into a "super group" you move around. Obvious disadvantage: more complicated fleet management.

Another thing to keep in mind in the overall discussion is that target priorities can heavily backfire. Consider there is a single carrier in the enemy fleet launching a single fighter per combat bout. If I give all my ships priority to attack fighters first and targeting becomes deterministic, then all their shots would be fired on that single fighter after it has been launched.

Which demonstrates why strictly deterministic target selection is a Bad Idea. A probabilistic approach should be able to sufficiently mitigate such effects.

1) If I can change the targeting priority dynamically before battles, then I can micromanage the targeting priorities so only few shots are wasted.
2) If I can't change the targeting priorities dynamically, then fleets may become essentially worthless just because they have an inadequate target priority for a specific fight.

This touches a very fundamental problem we face when trying to come up with a good combat system: there is no optimal approach, it's basically a pick x of y type of thing.

Ideally, we want a combat system that:

1) Offers sufficiently sophisiticated tatical choices: specialized roles for the various units, different tactical situations (caused e.g. by "terrain" properties like planets present, nebulas, fields, asteroid belts, etc.), etc. Not just a who has the bigger doomstack thing. There goes our current system...

2) Isn't too complex so space combat doesn't become a piece of work that quickly gets tedious and unfun (so a large set of very complex rules providing a trillion of subtle options is out of the question).

3) Does not lead to too much micromanagement (so being able to fine tune a set of standing orders for each ship for each combat is out of the question).

4) Allows for sufficiently flexible adjustment of ship roles so players can adjust their fleets to changing situations, and not something that would lead to what Morlic described in his option 2, which, believe me, will make players want to pull their hair out (so making the player choose a certain tactical scheme at game start that their empire will have to stick to for the entire game is out of the question).

Obviously, there is no system that can optimally satisfy all of the above. Which means, we'll have to decide what we want, and where we are willing to cut corners. And only after that has been decided, we can actually start to design our comba system. Any detailed work done before that is very likely going to be wasted effort.

If I can get around to, I'll open a thread to discuss the basic options we have.

I strongly disagree (I may be wrong, ofc). Consider FO is not aiming at implementing interactive/visual combat. A "realistic" space combat simulator that is understandable and liked by all its players is perfectly possible when the only combat they are going to see is a text resumee and log.

A "realistic" space combat based on considerations like those in the article you linked would only have extremely limited tactical options. Probably about as much as in a classical jousting match (to take your expample ). At least to me that doesn't sound particularly exciting.

Simple (extreme) example: consider a ship with a Spinal Antimatter Cannon (to take out big capital ships and planets) and a couple of flaks (to fend off enemy fighters). In a battle attacking an enemy planet, should it try to go after enemy fighters or try to get into position to fire at the planet? It could only optimize one goal.

The example makes no sense to me. If the fighters are fleeing away from the capital ship then you can just ignore them

Sure. Which is exactly what our ship would do if it decides to go after the planet, and not after the fighters. So clearly prioritizing one target (planet) over the other (fighters).

Even if the capital ship is doing something nonsensical as to "pursue" fighters (that are supposed to be faster, otherwise there wouldn't be any possible fluff explanation to allow fighters shot capital ships from close range)

That's not the way a Flak equipped ship would prioritize fighters as targets. If such a ship has fighters as top priority target than that actually means it's primary objective is protecting itself and allied ships against enemy fighter attacks. It's tactical maneuvering would then try to get into a position where it can intercept enemy fighters before they get to the other ships.

it can just shoot the spinal antimatter cannon to the planet at the same time it pursues the fighters. The SAC just need a straight line between the planet and the ship to "optimize" its targetting. And straight lines in space are... well, you don't need to move anywhere to get that. It is the space, the greatest emptiness you can get.

Not really... depending on how accurately such a cannon can be aimed, and what range it has, the ship has to move close enough to the planet first. Furthermore, to aim a spinal mounted weapon, you need to turn the entire ship into the proper direction.

To do that maneuver and at the same time the maneuvering required to intercept enemy fighters both optimally sounds a bit optimistic. Sure, focusing on one doesn't mean you can't also try to do the other, but you can't optimize both.

I think you here are showing a blatant double standard. Current combat systems only serves well one fluff explanation: artillerymen like to shoot randomly. All that previous explanation about maneuvering and the such only makes sense if you are right within a very dense and unrealistic asteroid field. BTW, asteroid fields are mostly empty.

No one ever claimed that the current combat system tries to simulate "realistic" space combat. All those previous explanations about maneuvering and the such only make sense when thinking space soap naval combat (I mostly think Wing Commander when trying to imagine FO's system spanning battles), and can only claim to be a very crude and overly simplistic abstraction of even that. So I repectfully object to the blatant double standard statement.

IMO, it is sad that FO intends to be just another naval conquest game where islands are planets.

I'm surprised that you feel that strongly about this, and that it surprises you... I mean, that FO's combat system is going to be your typical space soap naval combat is not something new, but something I thought has been obvious since forever. From the beginnning 3D tactical combat has been planned, we introduced carriers and fighters, we have space monsters (another thing that boldly defies reality), heck, Free*Orion* draws much of it's inspiration from the MOO series - FO is as space soapy as you can get.

At least I hope we will have pirates soon

Hm, should already be scriptable as a form of "space monsters". Something similar to how Drones and Drone Factories work. Would be very rudimentary, but still...

Sounds too micromanagey to me, to expect players to adjust a battle plan / tactics for each battle.

The moment you introduce enough tactical elements into space combat so that you get a variety of very different tactical situations (which is something we aim for), you create the potential to optimize your battle plans/tactics for each individual situation. And no matter what means you provide to the player to customize their battle plans/tactics, things are going to get micromanagy. The only question is, how can the system be designed so the experience will be as smoothly and least frustrating for the player as possible.

It sounds a bit like what I'm suggesting leaders could do, though, but that is specifically limited to a small number of locations where a player has a leader, of which there might be at most 3 or 4 at any given time.

Please don't. That sounds incredibly frustrating, to only be able to adjust your tactical settings in a restricted number of places, and have to watch your fleets perform subpar everywhere else.

Using parts in a ship design for target prioritization is better, to me, because it requires strategic planning and preparation as part of the (less frequent) ship design process, and doesn't require repeatedly checking each potential battle each turn to make settings adjustments.

I think the only thing this will achieve is to make it far more tedious and annoying to adapt your tactics. Instead of switching orders for ships/fleets, I need to adjust tactics by juggling fleet composition. I would have a lot of different specialized ship designs, and would fine-tune my fleets tactical behaviour by tweaking how much of which ship types I add to a certain fleet. I would have to have enough ships of each relevant design around to be able to do that fine tuning, producing more of the designs which are in demand right now and probably scrap the ships which I don't think I'll need so much.

That doesn't sound like less micromanagement, you're just micromanaging differently. If the intention is to limit micromanagement, you need to limit the variety of different tactical situations. You need to limit how often the player needs to change something in order to play optimally, not try to impede their ability to do so. The latter approach will only lead to frustrating gameplay, because you'd want/need to adapt your tactics far more quickly than you'd be able to. Which results in a constant struggle to catch up with the developing situation. Doesn't sound like fun to me.

Another option could be to use a set of policy cards which define the empire's military doctrine and subsequently target priority.

You could fine-grain the policies (a fighter policy, a short range policy, a flak policy, a planetary defense policy etc.) or only have a single slot which defines the strategy for all ships and parts.

This would mean that the player gets to make a choice in targeting but it will a) be set globally and b) cost something to change (influence, "anarchy" turns as in civ, or something similar). So micromanagement is discouraged while giving the player options to adapt and giving him an interesting strategic choice. And/Or it could take some time to switch policies - so you have to plan battle orders several turns ahead.

If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Sounds too micromanagey to me, to expect players to adjust a battle plan / tactics for each battle. It sounds a bit like what I'm suggesting leaders could do, though, but that is specifically limited to a small number of locations where a player has a leader, of which there might be at most 3 or 4 at any given time. Using parts in a ship design for target prioritization is better, to me, because it requires strategic planning and preparation as part of the (less frequent) ship design process, and doesn't require repeatedly checking each potential battle each turn to make settings adjustments.

Leadership system looks interesting and I think it's very global and could be used in other parts of the game like Government system.

Geoff challenged the concept of precision in the implementation branch, which is quite integral to that PR that i move that discussion back to the design forum (i.e. this thread). Quoted is the discussion from the implementation PR:

Geoff the Medio wrote:Is a precision value necessary? There are random pick and priority sort conditions that would allow more flexible control than whatever hardcoded precision mechanisms you implement...

Ophiuchus wrote:You mean picking and priority via FOCS? I do not think its a good idea to put the targetting algorithm distributed into FOCS parts.

The precision is there to supply weights for e.g. priority sort. I dont like the "hardcoded" fighting mechanism we have, I would prefer that it would be scripted in python and pluggable.

Geoff the Medio wrote:Why not in FOCS? Picking a subset of objects from a set of candidates is what conditions do, and this is part of how a part is to be scripted to function, so would make sense to implement in the part scripts.

Ophiuchus wrote:I am not sure I understand your point regarding FOCS. I would have used weighted conditions if such existed. I had a lot of trouble with the parser already, so that was a stretch goal.

I wouldnt mind if somebody moved weights to FOCS conditions.
I have the feeling that I would mind if the exact algorithm is specified in ship parts. I think the battle system should be pluggable, so the interpretation of the values could be different from one battle system to the next. The interpretation should not happen in the contents like the parts.

Precision is used as in a double role at the moment. Higher precision gives a weight for target selection if there a multiple conditions and also increases the chance that a condition actually locks a target. I expect precision to express a level of actually getting a lock on a target (and e.g. a good tactical engine could contribute to this) and maybe preferences weights move to its own specification. If you have a better suggestion, i will refactor the naming of course (its the best i could come up with).

I think the design is reasonable enough even with its debatable choices to be included in master (at least i hope so).

For design changes/expansion we should move this discussion to the forum i think. For example i think it would be a good idea to separate precision from condition weights. But that is definitly out of scope for my implementation. I think it is time to clean up the code and put the design into the wild and then improve.

Geoff the Medio wrote:The combat system can be "pluggable", but the way a part picks its targets is part of the design of that part, and not something that should take a few vaguely-defined values from the part and interpret in different ways.

IMHO precision is as vaguely defined as are the other values i.e. "damage", "shots", "capacity". I was already toying with the idea to move the launch interpretation for launch bay parts to FOCS.
You could script different launch parts for e.g. space boats and planetary bombardment and specify e.g.:

in the first turn all space boats launch

in second turn there is fighter vs fighter battle (interceptors shoot down bombers before they can hurt the ships)

in third turn ShortRange weapons and boats all battle and planetary bombardment missile launches

in following turns ShortRange weapons and boats all battle (there is the chance to shoot down bombardment missiles)

in the last turn the planetary bombardment which was not shot down applies its damage

But this is really dependent on the battle system being the way it is (as you can see i already scripted the battle system in my example quite different from what is now regarding to space boats). From a design perspective this should not be part of the launch parts but of the battle system. One could add tags to the launch parts (e.g. MISSILE_LAUNCHER and for all space boats BOAT_LAUNCHER) so the battle system can interpret the meaning (in this case: launch in turn three, apply damage in the last turn). (Just as extension: probably the damage turn interpretation should come from the hangar part e.g. tag SPACE_TO_PLANET_MISSILE).

I think the case is similar for targetting. I think it should be done in a declarative way in the parts.

Geoff the Medio wrote:I would drop the whole precision concept for this iteration. The point should just be to have a way to script what targets a part can attack, and apply that condition if present, to pick a part's allowed targets.

For the next iteration, you don't really need "weighted conditions". If species and part type both need to have input on target selection, then they can do so in a fixed order... eg. If there is a part targeting condition, filter the potential targets with that condition. Then, if there is a species targeting condition, apply that. For the latter, assuming a primary application would be prioritizing by species of the target, a sorting condition can be used, which checks for the species of the target and selects those targets first.

I try to repeat what i understood from your design:

weapon parts, scanner parts, hangar parts get a condition like possibleTargets which specifies which kind of targets are possible (i.e. the all_targets list gets filtered before a target is chosen to possible_targets. If that list is empty the weapon does no damage this turn)

species get a condition like priorityTargets which specifies which kind of targets are possible (i.e. the possible_target list gets filtered before a target is chosen. If the resulting priority_targets list contains targets, you select a target from that list. If the resulting priority_targets list is empty you choose a target from the possible_target list)

combination is trivial for possibleTargets, as this is basically combining blacklists

no precision value - combination of priorityTargets is undefined

This is basically the 2-tiered approach which was talked about as one of the many suggestions in this thread.
If you add another source of priority targetting, e.g. leaders or policy, you will need to define the combination and probably some kind of priority/precision.

So if i moved my design in direction of yours I would add the possibleTargets conditions and rename precision to priority or targettingEffectiveness. In my probabalistic interpretation the value models anything which helps you making an effective shot at a target (e.g. battle scanner helps planning movement, tactical engine part helps getting you into the right position).

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.

weapon parts, scanner parts, hangar parts get a condition like possibleTargets which specifies which kind of targets are possible (i.e. the all_targets list gets filtered before a target is chosen to possible_targets. If that list is empty the weapon does no damage this turn)

species get a condition like priorityTargets which specifies which kind of targets are possible (i.e. the possible_target list gets filtered before a target is chosen. If the resulting priority_targets list contains targets, you select a target from that list. If the resulting priority_targets list is empty you choose a target from the possible_target list)

combination is trivial for possibleTargets, as this is basically combining blacklists

no precision value - combination of priorityTargets is undefined

This is basically the 2-tiered approach which was talked about as one of the many suggestions in this thread.
If you add another source of priority targetting, e.g. leaders or policy, you will need to define the combination and probably some kind of priority/precision.

What I propose for the current pull request is that weapon parts have a possibleTargets condition, which is applied to all_targets before selecting which targets the weapon will attach for each combat round. That's all; species or scanner parts having some input can be implemented later.

What I propose for the current pull request is that weapon parts have a possibleTargets condition, which is applied to all_targets before selecting which targets the weapon will attach for each combat round. That's all; species or scanner parts having some input can be implemented later.

The PR is built around priorityTargets and precision. For me it does not make senses to rip that part out and replace it completely. Implementing possibleTargets is mostly orthogonal to priorityTargets. I think there is actually no code sharing between the two.

So should i add possibleTargets for weapon parts? Content wise i would switch flak from priorityTargets to possibleTargets. Also I could remove the c++ code for boats not shooting at planets into the hangar parts. Something else?
Would it be acceptable if the spinal antimatter cannon was unable to shoot small targets (e.g. less than 40 maximum hitpoints)?

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.

Possible Targets would be conceptually simpler than priority targets, and force a degree of "combined arms" (every decent assault fleet will need to be able to attack boats/missiles, ships, and planets)