Official NS2 bot
Flayra
Game Director, Unknown Worlds EntertainmentSan Francisco Join Date: 2002-01-22 Member: 3Super Administrators, NS2 Developer, Subnautica Developer
in Modding
<div class="IPBDescription">Are you up for writing one?</div>Hey everyone,
One of the things I really want to get into NS2 v1.0 is a basic bot, which players can use primarily for learning how to command. Right now there's no shame-free way to learn to command, and this will be exacerbated in NS2 now that both teams need a commander. As you guys know, we are a very small team and I don't know if we're going to have the resources to devote to a bot like this. However, a community member named Clamatius wrote <a href="http://whichbot.sourceforge.net/" target="_blank">WhichBot for NS1</a> which became widely played and was really awesome....which brings me to why I'm posting here.
I think someone in our community should write a bot that we could ship officially with the game.
We've already got basic bot support in the game and of course we are already shipping all the NS2 source code, as it's all Lua. If you look in Bot.lua, Bot_Player.lua and BotTest.lua, you can see how we've got very simple bots running around so far. There you'll see code for having bots ask for orders, medpacks, ammo and perform basic movement. You can test this out by turning on developer mode (dev 1 in the console) and then typing "addbots x y" where x is the number of bots and y is the team (1 is marines, 2 is aliens).
We really would need our bot to act like a very basic player in every way. A player should be able to add around 11 bots to the server and they would fill out both teams equally, and take up any roles that are needed. Ie, they would do a very basic job commanding if your team needed a commander. They would build nearby structures if they are marines. One would evolve to a gorge and build cysts if your team didn't have any. They would explore the map looking for the enemy. They would use voice comms and ask for orders. They would often follow orders (but not always and not exactly), like real players. All this would add up to a way that players could get a basic feel for the game and comfort with the tech tree and the commander role, without being embarrassed online.
We have pathfinding support ready to use (PathingMixin.lua) and everything you should need to be able to write a bot that fits this description. I'm not sure how much work it would be, but getting something very basic doesn't seem like a gargantuan task to me. I would be extremely pumped if we could find a promising programmer here that wanted to take this project on, and then work with them to completion. I'm sure we can figure out an arrangement that would work for both of us, but the important thing is that we see you make some progress on your own first. I'll be checking this forum regularly to see if anyone makes any good progress, and then we can take it from there.
Anyone game?
One of the things I really want to get into NS2 v1.0 is a basic bot, which players can use primarily for learning how to command. Right now there's no shame-free way to learn to command, and this will be exacerbated in NS2 now that both teams need a commander. As you guys know, we are a very small team and I don't know if we're going to have the resources to devote to a bot like this. However, a community member named Clamatius wrote <a href="http://whichbot.sourceforge.net/" target="_blank">WhichBot for NS1</a> which became widely played and was really awesome....which brings me to why I'm posting here.
I think someone in our community should write a bot that we could ship officially with the game.
We've already got basic bot support in the game and of course we are already shipping all the NS2 source code, as it's all Lua. If you look in Bot.lua, Bot_Player.lua and BotTest.lua, you can see how we've got very simple bots running around so far. There you'll see code for having bots ask for orders, medpacks, ammo and perform basic movement. You can test this out by turning on developer mode (dev 1 in the console) and then typing "addbots x y" where x is the number of bots and y is the team (1 is marines, 2 is aliens).
We really would need our bot to act like a very basic player in every way. A player should be able to add around 11 bots to the server and they would fill out both teams equally, and take up any roles that are needed. Ie, they would do a very basic job commanding if your team needed a commander. They would build nearby structures if they are marines. One would evolve to a gorge and build cysts if your team didn't have any. They would explore the map looking for the enemy. They would use voice comms and ask for orders. They would often follow orders (but not always and not exactly), like real players. All this would add up to a way that players could get a basic feel for the game and comfort with the tech tree and the commander role, without being embarrassed online.
We have pathfinding support ready to use (PathingMixin.lua) and everything you should need to be able to write a bot that fits this description. I'm not sure how much work it would be, but getting something very basic doesn't seem like a gargantuan task to me. I would be extremely pumped if we could find a promising programmer here that wanted to take this project on, and then work with them to completion. I'm sure we can figure out an arrangement that would work for both of us, but the important thing is that we see you make some progress on your own first. I'll be checking this forum regularly to see if anyone makes any good progress, and then we can take it from there.
Anyone game?
Comments
I've been looking into this in my free time (what little there is), and am quite interested in this. I can't say I'll be able to actually produce anything. My plan was to use the original Reaper Bot from Quake 1 days and inspiration on how to tackle the design. Considering any NS2 bots will need to have an extremely good understand of their surroundings and tactical aspects of the game, this won't be an easy task.
It's no way working but i thought it was funny enough to take a video to post it. Looks like the bot has had little bit too much coffee or some other substances. :D
The pathfinding seems to work well but i have no idea why the speed is off and why is it turning around all the time. Well I guess it's time to delve deeper.
Thanks mate! I will look into it!
It's no way working but i thought it was funny enough to take a video to post it. Looks like the bot has had little bit too much coffee or some other substances. :D
The pathfinding seems to work well but i have no idea why the speed is off and why is it turning around all the time. Well I guess it's time to delve deeper.<!--QuoteEnd--></div><!--QuoteEEnd-->
Either you just found a way to exploit the current movement-system, or you're allowing the bot to move faster than other clients. Bots run on the Server-VM, which means they can do whatever they like pretty much, without being corrected (eg. warped back).
What I guess Flayra is asking for is a very rudimentary bot, that can perform basic tasks (like for a gorge to heal nearby structures\teammates; try and fix broken DI and drop the occasional hydra here and there). I'm thinking the community will put out a superior bot in due time most likely (I might have a go it myself at some point), but I speculate the devs values having at least some kind of mechanic in there to ship with the retail-version, no matter how simple, so as to not be completely dependant on a third-party to provide it.
I still think a combat-mode is a better way to bridge the gap between a low and high player-count.
The moving of origin is wrong, thats how the drifters move, and it doesn't give you feeling of "player"..
Please look at my gorgebot, where I simulate the movement "by move command to the forward" .. in same way as player bot do.
BTW: Regarding the spinning ... looks like you don't subtract the base yaw and base pitch from "player" object's orientation. (that's already fsolved in gorge bot too... :))
Is there a chance to modify path-finding procedures input arguments ... to allow put/modify there maximum height differences between two waypoints (for skulk wall / vent climbing waypoints)
I assure that all these "features" were unintended. :P
<!--quoteo(post=1891503:date=Dec 24 2011, 01:16 PM:name=ZycaR)--><div class='quotetop'>QUOTE (ZycaR @ Dec 24 2011, 01:16 PM) <a href="index.php?act=findpost&pid=1891503"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->you move bot by moving his origin? or use standard input system to simulate the forward key pressing?
The moving of origin is wrong, thats how the drifters move, and it doesn't give you feeling of "player"..
Please look at my gorgebot, where I simulate the movement "by move command to the forward" .. in same way as player bot do.
BTW: Regarding the spinning ... looks like you don't subtract the base yaw and base pitch from "player" object's orientation. (that's already fsolved in gorge bot too... :))<!--QuoteEnd--></div><!--QuoteEEnd-->
Yes I moved the bot by setting the origin just like drifters and MACs. I figured out the the movementand yaw & pitch bugs from your and Jeffco's code. Thanks!
happy x-mas or whatever!
happy x-mas or whatever!<!--QuoteEnd--></div><!--QuoteEEnd-->
I also spent some time extending your script with auto attack, independent movement, knife fighting and some other stuff.
Here's a video of a test session I had. It didn't lag like that when playing without Fraps but I guess bad scripting from my part plays a part in the lag too.
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/ZI1gE4-9A74"></param><embed src="http://www.youtube.com/v/ZI1gE4-9A74" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
I can use it!
2 Zeikko: did your bots recalculate path, when is blocked ? (just curious)
I can use it!
2 Zeikko: did your bots recalculate path, when is blocked ? (just curious)<!--QuoteEnd--></div><!--QuoteEEnd-->
No it doesn't. In the video they get stuck in crossroads for example. This kind of recalculation would be a great feature for all bots, MACs and drifters.
Now it starts getting complicated. It would be cool use bots to populate a server and to remove them automatically when normal player join the game. Therefore, a bot should know how to build an infantry portal since marines cannot spawn otherwise. I have no idea how to add such a feature...
Now it starts getting complicated. It would be cool use bots to populate a server and to remove them automatically when normal player join the game. Therefore, a bot should know how to build an infantry portal since marines cannot spawn otherwise. I have no idea how to add such a feature...<!--QuoteEnd--></div><!--QuoteEEnd-->
The bot would have to have an impulse to build the Infantry Portal much like the impulse to attack enemy target and would have to be set by the mapper and allowed by game configs to be set to true on servers using bots. However the impulses would need to be set in priority
1. Attack/Defend
2. Build/Repair
The "bhop pro bots" oh lol - made my day :B
Adding artificial reaction time, target prioritisation, non-omniscient (limited; only sees what is in the player's view) awareness with short-term memory (so it doesn't lose targets immediately), and non-omniscient (estimated) target movement prediction - to simulate player behaviour; is it possible? Practical?
just make it so they can only shoot what is in there line of sight for one and stop them from spazzing out and doing 360s all the time
a simple scripted ai is all we really need. not anything like the bigger budget games
although im sure people will want to make them some what challenging
Maybe the rcbot would be a better bot to look at as far as AI intelligence, Particularly the hal.brn and how they work with the .RCR and .rld files.
Example of one of my RCBOT Profiles (Bot with top kills Overall)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->name="Super Wolf Bot"
favmod=2
favteam=1
favmap="ns_nothing"
skill=98
spray="tent"
gorge_percent=24
lerk_percent=20
fade_percent=14
onos_percent=19
numgames=0
hal_pretrain_file="common_hal.trn" [i](Random Phrases Entered by bot to text chat during game)[/i] I often see people arguing with bots in my servers.
hal_aux_file="common_hal.aux" [i] (Controls General Chatter Triggered by key words typed in by players)[/i]
hal_ban_file="common_hal.ban" [i](A filter for chatter to ignore key words for triggers, EX: Profane or abusive words)[/i]
hal_swap_file="common_hal.swp"<!--c2--></div><!--ec2-->
Also map specific configs (changing cvars and balance for each map on server)
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--># you can change HL cvars
# change time limit
mp_timelimit 90
# you can change other bot things
rcbot config max_path_revs 100
rcbot config chatting 1
# you can add some bots.
# add 3 bots
#team 1
#rcbot addbot 0
#team 2
rcbot addbot 2
#auto-team
#rcbot addbot<!--c2--></div><!--ec2-->
I know this bot is for NS1 but it worked so well for a number of source based game mods and it may be something to look into for ideas.
but since we no longer have to waypoint as the maps already have the waypoint system implemented (except for walls, ladders and possibly vents) how hard would it be to convert something like rc_bot over to ns2
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/djahFGgMICc"></param><embed src="http://www.youtube.com/v/djahFGgMICc" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
In the beginning you see marines obeying orders, moving, building stuff, etc. That code is mostly written by Jeffco. Later you will see me joining to the alien side and trying fighting against the marines as a skulk. Most of the attack, aim, targeting, following and "ambushing" stuff is written by me and UWE.
<a href="http://zeikko.fi/ns2/Bot_Zbot.lua" target="_blank">You can see the code here.</a>
EDIT: Witchbot----> <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->[../engine]
# radius within which sounds can be heard from the sound source location
hearing_radius=1200.0<!--c2--></div><!--ec2-->