Digital Paint Discussion Board

Development => General Development => Topic started by: jitspoe on October 19, 2013, 01:01:27 PM

Title: New Bot AI Progress
Post by: jitspoe on October 19, 2013, 01:01:27 PM
For the next version, I'm focusing on AI.  This is going to be a challenge, and I'm not sure when I'll have anything worth releasing, so I figured I'd create this thread to keep everybody updated on what the status is:

Done:

- Remove/Disable ACEBots
- Create new DLL
- Load DLL from game and update it
- Spawn AI player
- Wandering with no navmesh

To Do:

- Awareness of other players
- Game mode objectives
- Aiming
- Shooting
- Basic navigation
- Storage and loading of map navigation info
- Strafe jumping
- Dodging
- Neural network learning behavior?
- Personality
- Communication
- Handle map switching
- Linux support
- Probably a whole lot more
Title: Re: New Bot AI Progress
Post by: ViciouZ on October 19, 2013, 01:54:21 PM
When you've finalised the interface could you release a gamex86.DLL and put the AI library source up in the CVS? Would love to have a go at this
Title: Re: New Bot AI Progress
Post by: luckmore on October 19, 2013, 02:23:20 PM
I really dont understand why people voted for this. There are so many other things that could be done before this.
Title: Re: New Bot AI Progress
Post by: BASEBALLDUDE on October 19, 2013, 03:09:54 PM
Good luck Jitspoe! It will be epic when the new bot system is released to the public.
Title: Re: New Bot AI Progress
Post by: Bitius on October 19, 2013, 03:17:00 PM
Also, good luck jitspoe.Have fun developing :)
Title: Re: New Bot AI Progress
Post by: jitspoe on October 19, 2013, 04:02:44 PM
When you've finalised the interface could you release a gamex86.DLL and put the AI library source up in the CVS? Would love to have a go at this
I doubt it will ever be "finalized".  There will likely be a frequent need to add or change things.  I probably won't be able to release it until the next version is about done.

I really dont understand why people voted for this. There are so many other things that could be done before this.
A lot of people don't want to jump right in and get murdered by experienced players.  I believe it's the most requested thing on the uninstall survey.
Title: Re: New Bot AI Progress
Post by: ic3y on October 19, 2013, 05:03:29 PM
I really dont understand why people voted for this. There are so many other things that could be done before this.

Bots are useless. Jump Mod would be much better
Title: Re: New Bot AI Progress
Post by: jitspoe on October 19, 2013, 11:55:53 PM
Already better than acebots?  ;)
Title: Re: New Bot AI Progress
Post by: Bitius on October 20, 2013, 02:32:37 AM
They're celebrating about the new AI they're getting :D
Title: Re: New Bot AI Progress
Post by: TRION on October 20, 2013, 08:59:30 AM
Please add a customizable pathways too like .naz files.. So mappers can make a file for bots too :)
Title: Re: New Bot AI Progress
Post by: jitspoe on October 20, 2013, 03:09:36 PM
http://www.youtube.com/watch?v=QCUpvfAZ4l8 - better with music. ;D

I haven't decided how I'm going to handle the navigation stuff yet.  It's probably going to be a mixture of "learning" player paths and blindly stumbling around places that don't have player paths.

My initial thought was to record player input as they strafe jumped around the map, then develop paths of recorded input, so the bots could strafe jump like players.  Problems with that include:
 - Bot paths limited to exactly the paths players have taken.  No room for slight variations to avoid lines and such.
 - Data storage for these paths could be really large.
 - Bots won't discover new, non-recorded paths.
 - Aiming and shooting while on a strafe-jump path will break it, since strafe jumping depends on look direction.
Title: Re: New Bot AI Progress
Post by: JMR on October 20, 2013, 03:23:50 PM
Haha! Very nice jitspoe.
- Aiming and shooting while on a strafe-jump path will break it, since strafe jumping depends on look direction.
Hmm, for bots, maybe make up a separate way they shoot? So the player model rotates to the way they are looking, but the way they are aiming doesn't effect the path they go. So you basically have two different systems, 1 for aiming and rotating player model, the other just for moving the bot towards the navigation file, with maybe a spread of some kind (record multiple variations of the same jump and randomize it.)
Title: Re: New Bot AI Progress
Post by: BASEBALLDUDE on October 21, 2013, 09:30:14 AM
Haha! Very nice jitspoe.Hmm, for bots, maybe make up a separate way they shoot? So the player model rotates to the way they are looking, but the way they are aiming doesn't effect the path they go. So you basically have two different systems, 1 for aiming and rotating player model, the other just for moving the bot towards the navigation file, with maybe a spread of some kind (record multiple variations of the same jump and randomize it.)
That's a good idea, but there's one major flaw with that idea. If the boys were to pivot and aim somewhere else while maintaining the strafe jump, that would give them an unfair advantage over the humans because we can't do that.

Instead, I'd like to propose an alternate solution. Jitspoe was talking about giving the bots "personalities" so that not all bots behave the same way. I like this idea, and depending on the bot's personality, it would either neglect to shoot in order to maintain the strafe or break the strafe to shoot.
Title: Re: New Bot AI Progress
Post by: jitspoe on October 21, 2013, 12:14:04 PM
Updated the original post.

Completed:

- Wandering with no navmesh

Bots send out traces to avoid running into walls and aimlessly wander around the map randomly.

To Do:

- Handle map switching

