Frikbot swim up for air

Discuss Artificial Intelligence and Bot programming.
Post Reply
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Frikbot swim up for air

Post by Cobalt »

I had asked Frik about this issue a while ago and he said they ought not be staying under the water and dying when they hit an obstriction like a floor, but I dont see how this code checks for it, it just brings him up straight as ong as the traceline checks out ok. Was this fixed in another version?


Code: Select all

	// checks to see if bot needs to start going up for air
	if (self.waterlevel > 2)
  	{
		if (time > (self.air_finished - 2))
		{
			traceline (self.origin, self.origin + '0 0 6800', TRUE, self);
			if (trace_inopen)	
			{
				self.keys = KEY_MOVEUP;
				self.button2 = TRUE; // swim!
				return; // skip ai flags for now - this is life or death
			}
		}
    	}
Unless he was thinking tha the waypoint navigation code also has a contingency for this? Im not familiar with building routes yet with the editor....
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Frikbot swim up for air

Post by Dr. Shadowborg »

That does appear to be what the code is meant to do, yes.

I'm unaware of any waypoint specific stuff for use with water, so I would have to say no, it hasn't been fixed.

Now, that said, you must be playing on a very unusual map to have underwater areas that are THAT hard to navigate...
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: Frikbot swim up for air

Post by Cobalt »

They do it a little on DM3 above the LG, but their movement code seems to inadvertently fix it , not not always. But in general, yea, I am using Lightning Hunters 500+ Ultimate Frikbot mappack that has way_s done on lots (but not all) maps.
So its been an interesting testing ground with them.

Since you seem to be the resident "Dr Frikbot" :) obvious question is, how would you go about improving that code, and also, was there not a video or web page tut on how to use the waypoint editor? For some reason the editor menu on mines stuck or I need to maybe set some cvar to enter the proper mode?
Dr. Shadowborg wrote:That does appear to be what the code is meant to do, yes.

I'm unaware of any waypoint specific stuff for use with water, so I would have to say no, it hasn't been fixed.

Now, that said, you must be playing on a very unusual map to have underwater areas that are THAT hard to navigate...
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Frikbot swim up for air

Post by Dr. Shadowborg »

Cobalt wrote:Since you seem to be the resident "Dr Frikbot" :)
Since FrikaC has pretty much "Retired" from the quake scene, and my previous efforts regarding the last version update... Then yes, I suppose I am. (I assume Lightning Hunter put up the new version, one way to tell is by checking your bot_angle_set: If it's a lot bigger and more complex than FBXC and has code that gives them uncanny accuracy with grenades, and generally allows them to use you as a floor mop on Aerowalk, even at skill 1, then you've got the new version.)
Cobalt wrote: obvious question is, how would you go about improving that code
I believe the problem originates in the dreaded "butterscotch" loop.

Specifically, they look around the map for something they want, and if they don't see anything they particularly want, they just camp and ponder the virtues of butterscotch. Unfortunately, because of how their water code works, that can be less than...wise. :P

The fix for this is to give them more strategies that a deathmatch player might use:

1. An ai_sniper flagged waypoint to go to. (e.g. a spot somebody likes)
2. If no ai_sniper waypoint is found, check a player "grudge" list, then find a waypoint closest to the player he dislikes the most.
3. Find a weapon or item that is high valued, and isn't in the drink, then go there, expecting someone to kill will show up.

Now that I am fully aware of, and reminded of this, I'll put it in my todo list for the next version: Teh X-800. ;)
Cobalt wrote: and also, was there not a video or web page tut on how to use the waypoint editor? For some reason the editor menu on mines stuck or I need to maybe set some cvar to enter the proper mode?
Start quake with -condebug, then use impulse 104. Make sure you've bound 9 to impulse 9, impulse 10 (menu entry 0) is your "cycle next weapon key". After dumping your waypoints via the menu, open your console.log file and cut 'n paste is your friend. Alternately, there should be an option for exporting to a file if your chosen engine supports frik_file. Place your .way, .wa1, wa2, etc. files in your maps folder, and you should be good to go.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: Frikbot swim up for air

Post by Cobalt »

