Author Topic: Discussion : Neural Networks and Semi-evolutionary bot.  (Read 6228 times)

==Troy==

  • Posts: 440
  • Turrets: +65/-67
Discussion : Neural Networks and Semi-evolutionary bot.
« on: October 25, 2008, 08:13:04 pm »
Generally speaking, This is more sort of a discussion topic rather than anything seriously related to the actual code or future bots. I have a few ideas floating in my mind, and I am digging into books for the NN and general artificial life assembly and evolution, and just thought to ask/share some ideas and generally discuss the plausibility of such a thing.

In general the bots can be divided into 4 categories, 2 of which everyone have seen at least once :
1) Hard-defined AI. Defined set of rules, you expect it to react in exactly the same way under the same circumstances
2) Hard-defined AI with variable constants. Similar to 1, but this time it might change say rifle to shotgun, if it finds that it gets him more kills on the map. Still very restricted AI.
>> 3) Soft-defined AI, without self-evolution. AI that has some backbone algorithms which allow it to mimic and evaluate the actions of the _human_ players.
4) Soft-defined AI, with evolution algos. Full scale AI with ability to create and evaluate new ruleset for itself.

The difference between the 4 and 3 is quite small, although it simplifies a few complicated things, such as algorithms for creation of the initial ruleset and further development of it. (in a large scale, say you will not have to program the bot to enable him to get an idea to create a base somewhere just out of his mind).

The 3d case simplifies the algorithm to a set of procedures for the recording and evaluation of the human behaviour. In general, it can be explained as "Bot is learning from the players". My "hives following around the corners" patch is a good example of the initial  and the most basic bot algorithm, which can be summarised as : record, optimise and follow the path that a player creates for the bot.

Taking it further, just a single game on a map can already create a sufficient graph of paths for an AI (ignore the wallwalking for a moment), which can then be dynamically adjusted as the games continue. AI can record the most probable places for the friendly and enemy bases, and choose the path appropriately (i.e. builder will choose safest path, fighter will take the one leading to the base).

The general ruleset can be split into several parts, with some degree of usefulness in similar but not exact situations :
0) aiming techniques and general personal properties, such as accuracy, awareness and aggressiveness.
1) Close quarter combat. Relative patterns of the movements are recorded. Performance both of the weapon and the movement are evaluated. Can be used in any similar situation, assuming the sizes of the rooms are the same. Scaling factor can also be introduced to some degree, allowing to use same patters in even more cases. Requires a lot of approximation and cannot be accurately recorded (in reality)
2) A more generalised view on the map. Choice of weapons dependant on the path chosen and predicted enemies. Cannot be re-used since it is strictly map-dependant. Pathfinding happens at this stage.
3) Feedback loop, for general performance evaluation as a single cell (unit)
4) Team-size overview of the map. Attempts to sync 2 or more bots in the case (1) and constant re-evaluation of the performance of the team as a whole.
5) Base building. (hardest part). Creation of the efficiency/vulnerability map, and relative decision dependant on the buildings which are already built.


All of these stages use both humans and bots to alter and create the new rulesets. There is no creative work done by the AI (i.e. the only thing it can do is average between the recorded data, it cannot create a new pattern), but it still can gradually adjust itself to the human level.

The AI can be written in blocks, which simplifies the problem slightly (such as for example, I have a half-done algorithms for recording the path network from the players).

The final advantage of such an AI is that it will take a LOT less time for it to evolve to something playable, still allowing it to change.

Any comments and ideas are welcome. Just bear in mind, I am thinking of this as just a "maybe" project for a several years, so there is no reason to expect anything serious to happen any time soon.

« Last Edit: October 25, 2008, 09:16:46 pm by ==Troy== »

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: Discussion : Neural Networks and Semi-evolutionary bot.
« Reply #1 on: October 26, 2008, 01:48:33 am »
When demo games where shipped with "open" config files such as GTA 1 and Schleichfahrt, I took a look into those more frequent. One fascinating piece of configuration file was what I would name "AI file for the submarines" in Schleichfahrt. They had simple rulesets like with which probability to brake out left or right in case of being chased by the player or another enitity. Also, same probability scheme for decisions on when to attack and at what angle. Really cool. # Point 2 of what you discussed #

Second I'd like to add my view on the whole AI bot thing.

A good bot needs several layers of consciousness:

- Layer 1: lifesupport functions f.e. auto medkit, don't disengage jetpack while at lethal height, ...
- Layer 2: immediate sensory feedback and reaction f.e. I see another enitity, I decide to either attack, run away or warn my teammates
- Layer 3: "Strategic Intelligenz": Choice of weaponry, choice of path, Attack <--> Defence, this layer is different from layer2 which is more "Tactical Intelligenz"
- Layer 4: "Strategic Command" a.k.a teamplay, goals, generally think of a team of bots coordinating their actions to achieve a greater goal -> winning the game or not losing it

Thirdly:

