BotGorge
<div class="IPBDescription">there is lack of bots here ...</div>Hi all,
There was discussion about bots for NS2, therefore I would like to share with you Bot-Gorge.
It's simple right now and pretty stupid bot, but got implemented (somehow) the "follow the path" feature.
I uses the drifter's/Arc's/MAC's pathing.
EDIT - TODO:
- return from resource node back to (nearest) hive
- make gorge do mini cyst chain from hive to res point
- place hydras (randomly?)
- heal self, when damaged
- of course run away from marines :)
Here is code "lua/BotGorge.lua":
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//=============================================================================
//
// lua/Bot_Gorge.lua
//
// Created by ZycaR
// Chunks of code are inspired/reused/copyied from other NS2 parts to speed up implementation
//
// This class is a gorge bot
//
//=============================================================================<!--c2--></div><!--ec2-->
for usage just add these lines into Bot.lua (similar to test bot):
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> if className == "gorge" then
class = BotGorge
end
...
Script.Load("lua/BotGorge.lua")<!--c2--></div><!--ec2-->
There was discussion about bots for NS2, therefore I would like to share with you Bot-Gorge.
It's simple right now and pretty stupid bot, but got implemented (somehow) the "follow the path" feature.
I uses the drifter's/Arc's/MAC's pathing.
EDIT - TODO:
- return from resource node back to (nearest) hive
- make gorge do mini cyst chain from hive to res point
- place hydras (randomly?)
- heal self, when damaged
- of course run away from marines :)
Here is code "lua/BotGorge.lua":
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//=============================================================================
//
// lua/Bot_Gorge.lua
//
// Created by ZycaR
// Chunks of code are inspired/reused/copyied from other NS2 parts to speed up implementation
//
// This class is a gorge bot
//
//=============================================================================<!--c2--></div><!--ec2-->
for usage just add these lines into Bot.lua (similar to test bot):
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--> if className == "gorge" then
class = BotGorge
end
...
Script.Load("lua/BotGorge.lua")<!--c2--></div><!--ec2-->
Comments
<center><object width="450" height="356"><param name="movie" value="http://www.youtube.com/v/nwmjsJ2_dWQ"></param><embed src="http://www.youtube.com/v/nwmjsJ2_dWQ" type="application/x-shockwave-flash" width="450" height="356"></embed></object></center>
Lua files can be downloaded from <a href="http://dl.dropbox.com/u/5490563/mod_gorgebot.zip" target="_blank">dropbox</a>.
Installation instructions:
- Download and extract the mod files to your \Steam\steamapps\common\natural selection 2 folder
- Type "-game mod_gorgebot" in the launch options for NS2
To get the gorge bot running type these commands into console
- "cheats 1" (to activate cheats)
- "addbot 1 2 gorge" (to add one gorge bot to the alien team)
The addbot command has the syntax of "addbot [# of bots] [bot team] [bot class]" so if you wanted to add multiple bots to the alien team, you could type "addbot 2 2 gorge" to add two gorges, etc.
Pretty cool, imo :) Good job ZycaR and keep it up!
The next step will be to make base class for AI path, and then I'll try to make simple mini-cyst placement stuff.
The weekend is coming :)
BTW: do anyone know, how to add orders buttons for commander (when he select the GorgeBOt player?)
The next step will be to make base class for AI path, and then I'll try to make simple mini-cyst placement stuff.
The weekend is coming :)
BTW: do anyone know, how to add orders buttons for commander (when he select the GorgeBOt player?)<!--QuoteEnd--></div><!--QuoteEEnd-->
No problem :) I'm just excited that someone is working on a functional player bot for NS2. I'd be happy to help test/record video of any future updates of the bot.
Also, it'd likely be easier for other people wanting to use your mod if you released it in the way I showed above. Its pretty simple to do, just include any lua files that you've modified or updated in the zip file structure I set up. For example, once you update botgorge.lua, just overwrite the botgorge.lua in the zip file, rezip, and release.
But why did you not create a skulk bot?
It would be very good for unbalanced games.
anyway good luck!
Edit:
Maybe you could use the whip code for attacking?
The search code of finding a enemy could be taken from minimap?
So if a teammate see a marine on his map/and view, the bot get alerted there is a enemy and he find a path to him?
Also the alien commander could command the skulks like drifter and if the marine is in rage, the skulk attack him?
I was wondering if along with the gorge bot you could give the basic bots a bit more intelligence, just enough so they can make their way around a map towards the enemy, their main target being other bots and players, structures secondary, as it would make them a lot more fun to play around with.
[change-list:]
- bot targets are maintained by mixins (as I don't know LUA very well, I hope it's implemented correctly)
- bot pathing (also re-factored into mixin), use the same path-points as drifter / arc, therefore don't run just straight towards target
- to draw calculated path, use "dev 1" command in console (to prevent sticky lagging when lines are drawing)
- into mod I included bottest map (use command "map bottest") it's small map to run faster on cheater machines :)
<a href="http://dl.dropbox.com/u/50425358/mod_gorgebot2011_11_21.zip" target="_blank">mod_gorgebot 2011/11/21</a>
EDIT: I do a short investigation how add the commands buttons to bot player (when alien commander select gorge)
Unfortunately it's impossible to simply overwrite player's entity method GetTechButtons(), because it will overwrite method only on the server's side of code .. and commander (as it's players client side) will don't have buttons :( .. and it looks that UWE must add support for customized buttons it into client's installation.
Therefore I'll aim to implement some heuristics for better path generation and ability to handle stucking and going around unexpected obstacles.
Of course cyst placement is on top of implementation list :)
I have no idea about it, but can you not did a waypoint system (walk y,z,x)and safe it to a luafile for each map?
so the bot just call the waypointsystem and move/jump/crouch and on?
my english sucks i mean something like "ghost-pathing" you walk as a gorge through the map, save it and the gorge-bot can read the data.
For example if hive at datacore under attack, he choose the shortest waypoint path to the hive and heal the hive, place hydras at (before marked good ) places.
So like the rcbot works or other bots in other games.
Maybe the bot can learn with that?
the human-players play the game, the bot save in the lua file or txt file "how people dostuff"?
I have no idea about it, but can you not did a waypoint system (walk y,z,x)and safe it to a luafile for each map?
so the bot just call the waypointsystem and move/jump/crouch and on?
my english sucks i mean something like "ghost-pathing" you walk as a gorge through the map, save it and the gorge-bot can read the data.
For example if hive at datacore under attack, he choose the shortest waypoint path to the hive and heal the hive, place hydras at (before marked good ) places.
So like the rcbot works or other bots in other games.
Maybe the bot can learn with that?
the human-players play the game, the bot save in the lua file or txt file "how people dostuff"?<!--QuoteEnd--></div><!--QuoteEEnd-->
yeah and more thinks coming:
.. yesterday I reconsider the calculation of distance, not to do it by simple triangular distance between two points but use the "valid" path length,
because i.e. sometimes the resource door behind the closed door isn't the nearest one :)
.. today morning I was able to manage the parent cyst finding and tracking ... then gorge can do mini-cyst trail to nearest resource point.
I don't build the waypoints or simmilar stuff. I'm using build-in function to get path between two points of interest (usually gorge model and target) .
The returned path consist of waypoins (the path is and red line on the video, and waypoints are that blue lines on path)
Also pathing works (as far as I know) on ray tracing from destination to source ... but as I sad it's UWE stuff - simmilar to Drifter, MAC or ARC.
I think it would be great if you could make the basic bot code work so they can find their way around and attack the enemy.
The Khaa side classes of NS are so different that implementing more than one class for one bot will blob up the code very drastically. and unfortunately my LUA programming skills consist only of 2 days looking into NS2 LUA code .. sorry 2 and 1/2 because of today :)
or maby you can contact player and have him add it to his overmind mod.
But give him time to fix!
some people have a real life between gaming ^^
... my daughter was born, as Price says real life is now a little bit important ...
<!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->The little cute baby is crying all the time in the cradle. The mother take the little cutie on her arms and start to sing.
After half hour her Husband said to her "please put the baby back in the cradle, that was way better".<!--QuoteEnd--></div><!--QuoteEEnd-->
*cough* Now slave, build me a bot.
/jk
Now you've gotta build a BotDad so you can continue BotGorge.
Gorge finally finding parent cyst ! (where chain of mini-cysts can start)
... and what is more important, he building cysts to nearest resource tower :)
It's still beta (as whole NS2) then sometimes can gorge hangs and of course, when he don't have resources, then he stops and wait for them :)
<a href="http://dl.dropbox.com/u/50425358/mod_gorgebot2011_12_05.zip" target="_blank">mod_gorgebot2011_12_05</a>