Currently, on map switches, all the bots drop out but do not get reloaded (but the botlib still thinks they're there).
Title: Re: New Bot AI Progress
Post by: CyberZTec on October 21, 2013, 02:10:12 PM
Jump Mod would be much better
This.
Title: Re: New Bot AI Progress
Post by: BASEBALLDUDE on November 02, 2013, 09:38:19 PM
Keep up the good work Jitspoe!
Title: Re: New Bot AI Progress
Post by: Foxhound on November 03, 2013, 11:34:10 AM
I really dont understand why people voted for this. There are so many other things that could be done before this.

Horde mode!!!! I'll play again.
Title: Re: New Bot AI Progress
Post by: BASEBALLDUDE on November 22, 2013, 08:10:24 PM
How's the progress going jitspoe?
Title: Re: New Bot AI Progress
Post by: jitspoe on November 23, 2013, 07:06:42 PM
Haven't been working on the bots much recently.  I've been messing around with stars and trying to fix bsp compiler issues.

I've started on a system to record player input, but haven't gotten very far on it.
Title: Re: New Bot AI Progress
Post by: FusSioN on November 23, 2013, 07:46:13 PM
Should fix this: Players can get into a passworded server full of bots :p
Title: Re: New Bot AI Progress
Post by: jitspoe on January 29, 2014, 03:47:34 PM
As I mentioned in my .plan, I've just started getting player path following.  Perhaps a more accurate term would be "player input replays", as they just record the start point, the end point, and the player input used to get there.  I don't have the bots getting exactly to the start point yet.  They just replay the player input based off of the closest start point.

Problems:
- No dodging of dynamic objects (ex: other bots/players get in the way and screw up the path).
- Start position and velocity are not always close enough, causing the bot to go off-course.
- No correcting if off-course.
- Sporadic movements, like twitch shots, jukes, etc. get recorded, and look really out of place when there is no combat.
- Since movement is aim-dependent, there's no way to aim at targets and shoot while maintaining the recorded player path.

On the plus side, they make for much better target practice than the old bots.  I've attached a demo of them running around in arm while I shoot at them. :)
Title: Re: New Bot AI Progress
Post by: ALCOHOLIC on January 29, 2014, 03:50:19 PM
This is awesome. Much better than before
Title: Re: New Bot AI Progress
Post by: SuperMAn on January 29, 2014, 05:24:50 PM
Looks good! Nice work.
Title: Re: New Bot AI Progress
Post by: Rick on January 29, 2014, 07:08:13 PM
Lookin' real nice.
Title: Re: New Bot AI Progress
Post by: FusSioN on January 30, 2014, 12:15:23 AM
Nice new shiny bots!
Title: Re: New Bot AI Progress
Post by: LaZeRs on January 30, 2014, 12:18:20 AM
Wow! You have good aim...

And nice flowing bots as well.
Title: Re: New Bot AI Progress
Post by: DooCi on January 30, 2014, 10:01:41 AM
Maybe there should be different level bots like intermediate and easy, or hard
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on January 30, 2014, 11:58:01 AM
Wow! You have good aim...

And nice flowing bots as well.
Jitspoe doesn't have good aim, just you have bad. Also bear in mind he first recorded same exact path...

I don't see anything really impressive in bots jitspoe posted: Bots that badly try to execute jitspoe prerecorded few paths. Those need much polishing before they can do virtually anything. I'm not sure about all this player recorded paths, this will make aiming whilst executing any movement very hard.
Also bots need some strategy other than just choosing random path and going it's way. Probably marking for bots mid and bases could help if they would choose path that leads to enemy base.
Also maybe depending on difficulty bots should choose from other set of moves, as there are hard jumps on some maps, and bots can execute them every time. But this is still far future.
Title: Re: New Bot AI Progress
Post by: BASEBALLDUDE on January 30, 2014, 12:13:57 PM
It should record input differently if there's players in view vs. no players in view.
Title: Re: New Bot AI Progress
Post by: prozajik on January 30, 2014, 12:25:25 PM
I don't see anything really impressive in bots jitspoe posted: Bots that badly try to execute jitspoe prerecorded few paths. Those need much polishing before they can do virtually anything. I'm not sure about all this player recorded paths, this will make aiming whilst executing any movement very hard.
The work itself might not be impressive, but if you compare it with bots we had before, its an impressive milestone.
Nice improvement, keep it up. Looking forward to seeing these bots on more complicated maps.
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on January 30, 2014, 02:06:55 PM
The work itself might not be impressive, but if you compare it with bots we had before, its an impressive milestone.
Nice improvement, keep it up. Looking forward to seeing these bots on more complicated maps.
I can't really agree: Old bots could shot and aim, new can't.
Really adding player playback code is only start, and there are more problems with implementations than features... This will be case for longer than you expect. I think new bots will be more problematic than old, by far. But at least they can jump like anything that could playback input, wow....
I don't see it as a milestone, milestone will be when bots will be able to move without major problems though map, possibly with strategy...
You see prozajik why jitspoe got such simple map? Because those bots couldn't work on anything more complicated, and on this supersimple map they also had problems. I really think it's not time to say "gj" to jitspoe, it's just very very early version which can't do anything.
Title: Re: New Bot AI Progress
Post by: Cameron on January 30, 2014, 08:28:09 PM
I can't really agree: Old bots could shot and aim, new can't.
Really adding player playback code is only start, and there are more problems with implementations than features... This will be case for longer than you expect. I think new bots will be more problematic than old, by far. But at least they can jump like anything that could playback input, wow....
I don't see it as a milestone, milestone will be when bots will be able to move without major problems though map, possibly with strategy...
You see prozajik why jitspoe got such simple map? Because those bots couldn't work on anything more complicated, and on this supersimple map they also had problems. I really think it's not time to say "gj" to jitspoe, it's just very very early version which can't do anything.
Go on then payl, you make something better with the limited time jitspoe has to work on it.  I also can't agree with you that it can't do anything, otherwise you wouldn't have seen anything in the demo...
Title: Re: New Bot AI Progress
Post by: jitspoe on January 30, 2014, 09:03:12 PM
lol, payl is like high expectations Asian father: http://highexpectationsasianfather.tumblr.com/

Clearly, this isn't the end product.  It's just something to show progress.  The idea is to, ultimately, stitch these paths together so the bots can reach objectives.  The bots still have old-style random wandering similar to the old ACEBots did as well, for what it's worth.

I guess this is really an experiment.  I'm not sure if it's passing or failing at this point.  I think the best way to do bots would be to give them some sort of spacial awareness of the map so they could plot out strafe jumping paths of their own.

Another alternative would be to, instead of recording raw input, record the angles, positions, and velocities of each jump along a strafe jumping path and have the bot try to match them, allowing for some variation and aiming.

Plenty of challenges with each approach.  I'm not sure how much time I'm going to dedicate to bot development.
Title: Re: New Bot AI Progress
Post by: BASEBALLDUDE on January 30, 2014, 09:26:06 PM
Having good bots is critical to expanding this game. If jitspoe's numbers are correct, then the conclusion is that most people quit after one or two games. Having bots will open up the world of single-player mode, which will basically serve as training for multiplayer. It's also advantageous to have single-player mode because you can play it offline on an airplane or something. The best thing jitspoe can do right now is work on the bots. Map-making for single player mode can be done by JMR, Rick, or Clipz. Other developers in this community can work on the campaign mode and level progression if this game needs that.  Someone should also make the tutorial map better while jits does the bots. If everything above is eventually done, no need to rush or get it done soon, then what we will start seeing is an increase in the number of players playing this game.
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on January 31, 2014, 05:40:20 AM
Go on then payl, you make something better with the limited time jitspoe has to work on it.  I also can't agree with you that it can't do anything, otherwise you wouldn't have seen anything in the demo...
It's just demo, on simple map, and I can notice all bugs jitspoe mentioned (not correctly following path sometimes). If you can't, then don't judge.
Also, I already said I won't help game and there is no need for Clipz to hate me on that. But I have something related: I'm working on aiming, I'll leave you guessing what kind of aiming it is (obviously not aimbot). So when jitspoe finally makes his bot aiming system, we can compare...

lol, payl is like high expectations Asian father: http://highexpectationsasianfather.tumblr.com/
I'm not expecting much, nor I'm surprised with progress. I just can't understand what others are so happy about, it's long way ahead, pretty much everyone knows that. So I just don't feel like saying "gj" when you just started.
Clearly, this isn't the end product.  It's just something to show progress.  The idea is to, ultimately, stitch these paths together so the bots can reach objectives.  The bots still have old-style random wandering similar to the old ACEBots did as well, for what it's worth.
Yeah, this seems smart.

Quote
I guess this is really an experiment.  I'm not sure if it's passing or failing at this point.  I think the best way to do bots would be to give them some sort of spacial awareness of the map so they could plot out strafe jumping paths of their own.

Another alternative would be to, instead of recording raw input, record the angles, positions, and velocities of each jump along a strafe jumping path and have the bot try to match them, allowing for some variation and aiming.

Plenty of challenges with each approach.  I'm not sure how much time I'm going to dedicate to bot development.
Well, maybe there is some q2 bot library which can do strafe and other basic things like that so you can include it if it has correct license. Or at least look at to know how to design it? This would help with what solution to choose and what pros and cons it has.
This approach can possibly reduce your work time and make better results.
Title: Re: New Bot AI Progress
Post by: Clipz on January 31, 2014, 06:30:49 AM
What was the reason to use my name payl? QQ pew pew. Make something better and see if you can get people to play your game. Seeing if people want to be competitive jumping is more important then aim, having bots be able to jump better makes more sense. You can have the best aim in the game but if you can't jump in dp you will get owned.
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on January 31, 2014, 11:56:11 AM
What was the reason to use my name payl?
You are my dear hater, aren't you. Oh now don't go "I have no idea what you are talking about", ok?

Quote
Make something better and see if you can get people to play your game.
Paintball never was jitspoe game, he made it along with others, with some other contributors and based on different game. Can't you get over it? He never claimed it's his game, so I won't blame jitspoe, but you guys are ridiculous.
I love that when I actually try give few tips about various things people attack me that "you should try to make it yourself". If I don't have right to criticize jitspoe, you have no right to criticize me, as you haven't made PAC and other various things I made, but somehow you criticize me. This is awful and does not help anyone at all. So please keep those opinions for yourself.

Quote
having bots be able to jump better makes more sense.
I do agree, but you miss point I stated earlier: Demo jitspoe showed does show exactly what me mentioned: Not such a big progress, but people take it as he made something super complicated. He did not.

Quote
You can have the best aim in the game but if you can't jump in dp you will get owned.
I won't agree on this one: Aim is more important, but jumps are also big part of game.

Now, can we get over this? I surely hope so.
Title: Re: New Bot AI Progress
Post by: Clipz on January 31, 2014, 12:28:59 PM
Aim is not as important as jumping, play me on Zpar and I could prove it with out shooting once. If it was 10 years ago, I'd agree aim would mean alot more. The times have changed and gameplay and with every map having ice doesn't benefit people with aim.

Not saying aim is not important but if you can out jump and fly by people you can win with out a problem.
Title: Re: New Bot AI Progress
Post by: Toxiic on January 31, 2014, 12:36:22 PM
lol, payl is like high expectations Asian father: http://highexpectationsasianfather.tumblr.com/
^ http://www.youtube.com/watch?v=hVODv8A5-EM


Anyways, this is just a view of the progress; of course it won't be looking amazing. But over all good job on the progress.

@Baseballdude--Thanks for the obvious. After I posted that post that solo'd all post, there is no need to abbreviate it. Thanks.
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on January 31, 2014, 04:00:13 PM
Aim is not as important as jumping, play me on Zpar and I could prove it with out shooting once. If it was 10 years ago, I'd agree aim would mean alot more. The times have changed and gameplay and with every map having ice doesn't benefit people with aim.

Not saying aim is not important but if you can out jump and fly by people you can win with out a problem.
You said how you feel, I said how I feel about this, but you just can't stop forcing your opinion, yes?
I already said that I think aiming is more important than jumping. If you can't get over my opinion just don't post, you are wasting everyone's time. Thanks.
Title: Re: New Bot AI Progress
Post by: jitspoe on February 02, 2014, 03:33:04 AM
(http://digitalpaint.org/images/devel/debug_strafejump.jpg)

I've added in some long-overdue debug drawing functions, as I'm sure they'll become useful if not necessary when debugging the pathfinding.  For now, I've drawn the player path as an experiment.

I spent most of the day researching some different learning AI (neural nets, genetic algorithms, etc.) to see if they would be at all feasible for letting a bot "learn" to jump around a map, but, from what I've seen, AI research still has a long way to go.  As much as I'd love to play around with that stuff, it just doesn't seem practical.  I might be able to use some kind of learning algorithm to try to reach an unobstructed point at a specific angle and velocity, but it would probably take less time to figure out the algorithm to do that than have something learn it.

On a side note, this was probably the most interesting talk I found: http://www.youtube.com/watch?v=AyzOUbkUf3M
Title: Re: New Bot AI Progress
Post by: SuperMAn on February 02, 2014, 10:19:05 AM
I've added in some long-overdue debug drawing functions, as I'm sure they'll become useful if not necessary when debugging the pathfinding.  For now, I've drawn the player path as an experiment.

I spent most of the day researching some different learning AI (neural nets, genetic algorithms, etc.) to see if they would be at all feasible for letting a bot "learn" to jump around a map, but, from what I've seen, AI research still has a long way to go.  As much as I'd love to play around with that stuff, it just doesn't seem practical.  I might be able to use some kind of learning algorithm to try to reach an unobstructed point at a specific angle and velocity, but it would probably take less time to figure out the algorithm to do that than have something learn it.

On a side note, this was probably the most interesting talk I found: http://www.youtube.com/watch?v=AyzOUbkUf3M


Jitspoe:  Instead of building an AI from scratch, would it be possible to just modify an existing Quake2 AI such as JABOT?  http://www.quake.ie/blogs/rawshark/working-quake-2-bot-linux.php.

Quote
JABot Q2 is a Quake 2 AI. Originally based in ACEbot is almost a total rewrite of it, while still keeps the ACEbot states machine design. JABot more flashy features are: - A* pathing in realtime - MoveType based pathing: The AI will only find paths using movements its ai class can perform - AI support for BOTs and MONSTERs. Through the use of ai classes. - weighted goal system. - Jump movement/movetype support for Bots class. - Bot roams support (using a item_botroam entity, or dropping it from console). - Many other improvements in every aspect of the code. Unsupported: - Bot chat and bot messages have been removed. JABotQ2, while usable for players as a standard DM bot, is written for Q2 modders to be used as base for new monsters/bots/actors, allowing to create a modern AI for their mods. Direct Download (Win 32 bin & src) Direct Download (Linux port by qudos)

The path lines look very nice btw =).
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on February 02, 2014, 01:57:41 PM
Jitspoe:  Instead of building an AI from scratch, would it be possible to just modify an existing Quake2 AI such as JABOT?  http://www.quake.ie/blogs/rawshark/working-quake-2-bot-linux.php.
I already suggested that jitspoe should take a look at compatible (license-wise) bots, look what they can and can't, pros/cons and then maybe base on them. This will surely help make those bots better.
Title: Re: New Bot AI Progress
Post by: jitspoe on February 02, 2014, 02:18:55 PM
I haven't been able to find any really decent bots.  JABot is just a modified ACEBot and still uses a (more advanced, but still limited) waypoint system.  Plus this is kind of a learning experience for me.  I've always wanted to try writing good AI.

Now I'm trying to figure out if I should try to do something where I load the map collision data and try to build some sort of spacial awareness... something like the Quake3 AAS files.  At the very least, I'd like to build something that can define open areas where the bots can freely strafe jump around.
Title: Re: New Bot AI Progress
Post by: BASEBALLDUDE on February 02, 2014, 02:22:36 PM
Nobody's perfect, so neither should the bots be. Make sure the bots also learn some "failed" paths, aka trying to do a jump but messing up somewhere, and make that a part of the bot's program, especially for "easy" bots.

And good luck, jitspoe! Keep making progress!
Title: Re: New Bot AI Progress
Post by: omni on February 02, 2014, 03:04:12 PM
I think it would be hard to make bots that would be able to match top players ability at all, never mind making the bots too good for humans, I don't know.

@Jitspoe: do you know whether there will be different difficulty levels at this stage?

All in all looking brilliant so far, new bots should be good for the newer players
Title: Re: New Bot AI Progress
Post by: JMR on February 02, 2014, 06:57:11 PM
Message removed.
Title: Re: New Bot AI Progress
Post by: Superchu on February 03, 2014, 09:46:29 PM
hmmmm... i would have bots judge distance... that way, they can head whichever way is the most open, by testing 360 degrees, so a bot can 'learn' a map, then it tries to strafe the distance path. this would be limited, but a place to start.
Title: Re: New Bot AI Progress
Post by: jitspoe on February 04, 2014, 07:03:39 PM
hmmmm... i would have bots judge distance... that way, they can head whichever way is the most open, by testing 360 degrees, so a bot can 'learn' a map, then it tries to strafe the distance path. this would be limited, but a place to start.
That's sort of how the wandering works, but there are generally a lot of obstacles, narrow, zig-zagging passages, slopes, etc. that make this not work well.
Title: Re: New Bot AI Progress
Post by: Superchu on February 05, 2014, 09:37:17 AM
I thought wandering worked by just rnging an inital direction, then bounging off walls at 45 degree angles, untill it sees a target, then something snaps, and the bot becomes a fully realized painting machine O.o
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on February 05, 2014, 10:34:58 AM
I thought wandering worked by just rnging an inital direction, then bounging off walls at 45 degree angles, untill it sees a target, then something snaps, and the bot becomes a fully realized painting machine O.o
Fully realized as lol, sometimes as it shoots and jumps it lose eye contact with you and turns around to be shot in ass.
I too think that bot just random direction and then moves for x meters. Still, even choosing longest path wouldn't help achieve any strategy. I think jitspoe is really into it, so I think letting him decide what works best for him is best option.
Jitspoe: Just so you don't forget: Initial work is not most important, long balanced work is important.
Title: Re: New Bot AI Progress
Post by: Superchu on February 05, 2014, 11:31:52 AM
Forgive me if this has already been discussed, but the way i was proposing is more like echolocation, the bot sends out distance traces so it can 'see' walls and doors. using an rng, you could force it to attempt a different path on a new generation.the trouble is having the bot find switches and ladders. in order to keep the bot from back tracking, it could only trace what is in front of it while moving. once it maps out a path, the bot could jump around a little on the path, trying to go faster. eventually, the rng will force it to try to deviate from that path in order to find a new path.
Title: Re: New Bot AI Progress
Post by: jitspoe on February 06, 2014, 11:02:03 AM
The new bots do this better, but the old ones, if something like this did not exist, would be running into walls constantly.
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on February 06, 2014, 02:13:02 PM
if something like this did not exist, would be running into walls constantly.
Well, maybe your bots are smarter than mine, because for me they always run into walls. I think there is little heuristics (if you don't move, rerandom angle), but they still move halfway into wall and are unable to spot enemy.
I think both approaches have same common problem: bots will fastly end up going low path all the time because they fall. I.e. shazam33, they will just go mid-low, it's impossible they make it across bridge.
Title: Re: New Bot AI Progress
Post by: jitspoe on February 18, 2014, 12:46:58 AM
I tried an experiment where I gave the bots a bunch of random-ish input to select from (different turn speeds, forward/left/jump/etc. randomly pressed), tested each one, then picked the fastest one.  This was the result.

On the plus side, it allowed the bots to sort of dynamically figure out mediocre-average strafe jumping paths dynamically.  On the minus side, it's extremely CPU intensive.  I was noticing significant framerate hits with just 4 bots.

Of course, things could be done to optimize this, but depending on the obstacles in the map, the dynamic strafe jumping may or may not be effective without doing lots of actual physics casts (slow!).

I think, for now, I'm going to focus on using player recorded positions and paths, but try to make the bots follow them in a more dynamic manner.
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on February 18, 2014, 08:51:30 AM
On the minus side, it's extremely CPU intensive.  I was noticing significant framerate hits with just 4 bots.
If this happens on fast machine, I would say this is not acceptable.
I think, for now, I'm going to focus on using player recorded positions and paths, but try to make the bots follow them in a more dynamic manner.
Hybrid between two methods can be good, it would use both some player recorded data and follow it in less static manner, it's a good idea. Then it could try to aim without aborting following player recorded path. This will both allow bots to aim while moving and also do some more crazy jumps that are specific for map.
Also: I think right now bots are like trying to figure out how to strafe, you should give them a bit more knowledge about how to do that, this will surely help reduce CPU usage.
Title: Re: New Bot AI Progress
Post by: jitspoe on March 02, 2014, 03:27:14 AM
I've made progress on dynamic waypoint placement.  Basically, it observes player movement and places waypoints while they're on the ground up until a hardcoded limit.  Once the waypoint limit is reached, it "randomly" deletes and reconnects existing waypoints, favoring removal of waypoints that are clustered together (no sense keeping a bunch of waypoints that are right next to each other).

It actually... works a little better than I expected:

(http://digitalpaint.org/images/devel/dynamic_waypoints1.jpg)

(http://digitalpaint.org/images/devel/dynamic_waypoints2.jpg)

(http://digitalpaint.org/images/devel/dynamic_waypoints3.jpg)

3 shots of the same area as I've walked around it a bunch with a waypoint cap of 100.

This will be primarily for supporting beginner players as well as just providing general pathfinding for non-strafejumping paths.
Title: Re: New Bot AI Progress
Post by: Ace on March 02, 2014, 04:55:59 AM
How is it on the CPU compared to the random one you were doing earlier?
Title: Re: New Bot AI Progress
Post by: jitspoe on March 02, 2014, 02:49:03 PM
This isn't for strafe jumping - it's just for walkable area, though maybe I can figure out a way to make it work for strafe jumping.  I don't actually have the bots following the paths yet.  I'm just looking for a way to build them dynamically.
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on March 02, 2014, 03:24:41 PM
I think you should test it on much more complex map, jitspoe, probably with more nodes. I wonder how it would look on some more complex map, because for now those look quite promising. Then only you should add parts where bot can just repeat player input (for hard jumps) and learn them strafing. This would be acceptable already.
Title: Re: New Bot AI Progress
Post by: jitspoe on March 16, 2014, 12:31:22 AM
(http://digitalpaint.org/images/devel/dynamic_waypoints4.jpg)

Oh, what a tangled web we weave!

I think the dynamic waypoints I've done are about as good as can be expected.  Looking at the results, I can't help but think, "if this were a navmesh, it could guarantee 100% coverage and not have to have nodes everywhere with the potential of missed paths."

The disadvantage to nodes, is you never really know when you have enough.  With a navmesh, you can say, "I'm on the navmesh" and be done with it, or "I'm not on the navmesh -- need to generate another poly."

I think I'm going to continue with waypoints for now since I've gone this far.  Ultimately, the bots will hopefully be following the other path system I'm working on to allow strafe jumping, and this will just be there as backup/beginner level bots.

I have A* pathfinding implemented.  Now I just need to make the bots follow some paths and give them some goals.
Title: Re: New Bot AI Progress
Post by: Clipz on March 16, 2014, 02:35:47 AM
Will bots be smart enough to drop a brass barrel for a steel barrel? To drop a spider for a carbine or auto cocker?
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on March 16, 2014, 07:42:58 AM
Looking at screenshot I think there are too many paths, since bots would mostly use just small part of this.
Maybe there should be color indicating what kind of path it is.

Also I see one path being impossible to do upwards, is detecting this implemented?
Jitspoe, what about some pretest soon, so we have some time to play with new bots and test what is most imporant to be done? I'm not sure how complete is this new AI in basic matters, but I think pretty much anything will be better than old bots.

Will bots be smart enough to drop a brass barrel for a steel barrel? To drop a spider for a carbine or auto cocker?
If someone implements this. Jitspoe said he is going to make open bot library, so even you can implement this.
Title: Re: New Bot AI Progress
Post by: BASEBALLDUDE on March 16, 2014, 08:46:29 AM
If a bot somehow gets knocked off-track, will it be able to find its way back on track?
Title: Re: New Bot AI Progress
Post by: jitspoe on March 16, 2014, 11:30:47 AM
Will bots be smart enough to drop a brass barrel for a steel barrel? To drop a spider for a carbine or auto cocker?
Not currently, but maybe... trying to decide if it's worth putting any effort into items since about the only maps anybody plays anymore spawn you with equipment.


Looking at screenshot I think there are too many paths, since bots would mostly use just small part of this.

Mostly, but...

If a bot somehow gets knocked off-track, will it be able to find its way back on track?

The more waypoints there are, the less likely bots are to get stuck in places.  Also, when a flag might get dropped in some weird spot or a bot needs to track down a player hiding somewhere.  Anywhere players go, nodes are added.
Title: Re: New Bot AI Progress
Post by: not_payl_obviously on March 16, 2014, 02:30:29 PM
The more waypoints there are, the less likely bots are to get stuck in places.  Also, when a flag might get dropped in some weird spot or a bot needs to track down a player hiding somewhere.  Anywhere players go, nodes are added.
True, but still maybe mark somehow paths that are traveled most often? You said you implemented path finding, how bots decide what path of map to use? Will this vary? What about CPU usage?
With paths that are traveled mostly we could mark paths and it would reduce a lot of complexity in pathfinding.
Still thing you should focus on the most is some kind of strafejumping. It is basic in this game, then we can add learning from player some more complex jumps.
Title: Re: New Bot AI Progress
Post by: jitspoe on March 17, 2014, 11:54:02 AM
True, but still maybe mark somehow paths that are traveled most often? You said you implemented path finding, how bots decide what path of map to use? Will this vary? What about CPU usage?
With paths that are traveled mostly we could mark paths and it would reduce a lot of complexity in pathfinding.
Still thing you should focus on the most is some kind of strafejumping. It is basic in this game, then we can add learning from player some more complex jumps.
For the moment, it just uses the shortest path.  I want to do something based on probability, like Markov chains.  This would make the bots behave, statistically, like players, though they wouldn't necessarily make the best decisions for a given scenario.  They might give the illusion of being smart by using different paths that players use in different scenarios instead of taking the same paths every time (ex: what's the probability of going to each node connected to the waypoint, after grabbing the flag).
Title: Re: New Bot AI Progress
Post by: Union on October 05, 2014, 11:29:28 PM
I hope you succeed with the new AI. :)
I hate the bots we have now because it is like they have aimbot, and they don't do much.
Title: Re: New Bot AI Progress
Post by: jitspoe on January 13, 2015, 01:19:02 AM
I made a little video to show how some of the waypoint and path finding stuff works.  Uploaded to Vimeo and YouTube (pick your poison):

https://vimeo.com/116576240
https://www.youtube.com/watch?v=jphSKHwGjOw
Title: Re: New Bot AI Progress
Post by: Bundy on January 13, 2015, 04:21:05 AM
This looks great!
Title: Re: New Bot AI Progress
Post by: Rick on January 13, 2015, 05:00:30 AM
If this does not have audio commentary.... I'mma lose it.

Edit:   :-*
Title: Re: New Bot AI Progress
Post by: FusSioN on January 13, 2015, 05:24:14 AM
Jitspoe's voice tho. Nice work!
Title: Re: New Bot AI Progress
Post by: T3RR0R15T on January 13, 2015, 07:31:04 AM
What's the difference between the white and purple lines?
Title: Re: New Bot AI Progress
Post by: jitspoe on January 13, 2015, 12:33:52 PM
What's the difference between the white and purple lines?
They start out purple and get lighter the more frequently they are updated.  I think I was going to do some averaging for the waypoints to try to center them in the most frequently passed areas, but ran into a lot of edge cases, so I just ended up relocating close way points to exact player location to guarantee they were valid.
Title: Re: New Bot AI Progress
Post by: shockk on January 17, 2015, 09:17:35 PM
The whole bot problem with jumping up the boxes in that video... Isn't there just like a value you can increase in your code that makes them attract to each way point more accurately?

Like 5 as a value for example, they'll be near the way point then move on, but if you set the value to 20 you'll see them get way closer to each way point?

Hard to explain and I don't know this stuff but thought I'd mention it
Title: Re: New Bot AI Progress
Post by: jitspoe on January 17, 2015, 09:59:19 PM
It's easy to tweak how close tho bot should be to waypoints before considering them reached, but if it's too strict, the bots will often "miss" waypoints (especially on slopes) and have to double back to hit them.  If you're suggesting having a value on a per-waypoint basis, that could also be done, but it would involve introducing a new system for determining what that threshold should be at each waypoint, or have the bots somehow "learn" which waypoints they struggle on and tighten those thresholds.
Title: Re: New Bot AI Progress
Post by: shockk on January 17, 2015, 10:33:11 PM
Yeah I don't know much about it at all, but if the bots could recognize an "attempt" at reaching a waypoint (with a strict accuracy) maybe they could then register whether the waypoint was reached or not, and be programmed to tighten the parameter (raise the accuracy) on the next try before the box is reached and the waypoint attempt was verified as successful by the bot.
It would be just like someone trying to jump up a ramp, realizing it wasn't high/close enough, then re-attempting before verifying it as reached.
Title: Re: New Bot AI Progress
Post by: shockk on January 17, 2015, 10:36:35 PM
And then moving on to the next waypoint of course. But basically I was thinking something like adding an "attempt to reach waypoint" sort of process, then a "reached or not completed" follow up. Then they could readjust based on what values are increased automatically for the bots or whatever is programmed for them to changed
Title: Re: New Bot AI Progress
Post by: Cameron on January 18, 2015, 04:31:31 AM
In the case of those boxes, the objective is to come to you, in which case, it should only pass through each waypoint once.  So say it passes through a waypoint twice, would it be possible to tweak how close it should get to the next few waypoints (or up until that last waypoint it reached before and then fell), just to help it get past that bit?  I assume there would have to be some time window for this to apply though.
Title: Re: New Bot AI Progress
Post by: TRION on January 19, 2015, 05:30:29 AM
So to make the bots better we will have to let them play on a map for hours?
Will they have personalities like lagger,newbie,pro,just a good jumper and "doesn't even know he is now in red"? :P
Title: Re: New Bot AI Progress
Post by: shockk on January 19, 2015, 09:49:49 AM
One should be knowledgeable douche. He can grab both flags in reminissions and then hold down the secret room till his last breathe :p
Aside, what about bots strafing on ice?
Title: Re: New Bot AI Progress
Post by: jitspoe on January 22, 2015, 07:08:07 PM
Ice and other speed/trick jumps will require something more than waypoints.  A few ideas I've had:

1) Build paths of recorded player input.  Bots could use normal pathfinding to reach the start of these paths, then replay the exact input players used to reach different locations at a fast speed.
Problems: Player input can be very erratic and weird if they're aiming at/dodging other players.  Looks dumb when there's nothing there.  Getting to the exact start point can be difficult.  Being off just slightly can cause the replayed input to miss necessary ramps/ledges to complete the path.
2) Create a representation of the world -- something like a navmesh or Quake3 AAS file -- optimized for path finding.  Programatically figure out the most optimal way to navigate the space.
Potential problems: Figuring out the math to calculate the optimal paths could be very difficult.  Computing these paths could use a lot of CPU, impacting the performance of the server (or game framerate, playing alone with bots).
3) Create a representation of the world and use machine learning (things like neural nets and genetic algorithms) to figure out optimal paths.
Potential problems: Machine learning is a big unknown -- would probably take a while to research and implement, and could fail miserably.  Could be resource intensive.
4) Some kind of player path/machine learning hybrid.  Instead of recording and playing back exact inputs, record a path of player positions and velocities, then have a learning algorithm try to match these paths.
Potential problems: Again, the machine learning aspect is a big unknown, still, and needs some time to be researched.