Lightning Hunter's file is called: DefinitiveFrikbotWaypackV2.zip and I believe its over at quaketastic. No src included for Frikbot, just maps and ways.

As for your solution to the drowning issue, I thought the simple way would be to adjust that code to search for a nearby section near the surface where he could swim to and resurface. But those sound like good ideas to the "blank" moments FRikbot seems to have in certain situations.

Thx for the editor instructions, will have to give it a try soon.
Dr. Shadowborg wrote:
Cobalt wrote:Since you seem to be the resident "Dr Frikbot" :)
Since FrikaC has pretty much "Retired" from the quake scene, and my previous efforts regarding the last version update... Then yes, I suppose I am. (I assume Lightning Hunter put up the new version, one way to tell is by checking your bot_angle_set: If it's a lot bigger and more complex than FBXC and has code that gives them uncanny accuracy with grenades, and generally allows them to use you as a floor mop on Aerowalk, even at skill 1, then you've got the new version.)
Cobalt wrote: obvious question is, how would you go about improving that code
I believe the problem originates in the dreaded "butterscotch" loop.

Specifically, they look around the map for something they want, and if they don't see anything they particularly want, they just camp and ponder the virtues of butterscotch. Unfortunately, because of how their water code works, that can be less than...wise. :P

The fix for this is to give them more strategies that a deathmatch player might use:

1. An ai_sniper flagged waypoint to go to. (e.g. a spot somebody likes)
2. If no ai_sniper waypoint is found, check a player "grudge" list, then find a waypoint closest to the player he dislikes the most.
3. Find a weapon or item that is high valued, and isn't in the drink, then go there, expecting someone to kill will show up.

Now that I am fully aware of, and reminded of this, I'll put it in my todo list for the next version: Teh X-800. ;)
Cobalt wrote: and also, was there not a video or web page tut on how to use the waypoint editor? For some reason the editor menu on mines stuck or I need to maybe set some cvar to enter the proper mode?
Start quake with -condebug, then use impulse 104. Make sure you've bound 9 to impulse 9, impulse 10 (menu entry 0) is your "cycle next weapon key". After dumping your waypoints via the menu, open your console.log file and cut 'n paste is your friend. Alternately, there should be an option for exporting to a file if your chosen engine supports frik_file. Place your .way, .wa1, wa2, etc. files in your maps folder, and you should be good to go.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: Frikbot swim up for air

Post by Spike »

presumably the bot should just run off to camp an item that other players are likely to want, denying them access to the RL or whatever.
in quakeworld, tactics afe often more important than aiming!
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Frikbot swim up for air

Post by Dr. Shadowborg »

Cobalt wrote:Lightning Hunter's file is called: DefinitiveFrikbotWaypackV2.zip and I believe its over at quaketastic. No src included for Frikbot, just maps and ways.
Wait...you and a search of quakeone.com's forums is telling me that somewhere along the way, (over the course of NINE months) Lightning Hunter has disappeared without posting the new waypoint / frikbot update?! Uh oh. That also probably means you're still stuck using FBXB/C or FBX+ / FBX++... :shock:

Here's the absolute latest WIP that was actually posted publicly:
http://fbe.am/uJA

Theres some prototypey stuff in there for making them more personalized...

That version will have to do you until I can finish X-800 and find somewhere to upload it to, filebeam did away with free uploads... Anybody have some suggestions?
Cobalt wrote: As for your solution to the drowning issue, I thought the simple way would be to adjust that code to search for a nearby section near the surface where he could swim to and resurface. But those sound like good ideas to the "blank" moments FRikbot seems to have in certain situations.
Simpler in theory, in practice much, much harder and resource intensive. (eek, traceline hell!) In this case, the more complex method is better.
Spike wrote:presumably the bot should just run off to camp an item that other players are likely to want, denying them access to the RL or whatever.
in quakeworld, tactics afe often more important than aiming!
Yeah, frikbot's current strategic AI is sorta non-existant, and is best described as "swim swim, hungry. swim swim, hungry.". :lol:

Teh X-800 WILL have better strategic AI. Even if it drives me insanes doing it. :wink:
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: Frikbot swim up for air

Post by Cobalt »

In this case I dont know.

