Raised This Month: $32 Target: $400
 8% 

Advice needed for Map Testing Technology


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FPSBanana
SourceMod Donor
Join Date: Nov 2008
Location: New York
Old 07-27-2015 , 12:37   Advice needed for Map Testing Technology
Reply With Quote #1

Hi Ya'll,

I have an idea that has gotten some interest on my site GameBanana, and I was hoping to get some feedback from experts on AlliedModders as to its feasibility.

We have a large library of custom maps which can be downloaded (example map page). What I want to do is have a "Test this Map" button (see attachment), which allows users to test a map with two simple button presses:

  1. Clicking the first button entitled "Test this Map" reveals a message: "Please wait while we find an empty server to test on". In the background, GameBanana scans a list of dedicated servers and returns the first that is empty. GameBanana then instructs the server to download and install the map off GameBanana.
  2. When the server is ready, a new button appears entitled: "Launch Map". This button is a steam:// URL with the server's IP.
  3. The game is launched and the player downloads the map via fast DL and jumps right into the map.
This entire process, ideally, occurs very effortlessly and reliably inside of 60 seconds.

Is this possible? Is there a better way to do it?

Any help would be appreciated!
Attached Images
File Type: jpg Screenshot - 07272015 - 12:31:40 PM.jpg (85.4 KB, 302 views)

Last edited by FPSBanana; 07-27-2015 at 12:41.
FPSBanana is offline
Send a message via ICQ to FPSBanana Send a message via AIM to FPSBanana Send a message via Skype™ to FPSBanana
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-27-2015 , 14:04   Re: Advice needed for Map Testing Technology
Reply With Quote #2

Strictly speaking... is it possible? Yes.

Thinking about it, the first potential problem I can see is... how do you communicate to the server that you want it to download a map?

My gut feeling says to automate something based on SSH, but that's only going to work if the server in question is running Linux.

It might be possible to do it in PowerShell for Windows, but I'm not familiar enough with it to be able to tell you that.


My general thoughts on the process:
  1. User clicks the Test This Map button.
  2. Use AJAX calls to check the status of what's going on.
  3. Fork a new thread to check the list of servers for an empty one1.
    1. Acquire a lock on the server list (db table, file, etc...).
    2. Check for a server that is both empty and not marked as being in use.
    3. If you find a valid server, mark it as in use. This is so the system doesn't try to use the same server for multiple users.
    4. Remove the lock on the server list.
  4. Start a new thread to lo download the map on the server.
    1. The script logs in to the server.
    2. The script downloads the map to the proper place (consider putting it in custom/something/maps for Source SDK 2013-based games).
    3. If that succeeds, the script tells the server to switch maps.
  5. The AJAX call should poll the server to see if it has changed maps.
  6. Once the server's map changes, give the user the Launch Map button.

In a case of failure, lock the server list, remove the in use flag, and unlock the server list.

Notes: Make SURE to periodically remove the in use flags on empty servers. It might not be a bad idea to run through the list and delete all in use flags set longer than 10-15 minutes prior.

The reason I'm adamant about locking the server list BEFORE you check it is to avoid a Time of check to time of use bug.

1As a Java web developer, I tend to use ExecutorService to start the thread and store the Future object in the user session so I can check it from AJAX calls.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Dr_Knuckles
AlliedModders Donor
Join Date: Mar 2005
Location: SW Florida
Old 07-27-2015 , 15:39   Re: Advice needed for Map Testing Technology
Reply With Quote #3

Cool idea, assuming the "empty servers" are your own.
__________________
Dr_Knuckles is offline
FPSBanana
SourceMod Donor
Join Date: Nov 2008
Location: New York
Old 07-27-2015 , 15:46   Re: Advice needed for Map Testing Technology
Reply With Quote #4

Yes, locking would be an issue, good point. The other is abuse (rapidly requesting test servers for different maps) and timeouts (how long to allow the user to test a map).

I think the servers could have a simple script like testserver.com/dlmap.php?map=path/to/map that GameBanana requests, causing the server to download and install the map. This however would require the server to have a web server with PHP running at all times, with shell execution and write access to the maps directory.