On a progress note, I've been testing/fixing some minor things to make sure it's safely releasable, like making sure players connecting when the server is full of bots doesn't do weird stuff like treat the player as a bot.  Even if it's not in a very complete state, I really want to put out another release soon, so I can start making more frequent/minor updates.
Title: Re: New Bot AI Progress
Post by: shockk on January 23, 2015, 01:43:00 AM
1 sounds like a good idea, maybe make the waypoints that start the process being of a higher sort of value of attractiveness to the bot? Like theyre more likely to aim for that waypoint compared to others?

I think the player recorded input is a good idea, doesn't need to be too much more specific than that, some set jumps makes a bots play much more dynamic I'd say. 2 sounds kinda like the same thing and also a good idea.
Title: Re: New Bot AI Progress
Post by: TRION on January 23, 2015, 07:23:26 AM
What if only the movements are captured in option 1 ? so acebots can keep strafing fast like ninja and showering death in all directions :D
Title: Re: New Bot AI Progress
Post by: xrichardx on January 23, 2015, 10:19:06 AM
What if only the movements are captured in option 1 ? so acebots can keep strafing fast like ninja and showering death in all directions :D
Mouse movements are an important part in jumps. Without, strafe jumping will not get you above 36mph. As long as the bots rely on the same physics as all players do, that would disable a lot of jumps for them.
Title: Re: New Bot AI Progress
Post by: jitspoe on January 23, 2015, 07:57:10 PM
Yeah, that's another problem with #1.  Bots won't be able to aim while doing these jumps.  They still make good target practice, though, which I guess is something.
Title: Re: New Bot AI Progress
Post by: TRION on January 24, 2015, 10:53:39 AM
Yeah, that's another problem with #1.  Bots won't be able to aim while doing these jumps.  They still make good target practice, though, which I guess is something.
Independent system of motion and aiming for bots? it will be easy I guess
Title: Re: New Bot AI Progress
Post by: jitspoe on January 24, 2015, 11:43:55 PM
Independent system of motion and aiming for bots? it will be easy I guess
It could be done, I suppose, but that would kind of give the bots superhuman abilities, being able to aim perfectly in any direction while strafe jumping.
Title: Re: New Bot AI Progress
Post by: TRION on January 25, 2015, 01:30:01 AM
It could be done, I suppose, but that would kind of give the bots superhuman abilities, being able to aim perfectly in any direction while strafe jumping.
If bots go with the movements of the players but not rotation then.. what if they rotate slowly,have low Fov,a little imperfection in code.. Won't that work?
Title: Re: New Bot AI Progress
Post by: shockk on January 26, 2015, 03:48:42 PM
I wouldn't think not being able to shoot while doing ice jumps and stuff is a big deal, most normal players have to commit to the jump without shooting anyway so it's pretty natural. Ofcourse sometimes ppl break the jump, stop and start shooting instead but having bots commit to a couple jumps wouldn't be bad.

