TDBots: The fast-performing bots v19 (4/11/2019)

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are ONLY for YOUR PROJECTS! If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.

TDBots: The fast-performing bots v19 (4/11/2019)

Postby TDRR » Wed May 01, 2019 3:06 am

TDBots are another bot mod that puts a computer-controlled opponent/friend into ZDoom, GZDoom, QZDoom, Zandronum, Eternity and MBF-compatible ports (including PrBoom).
What sets it apart from most other bot mods, is that they are handled far more like real players. For example, in Deathmatch you can frag them and actually get it counted as a frag. You can spectate from their point of view, they can run out of ammo, they can use the vast majority of items (health, ammo, armor, weapons, Heretic/Hexen inventory items), they can chat, get damaged by damaging floors, activate walkover lines, can use skins and custom colors, and is far less stupid than the built-in bots! Did i mention there's far less eating wall and more action with these bots?

As it's licensed under the MIT license, you can use it in your own projects too!

DOWNLOAD! (ZDoom, GZDoom and QZDoom version)

DOWNLOAD! (Zandronum version)
(Note: the Zandronum version can't seek items or follow nodes yet, due to the unimplemented A_CheckProximity codepointer)

(Note: the following two versions are more basic compared to the ZDoom-compatible versions, and lack many features. Still pretty fun to play with)
To add bots in these, you need to pass the command line parameter -dogs <amount of bots>
Or in Eternity, just go to the options menu and change the helper dog amount.
DOWNLOAD! (Eternity version)

DOWNLOAD! (MBF-compat version)

Bot config file (REQUIRED): UNZIP DIRECTLY INTO YOUR (G)ZDOOM DIRECTORY (Not needed for Zandronum) (UPDATED: 6/6/2019)
DOWNLOAD BOT CONFIG!

NOTE: The following footage is outdated and bots perform better now


But, why? ZetaBots already exist, and ZDoom has it's own bots!
Well, this bot is actually quite different and is useful in it's own way compared to them, check out the features list!

Spoiler: Features


Spoiler: Bad stuff


Spoiler: Usage guide


Spoiler: Other versions


Spoiler: Changelog


Spoiler: How do i make my mod compatible?


Spoiler: Waypointing guide


Spoiler: Waypoints and other addons


Spoiler: Mod compatibility patches
Last edited by TDRR on Wed Nov 06, 2019 11:15 pm, edited 48 times in total.
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

TDBots: The SMART update!

Postby TDRR » Thu May 02, 2019 2:06 am

Updated! This update packs a good bunch of stuff. Pretty suprising getting from nothing at all to this version in just 2 days!

The bots are now REALLY good at Deathmatch, and quite good at Co-op.

Download link in the OP!
Last edited by TDRR on Thu May 02, 2019 5:21 pm, edited 1 time in total.
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: TDBots: The fast-performing bots v2 (2/5/2019)

Postby TXTX » Thu May 02, 2019 7:47 am

Wonder if you, Gustavo, and Zdoom Devs could collaborate on bots? Anyway im glad work is starting on zdoom specific bots as the old zcajun bots arent exactly the best. Just havent had the time to try them out yet.
User avatar
TXTX
Insane Feline, Hacking through ZScript
 
Joined: 12 Sep 2013
Location: A Hidden Location

Re: TDBots: The fast-performing bots v2 (2/5/2019)

Postby Gustavo6046 » Thu May 02, 2019 1:26 pm

Wow, that's impressive! Good luck to your project. I know you can do the same task I tried, but better :)
User avatar
Gustavo6046
 
Joined: 13 May 2017
Location: In an urban area in Brazil.
Discord: Gustavo6046#9009

Re: TDBots: The fast-performing bots v2 (2/5/2019)

Postby TXTX » Thu May 02, 2019 1:58 pm

Theyre pretty good so far. Question: do they use anything zcajun related at all or is the bot completely unused?
I'm asking since I've had a few mods that simply added things to the zcajun bots.
User avatar
TXTX
Insane Feline, Hacking through ZScript
 
Joined: 12 Sep 2013
Location: A Hidden Location

Re: TDBots: The fast-performing bots v2 (2/5/2019)

Postby Gustavo6046 » Thu May 02, 2019 2:38 pm

TXTX wrote:Question: do they use anything zcajun related at all or is the bot completely unused?
I'm asking since I've had a few mods that simply added things to the zcajun bots.


ZCajun is 99% native code. If he didn't fiddle with the source port's code (which I'm sure he didn't, since he'd have to distribute a separate executable, a la ZDoomBot), then no, it doesn't use anything ZCajun, unless he used any of the DECORATE flags or properties left over from ZCajun's ZDoom support.
User avatar
Gustavo6046
 
Joined: 13 May 2017
Location: In an urban area in Brazil.
Discord: Gustavo6046#9009

Re: TDBots: The fast-performing bots v2 (2/5/2019)

Postby Enjay » Thu May 02, 2019 2:56 pm

In saying that, however, it does use a zcajun-style zcajun/bots.cfg file.

Really cool bots BTW. I'm a fan of DM bots in GZDoom and it's nice to see the idea getting some love these days.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: TDBots: The fast-performing bots v2 (2/5/2019)

Postby TDRR » Thu May 02, 2019 4:26 pm

TXTX wrote:Theyre pretty good so far. Question: do they use anything zcajun related at all or is the bot completely unused?
I'm asking since I've had a few mods that simply added things to the zcajun bots.


I'm manipulating the ZCajun/Zandronum bots to do what i want via ACS and DECORATE, which is why they have such realistic and compatible behavior. Essentially i'm completely overriding their movement, some input handling and firing actions, which allows me to take advantage of all their perfect 1:1 player interactions, like actioning lines, getting teleported, standing on damaging floors among other neat stuff. This is quite obvious when you spectate the bots, as this would be otherwise completely impossible with any other sort of trick.
While i'm still using the ZCajun bots, they are basically only there to handle the core stuff, while the whole AI the bots rely on to attack, navigate and think is written by me, with no trace of the ZCajun behavior. (Which is why the bots behave identically on ZDoom and Zandronum, besides me not being able to override the original Zandronum bot chat system)

Me cooperating with Gustavo and the ZDoom devs may be out of the question, these bots are way too simple like to benefit the engine being added natively, IMO it's much better off as an addon, while ZetaBots becomes the basis of the new bots. They are skillful and everything but the code is quite tacky like to take anything really good from it, they hold up as addons, but not as a native engine feature. That said, i do hope Gustavo/The ZDoom devs take at least some of the aiming or navigating of these bots, because they work quite decently for barely any performance cost.

TL;DR Yeah it's the ZCajun bots but the TDBots completely replace their movement, firing, aiming and thinking routines. So more or less it's an almost completely new bot.

Enjay wrote:In saying that, however, it does use a zcajun-style zcajun/bots.cfg file.

Really cool bots BTW. I'm a fan of DM bots in GZDoom and it's nice to see the idea getting some love these days.


Thanks, glad you enjoyed them. The bots.cfg file is indeed directly used from ZCajun. Don't forget they can also play Coop!

Gustavo6046 wrote:Wow, that's impressive! Good luck to your project. I know you can do the same task I tried, but better :)

Hey, you gave me the inspiration with your great ZetaBots, so i guess i owe this to you :)

Also, i may need a lesson or two from your waypointing systems, because i'm completely stumped on how to do mine.
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: TDBots: The fast-performing bots v2 (2/5/2019)

Postby TXTX » Thu May 02, 2019 4:32 pm

TDRR wrote:
TXTX wrote:Theyre pretty good so far. Question: do they use anything zcajun related at all or is the bot completely unused?
I'm asking since I've had a few mods that simply added things to the zcajun bots.


I'm manipulating the ZCajun/Zandronum bots to do what i want via ACS and DECORATE, which is why they have such realistic and compatible behavior. Essentially i'm completely overriding their movement, some input handling and firing actions, which allows me to take advantage of all their perfect 1:1 player interactions, like actioning lines, getting teleported, standing on damaging floors among other neat stuff. This is quite obvious when you spectate the bots, as this would be otherwise completely impossible with any other sort of trick.
While i'm still using the ZCajun bots, they are basically only there to handle the core stuff, while the whole AI the bots rely on to attack, navigate and think is written by me, with no trace of the ZCajun behavior. (Which is why the bots behave identically on ZDoom and Zandronum, besides me not being able to override the original Zandronum bot chat system)

Me cooperating with Gustavo and the ZDoom devs may be out of the question, these bots are way too simple like to benefit the engine being added natively, IMO it's much better off as an addon, while ZetaBots becomes the basis of the new bots. They are skillful and everything but the code is quite tacky like to take anything really good from it, they hold up as addons, but not as a native engine feature. That said, i do hope Gustavo/The ZDoom devs take at least some of the aiming or navigating of these bots, because they work quite decently for barely any performance cost.

TL;DR Yeah it's the ZCajun bots but the TDBots completely replace their movement, firing, aiming and thinking routines. So more or less it's an almost completely new bot.



Smart. I'm really happy you're working on bots tbh. Im one of the few who play with them regularly since ZDoom isnt exactly online based (mostly in doom wars).
Keep it up for all of us.
User avatar
TXTX
Insane Feline, Hacking through ZScript
 
Joined: 12 Sep 2013
Location: A Hidden Location

TDBots: The FRIENDS update!

Postby TDRR » Thu May 02, 2019 5:18 pm

Another update! Not as big as the previous one, but still worth to update to.

Bots are now more team-y in Team Deathmatch and other teamgames.
Bots should be able to get into the MAP01 end room on their own (Unfortunately ZCajun bots won't press any exit-level switches, so it can't finish the level :( )

Download link in the OP!
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: TDBots: The fast-performing bots v3 (2/5/2019) (UPDATED)

Postby Enjay » Thu May 02, 2019 5:32 pm

Cool, thanks for the update.

Just a minor oddity I noticed; I suspect it's not a problem though. If I start a game (just map01 single player will do) add a bunch of bots up to the max then type removebots, the bots vanish (as expected) but I get thrust forwards a bit at the same time.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: TDBots: The fast-performing bots v3 (2/5/2019) (UPDATED)

Postby TDRR » Thu May 02, 2019 5:52 pm

Enjay wrote:Cool, thanks for the update.

Just a minor oddity I noticed; I suspect it's not a problem though. If I start a game (just map01 single player will do) add a bunch of bots up to the max then type removebots, the bots vanish (as expected) but I get thrust forwards a bit at the same time.


Tested on ZDoom LE 2.8.3a and it does happen, but i don't know why, will investigate further for the next update.

Seems to only happen with 4 or more bots, so it's possible the game gets confused and assigns one of the bots' think loops to the player.
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

TDBots: The NOT QUITE THERE UPDATE (3/5/2019)

Postby TDRR » Fri May 03, 2019 2:32 am

New update, however, it comes with an issue i couldn't manage to fix. So i need your help to pinpoint the cause of the bug.
Ocassionally, the bot will aim completely off-target and keep firing like it actually is hitting it's target and all LOS checks will indeed succeed but the projectiles/bullets themselves will be fired to the location the bot is actually aiming. You will know when this happens because the bot will start weirdly flickering between two angles and will miss most of it's attacks.

I still recommend reading the changelog though.

Download link in the OP!
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: TDBots: The fast-performing bots v4 (3/5/2019)

Postby Gustavo6046 » Fri May 03, 2019 11:50 am

I will help you tackle both the navigation and the aiming issue in this post.

• Navigation

The ZetaBots use a node-based navigation system, where neighbouring nodes are determined in real-time. Usually, you want to be able to see nodes only if a debug mode CVar is set (like zb_debug in the ZetaBot CVarInfo).

To determine whether two nodes are connected, one may simply check:
a) whether there is line of sight between both
b) whether they are close enough;
c) whether the other node is too far high (this rule might be a bit broader if the current node is a jump node);
d) whether there is not a closer node in the same direction (the dot product of unit vectors helps here!).

To be able to check for case D, in the case of the ZetaBot, I find and yield neighbouring (connected) nodes in two steps:
1. Checks A, B, C. Run for all nodes in the map; store all nodes that pass in a list.
2. Check D. Run for all nodes in the list, and yield the nodes that pass as a result.

Usually my bots just wander to the immediately neighbouring nodes, but when they are hunting an enemy, they try following a path, which they carve from nodes using the A* search algorithm. If I recall correctly, this path is researched everytime they reach a new node, due to the dynamic nature of ZTPathNodes – they are far from static, as they can even be moved by things like lifts.

Some nodes will also have a special type, e.g. ZetaBots have the following node types:
  • NT_Jump makes bots in that node jump way more often than they would in a normal node;
  • NT_Shoot makes them shoot;
  • NT_Use makes them use without activating auto-use (zb_autouse)¹;
  • NT_Slow makes them slower, or NT_Crouch makes them crouch;
    etc.
¹ ZetaBots will plop NT_Use nodes when they manage to activate a door, lift, etc. linedef via auto-use since v0.4.2, so the mapper doesn't need to plop those manually.

Still, I would have used a bit field, to be able to combine e.g. jumping, shooting and using. But now it's rather late for that. I will measure the necessary rewrite for such later on.

• Aiming

My bots usually shoot for as long as they have a target, which is wrong.
Ideally, bots should only really shoot if they have a line of sight to the target, and if the target is not behind them. I use functions to move or to aim towards other objects.

Code: Select allExpand view
// ZetaBot_v0.4.4.pk3 -- ZScript.zsc, lines 1475-1484, dedented
AimToward(enemy, 0.27, 30);

let off = possessed.Vec2To(enemy) / possessed.Distance2D(enemy);
let dir = AngleToVector(possessed.angle);
double ddot = (off.x * dir.x) + (off.y * dir.y);

if ( dDot <= 0 )
    possessed.EndShoot();

else { /* shoot if possible */ }
User avatar
Gustavo6046
 
Joined: 13 May 2017
Location: In an urban area in Brazil.
Discord: Gustavo6046#9009

Re: TDBots: The fast-performing bots v4 (3/5/2019)

Postby TDRR » Fri May 03, 2019 1:58 pm

Wow, thanks for the explanation, i will try making mine around points A and B, which should be the easiest to do in ACS+DECORATE.

Gustavo6046 wrote:• Aiming

My bots usually shoot for as long as they have a target, which is wrong.
Ideally, bots should only really shoot if they have a line of sight to the target, and if the target is not behind them. I use functions to move or to aim towards other objects.

Code: Select allExpand view
// ZetaBot_v0.4.4.pk3 -- ZScript.zsc, lines 1475-1484, dedented
AimToward(enemy, 0.27, 30);

let off = possessed.Vec2To(enemy) / possessed.Distance2D(enemy);
let dir = AngleToVector(possessed.angle);
double ddot = (off.x * dir.x) + (off.y * dir.y);

if ( dDot <= 0 )
    possessed.EndShoot();

else { /* shoot if possible */ }


That unfortunately doesn't help me much, my bots already do LOS checks to see if they can actually hit the target from their current standpoint and looking angle, if not, then they will just stop firing. When the aiming freaks out, all LOS checks return TRUE despite the fact they should all miss, so the bot just keeps firing.

In the end i had to roll back to version 3 for the next update, which fixes this issue almost completely, but it's a bit more inefficient than version 4.
User avatar
TDRR
iDeas from the deep (pit of hacks)
 
Joined: 11 Mar 2018
Location: Venezuela
Operating System: Windows Vista/7 64-bit
Graphics Processor: Intel (Modern GZDoom)

Next

Return to Gameplay Mods

Who is online

Users browsing this forum: Black Rock Shooter, Keldian and 14 guests