Need help on creating an A.I.
Moderator: Forum Moderators
Need help on creating an A.I.
Hi, I'm currently trying to implement an A.I. on Wesnoth.
The problem is I really have no idea where to start.
I've tried reading http://wiki.wesnoth.org/WritingYourOwnAI but for some reasons I couldn't find the correct ai.cpp file that this page mentioned.
I did find some files named "ai.cpp" but none of that have the function "create_ai" that the page mentioned - -.
So if anybody could teach me how or point me to where I should be reading, that will be really helpful
thx
The problem is I really have no idea where to start.
I've tried reading http://wiki.wesnoth.org/WritingYourOwnAI but for some reasons I couldn't find the correct ai.cpp file that this page mentioned.
I did find some files named "ai.cpp" but none of that have the function "create_ai" that the page mentioned - -.
So if anybody could teach me how or point me to where I should be reading, that will be really helpful
thx
Re: Need help on creating an A.I.
Hi, IArgosyI. Yeah, that page is pretty outdated. If writing the AI in C++ is what you are looking for, I won't be able to help you, but if you're fine with using Formula AI or Lua AI instead, this is a good starting point: [wiki]Practical Guide to Modifying AI Behavior[/wiki].
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on
Re: Need help on creating an A.I.
Thanks mattsc, I am now studying Lua Engine. It seems simple enough, but I have some questions regards its capability.
I'm trying to develop an A.I. that can adapt to the player's level, so I need to also collect and store decisions that player(s) made.
Is this possible to created using Lua Engine? If so how(or is it already explained in the tutorials? I've only read a little bit of the tutorials and have absolutely no background knowledge of Lua)
I'm trying to develop an A.I. that can adapt to the player's level, so I need to also collect and store decisions that player(s) made.
Is this possible to created using Lua Engine? If so how(or is it already explained in the tutorials? I've only read a little bit of the tutorials and have absolutely no background knowledge of Lua)
- Alarantalara
- Art Contributor
- Posts: 787
- Joined: April 23rd, 2010, 8:17 pm
- Location: Canada
Re: Need help on creating an A.I.
No AI has direct access to the actions of the player — they run while the player is not playing. It is possible to capture player actions using WML events or by doing before/after comparisons of the game state at the end/beginning of the AI's turn.
WML can persist captured values to a persistent storage as of 1.10, so you should be able to use it to get what you want.
WML can persist captured values to a persistent storage as of 1.10, so you should be able to use it to get what you want.
Re: Need help on creating an A.I.
Apart from comparing the before/after state of the A.I. turn, is it possible to have the A.I. send some value(e.g. its CA score) to the map or to the other A.I.?