v0.4 Interim Combat Window

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
The Silent One
Graphics
Posts: 1129
Joined: Tue Jul 01, 2003 8:27 pm

v0.4 Interim Combat Window

#1 Post by The Silent One »

Since it will take some time until 3D combat will be playable, we should have some interim combat code/window as we've discussed previously. Having only little spare time currently, the initial sketch-up I've produced sure is ugly, but will hopefully help to spark some ideas.

Image

This is the idea behind the layout:

System Combat Panel
- system name
- shows info about which planets are owned and maybe about their defense systems

Empire Panel
- flag, name
- bars that show relative hitpoints and firepower
- fleets:
--- icon, name
--- orders like attack fleet x, attack planet y, defend z, invade a, remain neutral, retreat are chosen from a drop-down box
--- can be extended to show individual ships. ships have shown hp and components
- planets

Other Empire Panel
- same as own Empire's panel, but shows less information (depending on sensors/stealth)

So far this is only about how the player can order his fleets in combat; the code behind that would be required to:
- calculate ship's and fleet's hp and firepower
- determine who is fighting whom (eg. when two ally fleets fighting one common enemy fleet their firepower should be added)
- make damage calculations based on firepower and accuracy (etc.)

... the image I have in mind is a system that resembles AD&D / RPG style combat calculations. The player makes his decisions, presses the turn button and sees how the hp bar of his enemy's fleet vanishes.
If I provided any images, code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0.

User avatar
The Silent One
Graphics
Posts: 1129
Joined: Tue Jul 01, 2003 8:27 pm

Re: v0.4 Interim Combat Window

#2 Post by The Silent One »

Split from the General Discussion:
Geoff the Medio wrote:we have various ships with speeds and stealths and numerous weapons with ranges and powers and rates of fire and such, and somehow the game has to determine which ones destroy or escape or are destroyed in a confrontation.
I've been thinking about that as well... basically the question is how much/little detail we want to put into that interim simulation.

My approach would be to greatly simplify and have a parser convert ship designs into a few abstract combat values as e.g. offense, defense, initiative, firepower and hitpoints; example: ship's defense = 10 (quantum computer) + 20 (ion drive) + 20 (small ship size) = 50.

Initiative would be an abstract value that reflects how quick a ship can (re)act in combat. Ships with high initiative may fire or escape first. A ship's initiative value would be calculated from its stealth, weapon range and speed.

This still leaves the question about which ship is fired at unanswered. One option would be to let the player choose a general strategy (fire at the ship that is easiest to hit / that has the least hp / etc.). Or he could designate targets by the UI; after all ships are destroyed, the battle would pause so that the player can select new targets. (There would have to be an AI that makes these decisions as well).

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

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

Re: v0.4 Interim Combat Window

#3 Post by Geoff the Medio »

The Silent One wrote:how much/little detail we want to put into that interim simulation.
It doesn't need to be an interim simulation. We'll need a non-graphical automated combat resolution eventually anyway, and it should take into account as much about ship designs and other strategic and tactical information about the battle as possible.
My approach would be to greatly simplify and have a parser convert ship designs into a few abstract combat values as e.g. offense, defense, initiative, firepower and hitpoints; example: ship's defense = 10 (quantum computer) + 20 (ion drive) + 20 (small ship size) = 50.
That would remove all dependence on various factors like stealth vs. detection, speed vs. range, and various weapon types being strong or weak against eachother.

An alternative might be to have a function to calculate, for one attacker and one defender, a damage amount. Each combat around, the game would, for each ship, randomly select a hostile target in the simulation. The damage amount for that attacker and target would be calculated based on all relevant statistics. The damage might be zero, as might occur if the attacker has insufficient detection to see the target it was assigned, or cases like if a weak missile ship attempts to attack a strong PD ship. Then, all damages are applied to all targets, destroyed ships are removed and damaged ships updated so that damage-effects can be included in subsequent rounds. Then the process repeats, until sufficient rounds have been simulated or one side "wins". In addition to targetting enemy ships, there might also be other goals for ships, such as escaping or attacking a strategic target, and a similar effectiveness or chance calculation would be used to determine if that succeeds or to what degree it occurs.
This still leaves the question about which ship is fired at unanswered. One option would be to let the player choose a general strategy (fire at the ship that is easiest to hit / that has the least hp / etc.). Or he could designate targets by the UI; after all ships are destroyed, the battle would pause so that the player can select new targets. (There would have to be an AI that makes these decisions as well).
Any actual interim solution shouldn't depend on having a UI. And log term, the automatic / non-graphical combat resolver will not involve any user interaction. There could be hooks built into the system to send updates after every "round" of combat simulation so that the UI can display results, but the combat simulation should be able to run quickly and without further input to resolve battles when appropriate.

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: v0.4 Interim Combat Window

