Qbasicnews.com

Full Version: computer game AI
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
im almost done with the beta version of a turn based strategy game similar to warcraft or age of empires. its tile based and relatively simple... however i was wondering if anyone has any good ideas or techniques for AI programming. My only guess is a huge set of conditions, but im not sure if thats the right direction i need to go. anyway, if you know anything about computer AI, id appreciate any suggestions u might have.
You can drop progger a message, him and agamemnus are workin on a RTS, but seeming as yours is turn based, you might want to go in a different direction.

1) you could have it based on several conditions
2) Have the AI do it's own thing(depending on difficulty) until you get within certain bounds of them.
3) make the AI have objectives (if gold=0 then workers mine gold, if gold=3000 then workers hunt, if food=3000 then if gold=3000 then build soldiers(5))so on and so forth...

but of course you would have to combine 3 and 2 for the best results...
If you know much about genetic programming, etc., you might be able to have the computer teach itself the AI, if the game isn't *too* complex.

If not, then email me the beta, and I'll try. But I won't promise anything. Tongue
sorry but i think it is funny to have a computer teach itself AI!
Email it to me, I'll give you some tips or code.. I love strategy games! Smile
Quote:have a computer teach itself AI

so your saying it will get smarter and smarter by the second, soon it will realize where the power cord/shut down button is and send many volts of electricity to those areas in defense.
The moment you made a computer that learn every second it would learn its own weaknesses and put up protection. then it will ind out that its not the only one of that type of computer and it will virus all the other computers of that type and gather info about them.
well, its like this...

there are 3 tile types, the terrain, the building, and the units
the terrain holds the resources (gold,wood,stone,ore, food)
the buildings increase population limit, and open other build trees
the buildings can also upgrade to big and better buildings
the units of course build, and attack with different stats.
ive got the whole 'player' turn done, all resourcing, building and attacking. now all thats left is the AI. i was thinking of making the AI a completely different program that just manipulates the saved data of the current game. so after you finish your turn, the second exe is run (the AI exe) which does nothing more than check for conditions, and manipulates the existing data of the saved state file. once this is done, the main game exe is restored and you now can can countine with your next turn.

pros of this idea, i can have plenty of room to code a huge AI with as many conditions and such as i need. there no graphics needed in this exe cause all the graphics are controled thru the game exe (which is the PLAYERS turn exe). so basically, the AI exe does nothing more than change around some data in the saved state of the players last turn.

cons, i cant show you what the computer is doing as he is doing it, because there are not routines for the graphics in the Ai exe, so when hes done computing his moves, you only get to see the finished product of his choices.

i have no clue how to make it learn, but since i know the game inside out, i can program an AI as good as I play.

illl post a download 2moro for anyone who wants to check out where im at.
Learning AI is hard to do. I think you should go to http://www.GameDev.net
Though it's not about QB, there are some interesting AI articles which are explained without using a specific language like C/C++ or VB. So EVERY coder can use this stuff.
A single behavioural AI must fit in. Just learn about state machines and have a state machine on every feature you want, for example a state machine which controls goodies recollection, another one who controls expansional behaviour, another one that takes care of building cities, and just let the states flow depending on your game variables.
Pages: 1 2 3 4 5