| 03-10-2003, 04:57 PM | #1 |
I'm creating a very different type of map that involves turn based strategy. Obviously, if a game is turn based, the basic AI's for the computer are useless. However, the computer displays certain "instinctive" behaviors that I'd love to tap into if I could. For example, the unless I'm mistaken, AI is usually smart enough to target the unit to which it will do the most damage. It's usually smart enough to use area spells only when there are many enemies nearby (and when it uses them, it targets them so as to do the most possible damage to enemies). Is this stuff buried in the AI and accessable to triggers, or is this a behavior that is a "lower level" of behavior than existis in the AI files? |
| 03-10-2003, 05:57 PM | #2 |
micro management is hardcoded. you cannot influence it, you can only turn it off by using some strange settings for the player |
| 03-10-2003, 07:38 PM | #3 |
Sigh, figured as much. Does there exist an algorithm to easily find a "cluster" of units if each unit has their own variable? In other words, suppose I have unit[1], unit[2], etc. In a turn based game, imagine there is a spell that has an area of effect which is a circle with a diameter of 500. Is there a way to have the computer quickly find out where to deploy that spell to get the most possible enemies covered? I'm looking for some sort of general principle here, not neccessarily a native blizzard function. |
| 03-11-2003, 10:22 AM | #4 |
I guess the easiest way would be to base the spell on a spell like Blizzard and let the hard coded AI take care of the rest, although I don't know how that would fit with your turn based thing. If you want to determine such a cluster yourself, I don't think that unit array is of much help. Instead the natives that pick all units of a player in a certain area should help. It is probably better not to try to find the exact maximum but instead use a heuristic to determine the target area. I'd try something like dividing the area around the caster in large overlapping rectangles. Then you pick the units in these and find out in which of these most enemies are. After that divide this rectangle again in smaller ones and do the counting again. Repeat that until you have reached approximately the size of your spell. Now cast the spell to the middle of that rectangle. You could of course also do the scanning with circles but I do not think that would improve the result. Beware that this is not very cheap of course but I guess in a turn based fight that should not matter. |
| 03-11-2003, 08:53 PM | #5 |
Guest | Do you have to have an AI script loaded for a hero to cast a spell or will he cast whatever he has learned whenever it wants. I decided not to use an AI script since my map doesn't follow most of the traditional rules (no towns, etc.) and I find the AI gets confused when it uses the built in functions. Instead, I opted for a more laggy, Issue Order trigger that is fairly interactive with what's going on in-game. I'm wondering if this will cause me any trouble for spell casting, however. I know I'll have to train the hero with triggers, but I'm more concerned with whether or not a creep or hero will CAST the spell if there are zero AI scripts loaded at all. |
