Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411567 Posts in 69386 Topics- by 58444 Members - Latest Member: darkcitien

May 04, 2024, 04:17:29 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperDesignAI in 4X Combats? (see video)
Pages: [1]
Print
Author Topic: AI in 4X Combats? (see video)  (Read 1536 times)
Orymus
Level 3
***


View Profile WWW
« on: October 11, 2013, 10:55:58 AM »

Greetings fellow developers!
I'm currently in the process of building a 4X game, and I'd be in need of input in regards to the Combat Playback module.
 
Context
This module is named Combat Playback, because there is no user input during combat sequences. They are generated when a turn is processed on the backend-side, and returned to the player. The Combat Playback simply displays the outcome.
When I refer to Combat Playback in this post, I am referring to both the 'frontend display' and the 'backend logic' of the outcome.
 
Reference
Here's a

that I've posted on youtube. It shows the progress that's been made towards building the Combat Playback prototype. Most of the rest of the game is already well underway, but the Combat Playback is, but an embryo at this stage.
 
Design Questions
There's a number of questions that I'd like to raise here, and please don't feel limited by them to provide feedback (so long as you understand that this is early work, without any form of polish, and with a lot of missing assets).
 
As you can see in the fight, ships will automatically acquire a target. For the moment being, this target is always the 'nearest enemy ship'. This was made both because it's my first stab at this, but also because I don't want the AI to be something players rage about. If the 'wrong AI' kicks in, I feel players will get mad.
 

Question # 1 - Should there be more AI types?
Specifically, should I have ships target the 'weakest', or retain their target until it is dead?

Question # 2 - How should I choose which AI to bind to which ship?
Assuming there should be more than one AI type, how should I dictate which AI does what?
Here's a few options I've got right now:
 
A - Contextual: the ship tries to evaluate what should be done, and assigns
itself a 'role' in this battle.
Pros: This could lead to 'intelligent' decision-making
Cons: This could easily lead to verrrrryy dumb decision-making, and would require a lot more effort
 
B - Ship-centric: When choosing what ship to build in the game, it also states its 'AI pattern' (aka how the ship behaves)
Pros: Clean, easy, and recognizable by the player.
Cons: Very limitating, and some player choices could be considered 'bad' (not seeing that a ship attacks only the nearest ship and equipping long-range weaponry could lead to sad cornercases).


Question # 3 - How should the AI respond to 'being in firing range'
The prototype also assumes specific AIs for movement and attack. The basic AI right now is to move until one weapon is in range of the closest enemy, and fire (idle).
Each ship will be equipped with possibly more than one weapon, each with varying ranges.
I'm wondering how each ship should behave assuming that.
A few 'sketches' of what I thought could work well:
  • As long as a ship is not within range / is not the current target of any other ship, it will stop moving as soon as at least 1 weapon is in firing range. The idea here is that it allows 'artillery-type' ships to take full advantage of their attack range without moving closer and endanger themselves.
  • As soon as a ship is the target of another ship and in being fired at, it seeks to move as close as its 'shortest ranged' weapon. The idea is to have it perform its optimal amount of damage.
  • Once all of its weapons are in firing range, it assumes a 'circular orbit' around the target. The idea is to avoid fire from 'other' enemies that might want to acquire it as well and minimize the chances of 2v1s. It's also a good way to avoid what can be seen in the video: ships stopping to move for no apparent reason, which doesn't look very exciting.

That's it for now. I'll add more if anything pops-up Smiley
 
Thanks!
« Last Edit: October 11, 2013, 06:16:42 PM by Orymus » Logged
starsrift
Level 10
*****


Apparently I am a ruiner of worlds. Ooops.


View Profile WWW
« Reply #1 on: November 13, 2013, 01:56:12 AM »

1. Yeah, probably a good plan. Depending on allegiance even maybe, or ship type, you may want ships to attack weakest, greatest threat, closest to death, etc.

2. You could sort ships into primary roles dependent on class. Which would be option B. This allows you to establish a ship class combat doctrine of strengths and weaknesses, otherwise your game devolves into "make the biggest most expensive ships", which has been seen in plenty of 4x games. You could get around your con by allowing the player to change the role from whatever the usual one is, before engagement, if you find your AI significantly weak. Alternately, you could implement a system fleet commanders who follow certain tactics. I think this question is going to lead into a comparison of Gratuitous Space Battles, which you might want to take a look at if you haven't. The answer really all depends on the scope of your game, how entertaining you want combat to be, and can quickly jump to feature creep.

3. Questions of firing ranges relate to roles. But attacking as soon as they get into range is probably the best general idea, unless you include some sort of stealth/ambush mechanic, heal-while-idle, or some such thing.

