Frikbot Monsters help?

Discuss Artificial Intelligence and Bot programming.
Post Reply
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Frikbot Monsters help?

Post by blubswillrule »

there are soooo many bots out there, that include some sort of waypoint pathfinding, and every time I play with a Frikbot, I drool at the pathfinding, and all the effort put into making the bot, I actually am a HUGE fan of pathfinding, although I'm not quite sure, something about seeing a bot navigate your map just like a player would just seems amazing to me! :)

anyways I've been wondering, with all the amazing uses for frikbots and their amazing pathfinding and waypoint editor, why has no one made this for monsters?

we all know that the monsters pathfinding is usefull for getting around simple obstacles, but I think that a pathfinding monster would open the doors for many mods yet to come!

now, this idea has been in the back of my mind for a while... until I realized that I actually need it.

as some of you may know, I am working on a mod/game named Nazi Zombies Portable, in which the zombies ALWAYS know where you are, and always head towards the closest player. now, we have some basics laid out, but we are missing a very important thing, pathfinding!

so, my question for you, would it be possible to somehow use the Frikbot code, and apply it's pathfinding to a knight monster?

could you give me any pointers/help/tips on which direction to head in order to achieve this?

now, I may not be the best code, or good enough to achieve this, but something as simple as pseudo code will help me immensely

any and all help is appreciate it :)
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
sp4x0r
Posts: 16
Joined: Mon Jul 21, 2008 11:48 am

Post by sp4x0r »

I have thought about this too. A while back I was digging around through the frikbot code to get my head around it. I'm pretty newb at all this, but here's what threw me (and I'm probably totally wrong about this):

To me it looks like the frikbot is emulating a client, so instead of having the engine deal with moving monsters about using movetogoal() it's getting the engine to think there's really a client connected and is sending generated keystrokes as if they're from the client to make it move around. Like I said, I could be embarrassingly wrong about that, and it's now a while since I looked at it.

So, my ignorance out in the open, I'd really like to get monsters to use frikbot waypoints too. I've been working on other things, so haven't bothered to ask so far.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

frikbot uses a player slot for the bot. this is purely to permit it to use the scoreboard a bit more sanely.
it claims to be a player as far as the (rest of the) mod is concerned, meaning its easier to plug in. But the engine never treats it as a player. The keystrokes it generates, it runs itself. It runs its own physics code, but has a separate entity to provide the actual collisions (as it does not depend upon tracebox extensions).
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Post by frag.machine »

Not only frikbot, but a number of other bots behaves as you described: they take a client slot and emulate its inputs, in a nutshell.

I wrote some npc code inspired in the way the FrikBot "thinks" some time ago. Search for "fragbot" in the "what are you working on ?" thread and you'll see a link to a YouTube video showing some waypoint based navigation and also free roaming searching for targets (in the example, weapons, ammo and medikits). If you think this fits in what you want I may upload my code to quaketastic and you can have fun. :)
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

frag.machine wrote: I wrote some npc code inspired in the way the FrikBot "thinks" some time ago. Search for "fragbot" in the "what are you working on ?" thread and you'll see a link to a YouTube video showing some waypoint based navigation and also free roaming searching for targets (in the example, weapons, ammo and medikits). If you think this fits in what you want I may upload my code to quaketastic and you can have fun. :)
actually, frag machine, I would be very interested in said code, it seems like it is exactly what i've been looking for!, of course I would have to strip a few things from it though ;)

thanks == thanks * 99999999999999999999999999999999 :D
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
Ranger366
Posts: 203
Joined: Thu Mar 18, 2010 5:51 pm

Post by Ranger366 »

bad that IonStorms Zeusbot didnt emulated one PlayerSlot.
Well, he is a very cool bot, except the BotHUD...
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Post by frag.machine »

blubswillrule wrote:
frag.machine wrote: I wrote some npc code inspired in the way the FrikBot "thinks" some time ago. Search for "fragbot" in the "what are you working on ?" thread and you'll see a link to a YouTube video showing some waypoint based navigation and also free roaming searching for targets (in the example, weapons, ammo and medikits). If you think this fits in what you want I may upload my code to quaketastic and you can have fun. :)
actually, frag machine, I would be very interested in said code, it seems like it is exactly what i've been looking for!, of course I would have to strip a few things from it though ;)
:D
Oki, I'll upload it when I'm at home.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
MauveBib
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Post by MauveBib »

My Squad AI Thing is effectively monsters with frikbot type pathing, amongst other things.
Apathy Now!
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

MauveBib wrote:My Squad AI Thing is effectively monsters with frikbot type pathing, amongst other things.
squad ai thing? lol , i'm not quite sure I know what you're talking about ;)
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Post by frag.machine »

