English New Bot System - Testing Version Released

89 replies
Goto Page
To the start Previous 1 2 3 4 5 Next To the start
22.06.17 11:04:38 pm
Up
Pagyra
User
Offline Off
For more experience, you should pay attention to source code, functional and principles embedded in various bots of 3d shooters - such as bots for cs 1.6 (like Podbot, nicebot, zbot, swatbot, realbot) or similar in other different games.

Moreover, to humanize bots it is required to add some human character traits and habits.
For example, here are a number of typically human habits,
- Look about in direction where you are moving,
- reload even ammo has more than 20 rounds
- stupid rush (even when player knows that enemies are waiting around corner) and panic if there are several opponents nearby
- forgetfulness to use grenades during round or their meaningless using at end of round (and even shooting last clip)
- constant switching between types of weapons
- throws grenades into area with allies
- shooting during movement (like run and shoot with awp and with using optical sight)
- running with a knife to opponent who is distracted or does not see player
- running in a dense crowd along narrow corridors
- using typical tactics (or cycle-actions)
- running with a grenade or a mine in hands
- rare switching to pistols

It also makes sense to add human characteristics that can affect at gameplay such as aggressiveness, greed for frags, greed for getting trophies, susceptibility to panic and fear, calmness, team feeling (understanding of allies' actions), teamwork (understanding order of personal actions in each situation), camper habits (habit of using certain places on map), habitual shooting distances, etc.

So you can use text files to save some waypoints and some team info for every analyzed map, i mean you can try to add analyze function to search areas for camping, defence, attack, for special actions. And it can be improved with addition of information about default view angle, about good weapon type for that map area, prefered method of typical distribution of team players in occupation of this sector of map, about "danger" of this sector and so on.
23.06.17 04:57:11 am
Up
Ortimh
User
Offline Off
@user Pagyra: Well they're 3D games which is totally different on the calculations, but I'll look into it, maybe there're some things that I could take. And as I said, there're CS2D limitations regarding on weapon proficiency, especially with getting ammo values. So I couldn't do anything about it, unless I need to hack it, which is I don't want to because some critical factors. Also all your suggestions is really too map-specific, could take a lot of time and it couldn't be generalized for all maps (if you know what I mean). But if this is something that I could make money with, I'd do it though.

Okay, repository is up! You can check it out here. There're some minor features that I added but I can't remember what they are.

UPDATE:
I've been working on this as daily as I can, so DON'T WORRY. I'm not going to update this thread until something really interesting happens. Instead of updating it here, you can check the daily progress in the repository. Also I have a question that I have in mind that has been delaying this project.. (instead of creating a new thread, yes?)

How can I get the seconds a bomb would detonate? Or seconds until detonation?
edited 2×, last 27.06.17 12:46:35 pm
I'm awesome ... and I really cookies
27.06.17 12:53:34 pm
Up
Masea
Super User
Offline Off
user Ortimh has written:
How can I get the seconds a bomb would detonate? Or seconds until detonation?
game("mp_c4timer")
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
27.06.17 01:17:14 pm
Up
Ortimh
User
Offline Off
@user Masea: Ah, that's not what I meant. It's the seconds after the bomb has been planted, so it would return 35, 34, 33, ... until detonation. But I think there's none.. so another hack, huh? This mod is getting bigger that online use might be impossible.
I'm awesome ... and I really cookies
27.06.17 05:26:36 pm
Up
Goo
User
Offline Off
If there isn't just add a second hook which will count down a variable every second when a bomb was planted.
27.06.17 06:03:24 pm
Up
Masea
Super User
Offline Off
@user Goo: Well... in this case, the cs2d lua cmd timer function would be the most useful thing instead. Why? Because you can start the timer counting once player planted the bomb. But the cs2d lua hook second hook can be trigger before.
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
27.06.17 06:05:02 pm
Up
Goo
User
Offline Off
Yes but with the timer you are unable (as far as I know) to check how long is left AT THE MOMENT for the bomb to explode.
27.06.17 06:10:37 pm
Up
Masea
Super User
Offline Off
Code:
1
2
3
4
5
6
bomb_timer = game("mp_c4timer")

addhook("bombplant","_")
function _()
     timer(1000,"parse","lua bomb_timer=bomb_timer-1",0)
end
Something like this would work regardless.
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
27.06.17 06:25:02 pm
Up
Goo
User
Offline Off
Is that hook being called every 1 second?
27.06.17 06:31:17 pm
Up
Fraizeraust
Moderator
Offline Off
@user Masea: That'd lead to problems though because cs2d lua cmd game always returns a string. Wrapping
game("mp_c4timer")
with
tonumber()
would make sense.
27.06.17 06:36:33 pm
Up
Mora_rus
User
Offline Off
It's not that hard to make a function which repeat self.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
bomb_timer = game("mp_c4timer")

addhook("bombplant","_")
function _()
     timer(1000,"speat")
end

function speat()
     if not ((bomb_timer-1)==0) then
          bomb_timer=bomb_timer-1
          timer(1000,"speat")
          msg(""..bomb_timer.."")
     else
          bomb_timer=0
          msg(""..bomb_timer.."")
          bomb_timer=game("mp_c4timer")
     end
end

addhook("startround","_st")
function _st()
     freetimer()
     bomb_timer=game("mp_c4timer")
end

btw when it would lead to problems using w/o tonumber?
I will finally join the army at 5.07.18 and back after year. bb
27.06.17 06:45:50 pm
Up
Masea
Super User
Offline Off
user Fraizeraust has written:
@user Masea: That'd lead to problems though because cs2d lua cmd game always returns a string. Wrapping
game("mp_c4timer")
with
tonumber()
would make sense.
Oops, sorry, didn't know about that!
Create and design your GUI easy and fast: file cs2d GUI Framework (12) | Go deep of the darkness and try your intrepidity: file cs2d Outlast 2 Modification (25)
28.06.17 09:28:49 am
Up
Pagyra
User
Offline Off
I think you need use more hooks (like reload,walkover,flashlight, ...), and may be need to add some functions to check values of objects.

At this moment your code is not optimized but anyway it can be improved at finish stage.

These manuals can be usefull for your project.
https://www.cs.rit.edu/~jdb/tmp/making_of_official.pdf
http://www.csse.uwa.edu.au/cig08/Proceedings/papers/8071.pdf
http://sander.landofsand.com/publications/meIRL-BC%20-%20Predicting%20Player%20Positions%20in%20Video%20Games.pdf
https://www.hindawi.com/journals/ijcgt/2009/129075/
28.06.17 11:14:52 am
Up
Ortimh
User
Offline Off
@user Pagyra: Thanks for the documents! Will sure read them all. Yeah, my code is unoptimized as heck, but I don't want to optimize it prematurely. Also could you elaborate more on...
user Pagyra has written:
I think you need use more hooks (like reload,walkover,flashlight, ...), and may be need to add some functions to check values of objects.
I'm awesome ... and I really cookies
29.06.17 01:30:13 pm
Up
Pagyra
User
Offline Off
I looked at your code and noticed ai_hook_ for standart hooks
'spawn', 'startround', 'always', 'second', 'move', 'drop', 'collect', 'break', 'select', 'attack','attack2', 'hit', 'projectile', 'kill', 'die',
but there are no hooks for non standart actions with players, objects and tiles:
'join','disconnect','reload','walkover','flashlight','suicide','objectkill', ...
06.07.17 06:37:00 am
Up
Ortimh
User
Offline Off
Since I don't want anyone to worry about this project being dead (it's been a week, heh?), I want to give an update.

