Statistics in games (AS3)

Started by
3 comments, last by jeteran 11 years, 8 months ago
Hello everyone.

In another post, we were talking about making achievements in a video game, and something that I want to rescue (and I'm making it in another post) is about creating statistics in the game.

I'm working on a AS3.0 title and I want it to have global statistics so they can sum up all the data played by each players (for example total of hours dedicated to the game by every player).

I did some research and found that there are 2 ways to make this: one is passing global vars from a XML file to the swf file (mh this is more like a "load game"); and the other one is saving data in the SharedObject (but this will save only on local data)

So my question is, are there more methods to have global statistics in games using AS3 and have it save the info of all the players of the game? If so (or not), how can I get vars from every user that plays the game?

Using my imagination, I thought about 2 things: one is save all that data localy in the players computer (using the SharedObject method) and then get them with a tool I build. The other one is save that data, when the player exits the game, on a online tool that save that data. What do you think?

Thank you so much guys; lets keep up the good work !!
Advertisement
If I am understanding your goal correctly, you want users to be able to see the statistics of all players combined.

You could store the statistics in a database somewhere on a server. Update the database and retrieve the statistics from the database via script calls within your game.


Doing this requires more than AS3 obviously, as you will need to have an understanding of a server side scripting language like PHP and some database know how, MySQL for example.

You might choose another scripting/database technology, but in general you need to have a database server side that stores the statistics that the clients can interact with.
Hey prototypical, thanks so much for your response !!

I'm sorry, I didn't specify who will see those statistics, but actually the player will only watch only his statistics; the global results of all the users combined will be only for me.

In either case and following your guide, I'll probably need a server with a scripting in PHP with MySQL.

And now, is there a special way to recieve the data of each user? Should I use the SharedObject method to save the data in the gamer's computer or from the game I send the info to a server that can catch that data?

Thanks once again prototypical !!
A SharedObject is for saving data client side.

For example if you want them to be able to save games and settings without the need of a database, that is a reason why you'd use a shared object.

The aspect of saving any data for your usage is the server side database part.

If your interest is tracking the data, you need to send it to the server database.
Great prototypical, thanks so much for your guideance.

Before finishing, you have any guide / tutorial that can help me getting start on configuring a database and server with AS3.0 ?

Thanks once again, your help is awesome !!

This topic is closed to new replies.

Advertisement