Why AI doesnt ForceField? - Page 2
Forum Index > StarCraft 2 HotS |
Acritter
Syria7637 Posts
| ||
Mortician
Bulgaria2332 Posts
On May 30 2011 01:14 Acritter wrote: If I can barely use Forcefields, I'm pretty sure no AI can. If I can barely use muta micro, I'm pretty sure no AI can. | ||
Datum
United States371 Posts
On May 30 2011 01:14 Acritter wrote: If I can barely use Forcefields, I'm pretty sure no AI can. Why? | ||
jjacobsson
Sweden6 Posts
1. It's ridiculously hard to get a good heuristic for when and where to place a forcefield, so it get's cut from the game. "Good" does not necessarily mean "strategically good", it can mean "leads to fun game-play". 2. You can get a good heuristic, but it takes to much processing power and/or memory to actually run it on the target hardware for the game. So it get's cut from the game. 3. It was not deemed an important feature in the game, so no effort was made to try to do it. My personal guess is number 1. If it's number 2, you will see it in the future expansions (given that Blizzard keeps it's usual pace of development our computing power will have multiplied by over 9000 before the last expansion is out). Since it's Blizzard I seriously doubt it's number 3. All of those 3 points are really different flavors of "game developer ran out of time" when I think about it. The only thing I can think of if I was to try to code this is some kind of influence map, but I doubt the results would be very good. | ||
nejdu
Sweden20 Posts
| ||
Kinetik_Inferno
United States1431 Posts
On May 29 2011 07:09 Jyvblamo wrote: A good forcefield AI would be impressive. It's one of those things that is much more intuitive to human minds and can't be put into a simple algorithm. This is basically it. It's practically impossible to program a computer so that it forcefields a ramp or an army, solely because it doesn't know when is a good time to forcefield. The only way I could think of is programming it to forcefield ramps to ground above, when they have seen a large group of units move up there and that group of units will likely kill the AI's army. EG, contain situation. The problem is defining the contain situation. There really is no "I know, therefore | ||
Zedex
United Kingdom310 Posts
| ||
Dhalphir
Australia1305 Posts
Little beyond a videogame at this point. | ||
Navillus
United States1188 Posts
| ||
Deleted User 101379
4849 Posts
On May 30 2011 06:18 jjacobsson wrote: I can think of 3 reasons why the AI does not use forcefields: 1. It's ridiculously hard to get a good heuristic for when and where to place a forcefield, so it get's cut from the game. "Good" does not necessarily mean "strategically good", it can mean "leads to fun game-play". 2. You can get a good heuristic, but it takes to much processing power and/or memory to actually run it on the target hardware for the game. So it get's cut from the game. 3. It was not deemed an important feature in the game, so no effort was made to try to do it. My personal guess is number 1. If it's number 2, you will see it in the future expansions (given that Blizzard keeps it's usual pace of development our computing power will have multiplied by over 9000 before the last expansion is out). Since it's Blizzard I seriously doubt it's number 3. All of those 3 points are really different flavors of "game developer ran out of time" when I think about it. The only thing I can think of if I was to try to code this is some kind of influence map, but I doubt the results would be very good. My bet would be on 2. Step 1: To place a good forcefield you have to get the position of all units in range of a sentry (and a little further away). Step 2: After that you have to group the opponents units into blobs (it is quite realistic to assume that the opponents army can consist of multiple groups). Step 3: Then you have to analyse if the force is stronger than your own force, taking into account the terrain and relative unit positions. Step 4: Decide if you want to cut the blobs (if you have a superior or equally strong ranged army), FF behind them (if you have a zealot heavy army) or FF in front of them (if their army is a lot stronger). Step 5: Find the position for the forcefields by going from the center of each blob to the place where you want to FF (front/center/back) and draw a line along the blob. Step 1, 2 and 5 are actually computationally intensive and they might have to be done for every AI iteration (multiple times per second). | ||
Slaytilost
Netherlands968 Posts
| ||
Deleted User 101379
4849 Posts
On May 30 2011 16:31 Slaytilost wrote: Software development is about cutting corners. What about just spamming forcefields in a 45 degree radius, or until an unmovable surface is detected, 2 secs after you start to battle. That would produce lots of funny forcefields that actually do nothing or hurt the protoss more than the opponent and only in 1 out of 10 situations it would produce good forcefields, it would even open more options to abuse the AI. | ||
Slaytilost
Netherlands968 Posts
| ||
MrTortoise
1388 Posts
the easy approach is to solve the constants first ... the maps, get data from them to use for scoring and selection algorithms. your first problem is looking at the map and figuring out how to score certain positions for forcefield placement ... eg ramps .. how do you get it to test a part of the map to see if it cuts it off. All these locations get a good score. Then you have to consider areas that can be cut off by tesselating forcefields. This would give you a decent score graph of any given map and greatly aid any algorithm ... would be really interesting to see actually ... areas that take up to 10 forcefields scored fairly low vs 1 forcefield scored high in a heat map. This kidn of graph also help with the mechanic of placing them as you end up with a sorted list of valid locations and groups. Then you can work with generally heuristics Eg, Its probably true that its not all that wrong to split an army of even size . Thats how id start - it would be primitive but its a start. battles id probably pre-rig with preset appraoches based on composition ratios and score these - eg push marauders back from marines would score higher than trap the whole lot if you have no collosus. Really crude stuff. Goals would be really simple and based on current known army sizes and composition Split, contain and push away. I dont think you need anything overly clever once you break the problem down, its a selection algorithm based on available data. You don;t need past data and you dont need any learning. The complexities of combat are really only half the problem. and are probably solved to an extent when yous sovle the map portion | ||
VIB
Brazil3567 Posts
On May 29 2011 06:35 Griffith` wrote: You're exaggerating. It's not as trivial as some other microing, but it's not too hard. With the right algorithm it's not NP.I've tried making an AI that does forcefields - its EXTREMELY hard - even harder than my mutalisk AI. It requires a lot of cluster algorithms to find centroids - an NP-hard problem. T = pick nearest enemy ranged unit If T's range < your unit's range and if battle is going for a few seconds { C = Count how many force field's you have P = T's position + a little behind by an amount of T's size C2 = 0 // will count how many force field worthy spots there are loop C times or enough to do an angle you think is enough { // P2 = array of forcefield worthy spots P2[C] = P + move force (field's size/2 + T's size/2) to the left or right (alternating) if P2[C] is a moveable spot then: C2++ } if C > C2 * (RATIO) // adjust RATIO to whatever you prefer between 0 and 1 - this is how many forcefields you'll have left then cast forcefields from P[0] to P[1] } TLDR: Check how many forcefield-able spots are there behind an enemy unit of short range. And if you have enough mana, forcefield those spots. This will prevent units with shorter range to run away from you. And make it so other's behind it cannot come to help. ie.: roaches vs stalkers Of course this example is very simple and there's a lot that can be improved. If you wanna make it more complex. You can later A) count how many enemy units there are near the target so you can tell wheter the battle is worth to fight. and B) check if there are massive units nearby and C) check also for units of longer range, force field in front of them if yours unit need to flee or behind them if you are already in it's range so it doesn't flee. etc etc This algorithm is fast to calculate and would make a reasonable decent use of force fields. It's fast because there aren't that many iterations to do. Since you consider the size of forcefields when calculating space. On May 30 2011 06:18 jjacobsson wrote: I'm very sure 3 is true.3. It was not deemed an important feature in the game, so no effort was made to try to do it. | ||
loadme
171 Posts
| ||
Faricho
Colombia116 Posts
But before it would be better to position the army to take full advantage of the chokes (I've no idea how) Maybe the easiest way to find the centers could be summing all the enemy unit's X,Y positions and dividing that by the number of enemy units. But that alone could be heavy | ||
Deleted User 101379
4849 Posts
On May 31 2011 00:29 VIB wrote: You're exaggerating. It's not as trivial as some other microing, but it's not too hard. With the right algorithm it's not NP. T = pick nearest enemy ranged unit If T's range < your unit's range and if battle is going for a few seconds { C = Count how many force field's you have P = T's position + a little behind by an amount of T's size C2 = 0 // will count how many force field worthy spots there are loop C times or enough to do an angle you think is enough { // P2 = array of forcefield worthy spots P2[C] = P + move force (field's size/2 + T's size/2) to the left or right (alternating) if P2[C] is a moveable spot then: C2++ } if C > C2 * (RATIO) // adjust RATIO to whatever you prefer between 0 and 1 - this is how many forcefields you'll have left then cast forcefields from P[0] to P[1] } TLDR: Check how many forcefield-able spots are there behind an enemy unit of short range. And if you have enough mana, forcefield those spots. This will prevent units with shorter range to run away from you. And make it so other's behind it cannot come to help. ie.: roaches vs stalkers Of course this example is very simple and there's a lot that can be improved. If you wanna make it more complex. You can later A) count how many enemy units there are near the target so you can tell wheter the battle is worth to fight. and B) check if there are massive units nearby and C) check also for units of longer range, force field in front of them if yours unit need to flee or behind them if you are already in it's range so it doesn't flee. etc etc This algorithm is fast to calculate and would make a reasonable decent use of force fields. It's fast because there aren't that many iterations to do. Since you consider the size of forcefields when calculating space. I'm very sure 3 is true. Ok, what about 2 groups of units from 2 different angles? Units stimming up a choke? Splitting units? Zealots + Sentries vs ranged units? While your algorithm would work in some situations, it would produce totally horrible results in others. It's simply something that a human can do far better by instinct than any machine. This doesn't mean there shouldn't be any forcefields, a simple implementation would suffice, but we will never see perfectly used forcefields from an AI (at least not in the next year or two). | ||
VIB
Brazil3567 Posts
On May 31 2011 00:56 Morfildur wrote: My algorithm would work fine on all 4 situations that you talk about. Did you even read it? Your argument that a human would do it better is empty and with zero scientific base. My algorithm is far from perfect, it's just a simple thing to show you what and how it can be done. Like I said you can add to it and make it more complex, there's lots of stuff I simply didn't bother putting in that could be. Ok, what about 2 groups of units from 2 different angles? Units stimming up a choke? Splitting units? Zealots + Sentries vs ranged units? While your algorithm would work in some situations, it would produce totally horrible results in others. It's simply something that a human can do far better by instinct than any machine. This doesn't mean there shouldn't be any forcefields, a simple implementation would suffice, but we will never see perfectly used forcefields from an AI (at least not in the next year or two). But neither are humans anywhere near perfect in the force fielding skill. What are you talking about? Humans suck at this. It's not hard to make a computer at least as good as an average player at this. Most players, even at the highest levels, just spam forcefield on the enemy troops without giving it too much thought and often times screw up and make horrible mistakes. It's very very easy to make an algorithm that simulates that. Which is basically what mine is doing. Most people just use it like "OMG blob of enemy units! Must quick throw force fields in there somewhere to make it less room for them! Don't matter exactly where" That's all. That's how 90% of all force fields are used even in pro games. It's very easy to reproduce that same thing on the AI. | ||
elitesniper420
Canada135 Posts
problem solved | ||
| ||