Thursday, January 8, 2009

Mission: Ambition?

Currently, we have five heroes that do not have a properly implemented AI. If heroes continue to be remade (which is likely, given the rate at which they have been remade in recent history), then this number will increase, and most likely faster than the total number of heroes in the game.

Continuing to port this AI over repeatedly will undoubtedly be less and less playable. Statistically speaking, if four more heroes are to be remade, this will up the percentage of heroes without AI to about 10%. Given that most DotA games have 10 players/bots, this would mean that, statistically speaking, almost every game would have at least one unusable AI hero.

What does this mean? It means that unless someone steps up to start doing their own thing, the viability of porting is going to steadily decrease. So...let's step it up.

I've been doing some planning and brainstorming, and what I envision looks something like this (note that this is rough brainstorming and subject to change):

Instead of multiple triggers that iterate through all AI-controlled heroes periodically, each AI bot will have its own set of dedicated triggers. I'm not sure of the performance ramifications of this, but it will allow greater flexibility in designing unique AI on a per-hero or per-difficulty basis, and will also allow for multiple AI personalities.

Each bot will have:
1. Basic trigger - Dictates the basics, like movement, last-hitting, retreating, that kind of stuff. This can be altered by people who want to make or fine-tune the AI, and also allows for multiple AI personalities (like dictating real differences between "Easy" and "Insane").
2. Item trigger - Dictates item use, depending on what types of items the hero might get. This can be general or specific, the former allowing greater flexibility in altering item builds ("I wonder how this hero would use this build...") and the latter allowing greater effectiveness ("Let's see how this hero uses THESE items").
3. Skill trigger(s) - Dictates how heroes will use their abilities. These can be linked (sequential skill combos) or independent (like using Wrath when a low HP enemy hero is visible somewhere). The reason for making these on a per-hero basis should be fairly obvious.
4. Item build trigger - Dictates how/when items are built and bought. Most of this is done already, thanks to 6.49c and the guys over at the OpenAI forum for their hard work in creating builds. Again, doing this on a per-hero basis will allow greater flexibility (maybe even have AI move to the secret shop to buy things?).
5. Other triggers - These can be added later, but would dictate things like ganking, attacking Roshan, neutraling, warding, checking for runes, taking over for leavers, etc.

Rough flow would go along the lines of having the basic trigger run most of the time, with the other triggers more or less idling in the background until conditions are met. Once one of these conditions is met, AI logic will branch along this auxiliary condition and temporarily suspend basic actions. Once auxiliary functions are completed (or aborted), basic trigger will resume command.

For example, an AI Zeus will wait and last-hit for a while (basic trigger) until it has a level greater than 3, has a good deal of mana, and an enemy hero pokes its head in the group of creeps (auxiliary condition). Zeus will temporarily stop last-hitting (disable basic trigger), cast Lightning Bolt (skill trigger), possibly Chain Lightning (continued skill trigger), then resume last-hitting (resuming basic trigger). Zeus then notes that the enemy is visible and has less than 200 HP (independent skill trigger) so he casts Thundergod's Wrath. Now Zeus is richer and happy, but out of mana and maybe low on HP for various reasons not mentioned, so he decides to go back and heal (resumes basic trigger/retreat functionality).

Just a basic example (and a good starting point for me, actually).

Well, it's an idea anyway. Working on an independent AI script will also allow us to stop porting all the time, which would eliminate any porting bugs and improve portability from version to version without having to recreate each change.

The downside? This is going to take much, much longer and a whole lot more work than porting. Fortunately all of the porting experience has made me fairly familiar with the structure of the map, so this should be easier than starting from scratch WITHOUT prior knowledge of the map (but that's a given).

What does this mean for now? Well, I'll probably release Rev. 3 tonight (I thought of an idea to fix -sc, but haven't tried it yet), and probably an incremental map too (I added a hero I thought up of earlier this week), and I'll try to continue to port and release incremental maps when I can, but I wouldn't count on them coming out as rapidly as they used to. On the other hand, we might have other beta maps to look forward to.

Or this could all be hypothetical and I'll fail horribly in practice. I guess we'll see. =P

6 comments:

Overflow said...

The only thing you're failing at is expecting a 200 HP hero to die from a level 1 Thundergod's Wrath. xD

The rest of your post is full of win, I'm looking forward to a revival of the openAI forum. Let's get busy!

Nostrazugus said...

I know you can do it !
Take the time it needs. The only thing, we, users of your maps, expecting is some news to see how this project goes

override182 said...

Does this mean perhaps BMP will release his own version of AI plus maps? cool... ~ it may take longer time but perhaps, its worth of waiting..

Jerzy said...
This comment has been removed by the author.
Jerzy said...

BuffMePlz^^ You're Great! Can I Help you in any way? Mail me plz dongiorgio.zwierzollo@gmail.com

ChaL said...

Great! AI by BuffMePlz
Not the ported one.
Can't wait for it.
Take your time!