51

Re: [SUGGESTION] How to make the bots more intelligent ?

Slisochies wrote:
Xaller wrote:

Why do u need bots?
Play against real players!

I often find that there are no populated servers, or that the populated servers have a very high ping. Bots are also useful for when you are not able for some reason to connect to the internet and improving your skills.

theres constantly 50+ players, usually ~400 in the middle of the day, with 200 server so you should be able to find some server tongue

anyway, i dont think people are trying to make a bot to replace real players, more of a fun thing or maybe use them for dummydragging/other stuff

52 (edited by Slisochies 2008-03-18 04:10:18)

Re: [SUGGESTION] How to make the bots more intelligent ?

Daniel wrote:

theres constantly 50+ players, usually ~400 in the middle of the day, with 200 server so you should be able to find some server tongue

Currently there are 151 servers online, only 8 are populated, and only 2 have semi-decent pings (Though that's probably due to my location and timezone).

Bots would also be good for evening out CTF games.

53

Re: [SUGGESTION] How to make the bots more intelligent ?

Slisochies wrote:

Bots are also useful for when you are not able for some reason to connect to the internet and improving your skills.

Improving your skills? How? Bots dont act like a human player, so the gameplay is different than vs. a human. Your skill get worse.

54

Re: [SUGGESTION] How to make the bots more intelligent ?

How much data can easily be dumped from the server? If I could get a few servers dumping a log of the following information, I reckon it would be an interesting supervised learning problem (you could even propose it as a 3rd or 4th year university project)

position, health, and weapon (current and stockpile) of each player
all shot and movement events
the map, including locations of all powerups and health/armour

From this, you could probably model the correlation between the following vectors for a player:
==knowable past state==
distance to closest {top, bottom, left, right} wall.
closest friendly player's relative position
closest enemy's relative position
relative position of closest {health, weapon}
time since last {start, stop, jump, fire, hook} action
exponentially smoothed past rate of {start, stop, jump, fire, hook} actions
current health
current weapon/ammo
time since last pain/death
...past rate of pain/death

==future events that we want to control==
aiming direction
time to next {start, stop, jump, fire, hook} event
exponentially smoothed future rate of killing
...future rate of pain/death

Once you have a correlation (I would probably try to learn the best fit (Maximum likelyhood) Multivariate Gaussian, but this might not be the best model) then make a bot that loops and picks events randomly, with probabilities related to the model. Might look something like this (in python):

def do_move(MOVING_EVENT):
    start_moving(MOVING_EVENT)
    NEXT_MOVING_EVENT,time = get_next_random_event(MOVING_EVENT)
    mainloop.timeout_add( do_move(NEXT_MOVING_EVENT), time)

def do_shoot(SHOOTING_EVENT):
    shoot(SHOOTING_EVENT)
    NEXT_SHOOTING_EVENT,time = get_next_random_event(MOVING_EVENT)
    mainloop.timeout_add( do_move(NEXT_SHOOTING_EVENT), time)

55

Re: [SUGGESTION] How to make the bots more intelligent ?

Roanoke wrote:

How do I even turn them on?

There are no bots in teeworlds

56 (edited by Roanoke 2008-04-06 21:39:45)

Re: [SUGGESTION] How to make the bots more intelligent ?

Not even just dummies?

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

57

Re: [SUGGESTION] How to make the bots more intelligent ?

dummies exist, but purly a debug functionallity. the variable is called dbg_dummies and is prone to crash the server smile

58

Re: [SUGGESTION] How to make the bots more intelligent ?

Anyone Thought of looking at the
Soldat bot System?

_|---------------------------------------|_
  |Skins StudioPaw Steam Icon Graphics |
_|---------------------------------------|_

59

Re: [SUGGESTION] How to make the bots more intelligent ?

Bots is useless in my opinion xD
But if you want to use them for dummy grab its easy just change the source that the bot(dbg_dummies 1) auto hook at spawn.

If you wanna train play against real player its better tongue

60

Re: [SUGGESTION] How to make the bots more intelligent ?

Rajh wrote:

Bots is useless in my opinion xD
But if you want to use them for dummy grab its easy just change the source that the bot(dbg_dummies 1) auto hook at spawn.

If you wanna train play against real player its better tongue

You'd better also remove a certain assertion in the code, or the server will crash.

61

Re: [SUGGESTION] How to make the bots more intelligent ?

I'm writting bots too smile. And i don't seen any other bots that can play on ctf. For testing i'm used one bot in clanwar 2on2 on dm1 (not insta!), and we win smile. You can see it in game under nick "[~X~] bot" or ask me to demonstrate.

Sorry for my english sad

62

Re: [SUGGESTION] How to make the bots more intelligent ?

101kl wrote:

Anyone Thought of looking at the
Soldat bot System?

Soldat bots aren't good. First of all maps have to have waypoints for bots. While the bots just run this fixed route, they have a certain field of view (correlating to their difficulty I guess) in which they can "see" enemies. When they do see an enemy, they shoot with a certain hit percantage according to their difficulty again. They of course "know" game physics, I would even say for every difficulty, the game calculates how to shoot to hit and then weakens the aiming. There even exist cool hacks which just tell your local game, you, the player are a bot and by that give you aimbot functionality wink

63

Re: [SUGGESTION] How to make the bots more intelligent ?

IMHO we dont need bots to make the game better, but it sure is an interesting project/work for a student or person addicted to programming and coffee.

We will meet again when the flowers spread their glorious scent of victory and the birds sing us the melody of justice...

64

Re: [SUGGESTION] How to make the bots more intelligent ?

Hm, practice bots? That seems to be the main point here.

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

65

Re: [SUGGESTION] How to make the bots more intelligent ?

Best practice is to play online. Not only skill, but behaviour also ! Also depends on which servers u play, and which games. Humans are lotta better to practice on than bots.

We will meet again when the flowers spread their glorious scent of victory and the birds sing us the melody of justice...

66

Re: [SUGGESTION] How to make the bots more intelligent ?

What about ping?

if($poster["intelligence"] == $intelligence["idiot"])
        deny_post($poster);

67

Re: [SUGGESTION] How to make the bots more intelligent ?

Well, I actually have been playing quite a lot of UT against godlike bots just for training's sake. It wasn't that you could play a proper 1on1 whenever you wanted (mainly newbies join servers with 1/2 players, no clue why) so I chose a small map, added a a few godlike bots and trained my aiming. Of course, player behaviour and psychology or whatever can't be trained that way as bots are dumb but reaction and aiming can be improved.

68

Re: [SUGGESTION] How to make the bots more intelligent ?

ask lite for clever bots

69

Re: [SUGGESTION] How to make the bots more intelligent ?

My bots aren't so clever wink
I published their sources... http://trac.assembla.com/teebots/browser
If anybody want to say anything to me, please write email or write comment on my bots' page... because i see this forum very rarely...
Also you can get some sources on http://kogarashi.chat.ru . There are some mods and old bots' sources. Some sources will be interesting for game developers, because of there are corrections of some errors, such as "cursor under game layer"...

Sorry for my english sad

70 (edited by Huffers 2008-12-16 23:40:48)

Re: [SUGGESTION] How to make the bots more intelligent ?

I'm interested in making a bot for TeeWorlds, with the ultimate aim of making a "campaign" mode, with scenarios. Not that I'll ever have time to do this, but these are my notes so far.

The bot would take as parameters:
* Accuracy
* Which weapons (including grappling hook) it's allowed to use. This could be used in scenarios to spawn 'hostages' (no weapons), 'zombies' (just hammer), 'ninjas' (sword and grapling hook), 'snipers' (laser only) etc.

Upon starting the Bot:
  the bot would make waypoints for the map. (Appendix A)   

Each 'Tick' of the bot:
  it sees what waypoints are in line-of-sight of it.
  it decides which of these it most wants to move towards. (Appendix B)
  it moves towards it (Appendix C)
  it sees what enemies are in line-of-sight of it.
  it decides at which of these, and with which weapon, it most wants to shoot. (Appendix D)
  it shoots with that weapon at that enemy (Appendix E)

the bot should maybe run in a separate thread, so a 'bot tick' can take multiple 'game ticks' to complete.

== Appendix A: making waypoints ==
make a waypoint on top of each item, spawn point, weapon, etc.
make a waypoint every N pixels, in a 2d grid
remove all waypoints that are inside walls
remove waypoint 'A' if it isn't on-top-of an item, and there exists another waypoint 'B', and 'B' is in line of sight of (at least) every waypoint that waypoint 'A' is line of sight of. Iterate until no more waypoints can be removed.

This should produce a graph (the comp-sci kind) of waypoints connected by line-of-sight. They should run all round the map and to all the items. This waypoint graph can be cached for maps (to save loading time when starting a new bot).

Waypoints should also be placed on each other player in the game - these waypoints move with the other players during the course of the game.

== Appendix B: deciding which waypoint to move towards ==
the bot uses a small feed-forward, 2-layer, neural net, with connection weights genetically evolved using "evolution strategy" over lots of games played.

The neural net takes as input:
* the bot's health, armour, weapons, ammo, etc.
* what weapons it is allowed to use (parameter to the bot)
* its accuracy (parameter to the bot)
* the distance from the waypoint to each item (shortest path along waypoints), and to each other player (along with their status).

It produces as output:
* the "goodness" of moving towards that waypoint

== Appendix C: moving towards a waypoint ==
if to left of waypoint, press "left"
if to right of waypoint, press "right"
if on grappling hook and not moving towards the waypoint faster than "cutoff", let go of hook
if the bot is X pixels more to the side of the waypoint than it is above it:
  if on ground, jump
  if at peak of jump, double jump
  if can use the grappling hook (parameter to the bot), hook diagonally up and to the side towards the waypoint

== Appendix D: deciding which target to shoot at ==
the bot uses another small feed-forward, 2-layer, neural net, with connection weights genetically evolved using "evolution strategy" over lots of games played.

The neural net takes as input:
* its accuracy (parameter to the bot)
* the distance to the target
* the status of the target (armour, health, etc)

It produces as output:
* the "goodness" of attacking that target with each weapon type (including the "null" 'dont shoot' weapon)

the bot picks the best target&weapon it's allowed to (parameter to the bot).

== Appendix E: shooting at an enemy ==
Aim towards the enemy target, taking into account their current velocity, the speed of the projectile the bot is firing, and the distance to the enemy target. Use basic trigonometry to determine the angle to fire at - assuming all weapons go along a straight line (they don't - but the bot's aim-algorithm can be improved later).

Randomise the aim angle in a normal distribution, with standard deviation determined by the "accuracy" bot parameter.

Questions, comments, suggestions?

71

Re: [SUGGESTION] How to make the bots more intelligent ?

http://www.youtube.com/watch?v=2EHJw3iBx3s
http://www.youtube.com/watch?v=J9B2M7j-E64

I suggest talking to somerunce, you both together could really do great work!

Qi - high level gaming
qi.m0g.net

72

Re: [SUGGESTION] How to make the bots more intelligent ?

nice goals huffer but how do the tees move ?? do they use hook for moving too ??

looking forward for ur first viewings

73 (edited by Huffers 2008-12-18 22:34:34)

Re: [SUGGESTION] How to make the bots more intelligent ?

Bobynator wrote:

[O]h [M]y [G]od!!!
When will it be ready?

2010.

Stephanator wrote:

I suggest talking to somerunce, you both together could really do great work!

Thanks for the info! I'll try contacting him.

Marik16 wrote:

nice goals huffer but how do the tees move ?? do they use hook for moving too ??

To move to a waypoint it can't see (like if there's a wall in the way), it would move to the destination via waypoints in line-of-sight of each other. To move to a waypoint it can see, the bot would use the algorithm in appendix C of my post above.