Maybe a way for them to break the jump process if they feel they should be shooting?
Title: Re: New Bot AI Progress
Post by: jitspoe on April 22, 2015, 01:14:50 AM
Tried to add some things to make the bots aim at targets over time with a little random variance, so they could aim more naturally "mess up" a little.

They messed up a lot...
Title: Re: New Bot AI Progress
Post by: jitspoe on May 06, 2015, 02:41:24 AM
Video progress update talking about what I've done for aiming and shooting:

https://vimeo.com/126889898

https://www.youtube.com/watch?v=EfVI0218V4U

(both are the same video, just on different hosting sites).
Title: Re: New Bot AI Progress
Post by: JMR on May 06, 2015, 05:04:35 PM
I am really enjoying these development updates, thanks for keeping us up to date, I really appreciate it.

Things are coming along nicely, I'm impressed by how you've made the aiming appear natural compared to the old AceBots where they'd just insta-aim. -- I didn't notice the "chasing DP2Bot02" until I was half way through the video, I thought it was you aiming and jumping.

I assume for different bot difficulties, it wouldn't be difficult to change that 20% variation to say, 40% or 10%?

Keep up the good work! :)

Would it be possible for players to save "waypoint packs" to use on their servers? For instance, experienced players who can jump around a certain map could upload their waypoint data to the forums which in turn would allow other not-so-good players to play against bots that know how to do these jumps.
Title: Re: New Bot AI Progress
Post by: jitspoe on May 06, 2015, 09:57:09 PM
The waypoints are just a file, so it's easy to copy them.  I was pondering doing some kind of system where people could merge bot path files for more advanced movement (depending on how that's handled).  I'm not sure if it will be necessary, though.  Once a map has been played through a couple times, I think most of the paths will be covered.
Title: Re: New Bot AI Progress
Post by: jitspoe on July 20, 2015, 01:19:40 AM
I've got 4 bots up and running on the EV1 server.  They seem to be working pretty well, aside from a few places they tend to get stuck, and they need to prioritize capping a bit more.
Title: Re: New Bot AI Progress
Post by: MON1TOR on July 20, 2015, 06:35:53 AM
I've got 4 bots up and running on the EV1 server.  They seem to be working pretty well, aside from a few places they tend to get stuck, and they need to prioritize capping a bit more.
I saw 'em. Nice Work!
Title: Re: New Bot AI Progress
Post by: flamer on July 25, 2015, 04:54:00 PM
Commenting a bit late but oh well.