Before, my bot system was using a general tree behavior for both teams, which meant idiotic. It resulted unexpected behaviors that I almost dropped this project (don't worry, it was just stress). Now the behavior tree is splitted each accordingly to their teams. Well my testing wasn't deep but I gave it a try and it worked wonderfully. And while I was it, I was thinking that with the behavior tree implemented, people with their own game modes could implement their own bot's behaviors using this, which means a good thing! There was a problem with the destination system, but it's fixed.

There're currently 3 game modes that are "partially" supported by this bot system: bomb/defuse; assassination; and hostage rescue. Why I said "partially"? Because there's a problem with the follow the leader function because cs2d lua cmd ai_goto returned 0 although the destination was walkable, which was the leader's position. I debugged it and saw nothing wrong with my function. I need to fix it soon.

I'm currently working on the Capture the Flag game mode. If you need more info (or want to read the code), head to the repository. I will soon need testers on this bot system, if you're up to it, let me know.
I'm awesome ... and I really cookies
06.07.17 07:14:07 am
Up
SQ
Moderator
Offline Off
Actually, perhaps I would like to participate on this just for the sake of fun. I would love to help making logics tree and behaviour.
06.07.17 07:22:12 am
Up
Ortimh
User
Offline Off
@user SQ: Sure, would love to see you participate.

UPDATE:
Due to the problem I've been facing for several days with cs2d lua cmd ai_goto, I've decided to use navigation mesh on CS2D maps. This way the making of paths for bots would be faster (I hope) and I could do something that previously impossible such as danger zones, one of my previous plans, come true. How, you ask? I will use the simple cs2d lua cmd ai_move on each node. I would be using triangles for the navmeshes and A* path-finding algorithm to find the path.

Relax, I've been working on the automatic generation of navigation meshes so you don't need to do it manually (you can if you want to). I've been working on my ass for several hours with the algorithms and this is what I found. Things that are done are the marching squares and Douglas Peucker algorithms. You want to see the mess, you could click below.
Automatic Navmesh Generation (unfinished) >


ANOTHER UPDATE:
After working my ass for hours and hadn't proper sleep last night, this freakin' automatic navmesh generator is done. Want to see it in action?
IMG:http://i68.tinypic.com/v80u0.jpg
IMG:http://i68.tinypic.com/huk70y.jpg

Or you prefer the "behind the scene", just click below.
Behind the scene >

Don't need to tell you all the details, right? Well but that doesn't mean it's working fully. It still has a problem when generating navmesh for as_mars which is sucks. If it still doesn't work then I will keep this generator, and would proceed with manual navmeshes. Now onto the bots again!
edited 4×, last 09.07.17 07:12:45 am
I'm awesome ... and I really cookies
09.07.17 10:14:36 am
Up
Pagyra
User
Offline Off
Look like way pointing of PoDBOT map analysis.
What about map with teleports? Something like my file cs2d AIM_headshot (Updated) (13)
edited 2×, last 09.07.17 12:29:27 pm
09.07.17 10:22:43 am
Up
DC
Admin
Offline Off
That nav mesh looks crazy. Nice work. What algorithm will be used to actually find paths using the nav mesh? I kind of doubt that it will be much more efficient than simply using a tile based pathfinding. At least on average maps - might be a different story for super huge maps or maps with large open areas.

I also have to admit that the built in pathfinding is implemented in a very crude and unoptimized way. It probably could be much faster (even when keeping it tile based)...
www.UnrealSoftware.de | www.CS2D.com | www.CarnageContest.com | Use the forum & avoid PMs!
To the start Previous 1 2 3 4 5 Next To the start