.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > YappA > The Agora
The Agora This is the place to go if you have suggestions, or if you want to participate in Council discussions. Everyone is welcome!

Reply
 
Thread Tools
Wannabe bot author
Old
  (#1)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Wannabe bot author - 12-04-2012

Hi everyone,

Quick intro as I'm new...

I have been interested in AI since I first fired up Zeusbot in the original Quake so I could play some coop (this being when a dial-up connection was expensive and tied up the phone line), and was intrigued by its technical cleverness. I then moved on to Quake 2 and the Eraser bot, counter-strike and PODbot etc. Despite this interest, until recently programming was very much a spectator sport for me.

Over the last year I've become more seriously interested in actually learning programming, and I've built up a reasonably solid grasp of the principals of object-orientated programming and how a program is put together, along with a decent knowledge of java and C++. I'm at a stage where I feel I can start dabbling in developing a bot and actually make some kind of progress rather than sit there looking blankly at reams of code.

I would like to try making a client-side bot for Quake 2, the main reason being partially due to nostalgia, and mostly being due to the fact that I'm using my work laptop and I'm not supposed to have games on it (so ssshhh!). Quake 2 is small enough to not matter too much, but a steam installation and HL1 is probably not the best idea. It would also be interesting to create a bot that mimics a human as closely as possible, hence client-side rather than server-side.

The problem is getting started, since I'll need a good grasp of the client/server architecture in Quake 2. I heard of the Q2BotCore which was a simple program that could connect to a server, spawn a bot, say something then disconnect. This would be perfect for me since I can look through and see how it's done, but alas I cannot find a working link for the source anywhere.

It's a bit of a long shot, but I was hoping somebody here might be able to point me in the right direction, or offer some advice to help me get started. Any help would be much appreciated!
  
Reply With Quote
Re: Wannabe bot author
Old
  (#2)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: Wannabe bot author - 15-04-2012

http://code.google.com/p/tossbot/
The link above will lead you to open source bot based on Q2BotCore.
  
Reply With Quote
Re: Wannabe bot author
Old
  (#3)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Wannabe bot author - 15-04-2012

Hi Storm, thanks for getting back to me.

Regarding the source for that particular bot, which parts do I need to download and compile to get started? I've looked through the source and it looks like I need to download and compile Q2bot and Q2map from the libs directory, and of course the source for Tossbot itself in the source directory, but I wanted to confirm that first and check there isn't anything else I need. Once I get my head around the basics and how it's all laid out, I can start building the actual bot.
  
Reply With Quote
Re: Wannabe bot author
Old
  (#4)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: Wannabe bot author - 16-04-2012

Hi,

I didn't download the sources myself, but I guess, that there is "readme" file that will instruct you. If not, just get the Tossbot sources, check which headers are missing and download the needed libraries(Q2Bot and Q2Map or whatever is needed).

You mentioned that you had gained some C++ knowage, so you must be able to do it.
  
Reply With Quote
Re: Wannabe bot author
Old
  (#5)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Wannabe bot author - 16-04-2012

Ah yes, that would be a good start wouldn't it? My bad!

I've got all the sources, but I'm having trouble getting my libraries linked up. It looks like it's having trouble finding the winsock library, as when I attempt to compile Q2map for example, I get a "undefined reference to `WSAStartup@8'" error, along with a load of other similar errors referring to WSA commands.

I'm using Eclipse Helios for C/C++ developers, and my CPP and header files are located in my documents/workspace/C++/Q2map/src

The source file has a quick "#include winsock.h" at the beginning (winsock.h has angled brackets around it, but the message board doesn't like it when I post it with them), but no other reference. I'm assuming there's something I'm missing, any ideas? Sorry, but I've not worked with winsock applications before...

Last edited by Neoptolemus; 16-04-2012 at 21:55..
  
Reply With Quote
Re: Wannabe bot author
Old
  (#6)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: Wannabe bot author - 17-04-2012

Yep, you must link with the winsock library of course. I don't know how to configure the libraries in Eclipse but basiclly the library name is ws2_32.lib.
  
Reply With Quote
Re: Wannabe bot author
Old
  (#7)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Wannabe bot author - 17-04-2012

I'm really struggling to compile the Q2map and Q2bot sources, probably due to my inexperience with Eclipse Helios for C/C++.

I'm using the MingW compiler and it keeps saying it can't find the WS2_32.dll library even though I've added it to the project properties. I've added the C:\WINDOWS\System32 path and the reference to ws2_32.dll, and Eclipse seems to have picked it up as it now recognises winsock commands where before it was complaining about them not being defined. The only error message I'm given is "cannot find -lws2_32.dll" even though it's right there.

It's so frustrating because once I get the code compiling I can actually work on the bot. I've already identified the main loop and I can see how it all works, I just need to get it compiling first before I start modifying it. Aaaaaaah! Come back Java, all is forgiven.

Any ideas? I'd rather not switch IDEs since I (normally) like Eclipse for my Java stuff, but I'd rather get stuff compiled than spend the next week slamming my head against the wall.
  
Reply With Quote
Re: Wannabe bot author
Old
  (#8)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: Wannabe bot author - 17-04-2012

Hi,

Remove the .dll extension from the linker. Make it to look like this:
-lws2_32
and it should be ready to go.
  
Reply With Quote
Re: Wannabe bot author
Old
  (#9)
Neoptolemus
Member
 
Status: Offline
Posts: 93
Join Date: Apr 2012
Default Re: Wannabe bot author - 19-04-2012

Ugh, still no luck. Now it just complains that it cannot find -lws2_32

Seriously, compiling this stuff shouldn't be this complex. I've linked the dll directly using the "file" option, I've tried linking the System32 directory and pointed it to both ws2_32.dll and ws2_32 (without extension), but it can't find it regardless. Even better, out of frustration I removed all links and references to ws2_32 and it's still giving me the message!

Do you use an IDE for development? If so, could you recommend one that isn't such a pain to set up?
  
Reply With Quote
Re: Wannabe bot author
Old
  (#10)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,618
Join Date: Jul 2004
Location: Bulgaria
Default Re: Wannabe bot author - 19-04-2012

Microsoft Visual C++ 2010 Express. It is free and very easy to use.

Hint: The linker does not use directly the DLL. It uses files with .lib(MSVC) or .a/so(GCC/Mingw) extensions. After that the final executable needs the DLL that is located in your system32 folder and you should not worry for that because this folder is in the PATH variable on Windows and the application will load the DLL without issues.

So after you download and compile the stuff on MSVC the file name that you must put in the linker is ws2_32.lib.

EDIT: From what I saw, the tossbot have MSVC project files already created. After you install the IDE you will be able to directly open them.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com