![]() |
Let the revolution begin!!!
Check this out...
www.botman2.com/videos/HPB_bot2_alpha.avi I got bots working in Counter-Strike: Source!!! P.S. That video isn't going to stay there long. Somebody might want to mirror it before this time tomorrow. :| (source code coming soon) EDIT: Viva la revolution! botman |
Re: Let the revolution begin!!!
One word. (or two)
Botman you rule =============== EDIT: Viva la revolution! =============== EDIT: mirror here Botmans HPB bot2 alpha movie Botmans HPB_bot2_Alpha_Source.zip |
Re: Let the revolution begin!!!
can always count on the bot-man 8D
|
Re: Let the revolution begin!!!
As promised, here is the server plugin source code...
www.botman2.com/downloads/HPB_bot2_Alpha_1.zip You will need to have created a Mod first (using Steam "Play Games" and double-clicking on "Source SDK", then double-clicking on "Create a Mod", and choosing "Start a mod from scratch"). Unzip the .zip file into your "MyMod/src/utils" folder and read the ReadMe.txt file found in the "MyMod/src/utils/HPB_bot2" folder. Have fun!!! botman |
Re: Let the revolution begin!!!
hmmm... I wonder who suggested this ...
gameclients->ProcessUsercmds(pBot->edict, &read_buf, 1, 1, 0, false, false); I'm still going to one-up you by figuring out how to get at the baseclass though. If the client can do it I still think the plugin can. |
Re: Let the revolution begin!!!
GO FOR IT! I'd love to see somebody get that working reliably inside a plugin. I still think it's impossible (at least to maintain it over various upgrades to the engine and game DLL files) since you assume that you know what is contained in the CBaseEntity and CBasePlayer classes based on what's in the SDK. There is nothing that forces MOD authors to use either of these classes as they exist in the SDK (MODs can add or remove stuff from them without your knowledge and this will break things because function pointers and member variables won't match up anymore).
BUT HEY! Give it a shot and see what you can do! :) botman |
Re: Let the revolution begin!!!
I don't believe you can change cbaseentity without crashing the engine. Since there are engine funcs to get to this (which I thought I could use, but I can't :( ).
If they change cbaseentity & engine then you'll have to recompile anyway. cbaseplayer can obviously change and I would expect it to. |
Re: Let the revolution begin!!!
So it appears that
CSDKPlayer* pPlayer = ((CSDKPlayer *)CBaseEntity::Instance( g_pEdict )); actually returns a REAL pointer to cbaseentity. Even when called in a plugin. I was able to create a bot and get him to move by calling pPlayer->PlayerRunCommand( &cmd, MoveHelperServer() ); This calls back into server.dll, since the function pointers were set up there ! I had to stub out MoveHelperServer since I don't have one in the plugin, but everything else appears to work. I was able to kill the bot, and it would respawn right away. |
Re: Let the revolution begin!!!
Ah and yes botman , is the plugin can only be compiled with Microsoft Visual Studio .NET ? I only have MSVC 6
|
Re: Let the revolution begin!!!
nice work botman ! ( who expected anything else but this development ?! )
about MSVC: http://wiki.bots-united.com/index.ph...Life%202%20SDK |
Re: Let the revolution begin!!!
Fantastic work Botman! Nice to see that you are still kicking ass:)
|
Re: Let the revolution begin!!!
w00t w00t w00t dr00l dr00l dr00l!!!!
i am gonna read the source and try it myself aswell. I am eager to see how close iw as myself... ;) |
Re: Let the revolution begin!!!
I took a look at the code...
botman congrats! you succeeded in the theory i had in mind as well (as the little snippet in 'i don't like this'). Congrats! Actually i was thinking that i had to do a lot more copying of code for WriteUserCmd and such, but it seemed it was not that much after all. The bot will crash in HL2DM for now, but thats a fault at valve, but no worries, they have fixed it (got confirmation from alfred) and will be updated on a next steam update of HL2DM ;) I am gonna change this lovely code... perhaps i can even get it to work for my ITM project... one question though: i see you use the gameinfomanager to let a bot change team. I assume this is on purpose? Because a bot should *actually* try to join the game via usercommands? (or some sort of 'menuselect' thingy?). |
Re: Let the revolution begin!!!
I'm not sure about the best way to select a team. I notice that there is a client-side cvar now (something like cl_team or some such sillyness) that teamplay_gamerules.cpp uses to select the player model. That stuff may only be used by HL2DM and/or TF2.
I don't know how to get plugin entities to set client-side cvars yet. I did notice that weapon select is now done as part of the cmd structure (instead of sending a text command with the weapon name that you want to switch to). Just set the proper bit in the cmd structure and do the WriteUsercmd() like you do for movement. Obviously, there's still LOTS of stuff to do, but hopefully we can help each other out and get a nice "empty" bot template going for the Source engine. botman |
Re: Let the revolution begin!!!
yes, i also noticed that on the weapon part ;) The cl_team thing is something odd for me too. I also noticed that the chooseteam(2) code does not work properly, the argument you pass is somehow overwritten by autoteambalance or something alike (i bet it is game dll specific code, so the argument you give is not used at all).
I am now investigating this piece of code, via the server interface: Code:
|
Re: Let the revolution begin!!!
noticed:
* you can change team to any one you want, the argument is a bit different: 1 = spectator, 2 = terror, 3 = counter-terrorists * my bots keep walking backwards, even when forward speed is set to 200. Even when removing the crosshairangle and such. EDIT: in addition to the second point. It seems 'forward move' is related to something. When i use -200 , my bots walk (on the T side) forward. THe same bot walks sideways in de_cbble. perhaps you need to link this with pitch/yaw things. I did not look into this yet. |
Re: Let the revolution begin!!!
Quote:
|
Re: Let the revolution begin!!!
nice work, next week i'm back at my normal PC :)
they still use normal angles in source2 ? 0°-360° or whatever ? I mean, calculation is based on radian, i.e. 0-2Pi, so why not that ? |
Re: Let the revolution begin!!!
@asp, why do it the hard way or the more human way? ;)
|
Re: Let the revolution begin!!!
ok, i had a little bit more time to fiddle around:
- the forward speed is somehow relative to the map. I did not yet figure this out. However, when i tried using IN_FORWARD (for buttons) only, it did not work either. Also a combination of 'forwardspeed=200' plus the IN_FORWARD bit, did not work either. I tried figuring out this relative computing of the speeds, but i think its like this: The game dll itself has code to let clients move around the map; they also rely on 'forwardmove' and 'sidemove' and such. I do not see some computing there; though i have to admit i did not do a very indepth search. Perhaps the engine itself handles movement for fake clients differently? - edit: also not luck with the crosshair function, despite what kind of pitch or yaw i pass through there... :S - edit 2: about the crosshair thingy; i think this is due the fact that the plugin sets info first, and then the game dll. Meaning the game dll overwrites the crosshair info? (fixme!) |
Re: Let the revolution begin!!!
ok how the hell do I debug with .Net and HL2 ?? :( sorry Im a bit mad at it... (most of the time it crashes and I have to close CS:S cause it blocks the MSVC window when it wants to break.. so its stops debugging..)
Also it doesnt debug the source, only the dissasembly which is a bit crap since I cant read that damn stuff |
Re: Let the revolution begin!!!
I have notes in the ReadMe.txt file that explains how to set up .NET 2003 for debugging the plugin.
Does that not work for you? botman |
Re: Let the revolution begin!!!
Yeah I did that but there are problems such as not copying the DLL file to the bin folder, even though it says "1 file(s) copied" I don't see it in the counter-strike source/bin folder.
I'll read over it all again ( I tried doing it myself without reading too much)... this is gonna be my new years, I can tell for sure :p oh it seems the default dir was c:\program files\valve\steam\... where mine should just be in c:\program files\steam , trying again |
Re: Let the revolution begin!!!
Keep up the good work botman...you are the best! :)
And keep up the good work all you others bot-coders also! |
Re: Let the revolution begin!!!
stefan, regarding the view angles.
I don't set them in the HPB_bot2 WriteUsercmd() function. You will probably want to change that code. Instead of this... Code:
buf->WriteOneBit( 0 ); // viewangles[0] Code:
EDIT: Doooh!!!! The last one is only 8 bits... The gameclients->ProcessUsercmds() eventually calls CBasePlayer :: PlayerRunCommand() which does this... Code:
if ( pl.fixangle == FIXANGLE_NONE) EDIT: When I do this, the bot's don't turn their bodies, but the DO move in a different direction each time the YAW changes in the viewangles. Perhaps the bot's model rendering isn't being handled properly somewhere (your client doesn't know which way they are really facing), so you see them as facing one direction, but they are really facing a completely different direction (Half-Life1 bots had this problem initially too). It should be easy to tell which way they are facing by setting the pitch to zero and have them shoot their weapons every second or so and see which way the bullets go! botman |
Re: Let the revolution begin!!!
thx botman. I do wonder how you figure this stuff out, as it seems most of the time i am looking into the wrong direction :)
Will try that soon! , edit: found somewhere in baseplayer_shared.cpp (dunno if it could be of any help) Code:
//----------------------------------------------------------------------------- |
Re: Let the revolution begin!!!
I'm wondering how to get Vector.Length() to work without getting _pfSqrt external errors (?)
|
Re: Let the revolution begin!!!
looks like you can have different coordinate systems and the matrix multiplications are used to transform one into another. if there is the need for info about transformations one could write another wiki article once we know what this is exactly about ...
no idea about that sqrt stuff ... the parameter of sqrt is always >=0 so I dunno where the problem can be ... no hl2 vector class here at the moment :) |
Re: Let the revolution begin!!!
got it working... well partially ;)
http://forums.bots-united.com/showth...1474#post31474 |
Re: Let the revolution begin!!!
Can someone post a compiled dll of this?
Whenever I try to load the one I compiled I get the very descriptive "could not load plugin" error message which makes it hard to track it down. |
Re: Let the revolution begin!!!
finally dug this out of some of my backup CDs...
so I mirrored the code here in case someone may still need it: http://yapb.bots-united.com/files/HPB_bot2_Alpha_1.zip :) |
Re: Let the revolution begin!!!
Quote:
Was this the only release anyway? |
All times are GMT +2. The time now is 23:03. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.