Code it so FF never overlap by more than a few pixels but always touch.
Code it so they do not use FF unless enemy army is at least 50% as strong as yours.
Code FF to never cover more than a certain % of impassable terrain.
Forum Index > StarCraft 2 HotS |
AzureD
United States320 Posts
Code it so FF never overlap by more than a few pixels but always touch. Code it so they do not use FF unless enemy army is at least 50% as strong as yours. Code FF to never cover more than a certain % of impassable terrain. | ||
dimfish
United States663 Posts
On June 09 2011 07:56 Siretu wrote: What handy functions? In the editor scripting language? Lying around in the universe? What is the algorithmic complexity of them? There will undoubtedly be a trade-off of precision for speed. Show nested quote + On June 08 2011 08:39 dimfish wrote: It might not seem that hard to code this up, but the issue is that it is a lot harder to define optimal FF casting than to say, define optimal kiting. Let me break it down for you if don't write code. In your mind you picture a situation with a blob of Protoss units and some sentries against some Terran units marching over in a ball, and you're like "oh, my toss army is bigger, so I would just FF a good-sized chunk of his stuff towards me I know I can kill." This is not how computers think! There are a ton of conditions your human brain can recognize in an instant. Computers have to think much more rotely. Let's assume the FF AI you write has perfect knowledge (map hack, whatever you want to call it). The AI does not "see" the picture above that you saw. It sees the data of the game like this. Player 1: Zealot @ location 4, 5, facing 56 degrees Zealot @ location 6, 2, facing 10 degrees Sentry @ location 3, 3 facing 10 degrees Player 2: Marine @ location 1, 1, facing 115 degrees Marine @ location 1, 2, facing 110 degrees etc. Now with a list of units and locations, what do you do? Are the armies close, far, scattered all over, what? Someone earlier in the thread mentioned you should do some kind of clustering algorithm on the units, which is a good start. The point is, you have to write the code to account for the entire range of data. What if the Terran player has single marines standing around the map? Do you want your FF AI to spend energy trapping and killing one marine? If three SCVs and one marine charge up your ramp would you FF it? Your AI might unless you define very clearly what is dangerous and what is not. What if you decide the Terran army is actually in a ball, and your army is actually in a ball and the conditions are right for casting FF? Should you just fire them off? Maybe not! Maybe the Terran army is actually walking away from your ball and in the time it takes your sentries to carry out the FF order you give it, the Terran units will be gone, and poof: silly-looking FF! This observation alone means a good FF AI will probably need to do some planning and keep sentries in range of points that might be good FF spots in the future. I think a good FF AI is certainly doable, it will just take some serious development time. I disagree. There are a lot of handy functions to easily work out how scattered the army is and if it's a decent amount of enemy units(not just a single marine). On June 09 2011 07:56 Siretu wrote:Force fielding a ramp is harder and would take some time but I think I could probably make a decent one within a day of serious coding. Blizzard has a bunch of great programmers who should be able to fix it pretty fast. I challenge you to actually sit down and try this and then post your AI after a week, even. And all it has to do is be the supplied game AI except you added some FF behavior. The scripting -> load in game -> test -> change code cycle is already really long compared to other forms of software development. Blizzard has a history of leaving stuff out if they aren't going to do it right. I suspect good FF AI didn't meet this criteria. If they could do it in a day, it'd be there.On June 09 2011 07:56 Siretu wrote:The question is, does the AI have to be better than a human? You mention "keeping sentries in range of points that might be good FF spots in the future." What human actually does that. I mean, you might sort your sentries so they're in the middle so they can get in range for the force fields but it's not like you're actually trying to calculate the best spot for them to be at to make sure they can cast their force field. Haha, now we're getting the difference between human and AI play! Of course a human doesn't sort their sentries, because a human can see an opportunity for FF coming in advance and also be able to tell whether the sentries will be in range, or maybe grab them all and move them up. A human brain feels a battle coming and knows where enemy units are likely to be in a few seconds from now. These are all much more difficult for an AI to "know."Without planning (meaning watching the past and predicting the future) an AI will just realize, in an instant, "hey there is a good FF spot, RIGHT THERE" and it might 1) cast the FFs if the sentries are in-range or close to in-range or 2) realize the sentries are out of range and not cast the FF. Or cast them anyway and hope for the best, and maybe do some really silly stuff. What I'm getting at is, to a human watching, the AI will sometimes do smart things and sometimes appear to be incredibly stupid. It's all because you have to tell the AI EXACTLY what to do in EVERY situation which is a lot harder for a us to write down in code (for something complex like casting FF) than to just do it yourself with human intuition. Now banshee micro on the other hand has an easily-expressed behavior. "If something that can shoot you is in range->move away from it, otherwise move toward the nearest known target." BAM! Only mechanics are holding humans back from being banshee gods! You can probably get a really nasty Bansee AI going in a day for sure. | ||
ftl
28 Posts
I have no doubt that, with access to the Blizzard AI code, a good programmer or a good team would be able to do something with forcefields which is better than nothing. The more time you spend on it, the more intricate it can be - something really basic within a day, something more reasonable in a month. But would it make for a good game? For example, if the AI would often make decisions that are good but sometimes make forcefields that *look really stupid* - then the casual player playing against the AI wouldn't have as much fun, because it's no fun to win against someone who looks like they're playing retarded. (Remember, the point of the built-in AI is to challenge casuals and give them something to play against! It's not to be the best AI it could be!) Likewise, if a natural result of the forcefield AI is that the AI would end up perma-forcefielding its ramp when it's been beaten... that would make for a really frustrating game. The human player is in a winning position, but still has to play on for half an hour to build a completely new army that can break a one-base anti-air army, because their ground army is permanently forcefielded outside. It's annoying and frustrating, especially to a casual player. Is it worth introducing those possibilities to the AI? Maybe it is, maybe it isn't. But the point is that the AI has to also look good and be a good opponent for casuals. Making an AI that can beat serious gamers was never the point. | ||
Siretu
151 Posts
On June 09 2011 08:36 dimfish wrote: Show nested quote + What handy functions? In the editor scripting language? Lying around in the universe? What is the algorithmic complexity of them? There will undoubtedly be a trade-off of precision for speed. On June 09 2011 07:56 Siretu wrote: On June 08 2011 08:39 dimfish wrote: It might not seem that hard to code this up, but the issue is that it is a lot harder to define optimal FF casting than to say, define optimal kiting. Let me break it down for you if don't write code. In your mind you picture a situation with a blob of Protoss units and some sentries against some Terran units marching over in a ball, and you're like "oh, my toss army is bigger, so I would just FF a good-sized chunk of his stuff towards me I know I can kill." This is not how computers think! There are a ton of conditions your human brain can recognize in an instant. Computers have to think much more rotely. Let's assume the FF AI you write has perfect knowledge (map hack, whatever you want to call it). The AI does not "see" the picture above that you saw. It sees the data of the game like this. Player 1: Zealot @ location 4, 5, facing 56 degrees Zealot @ location 6, 2, facing 10 degrees Sentry @ location 3, 3 facing 10 degrees Player 2: Marine @ location 1, 1, facing 115 degrees Marine @ location 1, 2, facing 110 degrees etc. Now with a list of units and locations, what do you do? Are the armies close, far, scattered all over, what? Someone earlier in the thread mentioned you should do some kind of clustering algorithm on the units, which is a good start. The point is, you have to write the code to account for the entire range of data. What if the Terran player has single marines standing around the map? Do you want your FF AI to spend energy trapping and killing one marine? If three SCVs and one marine charge up your ramp would you FF it? Your AI might unless you define very clearly what is dangerous and what is not. What if you decide the Terran army is actually in a ball, and your army is actually in a ball and the conditions are right for casting FF? Should you just fire them off? Maybe not! Maybe the Terran army is actually walking away from your ball and in the time it takes your sentries to carry out the FF order you give it, the Terran units will be gone, and poof: silly-looking FF! This observation alone means a good FF AI will probably need to do some planning and keep sentries in range of points that might be good FF spots in the future. I think a good FF AI is certainly doable, it will just take some serious development time. I disagree. There are a lot of handy functions to easily work out how scattered the army is and if it's a decent amount of enemy units(not just a single marine). Show nested quote + I challenge you to actually sit down and try this and then post your AI after a week, even. And all it has to do is be the supplied game AI except you added some FF behavior. The scripting -> load in game -> test -> change code cycle is already really long compared to other forms of software development. Blizzard has a history of leaving stuff out if they aren't going to do it right. I suspect good FF AI didn't meet this criteria. If they could do it in a day, it'd be there.On June 09 2011 07:56 Siretu wrote:Force fielding a ramp is harder and would take some time but I think I could probably make a decent one within a day of serious coding. Blizzard has a bunch of great programmers who should be able to fix it pretty fast. Show nested quote + Haha, now we're getting the difference between human and AI play! Of course a human doesn't sort their sentries, because a human can see an opportunity for FF coming in advance and also be able to tell whether the sentries will be in range, or maybe grab them all and move them up. A human brain feels a battle coming and knows where enemy units are likely to be in a few seconds from now. These are all much more difficult for an AI to "know."On June 09 2011 07:56 Siretu wrote:The question is, does the AI have to be better than a human? You mention "keeping sentries in range of points that might be good FF spots in the future." What human actually does that. I mean, you might sort your sentries so they're in the middle so they can get in range for the force fields but it's not like you're actually trying to calculate the best spot for them to be at to make sure they can cast their force field. Without planning (meaning watching the past and predicting the future) an AI will just realize, in an instant, "hey there is a good FF spot, RIGHT THERE" and it might 1) cast the FFs if the sentries are in-range or close to in-range or 2) realize the sentries are out of range and not cast the FF. Or cast them anyway and hope for the best, and maybe do some really silly stuff. What I'm getting at is, to a human watching, the AI will sometimes do smart things and sometimes appear to be incredibly stupid. It's all because you have to tell the AI EXACTLY what to do in EVERY situation which is a lot harder for a us to write down in code (for something complex like casting FF) than to just do it yourself with human intuition. Now banshee micro on the other hand has an easily-expressed behavior. "If something that can shoot you is in range->move away from it, otherwise move toward the nearest known target." BAM! Only mechanics are holding humans back from being banshee gods! You can probably get a really nasty Bansee AI going in a day for sure. The handy functions available in the editor allow you to easier work out if there's a deathball or just some spread out units. I mean, when you're coding you can get more out of the AI than just the location and rotation. Things like going through the enemy units close to your own army and checking how many units are around each of them will easily give you a trigger that finds out what kind of army(wide-spread, deathball, just a couple of units) you're dealing with. I have to again mention EagleAI(Search for it on battle.net). It uses some pretty good force fields(not for ramp blocking but for splitting armies). Just make sure you set it to a hard difficulty or it wont have enough attention points to do it. Even though there's already AI that does it, I will sit down and make a Force Field AI. Not right now since I have 3 parties this week and then my summer job starts next week. This means I wont have a serious day of coding available so I'll have to spread it out. Also, when it comes to ramp force fielding you would need a pathing system to recognize a ramp(Which is possible. EagleAI does it). If you include coding this, it would be hard to do it within a day. I cba doing a pathing system so I will create a simple splitting AI(As well as surrounding) I agree with your other points. I just didn't think most protoss players microed their sentries positions that much(I am not a protoss, so I wouldn't know) And yes, things with easily-expressed behaviors are easy to create and AI for. I've easily done kiting, storming/emp'ing the most dense area and avoiding storm damage. | ||
GGitsJack
New Zealand426 Posts
| ||
xaeiu
432 Posts
On June 09 2011 19:38 GGitsJack wrote: Soon we can get an insanely-insane out of this world A.I that our pro gamers cant even beat :D what's more insane than a cheating ai? | ||
HoMM
Estonia635 Posts
On June 09 2011 19:38 GGitsJack wrote: Soon we can get an insanely-insane out of this world A.I that our pro gamers cant even beat :D That's what they said about chess... ![]() | ||
typedef struct
United States84 Posts
1. Am I up a ramp, or containing an enemy up a ramp? Easiest case, basically a specialization of #3. Friendly strength vs perceived enemy strength, cast in time to allow 0-50% of enemy forces up/down. 2. If I outrange the enemy units, are they clumped enough to put them in FF-jail, and do I have enough to kill them before they get out? Straightforward. Of course if the value of the enemy units is less that the value of my sentry energy, don't do this. 3. Are there 2 impassable terrain features close enough, and I do have enough FF, to completely block off the enemy's avenue of approach? The primary case. Cast a line of FF, perpendicular to the enemy's avenue of approach, connecting 2 impassable terrain features. When to cast depends on friendly strength vs perceived enemy strength. Could be after 0-100% of enemy forces have passed the desired FF area, with additional considerations. If I have HT, I want to let enough through for 1 storm to fully cover without wasting any of the storm. If I'm Zealot-heavy, let enough through that I don't run into my own FF. 4. If I outrange the enemy, do I have enough FF to put myself in FF jail? Getting desperate here. Your stalker ball has been swarmed by lings. 5. You're a Protoss in the open with no sentry energy. gg | ||
Eiviyn
United Kingdom169 Posts
If all you wanted was a FF line down the (perpendicular) middle of the group, it'd take a few minutes tops to make. | ||
RoyalCheese
Czech Republic745 Posts
| ||
BadgerBadger8264
Netherlands409 Posts
| ||
Siretu
151 Posts
| ||
butchji
Germany1531 Posts
On June 09 2011 23:52 HoMM wrote: Show nested quote + On June 09 2011 19:38 GGitsJack wrote: Soon we can get an insanely-insane out of this world A.I that our pro gamers cant even beat :D That's what they said about chess... ![]() And it's true now? | ||
MrTortoise
1388 Posts
you just have to make it look like its about ruight in 80% of situations yes you can abuse AI ... but if you want ed to write something to solve a sitaution you probably could ... it just that it wouldn't work realtime ... its kind of why people need to play for a LONG time to learn ... and people learn REALLY fast. All you need is avague approximation. | ||
Medrea
10003 Posts
| ||
Siretu
151 Posts
Edit: Some updates on the challenge dimfish gave me. I started coding 16.00 GMT +1 but I did lots of other stuff in the 7h since I started(Eating dinner, being outside, watching TLAttack) So I'd say I worked for about 3h. I am by no means one of the better SC2 mapmakers around but I now have an AI that can easily do a correct split of an attacking and moving army. I can also on command make it surround itself in force fields to protect from melee attackers. | ||
FudgeMunkey
Australia59 Posts
If you try that mission again (save before the ffs then reload save file) then the ffs will most likely be placed in the exact same place as before... | ||
dimfish
United States663 Posts
On June 12 2011 23:58 Siretu wrote:Edit: Some updates on the challenge dimfish gave me. I started coding 16.00 GMT +1 but I did lots of other stuff in the 7h since I started(Eating dinner, being outside, watching TLAttack) So I'd say I worked for about 3h. I am by no means one of the better SC2 mapmakers around but I now have an AI that can easily do a correct split of an attacking and moving army. I can also on command make it surround itself in force fields to protect from melee attackers. HAhha, awesome! One more tricky thing: how many forcefields should you use in any given engagement? MAke this thing bad-ass | ||
Siretu
151 Posts
That's the diameter of a circle that fits the entire army in it. A force field has a diameter of 3. So use (Army diameter) / 3 force fields and probably round up. Don't forget to check you actually got the energy to finalize the wall-off. Right now it uses 7 force fields for splitting and when it surrounds itself in force fields it makes as many as are needed to protect the entire sentry ball(There was some trigonometry involed, damn I hate trigonometry) | ||
DocNemesis
Philippines446 Posts
| ||
| ||
![]() StarCraft 2 StarCraft: Brood War Dota 2 Counter-Strike Super Smash Bros Heroes of the Storm Other Games Organizations Dota 2 Other Games StarCraft 2 StarCraft: Brood War
StarCraft 2 • Berry_CruncH200 StarCraft: Brood War• RyuSc2 ![]() • davetesta41 • Hupsaiya ![]() • IndyKCrew ![]() • sooper7s • AfreecaTV YouTube • Migwel ![]() • intothetv ![]() • LaughNgamezSOOP • Kozan Dota 2 League of Legends Counter-Strike Other Games |
GSL
Rogue vs GuMiho
Maru vs Solar
Online Event
Replay Cast
GSL Code S
herO vs Zoun
Classic vs Bunny
The PondCast
Replay Cast
WardiTV Invitational
OSC
Korean StarCraft League
SOOP
sOs vs Percival
[ Show More ] CranKy Ducklings
WardiTV Invitational
Cheesadelphia
CSO Cup
GSL Code S
Sparkling Tuna Cup
Replay Cast
Wardi Open
Replay Cast
Replay Cast
RSL Revival
Cure vs Percival
ByuN vs Spirit
RSL Revival
herO vs sOs
Zoun vs Clem
|
|