The mod I am picking up with the Frikbots is Electro's old Q1 Arena od ver 075. His readme says the Frikbots are a "special new version" just for his mod, but thats about all it says.

In case anyone is interested, heres his readme file updated with the stuff I have added, also there is a Darkplaces server up runing it with the new stuff added, check the Darkplaces multiplayer menu.
http://pastie.org/10292202

That said, I move that perhaps include a global string in defs such as: FBX_VER; , where the string represents the numeric version for the release of the bot. Alot easier to call up the global string using the prvm_global command at the con then skim through all the functions as in my case where the commented stuff usually at the top o0f botai has been removed.

Also, is it possible to determine the version by another method like number of lines in each specific function for example? Im not sure if your experience level with FBX is to the level you would know how to tell what version the bot is by certain things?

Dr. Shadowborg wrote: Wait...you and a search of quakeone.com's forums is telling me that somewhere along the way, (over the course of NINE months) Lightning Hunter has disappeared without posting the new waypoint / frikbot update?! Uh oh. That also probably means you're still stuck using FBXB/C or FBX+ / FBX++... :shock:
Thanks, I will have to ck that out later. Are the DM files for the waypoints new and improved also?

As for hosting , I could probably swing a mirror of sorts on my tekbot domain for this file....however Im wondering why files like this cant be hosted right here on this site? I posed a Question like that to Scarecrow about the issue seen at times when images posted to posts using other free image site hosts time out and vanish. I know there have been hack issues here from time to time, but wasnt this site created by Frik originally? He sure was alot more active here back in the day.
Dr. Shadowborg wrote: Here's the absolute latest WIP that was actually posted publicly:
http://fbe.am/uJA

Theres some prototypey stuff in there for making them more personalized...

That version will have to do you until I can finish X-800 and find somewhere to upload it to, filebeam did away with free uploads... Anybody have some suggestions?
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Frikbot swim up for air

Post by Dr. Shadowborg »

Cobalt wrote:The mod I am picking up with the Frikbots is Electro's old Q1 Arena od ver 075. His readme says the Frikbots are a "special new version" just for his mod, but thats about all it says.
It's likely at most a modified FBXC then. You'll probably be wanting to look at upgrading some things. Off the top of my head:

- bot_angle_set (upgraded greatly from the original fbx code)
- some stuff relating to going through teleporters (a few maps have teleporter problems with frikbots going through them that I fixed)
- Using the wrong weapons for certain situations, for example using the rocket launcher at pointblank to open a secret door
- Some code to prevent shooting when there's no clear shot to what they want to hit (some is in bot_angle_set, the rest is in bot_fight_style)
- Some stuff to help prevent falling and dying in maps voidmaps like coagula2, also improves some other maps with lava / slime
- Some latency code that would cause them to fail at certain jumps, I forget where exactly this was, maybe BotAI()?

Cobalt wrote: That said, I move that perhaps include a global string in defs such as: FBX_VER; , where the string represents the numeric version for the release of the bot. Alot easier to call up the global string using the prvm_global command at the con then skim through all the functions as in my case where the commented stuff usually at the top o0f botai has been removed.
Will be done in X-800.
Cobalt wrote: Also, is it possible to determine the version by another method like number of lines in each specific function for example? Im not sure if your experience level with FBX is to the level you would know how to tell what version the bot is by certain things?
FBX and FB009 were very easy to tell apart because they were radically different.

FBXB pretty much just had bugfixes for FBX / FBXA IIRC, FBXC has an option to dump waypoints via frik_file that the previous versions didn't.

Igor9's FBX+ had broken mapcycles, more randomized spawning / respawning (and limited telefrag avoidance), some amusing de-satanification of the pent in a telefrag message, and tweaks to item hunting / thisp. Somebody over on quakeone.com did a FBX++ that basically just fixed the broken mapcycles in FBX+.

The latest version was in collusion with Lightning Hunter, incorporating FBX+, his own tweaks, and my bugfixes / upgrades for the AI. It should also have the revised dm1-6 QC waypoints Lightning Hunter did, though they should only be used with an extended limits engine, as there are lots more waypoints eating up limited edicts. DM3 will usually crash to console from a lack of edicts in vanilla winquake during normal gameplay.
Cobalt wrote: Thanks, I will have to ck that out later. Are the DM files for the waypoints new and improved also?
See above. Only the QC waypoints for DM1-6 have any revisions.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: Frikbot swim up for air