Although actually another neural net might be able to do better, with the following as inputs:

* (float) x distance to the waypoint
* (float) y distance to the waypoint
* (bool) able to use hook (bot parameter)
* (float) x velocity
* (float) y velocity
* (bool) hook attached to something
* (float) x distance to where the hook is attached
* (float) y distance to where the hook is attached
* (8 floats) distance in each (up,down,left,right,diagonals) direction to the nearest wall

and the following outputs:
* (bool) press left
* (bool) press right
* (bool) press jump
* (bool) press hook button
* (float) angle to aim hook in

If the waypoint is to the bot's left, it should flip the x/y left/right input given to the neural net and flip the neural net's x/y left/right output (so, by using symmetry, the neural net only needs to learn half as much). This net should be trained independently of the other 'nets used by the bot, by making a random race course to and from various waypoints on the map and picking the nets which race around fastest.

17-Dec-2008 Edit:
I've got the svn trunk (bleeding-edge version) of teeworlds compiling and running now, but I'll hold off coding anything until I hear from Somerunce.

18-Dec-2008 Edit:
Haven't heard anything from Somerunce, so I've had a look at the source, and added a new server command: "spawnbot". I've currently made it an alias for "kick", but I can now make it do anything...

74 (edited by Pillum 2008-12-30 17:49:22)

Re: [SUGGESTION] How to make the bots more intelligent ?

Someone could also port the OpenLieroX AI (shouldn't be that hard -> only 2300 lines of pure code big_smile ).
So you don't have to reinvent the wheel. wink

The structure should also be the same since it is the same game genre. (2D worms-like deathmatch shooting with weapons and ropes)

75 (edited by LordSk 2009-01-04 21:39:43)

Re: [SUGGESTION] How to make the bots more intelligent ?

I am making actually a modificated server with bots, just for training and fun big_smile.
They can shoot you, try to follow you, and jump some barriers, but they cant already move with hook : It is very hard to code that.

And i have a question, I have tried to compilate the branches/bot to see the others's work, but the compilation failed,
A strange visual c++ error ask me to activate exceptions with /EHsc. I have done it, but after the compilation tell me "cl" is not a valid command. Whats that oO ?

lordskelethom - want to reach me quickly? https://discord.gg/teeworlds