#4 Post by Bigjoe5 »

Geoff the Medio wrote:And lo[n]g term, the automatic / non-graphical combat resolver will not involve any user interaction.
You mean after the battle has started, right? Presumably the player will need to give and prioritize general goals at the start of the battle, for example:

Priority 1: Target - Colony Ship.....Identity - Mink.....Goal - Escape.....Destination - Urania

Priority 2: Target - All Forces.....Affiliation - Gyisache.....Goal - Destroy

Priority 2: Target - Planet.....Identity - Orion IV.....Goal - Capture


So the priorities don't all have to be different numbers. In this case, the player wants to put equal weight on destroying all Gyisache forces and capturing Orion IV.

I'm thinking drop boxes for each of these. The player has to start with the first one, "Target", which will give him a list of everything he has the ability to target in this battle.

Once he has made his selection, the second drop box appears, listing every viable option. In the case of general targets such as "All Forces", the "Affiliation" box will come up. In the case of more specific targets such as "Planet", the "Identity" box comes up listing the identity of all objects that conform to "Target".

Next, the Goal drop box appears, listing all the valid goals for that target. Destroying an owned or allied ship would be considered a valid goal, since in a real battle, it should be possible to essentially move a ship into enemy forces where it is sure to be destroyed, or to fire on an allied ship. I can't really think of a valid reason why the player would want to destroy his own ship in combat rather than just scrapping it, but we don't know for sure how everything will work in FO yet. In the future, such a reason may exist, and for the time being, it is best to make everything as unrestrictive as possible. Capturing an owned planet on the other hand, is not a valid goal.

If further clarification is required after "Goal", a goal-specific drop-box appears, giving any further necessary options, such as in the case of the escaping colony ship.

I wonder if battle resolution could occur in an actual battle, not shown to the player, controlled by AIs? I realize it would take a lot more time (though by the time this game comes out, our children will probably be asking us what a "loading time" is) but if it's just a numbers game with a bit of randomization, it's possible that fairly different results might be obtained. This would give an actual advantage to players who choose to watch the battle (thus making it an AI vs. AI battle) rather than let it auto-resolve or vice-versa, which would be really weird, IMO.
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: v0.4 Interim Combat Window

#5 Post by OndrejR »

