Making a simple bot for Nexiuz Using Quake C or C++

Post anything to do with editing Nexuiz here. Whether its problems you've had, questions, or if you just want to show off your work.

Moderators: Nexuiz Moderators, Moderators

Making a simple bot for Nexiuz Using Quake C or C++

Postby bengreenwood » Fri Oct 19, 2007 1:21 am

Hi.

I started programming C++ a few months ago and I'm interested in programming some simple bots for some FPS games.

I've heard that you can make stuff for Nexuiz in Quake C but I'm wondering.. can you also make stuff for it using C++? This might seem like a dumb question, I just ask because C++ seems a bit more powerful than Quake C.

If so, how hard would it be to make a very simple bot for Nexuiz? I mean, just something incredibly dumb that follows the player and shoots at it, just something as a tutorial for how to compile it and get something actually working. How hard would that be to do, in Quake C or C++?

Thanks, any help would be seriously appreciated.
bengreenwood
Advanced member
 
Posts: 67
Joined: Sat Sep 29, 2007 4:47 am

Postby Psychcf » Fri Oct 19, 2007 1:53 am

well, you don't have things like cout or cin with C, there are some other differences, but it shouldn't be too hard to figure out.

C++ is not necessarily more powerful, but just time saving. C is more efficient then C++.
Psychcf
Forum addon
 
Posts: 1554
Joined: Sun Dec 03, 2006 11:38 pm
Location: NY, USA

Re: Making a simple bot for Nexiuz Using Quake C or C++

Postby KadaverJack » Fri Oct 19, 2007 12:26 pm

bengreenwood wrote:I've heard that you can make stuff for Nexuiz in Quake C but I'm wondering.. can you also make stuff for it using C++? This might seem like a dumb question, I just ask because C++ seems a bit more powerful than Quake C.

You could, but using qc is much easier, since the engine isn't meant to run game logic written in C(++).

If so, how hard would it be to make a very simple bot for Nexuiz? I mean, just something incredibly dumb that follows the player and shoots at it, just something as a tutorial for how to compile it and get something actually working. How hard would that be to do, in Quake C or C++?

@compiling: see FAQ, last line. If you add additional files, you need to add them in progs.src, so fteqcc knows about them.

@stupid bots: this is pretty much what you're looking for: http://svn.icculus.org/nexuiz/trunk/dat ... &view=auto
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm

Postby A8hm » Fri Oct 19, 2007 12:27 pm

This sounds like a fun project. Maybe you could put in a routiene that makes the bots create a pyramid like many of the nexuiz people like to show screenshots of their bot pyramids. You should change the skin of the bots too. Maybe tan or something.
A8hm
Banned
 
Posts: 48
Joined: Fri Oct 19, 2007 11:47 am

Postby bengreenwood » Fri Oct 19, 2007 1:48 pm

Okay this is going to sound incredibly dumb here but KadaverJack, that FAQ gave me a link to that FTEQCC program. So what is that, just like another compiler? To be honest I'm confused.

I'm learning my way through C++ at an okay rate but this whole thing about multiple source files really does my head in. With the code for Quake, I remember downloading the source code for the Reaper bot once, I pretty sure that was QuakeC. Well that was just like, 50 different source code files. How do they translate into one program? I'm presuming most of them are just header files and then there's just one main file, too, right?

I mean, when you make a mod for say, Quake, do you need to recompile the entire game code or just part of it? I'm presuming it's the latter. LIke I said I apologise for my dumbness, I'm just confused.
bengreenwood
Advanced member
 
Posts: 67
Joined: Sat Sep 29, 2007 4:47 am

Postby KadaverJack » Fri Oct 19, 2007 3:00 pm

bengreenwood wrote:Okay this is going to sound incredibly dumb here but KadaverJack, that FAQ gave me a link to that FTEQCC program. So what is that, just like another compiler? To be honest I'm confused.

yes, fteqcc is a QuakeC compiler.

Well that was just like, 50 different source code files. How do they translate into one program? I'm presuming most of them are just header files and then there's just one main file, too, right?

Having all code in one file and a million headers would pretty much defy the porpose of having multiple files...
With qc it's pretty simple to split your code in mutliple files: just list all files you use in progs.src in the order in they should be compiled. Scoping work pretty simple in this case: if a.qc is listed before b.qc, you can use functions & globals from a.qc in b.qc, but not vice versa.

I mean, when you make a mod for say, Quake, do you need to recompile the entire game code or just part of it? I'm presuming it's the latter.

Yes, you need to compile it all, since everything will end up in a single file (specified in the first line of progs.src, usually it's called progs.dat).
KadaverJack
Site admin and forum addon
 
Posts: 1102
Joined: Tue Feb 28, 2006 9:42 pm


Return to Nexuiz - Editing

Who is online

Users browsing this forum: No registered users and 1 guest

cron