I watched your video showing the waypoints. Do you think it would be possible to implement the creation of waypoints during the warmups ?

At the beginning of any game, if this was implemented, we could create waypoints simply by moving around the map during the warmup. That would allow you to gather a lot of waypoints on many, many maps, leading to a bot being able to play 'Smart' on more than 1 map.

What do you think ?
Title: Re: New Bot AI Progress
Post by: mRokita on August 01, 2015, 06:09:04 AM
Commenting a bit late but oh well.

I watched your video showing the waypoints. Do you think it would be possible to implement the creation of waypoints during the warmups ?

At the beginning of any game, if this was implemented, we could create waypoints simply by moving around the map during the warmup. That would allow you to gather a lot of waypoints on many, many maps, leading to a bot being able to play 'Smart' on more than 1 map.

What do you think ?
+1

To jitspoe:
I've tested the new bots, and didn't feel any difference, maybe they didn't get stuck in the same way the old bots did.
IMO it wont improve the game very much :/
Title: Re: New Bot AI Progress
Post by: xrichardx on August 01, 2015, 09:26:53 AM
I think the bots work very well and are much better than the old ones (Good job, jitspoe! :)). They could be used to introduce new players to the game. The thing is that they really need the navigation data, so it would be necessary to distribute it with the game to make this work like a singleplayer mode.
Title: Re: New Bot AI Progress
Post by: MON1TOR on August 01, 2015, 10:33:10 AM
I think the bots work very well and are much better than the old ones (Good job, jitspoe! :)). They could be used to introduce new players to the game. The thing is that they really need the navigation data, so it would be necessary to distribute it with the game to make this work like a singleplayer mode.

If there was only a way to make bots so smart like in TF2...
Title: Re: New Bot AI Progress
Post by: Mission on August 01, 2015, 11:21:52 AM
How have you tested the bots? Are they on a server? What command?

Edit: found it, look for "Official B41 Bot Testing" in server browser
Title: Re: New Bot AI Progress
Post by: xrichardx on August 01, 2015, 11:25:58 AM
paintball2://70.85.9.178:27910
Title: Re: New Bot AI Progress
Post by: mRokita on August 01, 2015, 01:16:56 PM
I think the bots work very well and are much better than the old ones (Good job, jitspoe! :)). They could be used to introduce new players to the game. The thing is that they really need the navigation data, so it would be necessary to distribute it with the game to make this work like a singleplayer mode.
What map did you test them at?
I've seen the new bots on neon and wasnt very amazed.
Title: Re: New Bot AI Progress
Post by: xrichardx on August 01, 2015, 05:27:46 PM
What map did you test them at?
I've seen the new bots on neon and wasnt very amazed.
Wipa, but I don't think the map matters. It should be more important that you jump around (or play) a bit so bots have a chance to reach their targets. I also already saw them fail miserably when they were on a new unkown map, but navigating through unplayed maps is not what they were designed for so I would not judge that.