I'm lazy and I don't make maps but I like coding and I like problem solving so I'm hoping some of my little trigger projects can be of benefit to
someone else's map rather than just sitting around.
Now on to my general AI "solution" I really doubt it is original and I have suspicions it is unfeasible for some reason, but you guys can point those out.
The principle is simple, in order to create AI for a unit type you just cycle through each one of those units, give it a burst of 'intelligence', and move
on to the next one, repeat forever (or until you want it to stop, w/e)
As far as how thats done well, replace the unit with its hero counterpart, when there are no longer any of that unit, replace the hero with the original
unit and hey presto you've got a cycle.
The effect is you have a location (or locations more usefully) that are always centered on one of those units, a random one at any given point in time.
Then you can start constructing intelligent behavior inside those location, which will then be applied to all the units of that type, in due time.
Disadvantages:
-units are healed when switched as well as possible unwanted upgrades/downgrades (hero unit) You can slow down the rate at which the switching occurs,
lowing the probability of it happening during a fight but in general I recommend this AI for many weak enemies rather than few strong ones.
-the intelligence is not omnipresent, it will only occur when the unit is switched but you can make it affect the behavior of other units within a certain
vicinity of the intelligent one, you'll see this in the example map.
-unsuitable for air units, they stack on each other, this will cause issues in the switching of them, perhaps there is a work around, I don't know it.
-perhaps it goes without saying but this will only be useful for computer units, human players like controlling their units (I think) xD
Advantages
-only one computer required.
-can create special behaviors, abilities in units.
-can be used to procedurally create and remove spawn points and rally points + pretty well anything else you can think up (I can explain this fully if you're interested)
-area-sensitive that is to say you can make units behave one way or have an ability in one region and totally different behavior/abilities in another, with a seamless hand-off.
-lots of room for tweaking and optimizing.
So anyways I'll give a simple example of a problem and the solution with this system at it's heart.
Zombies, how to make them both wander randomly but also swarm, I also used the fact that the location is randomly at a zombie to make it so
zombies only spawn where there are already zombies, at a random one, also they spawn by killing something, in this case civilians.
(exponential growth of zombies = coolness)
As far as actual AI in this example it is only the bottom 2 triggers of player 2. If you want to play around with it the simplest thing to do
is to make location Z4 bigger, this will make them more swarmy and less wandery, have fun.
Err and keep in mind this is my first time posting and I realize this may be unfeasible but idk, so be honest but please don't be mean *hides in corner*
Oh and I forgot to mention for your viewing pleasure ore = number of zombies, gas = number of civilians ^_^
Attachments:
Post has been edited 1 time(s), last time on Feb 17 2010, 10:37 pm by Burgled.
None.