Bigjoe5 wrote:I wonder if battle resolution could occur in an actual battle, not shown to the player, controlled by AIs?
Yes. AI have to know predict probable result of battle between 2 ships and between 2 fleets to predict threats.
Bigjoe5 wrote:I realize it would take a lot more time (though by the time this game comes out, our children will probably be asking us what a "loading time" is.
Freeciv in version 2.0(FreeOrion 1.0) was with about 10000 commits. Currently there is about 500 commits a year which makes 7000 needed commits - another 14 years to achieve version 1.0. But as is visible with Freeciv, with more advanced state of project there will be more contributors. Freeciv needed only 4 years from 3474 commits to 10263 commits which was version Freeciv 2.0.0. But to gain contributors game has to be in somehow playable state.

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: v0.4 Interim Combat Window

#6 Post by Bigjoe5 »

To clarify, the "time" I was referring to was combat resolution time rather than development time, i.e. it's a whole lot faster to crunch the relevant numbers than to go through an entire battle turn by turn, even if the battle doesn't need to be displayed. But I see your point.
Warning: Antarans in dimensional portal are closer than they appear.

User avatar
TerranStarCommand
Krill Swarm
Posts: 11
Joined: Sat Sep 26, 2009 7:59 am
Location: Venice, CA

Re: v0.4 Interim Combat Window

#7 Post by TerranStarCommand »

How about a hierarchical battle command system based on limited state-driven AI?

We can automatically assume that a generic battle condition will always be "Stay Alive", along with "Kill the Enemy". These are the conditions on battle start.

(Both) players will have the option before beginning combat to issue general orders to their fleet command. These orders will weight the actions of individual ship commanders (more on this later) in combat.

If no orders are issued, your ships will simply attempt to wipe out all of the enemy's combatants - including orbitals and planetary defenses.

Every order the player issues at battle start should be issuable DURING BATTLE as well, in order to accommodate things like stealth ships (not visible at battle start), and unexpected developments during the course of battle.

Examples of beginning battle orders might be "Capture as many ships as possible", "Destroy the Battlestation", "Protect the Colony Ship", or "Scan the Planet"

Individual ships can also be issued orders as well, so a more tactical player could tell the capital ships to "Protect the Colony Ship", the heavy raiders to "Capture as many ships as possible", the bombers to "Destroy the Battlestation" and the scout frigates to "Scan the Planet".

Most weapons should be automatically used when appropriate. Orders should be available depending on fleet composition - a fleet with no planetary bombs will not be able to "Bomb Cities", and a fleet with no troop carriers won't be able to "Board and Capture Enemy Vessel" (though "Disable Enemy Vessel" or "Deathray Crew" might be options.)

We may not actually need a "General Battle Commands" window, as most complex situations could be covered from a ship-driven AI engine, and that way we're not creating the illusion that our fleet AI has any degree of competency. A modular AI-behavior approach also allows the programming team to incrementally add AI behaviors as orders, so the initial combat prototype may only begin with "Attack Enemy", "Hold Position" and "Run Away".
"I was boarded by Reavers and all I got was this lousy T-shirt."

User avatar
Bigjoe5
Designer and Programmer
Posts: 2058
Joined: Tue Aug 14, 2007 6:33 pm
Location: Orion

Re: v0.4 Interim Combat Window

#8 Post by Bigjoe5 »

TerranStarCommand wrote:Every order the player issues at battle start should be issuable DURING BATTLE as well, in order to accommodate things like stealth ships (not visible at battle start), and unexpected developments during the course of battle.
This thread is specifically about auto-resolved battles, which means that there must be no player interaction allowed once the battle has begun. Feel free to start (or continue) another brainstorming thread on the exact options which should be available at the start of (or during) player-controlled battles.

A potentially troubling issue regarding automatic battle resolution is that there may be ships which cannot be detected on the galaxy map, but may become visible in combat. However, if the same stealth and detection meters are used in combat and on the galaxy map, a ship that's invisible in the same system on the galaxy map would be undetectable at any distance in combat, unless it is performing an action which lowers its stealth, such as firing weapons.

This probably won't be a problem, since if a ship is firing weapons (or performing some other action which would decrease its stealth), the AI should perceive it as a threat and try to destroy it anyway, without having been given explicit orders to do so at the start of the battle. If such a ship was a strategic target, it probably would not be performing an action which would lower its stealth.
TerranStarCommand wrote:(Both) players will...
"All" would be a better word in this context, since battles will involve all the forces in a system.
TerranStarCommand wrote:Individual ships can also be issued orders as well, so a more tactical player could tell the capital ships to "Protect the Colony Ship", the heavy raiders to "Capture as many ships as possible", the bombers to "Destroy the Battlestation" and the scout frigates to "Scan the Planet".
It's more likely that the player would just give the general orders "Protect the Colony Ship", "Capture as many ships as possible", "Destroy the Battlestation" and "Scan the Planet" and the ships that are best equipped for each task will automatically carry it out. This will also, AFAIK, be necessary for the AI's orders, since the same AI that decides that a planet needs to be bombed will not be the same AI that decides which ship bombs it (AFAIK).
Warning: Antarans in dimensional portal are closer than they appear.

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

Re: v0.4 Interim Combat Window

#9 Post by Geoff the Medio »

Bigjoe5 wrote:A potentially troubling issue regarding automatic battle resolution is that there may be ships which cannot be detected on the galaxy map, but may become visible in combat. However, if the same stealth and detection meters are used in combat and on the galaxy map, a ship that's invisible in the same system on the galaxy map would be undetectable at any distance in combat, unless it is performing an action which lowers its stealth, such as firing weapons.
The distance used during combat for stealth and detection calculations will be distance on the combat map. The in-context rationale for this is that on the map, you've got a whole game turn to detect things, meaning you can see them much further away, whereas during a battle, you're busy and distracted and it's all happening in a much shorter period of time, so it's much harder to see stealth ships even in the same system, at the same galaxy-coordinates.

User avatar
OndrejR
Space Dragon
Posts: 339
Joined: Thu Oct 02, 2008 11:00 pm
Location: Slovakia

Re: v0.4 Interim Combat Window

#10 Post by OndrejR »

Bigjoe5 wrote:It's more likely that the player would just give the general orders "Protect the Colony Ship", "Capture as many ships as possible", "Destroy the Battlestation" and "Scan the Planet" and the ships that are best equipped for each task will automatically carry it out. This will also, AFAIK, be necessary for the AI's orders, since the same AI that decides that a planet needs to be bombed will not be the same AI that decides which ship bombs it (AFAIK).
In current svn there are already some preliminary steps to do this.

Post Reply