View Full Version : Bots tutorial?

22-05-2003, 05:45 PM
Well let just say that my friend is lacking. (he's not fat but he sure knows how ta eat) and he still never teaches me how ta code SC and CS bot!

Can anyone give me a Website that teaches me how ta code, I know theres gonna have a website somehow, because if there isn't. How can they make bots then? (Sry about the grammar......)

I wish u guys can help me so I can carry on with my bot

23-05-2003, 12:55 AM
HAHAHHA WEBSITE!!! To learn to code u gotta go to uni!!!

Or Buy a huge book and read it about a million times. If there was a website would we be standing here? NO we will be out there making games etc. Just think about it?

Sorry if i flammed u. I think i didnt :S

And btw I have been learning code 4 a while now. And all i can do is make a simple program when u push a button and it says ur gay.

Agent Pingwin
23-05-2003, 09:58 PM
my friend coded pong on his calculator, not sure if thats gonna help you with coding bots =/

23-05-2003, 11:22 PM
....b4 u code any bots.... do u noe tt im already doin 1?!

24-05-2003, 03:05 AM
I know Radioactive^ man. Well I'm also making a Bot support for CS, DOD (updated) and Sven Co-op. Well let just say this can be 2nd bot........

Say Hows ur bot going Radioactive^man?:D Must be cool:p

Sniper Viper
24-05-2003, 04:40 PM
Actually the idea is not that bad, though it sounds ridicolous at first. But it gives me the following idea: I guess there is more than one coder out there who already got some bots running on a SC-Server. Being all in various states, as everybody started solving problems on a different way. As far as I found out so far working on mine, there are many (not unsolvable) problems with navigation, combat and communication with the bots. I guess these three are the main components of a team, aren't they?
So: why not have an own forum for us coders, what problem one encountered and how someone else maybe solved it? What template one uses, ( I guess most used HPB from Botman), what concept of navigation (waypoints or following user) and stuff like that.

25-05-2003, 04:26 PM
If there's isn't any website then.... can anyone give me a tutorial at this thread? Please?:rolleyes:

Sniper Viper
26-05-2003, 12:12 AM
peterchen, there won't be a tutorial like a recipe of "how to make a bot". But I'll try to explain very roughly what you need, which way to go, and what are the steps of it:

What you must have:
- knowledge of C, better is C++
- a develop environment software with compiler, debugger like Microsoft Visual Studio or so
- know your tools, how to use them, set breakpoints and analyze debug output
- also strongly recommended is a bot source code for the other mods. I think HPB-bot template 3 on http://planethalflife.com/botman/ should do for this purpose

The first steps:
- read and try to understand the readme.txt, which is in the bot source code package. Whatever functions botman explains, check them in the source code and analyze them.
- analyze what you need to do to run the bot in a mod and make the necessary modifications. That means adapting the mod directory, team selection and weapons. The valve standard weapons should do for now (we add the svencoop special weapons later)
- now is the time to make the first test run. If successful, you should be able to spawn a bot while hosting a svencoop server. Supposed you haven't made any changes in team selection, these bot's will either ignore you or attack you with whatever weapons they got.

Congratulations. We got approximately 5% ready.

- find all entities that are in svencoop and implement those which aren't implemented yet into the bot code. If you don't know how, there is a complete instruction in botman's readme
- add the new weapons into the weapon list (see botman's readme) and analyze the criteria when to use which weapon if it's available. Replace the current weapon selection with whatever the results of your studies
- anyalyze the way how a bot finds an enemy player and replace it with a function to find monster entities. Criteria to select enemy from friendly monsters would be the entity model and name. This is quite a rough selection, and you will find that he will attack monsters it is not supposed to attack, and ignore others. A better way should be figured out later, but it'll do for now
- make the bot follow a user and stop following, attacking, pressing buttons or resupplying by intercepting and analyzing the pfnServerPrint. Set here the flags which are queried in botThink(). Analyze this function very thoroughly, and consider a complete restructuring of navigation and combat functions.

If it works so far: very good. You got about 80% of the work ready, and 20% of the time (about 3 months or so).
The Details:
- consider a navigation concept for the jump-and-run parts in many maps. Find out how you as a player avoid getting stuck and what you do if you get stuck
- make the friendly-foe-recognition water proofed
- teach the bots to find cover when reloading
- design a full concept of communication between master human and slave bot
- make the bot listen to sounds
- "teach" the bot how to break stuff
and so on and so on....
- alltogether: analyze your own behaviour in playing, what criteria have to match for making your decisions in playing, and write them down into mathematic formulas like vectors, distances, angles and parsing texts and examining sounds and decide what actions like pressing keys, strafing, jumping and stuff result from them

Great. You did it. It's working perfectly now. Half Life 3 was released a month ago...

26-05-2003, 04:43 AM
HAHAHHA Thats awesome.

You should change where it says "knowledge of C, better is C++" tooo

"knowledge of Basic, better is C++"

Cause basic is the main prgraming laungage while c ++ is more advanced.

26-05-2003, 07:18 AM
Hey Peterchen...
I haven't a single clue about coding, but check this tutorial:
AI Tutorial (http://hlpp.telefragged.com/tuts/ai-description.html)

Here are some too:
AI Tutorials... (http://hlpp.telefragged.com/tut-bot.htm)

And finaly for some simple AI, check this Tutorials:
Simple AI part 1 (http://hlpp.telefragged.com/tuts/ai_tut1.htm)
Simple AI part 2 (http://hlpp.telefragged.com/tuts/ai_tut2.htm)
Simple AI part 3 (http://hlpp.telefragged.com/tuts/ai_tut3.htm)

I hope I could help ya Dude... ;)

26-05-2003, 12:40 PM
Considdered (spelled?) botmans' site?

26-05-2003, 10:58 PM
I want to thank Sniper Viper for typing a VERY LONG article to make bots and thank u Zom-B for giving me the link!:D Before I start making bots. the folder program files/Microsoft Visual Studio has only one folder and its only a help thingy. DOes it stays that way? Or how can I use it? (sry about the Grammar......... I'm terrible at grammar!)

18-06-2003, 10:28 AM
May i just ask? Is it really possible to make a bot for both Sven Co-op, DoD and CS? I mean those are COMPLETELY DIFFERENT games!

19-06-2003, 05:31 AM
Well it is posible, there are bots that will work for diffirent games/mods, but it is going to be a lot of difficult work to complete it ... unless you are a great programmer

19-06-2003, 07:39 AM
The BOC-Bot (Brain-Of-Combat) for example worked for Counterstrike, Dod and Firearms... :eek:
Developement stoped and source Code is out I think...

20-06-2003, 06:21 AM
You coders give me a "brain cramp" just reading this stuff. I took a year of programing in college and have a basic knowledge of programing but I still get a " brain cramp".
Hey Sniper you ever get "brain cramps"? HeHe.