Page 1 of 5

New Ai Ideas

Posted: 01 Sep 2008, 09:11
by isieo
This should be where we start our new AI disscussion.
as we finialize some stuff this thread should go back to Devs corner.

Some rules we should have in this thread:
- If you don't like someone's idea , don't just say you don't like it, please state how to improve it.
- don't flame... err that's it i think.

We should start by stating the weakness of the current AI
then
How to make it Better
then
Map out the specs for the new AI

also please Read:
http://www.openkore.com/wiki/index.php/ ... k_overview

Documentation available here: http://www.openkore.com/srcdoc/

Re: New Ai Ideas

Posted: 01 Sep 2008, 09:20
by isieo
Klabmouse's idea for new Ai:

Code: Select all

Task usage Map:

Task
|-CharacterAI
| |-Route
| | |-GlobalRoute
| | | |-Skill
| | |-MapRoute
| | | |-Skill
| |-Follow
| | |-Route
| |-Attack
| | |-Equip
| | |-Skill (Self)
| | |-Skill (Combo)
| | |-Skill (Attack Skill)
| | |-ItemUse
| | |-Follow
| | | |-Route
| | |-KeepDistance
| | | |-Route
| |-AutoShop
| | |-Route
| | |-Buy
| | |-Sell
| |-Storage
| | |-Route
| |-Skill (Non Attack mode)
| |-ItemUse (Non Attack Mode).
| |-Idle (Sit, Stand, etc.)
|-HomunculusAI
| |-Route
| | |-GlobalRoute
| | | |-Skill
| | |-MapRoute
| | | |-Skill
| |-Follow
| | |-MapRoute
| |-Attack
| | |-Skill (Self)
| | |-Skill (Combo ??? )
| | |-Skill (Attack Skill)
| | |-ItemUse
| | |-Follow
| | | |-Route
| | |-KeepDistance
| | | |-Route
| |-Skill
| |-Idle (Pseudo state)

Tasks that use AI functions:
GlobalRoute -- uses AI to decide whatever we must use any types of Wing's, or cast Skill like teleport to get to the dest point quicker.
MapRoute -- uses AI to decide whatever we must use any types of Wing's, or cast Skill "Protal" to the dest point quicker.
Attack -- uses AI to decide: What Equip to use; What Skill we must cast now, and on who; What item we must use; Whatever we must follow target; Whatever we must KeepDistance (for "Sages" and "Archers").
KeepDistance -- uses AI to decide the spot where to go, that we don't get hurt by target or multipe Actors.
Follow -- uses AI to decide the spot where to go, that we will keep distance to target and don't get in Target way or attacked by one or multiple Actors.
AutoShop -- uses AI to decide what to sell, what to buy, in what sequence.
Idle -- uses AI to decide whatever we must sit to recover some.

Re: New Ai Ideas

Posted: 01 Sep 2008, 09:56
by kLabMouse
OK. We don't have Task that can work with more then one SubTask at a time.
We need it to make OK to do some things in one time.
Now, it can DO more then one Task. But we have no system to work with multiple SubTasks.

You ask. Why do we need it???

Lets see my favorite example.
"Sage" can do more then one task at a time. Like Keeping Distance from mob, while attacking it with skills.
If we want "Task::Attack" to be real, we need some adjustments to the current "Task framework".
"TaskManager" must control "Tasks" and "SubTasks".
So the "Task" itself won't loose it's time to control it's "SubTasks" and loose performance.

Re: New Ai Ideas

Posted: 02 Sep 2008, 12:06
by isieo
i have created a svn branch for this,

please use svn repository: https://openkore.svn.sourceforge.net/sv ... tal-ai2008

this is so everyone can see the code and help out.

Re: New Ai Ideas

Posted: 03 Sep 2008, 02:39
by kLabMouse
isieo wrote:i have created a svn branch for this,

please use svn repository: https://openkore.svn.sourceforge.net/sv ... tal-ai2008

this is so everyone can see the code and help out.
Thanks. But I think. that this branch will not run until it's get debugged.
Because, first of all, I'll commit drafts there, so everybody can debug it, fix, and add functionality.

P.S. Sorry. I cannot Access OpenKore SVN.

Re: New Ai Ideas

Posted: 03 Sep 2008, 04:47
by isieo
i reset your svn access, so you should be able to get access now.

also this branch can be left broken since no one will use it other than developers.

Re: New Ai Ideas

Posted: 03 Sep 2008, 04:56
by kLabMouse
isieo wrote:i reset your svn access, so you should be able to get access now.

also this branch can be left broken since no one will use it other than developers.
OK. Thanks.

Committed Task::WithSubTasks draft.
I've never run it, so it need to be checked and double checked, and even triple checked.

Re: New Ai Ideas

Posted: 16 Sep 2008, 06:32
by kLabMouse
On the planing work.
I've experienced some Problems with making AI Simple and Task based.
What I suggest:
1) AI must be Modular.
1.1) AI must have only basic Features like: Attack, PickUp, Walk, MapRoute
1.2) All other Stuff are Added using "AI Module System". (For Example: AutoSell/AutoBuy is an a custom Module, that will register itself as AI Module and add it's functionality.)
1.3) All AI Modules can be Easly Activated and DeActivated
1.4) Every AI Module have it's own mutex, priority, stop marker (IF Module Spawn a Task, All other [conflicting] modules will be suspended until that Task is done).
2) Homunculus and Mercenary uses and run LUA files from Client (this will reduce CPU load, make Simple AI). And are made using (1).
What Developers will Suggest???
Is it a good thing, to lower AI Code line, add AI Functionality, make AI Scalable.

Re: New Ai Ideas

Posted: 16 Sep 2008, 06:58
by Bibian
Well we do need simple tasks that are directed by higher tasks...

For example "attack" would have to move towards the target, decide wether or not to use skills and melee (or not) the target..
be aware though that a target does NOT have to be a monster, it can be a monster AND player (but we should not let the AI support PvP by default)
But we have to have the possibility to give a player as target

Re: New Ai Ideas

Posted: 16 Sep 2008, 09:29
by sli
The AI should be written in C.