Raised This Month: $51 Target: $400
 12% 

How to do testing for SourcePAWN


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 08-17-2009 , 06:24   How to do testing for SourcePAWN
Reply With Quote #1

So, I figured, as I do every now and then, that it's probably time I *actually* learned me SourcePAWN.

I can probably work out the most part of learning it, but what I wanted to know is "How does one go about testing?"
Specifically TF2.

And without a nice remote server box hosting a server ... or the TF2 client.

Let's all assume, for the moment, that I have but the one PC.

If I wanted to test on a local dedicated server, are there any good bot plugins I can be playing with?
I can probably handle getting it to log all I need, so I just need a sufficiently convincing fake client that it can spawn and choose a class and maybe shoot (on demand - it doesn't have to actually be smart) and call all the relevant events I want to hook.

Or does it have handy built-in fake client jazz?

Also, how do you all do your testing?
purple_pixie is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 08-17-2009 , 09:33   Re: How to do testing for SourcePAWN
Reply With Quote #2

Well, for TF bots can be added by using cheats.
Code:
sv_cheats 1
bot
bot
bot
....
They just stay on spawn because they don't have an AI, but you can force them to move or shoot by using console commands. I recommend you to use SRCDS through the Steam because it has a nice console that helps a lot with finding commands.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 08-17-2009 , 09:42   Re: How to do testing for SourcePAWN
Reply With Quote #3

Most handy - I'll have a play with these then.
purple_pixie is offline
Whosat
Senior Member
Join Date: Nov 2007
Location: Singapore
Old 08-17-2009 , 09:45   Re: How to do testing for SourcePAWN
Reply With Quote #4

There's an rcbot2 for tf2 beta. I'm not sure how it works or how to install it though just read about it last year or something.
__________________
Whosat is offline
VXD Guy
Junior Member
Join Date: Apr 2009
Location: Illinois, United States
Old 08-20-2009 , 11:59   Re: How to do testing for SourcePAWN
Reply With Quote #5

This is what my dev setup looks like:

free vmware server (http://www.vmware.com/products/server/)

virtual machine running slackware 12.2 (http://www.slackware.com)

Windows RCON CLI tool (http://svn.assembla.com/svn/SrcCon/b...ed%20Binaries/)

wget for win32 (http://users.ugent.be/~bpuype/wget/)

srds for Linux to run TF2 (http://forums.srcds.com/viewtopic/1139)


----

Slackware is running under VMWare Server
VSFTP is the FTP server I'm running under Slackware

Command line I use to update/install TF2 is:
./steam -command update -game tf2 -dir /hlserver -verify_all -retry

Command line I use to run TF2 is:
screen -A -d -m -S tf2 /hlserver/orangebox/srcds_run -console -debug -debuglog /hlserver/tf2debug.log -game tf2 +map zf_asylum_b1 +maxplayers 16 -autoupdate +ip 192.168.0.183

Command line I use to interact with the TF2 console is:
screen -x tf2


When I start steam, I use task manager to set affinity so that it's tied to CPU0. Later when the TF2 client is launched, it'll also be running with the same CPU affinity as it's parent process. After I start the Slackware VM, I set the vmx.exe(?) service's affinity to CPU1. This prevents stuttering when the client is eating up more CPU time than the server. This I'm going to automate with autoit3; I restart steam and the vm maybe once a month, if that.

My build process for scripts recompiles *.sp to *.smx using a makefile, uploads *.smx files to the FTP server using wget, then uses the RCON CLI to execute a restart. After restart, the RCON CLI waits for the server to start, changes maps, sets cheat mode, spawns bots, teleports them to their preset spots for testing, sets whatever other settings I usually use, then turns off cheat mode. Final step is to launch iexplore with steam://magic url to join the game server on the vm.

Basically I got tired of doing this manually time and time again, so I spent a day tracking down the necessary software to automate this as much as possible. The system is a little flakey, but for the most part it saves me quite a bit of time. I just need to add a lot more error checking to my batch files so that stupid mistakes don't break the build system.

The RCON CLI program is an absolute gem; it runs as a dot net program and I believe it runs under mono as well. I also found a PHP based rcon script to allow web servers to talk to a TF2 server; something I plan to use when setting up clan matches from a web based management system (not a priority at the moment, just one my todo list).
__________________

VXDGuy (aka VX)


Last edited by VXD Guy; 08-20-2009 at 12:02.
VXD Guy is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 08-20-2009 , 12:31   Re: How to do testing for SourcePAWN
Reply With Quote #6

As said, just use the Team Fortress 2 Dedicated Server under Steam > Tools if you're on Windows. I point PawnStudio directly to my SourceMod folder, so I can quickly edit the script, hit recompile, reload the plugin and I'm done.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 08-20-2009 , 17:30   Re: How to do testing for SourcePAWN
Reply With Quote #7

Quote:
Originally Posted by purple_pixie View Post
And without ... the TF2 client.


I don't see how you are going to effectively test anything without at least the TF2 client.

As mentioned above, you can get arounf the server by either starting a listen server (which requires the client) or running the linux (or windows) dedicated server either on another box or a virtual machine.

You can try using the bots, but the ones that kinda sorta come with TF2 aren't very useful, I don't know about the rcbot.

Either way it probably isn't going to be possible to give the bots any specific instructions to test the scenarios you will probably need to test.

What I do is compile the scripts on my windows PC using the provided compile.exe, which compiles EVERYTHING. I have it copied into the directoires I need to compile from (I double click compile.exe using the windows exploder).

Then I FTP the .smx files to the target TF2 server and restart it (we have a windows development server here at jigglysfunhouse.net). So I do testing there before SCP or FTPing the same .smx files (which are OS agnostic) to our "production" linux servers and restarting them.

I use WinSCP to transfer the files and vim to edit them.

Last edited by naris; 08-20-2009 at 17:37.
naris is offline
Reply



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 Off

Forum Jump


All times are GMT -4. The time now is 05:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode