Forcefields can be used both offensively and defensively. There are probably just too many possibilities for forcefields and the AI wouldn't be able to utilize to their full potential. They would also have to realize all the kinds of things they can do (like blocking a ramp to stop reinforcements from the natural while you take out the main) which will take a very long time considering SC2 is still, in a way, fairly new.
On June 14 2011 08:26 StormsInJuly wrote: I'm not even sure blizzard realized the potential for forcefield back when they were developing the game
Im possitive they did. They did have people like david kim playing it afterall. I keep checking this thread for more developments of people actually doing it aha.
Forcefielding a ramp is the easy part. Using forcefield to control space during a battle, to cut off retreats or to split an army or to create a better concave, is incredibly hard to code.
I think I have an idea that at worse is much better than NP hard. I think it's N^2*O where N is the number of enemy units and O is the number of force fields.
For each enemy unit determine what enemy units around it would get pushed and where. Draw a straight line away from the center of the force field to determine where that unit "in theory" would be moved to and keep track of "how far" that unit would be pushed relative to the sentry, closer or farther away. From that grouping use the Variance to determine which force field "splits" the most units, and add some way of "preferring" units closer to the sentry so you don't try to ff the middle of the ball and die in the process.
This is like a situation that came up in a video game I finished working on recently called Fender Bender. The issue here was that the AI vehicles could collect and use shields. The problem was they could be programmed to be used at perfect times in the game without weapon switching delay. They also could collect the shields when available at the best times. One of the ways we dealt with this was by only allowing the hardest difficulty of AI to use the shields. We also gave the shield equal priority to all other pickups.
How this applies to Starcraft: In insane mode force field could def. be used. When battle has been detected by the ai. It can determine the largest sphere created by connecting unit positions together. This bounding sphere can then be split in half. At the center point the force field could be casted allowing for "perfect" army splits.
To take this a step further. The AI is able to understand enemy army size. If the enemy is stronger then the computer, the AI can detect how far the battle commencing is from a nexus and if a ramp is near by. If its with in a certain range then it can cast force field on the ramp blocking the enemy.
Finally: Guardian shield is nice so the AI can just decide that if a guardian shield is active then the other sentries can cast force field.
This code would not be difficult to write in, it's probably that the amount of work load already thrown at the programmers was too much to try and include everything.
Since I am working full time, I don't have so much time to work on the AI.
I've fixed a bug that made it FF too early when attacking from the right. It now automatically detects what kind of FF it should use(Currently limited to either split or defensive surround against enemy melee units)
It's fun to see 20 sentries own 1000 speedlings without any losses. They could probably beat 2000.
I remade the splitting code so I can easily adjust the amount of force fields used. I haven't added the automatic adjustment of the amount of force fields. Not because it's hard, just because I've been prioritizing other stuff.
Adding ramp force fielding requires pathing algorithms that I know EagleAI has but that I don't have. I will try remaking the part I need.
Rudimentary forcefielding would not be particularly hard to program. Obvious things like ramps or splitting an army in half or blocking melee units is easy.
Things begin to get more difficult outside of those trivial situations. For instance:
-Suppose you only have enough energy for say 5 forcefields while your army engages in a wide open area. Would the AI know where to optimally place those forcefields? This problem involves things like existing Terrain, the position/range/speed/damage/composition/etc. of not only the Protoss units but the enemy units as well. I'm sure you could program the AI to figure this out given time, but it becomes much more difficult.
-Suppose its a PvP and the enemy has a slightly larger Colossus count. Would the AI know that FF might end up being detrimental because it would help the enemy colossi? Would it be able to account for massive units possibly breaking FF. How would each of those things affect the rest of the army? Also, would the AI be able to calculate that if it placed FF in a certain way, how the enemy army might reposition and possibly take advantage of the AI's own FF's (i.e repositioning Colossi in a line parallel to the FF's).
All of those things would need to be taken into consideration. Otherwise the AI would be easily exploitable. Making an AI to FF trivial situations is pretty easy. Making one that places optimal FF, can take advantage of them correctly, prevent the enemy from taking advantage of them, and works on all maps and engagement situations would be extremely difficult.
On June 15 2011 08:16 Sevenofnines wrote: Rudimentary forcefielding would not be particularly hard to program. Obvious things like ramps or splitting an army in half or blocking melee units is easy.
Things begin to get more difficult outside of those trivial situations. For instance:
-Suppose you only have enough energy for say 5 forcefields while your army engages in a wide open area. Would the AI know where to optimally place those forcefields? This problem involves things like existing Terrain, the position/range/speed/damage/composition/etc. of not only the Protoss units but the enemy units as well. I'm sure you could program the AI to figure this out given time, but it becomes much more difficult.
-Suppose its a PvP and the enemy has a slightly larger Colossus count. Would the AI know that FF might end up being detrimental because it would help the enemy colossi? Would it be able to account for massive units possibly breaking FF. How would each of those things affect the rest of the army? Also, would the AI be able to calculate that if it placed FF in a certain way, how the enemy army might reposition and possibly take advantage of the AI's own FF's (i.e repositioning Colossi in a line parallel to the FF's).
All of those things would need to be taken into consideration. Otherwise the AI would be easily exploitable. Making an AI to FF trivial situations is pretty easy. Making one that places optimal FF, can take advantage of them correctly, prevent the enemy from taking advantage of them, and works on all maps and engagement situations would be extremely difficult.
exactly what you said, sir.
a 'stupid' FF-AI is pretty easy to code, an intelligent one is not.
On June 15 2011 08:16 Sevenofnines wrote: Rudimentary forcefielding would not be particularly hard to program. Obvious things like ramps or splitting an army in half or blocking melee units is easy.
Things begin to get more difficult outside of those trivial situations. For instance:
-Suppose you only have enough energy for say 5 forcefields while your army engages in a wide open area. Would the AI know where to optimally place those forcefields? This problem involves things like existing Terrain, the position/range/speed/damage/composition/etc. of not only the Protoss units but the enemy units as well. I'm sure you could program the AI to figure this out given time, but it becomes much more difficult.
-Suppose its a PvP and the enemy has a slightly larger Colossus count. Would the AI know that FF might end up being detrimental because it would help the enemy colossi? Would it be able to account for massive units possibly breaking FF. How would each of those things affect the rest of the army? Also, would the AI be able to calculate that if it placed FF in a certain way, how the enemy army might reposition and possibly take advantage of the AI's own FF's (i.e repositioning Colossi in a line parallel to the FF's).
All of those things would need to be taken into consideration. Otherwise the AI would be easily exploitable. Making an AI to FF trivial situations is pretty easy. Making one that places optimal FF, can take advantage of them correctly, prevent the enemy from taking advantage of them, and works on all maps and engagement situations would be extremely difficult.
I agree With your first paragraph. Stupid FF ai is easy to make. I just think making smart FF ai is easier to make than you say.
First of all I see it like this: There are three levels. Stupid ai, player-like ai(FFs are not always optimally placed and sometimes it can be abused, just as a normal player), smart ai.
Creating a smart ai that always places optimal FF in all situations is extremely hard. Creating a player-like ai with a high sucess-rate is not.
Now for your difficult situations. My ai analyzes the two armies(not extensively, just a little), it will check terrain soon. Not perfectly ofc but I will improve it over time.
Checking coloossi count is very easy, so is checking for massive units.
Your last argument about repositioning and taking advantage seems very vague. It seems like something players dont think about and that they might be abused in the same Way.
I hope my entire post is readable. writing it on a small smartphone is hard work.
I haven't had time working on this lately due to work and other projects but I thought I should upload what I made so far. There is no difference between the attacks(except the units). The AI automatically detects which kind of force fields it should use(split or surround)
I know the surround part is kind of boring. Interesting fact, 24 sentries should be able to beat an infinite amount of lings using this since 6 sentries is enough to force field a ramp indefinitely. This means 24 sentries can keep 4 force fields up indefinitely which is what is needed to help them survive.
On June 19 2011 02:27 Siretu wrote: I haven't had time working on this lately due to work and other projects but I thought I should upload what I made so far. There is no difference between the attacks(except the units). The AI automatically detects which kind of force fields it should use(split or surround)
I know the surround part is kind of boring. Interesting fact, 24 sentries should be able to beat an infinite amount of lings using this since 6 sentries is enough to force field a ramp indefinitely. This means 24 sentries can keep 4 force fields up indefinitely which is what is needed to help them survive.
Cool, cool! Now you gotta get those isolated cases into a multiplayer AI and see how well you can get it to decide when to FF
I will but I have two things left to fix first. 1. terrain check. 2. make sure they dont Force field if all the sentries together cant make all the Force fields needed. right now 1 sentry will try to shield itself with Force fields even if it only has enough energy for one.
after that is added, i will add it to the standard ai and see what happens.