PDA

View Full Version : Download tracking


Phil Steinmeyer
01-10-2006, 12:42 PM
What's the best way to track downloads of a particular file? Ideally, I'd like to track both downloads started and completed.

Mark Currie
01-10-2006, 02:02 PM
What about tracking the number of installs your game gets? This is useful if your game gets included in a magazine's coverdisk.

My game pings my server the first time it is run with a special message. If the ping fails (user is offline, or whatever), then it keeps trying subsequent on runs, until it succeeds. This isn't perfect but it lets me know the number of people who have installed the game and run it at least once--except for people who never play it while online.

princec
01-10-2006, 02:32 PM
That's what my games do too. Very handy.

Cas :)

Evanstaul
01-10-2006, 03:27 PM
What happens when they install and run your game and it tries to ping the server while there is no connection, won't some dial-up box try to pop-up making them suspicious or upset?

Mark Currie
01-10-2006, 04:16 PM
Currently my game has that flaw -- and a Windows dialog will appear. The dialog says something like "an application is trying to access news.inhumangames.com". In the game, there is a news pane that shows the message of the day. Users probably figure that's how the game is updating the news pane, which is true.

I've recently learned there is an easy way to check to see if there's an internet connection or not using a Wininet function. When I update my game in the next patch, it will have this fixed.

No one has yet to complain about it to me. I do mention stat tracking in the game's EULA.

My ping message does more than stat tracking. Besides getting news, it checks the version, checks to see if the serial key is still valid, and it relays lots of fascinating stats.

The system I made is pretty cool. I'm thinking about offering it as a service to other indie developers.

soniCron
01-10-2006, 05:12 PM
What's the best way to track downloads of a particular file? Ideally, I'd like to track both downloads started and completed. If you're simply wanting to see how many downloads were completed, serving the file through PHP is a solid bet. Just read a portion of the file and "echo" it. You can also set it up to fail if nothing has been transfered in "x" seconds. The PHP manual page for fread (http://us3.php.net/fread) has some sample scripts in the comments section, some of which were contributed by our very own James C. Smith.

If you want to track files after they've been downloaded, start with this thread: http://forums.indiegamer.com/showthread.php?t=3825

Fabio
01-10-2006, 09:46 PM
I've recently learned there is an easy way to check to see if there's an internet connection or not using a Wininet function. When I update my game in the next patch, it will have this fixed.Can you share the info please? I had a file somewhere with code to see if we're online or not, but I can't find it anymore. Perhaps it's the same thing, I should realize it by looking at your info/code and comparing it with my brain's memory image of the file. If it's not, I'll look further for mine and post it too.

Gilzu
01-11-2006, 01:38 AM
My game pings my server

I can't even count the number of games and sofware i've deleted after my firewall warned me about my software/game trying to send things to the net without a good reason (or even asking me/warning me).

It's not that spyware aspect annoys me (although there are many who do), but its the fact that I just HATE people spying over me. Even with stuff like when i play the game.

Invasion of privacy if you'll ask me. At least ask before.

Sharpfish
01-11-2006, 02:11 AM
I can't even count the number of games and sofware i've deleted after my firewall warned me about my software/game trying to send things to the net without a good reason (or even asking me/warning me).

It's not that spyware aspect annoys me (although there are many who do), but its the fact that I just HATE people spying over me. Even with stuff like when i play the game.

Invasion of privacy if you'll ask me. At least ask before.

Even though it's harmless - I also feel the same. If it gets flagged by my firewall then I am not going to say "oh go on then" so it's useless - and many people use firewalls these days. I always view the software with mistrust after that even knowing what I know (that it's just harmless stat's gathering). It does feel like spying and that is not good.

jankoM
01-11-2006, 02:42 AM
Yes... these days mostly everybody have firewalls and every such conection pops it up. To me personally , if a big game like Trash would wanna contact the web when I run it I would let it, but if I download some small game demo and it does this I deny it and suspect it is some spy/add/trojan bussines going on.

