Forum

> > CS2D > Mods > New Bot System - Testing Version Released
Forums overviewCS2D overview Mods overviewLog in to reply

English New Bot System - Testing Version Released

89 replies
Page
To the start Previous 1 2 3 4 5 Next To the start

old New Bot System - Testing Version Released

Dousea
User Off Offline

Quote
I'm currently unsatisfied with our current bot system. It's pretty good I know, but I'd like it to be more human-like. I have ideas in mind that I could implement. I rewrote the system from scratch, trying to scratch what kind of things that I could do with current bots, but as you know CS2D has many limitations and I couldn't make big changes as I want it to be. My current plans are as following.

• Behavior tree: Behavior tree is a control system that could be used in AI. It could test many cases (added manually) and create actions on how to react to the cases. I have read many articles and I wonder how I could implement this one in CS2D, because I don't want to end up using too many tables just to simulate classes. It's too extreme.
• Hiding/sniping/camping spots: In CS, there're so-called hiding spots. These spots are used by bots when they're on danger or something. I want to include this to the system by adding additional file to map (like navmesh in CS) that contains a table of hiding spots locations. I might add an automatic system that scans a map for hiding spots.
• Reacting to noises: This one is a beast. I don't know how to implement this one, but additional hooks might be a good idea. I might use cs2d lua hook attack and cs2d lua hook break hooks and send a signal to all bots where it's fired, and add appropriate response on the signal.
• Danger: Another game-changer feature that might be hard to be implemented. "Danger" is restarted every spawn and only be added when a teammate dies. It changes on how bots take a "go-to" point.
• Morale: Feature that could kill me. This one doesn't restart every spawn and calculated on the bot's lifetime. Morale is increased when: kills an enemy; completes an objective; and is on the winning team. While it's decreased when: is killed; and is on the losing team. It determines whether to "rush" or "camp".

Maybe there're tons of other features that I'd like to implement, but they're too small so I didn't list them on the game-changing features list. I started this work since 2 days ago, so when to add "danger" and "morale" are already added (not when to use them). It might take a long time. Don't lose hope because this project passionates me a lot (especially after making this thread.. don't want to make you hopeless, aren't we?), and giving experiences on how to deal with AI when working on my own games. Giving me support would boost my work too.

Maybe you have ideas in mind that I could implement too? That'd be great. Don't ask for weapon profiency, how to take path, etc. because CS2D has limitations as well. Or do you want to help me in this project, on any aspect? All help are appreciated.
edited 1×, last 20.07.17 12:36:03 pm

old Re: New Bot System - Testing Version Released

TimeQuesT
User Off Offline

Quote
user Dousea has written
• Reacting to noises: This one is a beast. I don't know how to implement this one, but additional hooks might be a good idea. I might use cs2d lua hook attack and cs2d lua hook break hooks and send a signal to all bots where it's fired, and add appropriate response on the signal.


I like that idea. Anyway to detect noise, you actually have to scan for every action that emits sound. Like checking if a player is walking, reloading, shooting etc. Yep, this will be alot of work.

This might be a realized with a table storing all sound events for 1 frame. This includes : position, volume. (volume is determined in the specified hook that adds the entry)

Wish you good luck with that, and hoping to hear new stuff about this project in future.

(This looks like you try to rewrite the CS:CZ bots :D) [Best gaming AI I have seen so far]

old Re: New Bot System - Testing Version Released

Dousea
User Off Offline

Quote
@user _3yrus: Yeah, I already think so too. Thanks for that anyway.
@user TimeQuesT: If I need all of those check-ups then this bot system couldn't be played in online mode at most. Anyway walking IS the way to avoid creating noises and reloading is not really that important to react. Thanks for the idea of the implementation, I'll think about that. Also yeah, I'm reading a "bot design" PDF from someone who was creating CS:CZ.

If anyone interested on "the making of bots for CS:CZ", here's The Making of the Official Counter-Strike Bot PDF file.

old Re: New Bot System - Testing Version Released

_3yrus
User Off Offline

Quote
I think the biggest bug bots include is when fog of war id off u can see bots but they arent able to do that.so u easily can kill them.and i think its not hard to be solved it is ??

old Re: New Bot System - Testing Version Released

Dousea
User Off Offline

Quote
I'm done with auto-find hiding spots, but basically what it does only search for corners. Anyone wants to look at the code, click on the spoiler. This one might be my test tool only but if you want it to be a thing.. but.. let's focus on the bot system first. As you can see (or no), I'm going for spots file type. It's not preferable to use this auto-find script. Hiding spots must be added manually because human minds are better..
Spoiler >

old Re: New Bot System - Testing Version Released

Masea
Super User Off Offline

Quote
Good project, good luck

I've got one idea. That is to change the behavior of bots by enemies' weapons. Like if the enemy has a close range weapon(shotgun), the bots will not get too close to them.

old Re: New Bot System - Testing Version Released

gotya2
GAME BANNED Off Offline

Quote
What would be nice too:
-Bots can aim outside of screen camera, based on "hearing".
-The further the shooting distance, the worse the accuracy.

I've actually already implemented this to make the bots more challenging.
All your other plans require support from the map editor / DC.

old Re: New Bot System - Testing Version Released

TimeQuesT
User Off Offline

Quote
Heyo user Dousea, I started working on a sound-lib. Yet it works very fine. Weapon volumes still need's tweaking. Unfortunately I had to use the "move" hook to detect walking. Sound list is cleared every 4th frame via a timer.

Since now it detects:
• breaking walls
• shooting
• running
• reloading

Sound volume reduces with the distance to the listener (linear).

I might implement more stuff and investigate time into acoustic physics if you're interested (yet, math done is very primitive).

You can get the script HERE
An example can be found HERE
(makes enemy bots going towards the position where they last heared you.)

Ps: The only function required for controlling bots is: snd.FindSound(searching_player_id)

Known Bugs:
Knife is loud as fuck
A non silenced usp can be marked as silenced by silencing and dropping it. Afterwards buy a new one. It is handled as silenced.

old Re: New Bot System - Testing Version Released

Dousea
User Off Offline

Quote
@user Masea: Yes, that would be great. Thanks for the kind words.
@user gotya2: Yeah, your ideas are parts of my plan. Thanks.
@user Pagyra, user Starkkz, user Avo: Welp that's an overkill feature for me. Even in original CS they hard-coded the bots. It's impossible to lay my hands on it because it's really time-consuming.
@user TimeQuesT: Wow, man. Thanks. It really helps me out and opened my mind a bit. Will see what I can do.

old Re: New Bot System - Testing Version Released

Zeik
User Off Offline

Quote
For the noise events it would be something like this with OOP:
Spoiler >

old Re: New Bot System - Testing Version Released

Dousea
User Off Offline

Quote
@user Zeik: Another code that opened my mind! Thanks. But actually I won't be using OOP for the sake of raw speed.. but I'll see what I could implement. Also fun fact, your code might open the possibility to do
bots[1]:new('lol'):new('lol'):new('lol')...
..
To the start Previous 1 2 3 4 5 Next To the start
Log in to reply Mods overviewCS2D overviewForums overview