I've also been told that certain maps require certain server plugins, like bhop. This would complicate things further wherein the server list would have to be narrowed down to servers that support bhop, if a bhop map test is requested.

Quote:
Originally Posted by Dr_Knuckles View Post
Cool idea, assuming the "empty servers" are your own.
Initially I thought I'd provision small virtual servers via Digital Ocean on demand as it's the kind of idea that is suited to horizontal scaling and per hour billing. But then I thought some server owners might be interested in supporting the idea, offering up their servers for testing (if it's empty).

Last edited by FPSBanana; 07-27-2015 at 15:52.
FPSBanana is offline
Send a message via ICQ to FPSBanana Send a message via AIM to FPSBanana Send a message via Skype™ to FPSBanana
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 07-27-2015 , 15:53   Re: Advice needed for Map Testing Technology
Reply With Quote #5

Oh hey I never thought that I would see the owner of GameBanana on Alliedmodders.

My MvM server has a dumbed down version of this system in place, except it's locked to trusted people only and not to the public.

What you could do is have a MySQL database that all of your servers constantly send data to every now and then, (once every 5 minutes maybe?) including player count, current map active, and MAYBE a list of all the maps on the server? (In XML form I guess or something. At least you can do an SQL "LIKE '%mapname%s' statement to check if the map is already on the server, if there is no better way to query the server for the maps list.) This MySQL server is like your "master server".

Then on the client website to the button you showed on the picture, when it's pressed, you can then query this master server, find an empty server (or a server already running the map), tell the server to download the map, and report back the IP to the client. In my case I have an external program that listens for incoming map files and automatically bzips the map and uploads it to FastDL while also sending an uncompressed copy to the server. It is probably easier to use an external program to do all that work or something rather than hauling all the work to the game server (especially since you also don't need to worry about certain extensions breaking on some game engines).

I dunno, just some ideas I'm throwing around. I like to use SQL for communicating between systems, although I'm sure there are other approaches that are equally acceptable or better (that are outside my skill level). If you choose the SQL approach you might need multiple tables on the database (one for incoming client requests, one that houses server data, etc).

One thing you do need to take note of are malicious map submissions, which can easily make a mess on servers if a mapper uploads a map with intentions to damage servers. I have no idea how you will deal with that, but be aware that that might be a problem. With the current system at least a server owner has to manually download the map and upload it, but if you automatically upload a map to any server then you might cause grief to some server without the owner ever knowing about it.

In any case, I wish you good luck!

Last edited by Potato Uno; 07-27-2015 at 15:58.
Potato Uno is offline
Ade
I love purple
Join Date: May 2010
Old 08-04-2015 , 05:18   Re: Advice needed for Map Testing Technology
Reply With Quote #6

the most dumbed down version i see would be the non automatic one of course: have a checkbox when submitting maps, asking if they want to participate in the lil testing initiative. Then have 1 server dedicated to this, namely have the owner periodically (daily/weekly) check for new submissions with the test option checked, upload those maps and change map to them to see if they crash, if all ok then add to fastdl as well and add the 'test this' button for normal users on the map dl page. server will also need some rtv plugin or a popular chat commands plugin to change the map.

maps that require special attention like specific plugins shud also come with an ip where players can test that map on, cus no one cba to create a specific environment just for 1 map.

i own but dont play csgo but i offer my services as a cpanel subuser/monkey that regularly checks for new such maps, puts them on the server and checks if they crash then ul on fastdl.
__________________
Ade is offline
Phaiz
AlliedModders Donor
Join Date: Feb 2014
Location: USA
Old 08-04-2015 , 07:09   Re: Advice needed for Map Testing Technology
Reply With Quote #7

This seems like a lot of work for something that can be done by downloading the map, moving it to the maps folder, launching the game and launching a listen server
__________________
Phaiz is offline
Ade
I love purple
Join Date: May 2010
Old 08-04-2015 , 07:27   Re: Advice needed for Map Testing Technology
Reply With Quote #8

for a multiplayer game, it's not enuf sometimes, plus the hassle of port opening, having good ul for ur friends to join ur listen server
__________________
Ade is offline
Reply


Thread Tools
Display Modes

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 21:17.


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