This is bad because I would like my games to check for updates, new releases and such stuff... the one solution I intended to do is to clearly inform user with a screen saying "Now the game will connect to wor internet page and check for updates, so firewall might pop up. Please allow it blabla... The game contains no spyware... or check for updates manually."

princec
01-11-2006, 04:49 AM
What happens when they install and run your game and it tries to ping the server while there is no connection, won't some dial-up box try to pop-up making them suspicious or upset?
Mine checks the local IP addresses of the machine; if it only finds loopback IPs it doesn't try to connect.

It also remembers if it has ever been allowed to connect - which it probably will be, as it has to connect to use the hiscore server, update server, and registration server.

Cas :)

Teq
01-11-2006, 05:31 AM
Have to be careful with that approach though Cas, some people use dial up connections for internet access and have LAN access (giving a non-loopback IP), I guess this is an ever decreasing proportion of customers, have you ever had complaints?

princec
01-11-2006, 05:33 AM
Have to be careful with that approach though Cas, some people use dial up connections for internet access and have LAN access (giving a non-loopback IP), I guess this is an ever decreasing proportion of customers, have you ever had complaints?
I realise it's not 100% but I've never had a complaint.

Cas :)

Teq
01-11-2006, 05:35 AM
Guess thats good enough then, was thinking of soap integration with some of my apps, perhaps advertising products through free downloads as well as showing news, getting version info, etc..

mahlzeit
01-11-2006, 06:14 AM
How about showing a message box first. "Hi, the game would like to connect to the internet to download whatever. Do you want to allow this? Y/N". If they choose Yes, pop up a new message box: "If you have a firewall, it may issue a warning when the game tries to make a connection. You need to allow the firewall blah blah. OK" That way you will at least have told them what the firewall warning is for and it will seem less like an intrusion. I think (never actually tried this approach :)). Of course, you only do this once (not in the installer, because no one ever pays attention to that).

Oh, and to be on-topic: I simply look at the raw website log files for downloads. You have to perform some tricks to distinguish between incomplete downloads and partial downloads from download managers. So if you can't do the PHP thing, this is always a possible solution.

Mark Currie
01-11-2006, 02:41 PM
I did some basic tests with my firewall on and I didn't get any warning until I tried to access the multiplayer game lobby. That is, there was no warning when the game relayed usage information to my webserver. I guess the firewall that comes with Windows XP doesn't care about Wininet making HTTP requests. I suppose if people are running other firewall software they could get a warning.

The information gathered has sort of evolved over time. At first it was just getting news of the day. Then it was checking for version updates. Then it was verifying a serial key were still valid (in case of a customer refund). Then it was sending the number of times the game had been launched, etc. The information gathered is similar to what a website gathers in a web log file.

I have used this information to learn that although my game is primarily a multiplayer game, that most people are actually playing single-player skirmishes against the computer AI. I have also learned that over 3000 people have launched my game 50 times or more--and not paid for it. Going forward I will use this information to increase sales. I will further restrict the single player aspect of the game which will hopefully increase the conversion rate.

I realize information gathering could be considered an invasion of privacy. Part of me doesn't like knowing that the cable box is relaying which channels I'm watch back to the cable company. Part of me doesn't like knowing the grocery store is tracking my purchases with my discount card. At the same time, I realize information tracking also helps these businesses provide better products.

I can't even count the number of games and sofware i've deleted after my firewall warned me about my software/game trying to send things to the net without a good reason (or even asking me/warning me).

Hmm, that’s something else I should track. Hehe. I actually agree that I should ask the user if it's okay to contact the webserver. I'll add that. Most people don't read EULAs.

Fabio, here is the Windows code I was going to use to check if the user is online:

// if user is offline, don't ask him to connect
// this check is to prevent the Window's dialog being shown "a program you are using is trying to access the internet, would you like to connect?"
DWORD nFlags = 0;
if(!InternetGetConnectedState(&nFlags, 0) ||
(nFlags & INTERNET_CONNECTION_OFFLINE)) // this part of the check may not be needed
{
DoErrorInThread("Not connected to Internet.");
return false;
}