DukeThought "the bot I'm working on"
#1 Posted 17 September 2017 - 03:50 AM
This is a big project and I expect it will be a long time before my bot is capable of completing a significant number of real game levels (i.e. levels made by and for humans). As of this writing, the bot is a useful coop companion but isn't smart enough to complete levels. However, I have made good progress on several fronts and I plan to report about it in this thread. This is both my own record of progress and an opportunity for discussion with interested members of the community.
DukeThought
For years I was known in the community as "DeeperThought", which was inspired by the fictional computer Deep Thought, so naming my bot DukeThought seems appropriate.
Duke 3D levels have many features to confound bots. I want my bot to be able to complete unmodified versions of maps without any prior knowledge of them: no waypoints placed in them ahead of time or anything similar will be allowed. This makes my job very, very difficult. Even a relatively simple level like E1L1 presents great challenges. Failure is an option. If I fail, I'll still have a good bot for coop and other purposes.
Progress so far:
My bot can follow the player around pretty well. He can also fight competently. He knows how to select, aim and fire weapons, and will make appropriate choices depending on the situation. He also knows how to move towards nearby items to pick them up, and can prioritize them according to need. He can also use the medkit.
Now I am beginning to work on the hard part: level navigation. Following the player around is simply a matter of tracing the player's steps, and has zero implications for the bot completing a level by himself. This weekend I gave him a recursive path finding algorithm and successfully tested it to make him navigate to goal sectors across simple mazes. This is just the first step of a long journey with many pitfalls. There's a myriad of obstacles in real levels which will make it a nightmare for the bot to figure out how to complete them. Doors, elevators, keycards, switches, cracks in walls, teleporters/water, and jumping puzzles are just a few.
#3 Posted 17 September 2017 - 04:50 AM
Great idea anyway, i expect it willbe pretty hard, also because there are very few AI experts like you, and level navigation/exploration is the hardest part...
I bet you already got the idea, but i think to an array with visited sectors and a random/priority route selection, for example when the bot finds a locked door OR a keycard before, then skip some previous routes or find new ones
This post has been edited by RichardStorm: 17 September 2017 - 04:52 AM
#4 Posted 17 September 2017 - 11:07 AM
RichardStorm, on 17 September 2017 - 04:50 AM, said:
I bet you already got the idea, but i think to an array with visited sectors and a random/priority route selection, for example when the bot finds a locked door OR a keycard before, then skip some previous routes or find new ones
Yes, I am planning to implement something like that. The reason is that it is too difficult to analyze an entire level at once. There are just too many nonlinear ways that level progression can occur. But if the bot can successfully path to local goals and prioritizes exploration of new areas, this will increase the probability of him completing the level. My rule of thumb to start with will be "go where you haven't gone, do what you haven't done". There's not necessarily any need for a random element, but I suspect that results will be somewhat randomized by enemies encounters that will throw him off course and change his health and equipment levels.
#5 Posted 17 September 2017 - 11:43 AM
Yeah, balancing an eventual game on the point of different abilieties when it's a player to control an alien it's another question. Just don't make it a sort of Overwatch.
This post has been edited by Fantinaikos: 17 September 2017 - 11:48 AM
#6 Posted 17 September 2017 - 11:52 AM
Fantinaikos, on 17 September 2017 - 11:43 AM, said:
Yeah, balancing an eventual game on the point of different abilieties when it's a player to control an alien it's another question. Just don't make it a sort of Overwatch.
Calm down. I said the new bot AI would be the "foundation" of Arena if I remake it, I didn't say that the advances would be exclusive to bots or that it wouldn't have a ton of other features. Anyway, that seems far in the future right now, and I'm focused on making the bot.
#8 Posted 17 September 2017 - 02:21 PM
#9 Posted 19 September 2017 - 10:55 AM
If you want to kill this bot, make a tunnel he has to crawl into, then put some laser tripbombs right above the entrance.
If any devs are reading: I don't know how hard this would be, but it would be amazingly good for this project if setting the input bits in the input struct actually caused the player to do shit as if he were pushing the corresponding keys. It works with some stuff (pushing space, pushing fire) but not others.
This post has been edited by Trooper Dan: 19 September 2017 - 10:59 AM
#10 Posted 19 September 2017 - 11:02 AM
#11 Posted 19 September 2017 - 11:05 AM
TerminX, on 19 September 2017 - 11:02 AM, said:
I am not doing anything in EVENT_CROUCH. Should I? I set the bit on a var, then I constantly set the bits input member in EVENT_PROCESSINPUT to the var.
#12 Posted 19 September 2017 - 11:07 AM
#13 Posted 19 September 2017 - 11:26 AM
TerminX, on 19 September 2017 - 11:07 AM, said:
Yes, it fucking works now, and I don't have to make him jump or push him down or any BS like that! Thank You!
#15 Posted 19 September 2017 - 11:43 AM
This post has been edited by Mark.: 19 September 2017 - 11:44 AM
#16 Posted 19 September 2017 - 12:39 PM
Mark., on 19 September 2017 - 11:43 AM, said:
Oh Duke, you so kawaiii.....
#17 Posted 19 September 2017 - 03:23 PM
also I think you should be able name the Duke Bot I proply name him Hendricks266
This post has been edited by Duke Legacy: 19 September 2017 - 03:25 PM
#18 Posted 19 September 2017 - 07:15 PM
Duke Legacy, on 19 September 2017 - 03:23 PM, said:
Sounds good, but if you pick that name, don't be surprised in coop if he starts shooting you when you deviate from the optimal path that he calculated.
#19 Posted 19 September 2017 - 07:38 PM
This post has been edited by Duke Legacy: 19 September 2017 - 07:40 PM
#21 Posted 26 September 2017 - 07:38 PM
Hendricks266, on 26 September 2017 - 07:22 PM, said:
The fix for players getting squished on multiplayer start seems to work fine. I was able to remove my workarounds for that problem without any issues, and nobody is getting squished.
I don't yet know what other impacts this build will have. My focus for the last few weeks has been on single player AI, and I have allowed my coop AI to become broken (mainly because it sits on top of items because it doesn't notice that they stay in coop). My single player AI seems to work exactly the same with this build, and my coop AI is just as broken.
#22 Posted 28 September 2017 - 01:33 AM
Hendricks266, on 26 September 2017 - 07:22 PM, said:
Here is an issue I'm having, although it isn't new to this build. Setting input bits to emulate the player pressing weapon keys does not work. In particular, this does not work:
switch botweapchoice case 0 orvar botbits 256 break case 1 orvar botbits 512 break case 2 orvar botbits 768 break case 3 orvar botbits 1024 break case 4 orvar botbits 1280 break case 5 orvar botbits 1536 break case 6 orvar botbits 1792 break case 11 orvar botbits 1792 break case 7 orvar botbits 2048 break case 8 orvar botbits 2304 break case 9 orvar botbits 2560 break endswitch
The bits member of the bot player's input struct are set to the botbits var in EVENT_PROCESSINPUT, and this works for other functions. Since this doesn't work for weapon switching, what I've been doing is trying to fake it as best I can.
This is what I do to force a weapon switch:
setp[].weapon_pos -1 setp[].kickback_pic 0 setp[].wantweaponfire botweapchoice getp[].curr_weapon temp setp[].last_weapon temp ifg player[].ammo_amount temp 0 setp[].last_full_weapon temp setp[].curr_weapon botweapchoice ife botweapchoice 1 sound INSERT_CLIP else ife botweapchoice 2 sound SHOTGUN_COCK else sound SELECT_WEAPON
Before forcing it, I check to make sure that the weapon has ammo and weapon_pos, reloading, and kickback_pic are all 0. Still, I sometimes get problems. The worst is that the shotgun often locks up and can't fire after switching to it (even when I manually press the fire key). I'm doing something wrong in the forced switch and it would be a lot easier if the input bits worked.
#23 Posted 28 September 2017 - 07:14 PM
#24 Posted 29 September 2017 - 01:38 AM
Some day I hope that my bot will be able to complete a published map made for human players, but for now here is a video showing Duke Thought completing a very simple, ugly little map that I made for testing. This bot operates without any waypoints or other modifications made to maps for him, so he has to analyze the map structure on the fly. He still fails badly in more complex levels (i.e. any actual published map), but I have been adding to his capabilities bit by bit.
#25 Posted 29 September 2017 - 03:20 AM
#27 Posted 29 September 2017 - 06:39 AM
A weapon priority array would need to be built for each enemy upon visual contact. But if there happens to be 4 or more of the same enemies or a mass amount of enemies detected within a close proximity then use rocket launcher/ devastator. If either one are not found then run like hell in the opposite direction. lol
This post has been edited by Paul B: 29 September 2017 - 06:52 AM
#28 Posted 29 September 2017 - 07:41 AM
#29 Posted 29 September 2017 - 09:25 AM
P.S. to any devs who may be reading -- as I was saying above, it's not possible to switch weapons by setting the corresponding bits in the input structure. I would be very helpful if that could be changed.