Yay! MauveBib! :)

Here's the link. It's an incomplete mod, but the bot code is done and can work for both npcs or monsters.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

thanks soo much, I'll be sure to include you in the credits ;)

ive been studying the code a lot, and seeing exactly how it is that it works, and it seems, that the bot chooses the waypoint nearest to the player regardless of where it is, for example

the bot may try to go to a waypoint above it's head on another story

which leads me to conclude that waypointing method does not include linking , am I right?

edit--------
if I am right, how hard do you think it would be to include waypoint linking, how about adding the frikbots dynamic editor? (makes things easier ;) )
note: i'm asking how hard it would be to add these features ;)
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Post by frag.machine »

blubswillrule wrote:ive been studying the code a lot, and seeing exactly how it is that it works, and it seems, that the bot chooses the waypoint nearest to the player regardless of where it is, for example

No, it's a bit more complex than this. :)

In a nutshell, every 0.1 second the bot runs a findradius around his own origin, and select a list of "targets"(botScanForTargets() if I remember the name correctly). Each one of these targets are processed in botEvalTarget(), receive a classification according the current context, the player status and its own nature (basically, a weight, a time window and an associated command) and compared with the current bot target stack. If the target has a higher weight than any target into the bot's stack then the last is updated and re-sorted. After iterating thru all targets the bot immediately reacts to its new priorities.

Although the waypoint system uses a different implementation, it behaves in a quite similar way of the vanilla info_pathcorner system, except it can be toggled on/off, allowing some scripted sequences (for example, to make a bot only follow a path after the player touching a trigger or killing a monster).

If there are no visible/enabled waypoints the bot will navigate freely in roaming mode, looking for monsters, weapons, armor, ammo, etc.

You can change a lot of the bot behavior in botEvalTarget(), for example making the bot skip a medikit even if he needs it badly just because the player is near and also injured, or turn the bot aware of grenades and avoid them (or at least try to).

blubswillrule wrote:which leads me to conclude that waypointing method does not include linking , am I right?
No. The waypoints can be linked, they only work a bit differently: since the idea was to use them for scripted sequences, I wanted to force the bots to touch them in a fixed order, and only once, so the bot compares his navigation index with the found waypoint. If the waypoint is lesser, it's just ignored.

blubswillrule wrote:edit--------
if I am right, how hard do you think it would be to include waypoint linking, how about adding the frikbots dynamic editor? (makes things easier ;) )
note: i'm asking how hard it would be to add these features ;)
See above, the waypoints already are linked. Regarding an ingame editor, I haven't studied this FrikBot part, but I magine many of the code (specially the UI part) can be reused.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

ok, and thanks again :)

i'm gonna work on the code, and see if I can somehow adapt it to fit my needs ;)

will post progress update!

edit--------------------------

although thanks for the code, it's not exactly the type of pathfinding i'm looking for

i'm looking for something that has many waypoints all throughout the map, and it uses them to find the closest player, just goes to the player, attacks him, and nothing else.

the type you gave me is more of a story mode based pathfinding ;)

like, once you defeat a boss, he goes to the next objective, which is still freaking awesome, just not quite what i'm looking for ;)
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
Baker
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Post by Baker »

Interesting ideas ... nice video.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

so, anyone have any Ideas on applying frikbot's pathfinding to a monster? :)

this is a major feature that is crucial to our mod, after taking a break to do some graphical work, I have come back to this issue with no success, any help is immensely appreciated ;)

edit--------------------------------
in hopes of not sounding stupid, I will post my thoughts on how to achieve it, and specifically what I need help with.

I have been able to narrow my search of the code down to a few functions that are essential to the pathfinding process,

even though I'm sure that I have not found everything necessary :P

but the real problem comes when I try to find when the function is called

-for example, how do I get the pathfinding to kick in?

I would normally be able to do this on my own, but the complexity of the code overwhelms me, and there is just so much going on in the background that I honestly don't even need.

-also, since monsters and bots move differently (monsters=frame steps, frikbots = actual velocity ), will the pathfinding moving still work?

again, thanks ;)
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
Post Reply