4. Rather than have a chaotic mess of ships attacking the 'nearest' ship to them, you may want to subdivide a combat group into squadrons to group up and adapt a role/share a target. If you have detailed roles and combat behaviour, of course, this will occur somewhat naturally, but in large-scale engagements you might see absurdities like an entire fleet piling in on a single ship, taking half a second to kill it before orienting on the next.
Logged

"Vigorous writing is concise." - William Strunk, Jr.
As is coding.

I take life with a grain of salt.
And a slice of lime, plus a shot of tequila.
motorherp
Level 3
***



View Profile
« Reply #2 on: November 13, 2013, 03:07:38 AM »

If the player has no control over the combat, isn't having them watch a long battle sequence play-out each time going to get tedious?  Personally I'd use a more abstract and quicker way of showing the results of battles (think advanced wars for example) to keep the game flowing and then you don't have to solve any of the problems you mention in the OP.
Logged
mihai
Level 1
*


View Profile WWW
« Reply #3 on: November 18, 2013, 04:50:56 AM »

As motorherp said, I think it will become boring for the player very quickly by having no control over it. 4X are big games, it takes a lot of time to play one game and it can spread through weeks sometimes. Players are mostly interested in the grand plan of things and not in little skirmishes. If you have 10 fleets and battle each one ten times a day, you would skip such non-interactive features after watching a couple. Even the "Skip to results" button would be hard to press 100 times during a war.
Logged

Orymus
Level 3
***


View Profile WWW
« Reply #4 on: November 18, 2013, 07:16:37 AM »

4. Rather than have a chaotic mess of ships attacking the 'nearest' ship to them, you may want to subdivide a combat group into squadrons to group up and adapt a role/share a target. If you have detailed roles and combat behaviour, of course, this will occur somewhat naturally, but in large-scale engagements you might see absurdities like an entire fleet piling in on a single ship, taking half a second to kill it before orienting on the next.

I doubt an average battle would have enough ships to warrant this type of behavior. I'm expecting the majority of fighters to be 1v1, 1v2 or 2v2.

If the player has no control over the combat, isn't having them watch a long battle sequence play-out each time going to get tedious?  Personally I'd use a more abstract and quicker way of showing the results of battles (think advanced wars for example) to keep the game flowing and then you don't have to solve any of the problems you mention in the OP.

Well, assuming the sequence is 30 seconds, and can be skipped to the result screen instead, I consider it mostly a tool to visualize victory/defeat. The key component here is that its interesting to see how ships behave in combat, so that you understand when you need them. How manoeuvrability, speed, attack range, etc affect combat is interesting.

Not seen in my previous videos is an interesting thing that can happen: minimum weapon firing range. Some ships will equip long-range missiles, which can lead to some epic flawless victories (launching volleys of missiles at incoming enemies). However, if fast ships equiped with deadly short-ranged cannons come too close to these battleships, they'll find themselves losing despite being technically far superior.
It would be hard for a player to figure out why he's lost unless he sees that.
Since there will be many subtleties to combat (cloaking for example), a playback will really help players understand when and how.

Advance Wars was actually suggested by Yannick (the other developer on this team). We haven't ruled that option out yet either.

As motorherp said, I think it will become boring for the player very quickly by having no control over it. 4X are big games, it takes a lot of time to play one game and it can spread through weeks sometimes. Players are mostly interested in the grand plan of things and not in little skirmishes. If you have 10 fleets and battle each one ten times a day, you would skip such non-interactive features after watching a couple. Even the "Skip to results" button would be hard to press 100 times during a war.
In our case, games will be possibly far longer than weeks. Assuming 1 turn per day, its not impossible to imagine a long game to span 6 months, and it may be interesting to make turn frequency lower than once per day to account for people's lives, therefore, a year is not impossible.

Assuming "playing the turn" will represent a minor part of the entire span of the game, I believe its good to provide playback tools that you can learn from when you are waiting on your next turn. This provides means to analyse the outcome and learn from it.
Also, note that, with the given scope of this game, a battle of 3V3 is not a skirmish, by any stretch: it's a major encounter, possibly deciding of the entire war. Players won't be expected to own more than 100 ships at any given point in time (most likely much less), therefore, losing 3 will matter.
If you have 10 fleet and battle each one, chances are you're left with no more ships, or have destroyed 1 or more players.
I think its all a matter of assessing the scope of this game.

I realize this is a bit different from modern 4X games, but this title is meant to be true to the origins of the genre, most notably, similar to VGA Planets 3.0
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic