TDBots Mk2 - v1 (11/05/2022)

Projects that alter game functions but do not include new maps belong here.
Forum rules
The Projects forums are only for 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.
Post Reply
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

TDBots Mk2 - v1 (11/05/2022)

Post by TDRR »

TDBots are another bot mod that puts a computer-controlled opponent/friend into Zandronum, plus simplified versions for ZDoom, GZDoom, LZDoom, Eternity and MBF-compatible ports (including PrBoom). (They are also compatible with the respective Delta-Touch versions of these sourceports!) ZDoom-compatible, Eternity and MBF versions are now available in the "Legacy stuff" spoiler.

What sets it apart from all other external bot mods (Loaded by a .pk3 instead of custom .exe), 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, learn the map from your exploration, play almost any mod and IWAD, and are far less stupid than the built-in bots!

As it's licensed under the MIT license, feel free to use it in your own projects too!

DOWNLOAD! (TDBots Mk2, Zandronum version, actively maintained!)

baj468's / Brendon James' Waymaker v1.2 (link)
Didn't like the built-in node studio and prefer an external program to make waypoints more comfortably? Try this. With a WadAuthor-esque look and simple controls, you'll get used to it really quick. Comes with a quick start guide in it's readme.txt file!

But, why? Zandronum 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: Changelog
Spoiler: Known issues
Spoiler: Waypoints and other addons
Spoiler: Legacy stuff (for v30 / GZDoom-compatible version)
Last edited by TDRR on Tue May 17, 2022 6:08 pm, edited 87 times in total.
User avatar
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

TDBots: The SMART update!

Post by TDRR »

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 4:21 pm, edited 1 time in total.
User avatar
TXTX
Posts: 195
Joined: Thu Sep 12, 2013 5:53 pm
Location: A Hidden Location

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

Post by TXTX »

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
Gustavo6046
Posts: 137
Joined: Sat May 13, 2017 3:11 pm
Location: Brazil
Contact:

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

Post by Gustavo6046 »

Wow, that's impressive! Good luck to your project. I know you can do the same task I tried, but better :)
User avatar
TXTX
Posts: 195
Joined: Thu Sep 12, 2013 5:53 pm
Location: A Hidden Location

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

Post by TXTX »

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
Gustavo6046
Posts: 137
Joined: Sat May 13, 2017 3:11 pm
Location: Brazil
Contact:

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

Post by Gustavo6046 »

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
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

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
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

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

Post by TDRR »

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
TXTX
Posts: 195
Joined: Thu Sep 12, 2013 5:53 pm
Location: A Hidden Location

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

Post by TXTX »

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
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

TDBots: The FRIENDS update!

Post by TDRR »

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
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

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

Post by Enjay »

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
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

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

Post by TDRR »

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
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

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

Post by TDRR »

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
Gustavo6046
Posts: 137
Joined: Sat May 13, 2017 3:11 pm
Location: Brazil
Contact:

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

Post by Gustavo6046 »

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 all

// 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
TDRR
Posts: 815
Joined: Sun Mar 11, 2018 4:15 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Debian 12/ Manjaro
Graphics Processor: nVidia with Vulkan support
Location: Venezuela

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

Post by TDRR »

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 all

// 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.
Post Reply

Return to “Gameplay Mods”