I think to teach an AI how to build is the most difficult task. It involves layers 1-4 with the additional trouble of interpreting base entries and generaly base layout. I think that one is a tough one, which can also be seen by human players building first time sucking so much.

Now for the closing statement:

Record games with all the actions of all (human) players. From that generate a network of attack paths, building places, statistical analyzation of action <--> reaction, ...

Maybe some bayess algorithm might come in handy for the latter.

Oh, and:

Teach the AI morons how to recognize walls ffs!

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: Discussion : Neural Networks and Semi-evolutionary bot.
« Reply #2 on: October 26, 2008, 02:51:19 am »
Bots would also need to be able to communicate. While they could talk to each other with some sort of low-level text instructions, that's hardly ideal when playing with humans.

Turning said instructions into a recognizable language (speed-optimized gamerspeak, for example) shouldn't be too difficult. Of course, a bot also needs to be able to receive commands. This is significantly harder, due to variations in how people represent ideas as text.

tl;dr version: If you want AI bots to be human-compatible, they have to be able to talk to people.

techhead

  • Posts: 1496
  • Turrets: +77/-73
    • My (Virtually) Infinite Source of Knowledge (and Trivia)
Re: Discussion : Neural Networks and Semi-evolutionary bot.
« Reply #3 on: October 26, 2008, 04:31:50 am »
On word interpretation matters, many players use binds with team_say commands and requests. It could look for multiple keywords in a phrase and act based on those or combinations thereof. This would have the side-bonus of encouraging proper spelling in chat where speed is not an issue.
Keywords could include: 'Assist' 'Attack' 'Base' 'Defend' 'Enemy' 'Incoming' 'Repair' 'Retreat' & 'Team'

On the subject of shorthand, we could manually sort through team_say in server logs for common abbreviations and include them.

In short: For every order the bot can follow, what do people say when they want a human player to do said action?
I'm playing Tremulous on a Mac!
MGDev fan-club member
Techhead||TH
/"/""\"\
\"\""/"/
\\:.V.://
Copy and paste Granger into your signature!

==Troy==

  • Posts: 440
  • Turrets: +65/-67
Re: Discussion : Neural Networks and Semi-evolutionary bot.
« Reply #4 on: October 26, 2008, 11:00:24 am »
You misunderstood me. The bots themselves are not going to interact with human players, i.e. respond to their commands or  teamplay with them, the only thing that humans are useful for this AI, is that it records, analyses and learns from them. I.e. every game played, there is a "mastermind AI" present, which tracks all of the human and AI players, and tries to create a ruleset for the bot from what it has seen, obviously split into levels. There is no need for the bots to communicate with each other, since it is more like the alien's overmind structure AI, main block for tracking and self-evaluating, and "cells" which represent single units, whether it is builder or fighter.

Most of the things which were said at the moment, are generally the futher details, once the bot itself is done, which isnt really useful at this stage :)

@ Bissing

You do have a point, but bear in mind that most of the global decisions are going to be done by the main AI block, which is independent from the single units.

Syntac

  • Posts: 841
  • Turrets: +118/-104
    • Syntac's Stuff
Re: Discussion : Neural Networks and Semi-evolutionary bot.
« Reply #5 on: October 26, 2008, 03:59:11 pm »
Then what's their purpose? I mean, sure, an all-bot game is fine — but why shouldn't they play alongside humans?

[EDIT] Oh whatever, you know the most about this particular subject.
« Last Edit: October 26, 2008, 04:01:46 pm by Syntac »

Bissig

  • Posts: 1309
  • Turrets: +103/-131
Re: Discussion : Neural Networks and Semi-evolutionary bot.
« Reply #6 on: October 27, 2008, 01:07:12 am »
You misunderstood me. The bots themselves are not going to interact with human players, i.e. respond to their commands or  teamplay with them, the only thing that humans are useful for this AI, is that it records, analyses and learns from them. I.e. every game played, there is a "mastermind AI" present, which tracks all of the human and AI players, and tries to create a ruleset for the bot from what it has seen, obviously split into levels. There is no need for the bots to communicate with each other, since it is more like the alien's overmind structure AI, main block for tracking and self-evaluating, and "cells" which represent single units, whether it is builder or fighter.

Most of the things which were said at the moment, are generally the futher details, once the bot itself is done, which isnt really useful at this stage :)

@ Bissing

You do have a point, but bear in mind that most of the global decisions are going to be done by the main AI block, which is independent from the single units.

Yeah,

I did a general view on AI not drawing the line between single units AI or a generally global AI.

To discuss the type of the AI or the different AI stages is worth writing a dissertation on its own. I don't agree with using neural nets. I think they are/were greatly overrated.

What really impressed me the last years was the Bayess Algorithm in conjucture with the war on spam. It really does work great and it also is a learning algorithm. I wonder why it is only used to split of spam from legitimate mail. It should also be used to differentiate between different types of mails. But.. that's a completely different story.