Post by Cobalt »

Ok I just found the original q1A075 compressed dl file, and botai.qc has this at the top:

======================================
FrikBot version 0.09 REVISION B
======================================

However in electro's accompanying readme, he added:

- Upgraded to Frikbot 0.09a (special unreleased revised version)
-revised frikbot includes: better avoidance of being pushed into lava
-fixed angle calculations ? (not sure if he is saying he fixed angle calcs or the new bot has fixed them)


More or less this bot is "as is" except I had to fix some weapon_range problems where he was using Vanilla Quake weapon floats for the bot code and not using the new ones
Electro put in the mod, say for the Railgun etc - hence the RJ issue mentioned in the other thread. I also experimented with the vectors it returned hoping to improve some, at least for the railgun,
which was returning the vector used for the sng since its the same weapon float now. I'll have to peek at your code to see if you have improived any of them.

Dr. Shadowborg wrote:
It's likely at most a modified FBXC then. You'll probably be wanting to look at upgrading some things. Off the top of my head:

- bot_angle_set (upgraded greatly from the original fbx code)
- some stuff relating to going through teleporters (a few maps have teleporter problems with frikbots going through them that I fixed)
- Using the wrong weapons for certain situations, for example using the rocket launcher at pointblank to open a secret door
- Some code to prevent shooting when there's no clear shot to what they want to hit (some is in bot_angle_set, the rest is in bot_fight_style)
- Some stuff to help prevent falling and dying in maps voidmaps like coagula2, also improves some other maps with lava / slime
- Some latency code that would cause them to fail at certain jumps, I forget where exactly this was, maybe BotAI()?
So I have perhaps v 09a slightly modified to a b to fit Electros mod, unless Electro modified it to a b himself. Or perhaps you would know?
The dl can be gotten here [ http://www.quakewiki.net/download/2837/ ]

Respawning problems I am experienced with, and have coded a few different solutions of my own that seem to work good, but have not yet put them into q1 Arena.

Did you put his item hunting code in your new version or was it worth including?

Not sure what you mean by mapcycles, unless you mean picking random maps? If so, I just finished making code using Orions sample code on this other thread:
[ http://forums.inside3d.com/viewtopic.php?f=2&t=5369 ]

Basicly I have it using Frik file to read the text file of Lightning Hunters 500 map names , so far working ok. Will probably post the code in that thread soon.

Im using DP and its edict limits are I believe 6K, though right now the number of gibs flying around tends to somewhat give a FPS hit depending on how many bots are Gibbing ,
Im managing it on so far with the remove() time code, and also as an added trick if the gib goes into the lava, I sometimes turn it into a fireball.

Havent peeked at your new version just yet, but I suppose I will just compare function to - function or I guess diff them to see what needs to be changed.

Dr. Shadowborg wrote: FBX and FB009 were very easy to tell apart because they were radically different.
FBXB pretty much just had bugfixes for FBX / FBXA IIRC, FBXC has an option to dump waypoints via frik_file that the previous versions didn't.

Igor9's FBX+ had broken mapcycles, more randomized spawning / respawning (and limited telefrag avoidance), some amusing de-satanification of the pent in a telefrag message, and tweaks to item hunting / thisp. Somebody over on quakeone.com did a FBX++ that basically just fixed the broken mapcycles in FBX+.

The latest version was in collusion with Lightning Hunter, incorporating FBX+, his own tweaks, and my bugfixes / upgrades for the AI. It should also have the revised dm1-6 QC waypoints Lightning Hunter did, though they should only be used with an extended limits engine, as there are lots more waypoints eating up limited edicts. DM3 will usually crash to console from a lack of edicts in vanilla winquake during normal gameplay.
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Frikbot swim up for air

Post by Dr. Shadowborg »

Cobalt wrote: More or less this bot is "as is" except I had to fix some weapon_range problems where he was using Vanilla Quake weapon floats for the bot code and not using the new ones
Electro put in the mod, say for the Railgun etc - hence the RJ issue mentioned in the other thread. I also experimented with the vectors it returned hoping to improve some, at least for the railgun,
which was returning the vector used for the sng since its the same weapon float now. I'll have to peek at your code to see if you have improived any of them.
Frikbot 0.09 is not compatible with FBX. The pastie you posted earlier mentioned that he upgraded to FBX, so I dunno. (i.e. FBXC is 0.10.2)

weapon_range is specific to mod, so you will have to tweak them, as the latest FBX I gave you is only meant for vanilla.
Cobalt wrote: So I have perhaps v 09a slightly modified to a b to fit Electros mod, unless Electro modified it to a b himself. Or perhaps you would know?
The dl can be gotten here [http://www.quakewiki.net/download/2837/ ]
Downloaded that, couldn't open the archive. Downloaded latest version of 7-zip 15.05, still couldn't open it.
Cobalt wrote: Did you put his item hunting code in your new version or was it worth including?
This was Lightning Hunter's version that I fixed up, so his item hunting mods are present.
Cobalt wrote: Not sure what you mean by mapcycles, unless you mean picking random maps? If so, I just finished making code using Orions sample code on this other thread:
[ http://forums.inside3d.com/viewtopic.php?f=2&t=5369 ]

Basicly I have it using Frik file to read the text file of Lightning Hunters 500 map names , so far working ok. Will probably post the code in that thread soon.
Random map cycle yes.
Cobalt wrote: Im using DP and its edict limits are I believe 6K, though right now the number of gibs flying around tends to somewhat give a FPS hit depending on how many bots are Gibbing ,
Im managing it on so far with the remove() time code, and also as an added trick if the gib goes into the lava, I sometimes turn it into a fireball.
O_o thats nuts. Good call on lava though. :D
Cobalt wrote: Havent peeked at your new version just yet, but I suppose I will just compare function to - function or I guess diff them to see what needs to be changed.
Probably the easiest, that said, if it IS still FB009, then you're gonna have to bite the bullet and update it to FBX, as mine and Lightning Hunter's upgrades won't work with that version.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: Frikbot swim up for air

Post by Cobalt »

Ok , spent alot of time Diffing each individual bot file but finally got it done. Yea most the biggest changes seem to be in botangleset, and I think the misc file was completely different so that was just a pure copy n paste. The rest of the functions were not too many changes alot needed no changes at all.

I saw your new code for the bot weapon selection and though the fav wep seems neat I didnt utilize it just yet.

I did however notice after compiling, loading up DM5 for example the bots just stood where they spawned. So I went into the waypoint file, and noticed there was a float completely gone called: search_time , removed from make_waypoint () , waypoint () and SpawnTempWaypoint (). When I put these back in where they originally were the bot now navigated on that map ok, so I am wondering if its a big problem? Seems you have it in Botai () but I have it in a function called target_add () which seems completely gone in your code called from bot_handle_ai () which is also gone as well as another called: bot_path ().

Somehow I guess I didnt remove these from the old code and they are still playing a role I guess?
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Re: Frikbot swim up for air

Post by Dr. Shadowborg »

Cobalt wrote:I did however notice after compiling, loading up DM5 for example the bots just stood where they spawned. So I went into the waypoint file, and noticed there was a float completely gone called: search_time , removed from make_waypoint () , waypoint () and SpawnTempWaypoint (). When I put these back in where they originally were the bot now navigated on that map ok, so I am wondering if its a big problem? Seems you have it in Botai () but I have it in a function called target_add () which seems completely gone in your code called from bot_handle_ai () which is also gone as well as another called: bot_path ().

Somehow I guess I didnt remove these from the old code and they are still playing a role I guess?
Examination of FBXC vs. FB009b indicates that you are still using FB009b, likely some hodgepodge cobbled together with stuff from FBX using duct tape version.

bot_way.qc does NOT have .search_time anywhere in it in FBXC or the mine / Lightning Hunter's upgrade.

You'll just have to figure out what mod specific stuff electro did and what you've done so far, then take the plunge and update to the proper version. Or just simply remake q1arena.
Post Reply