ProIcons   -  Feb 07, 2013

So i have My Gaming Community and i developed a new C++ add-on for my Servers that it will capture FULL details for each player for each game he plays.. The Basic concept of my project is:
1 Gather System , that gathers 10 random players and short them based on their skill points calculated in ELO Rating System ( http://en.wikipedia.org/wiki/Elo_rating_system ) Originally Founded by Arpad ELO ( http://en.wikipedia.org/wiki/Arpad_Elo ) and separate them into 2 Teams... (the users must be registered in my system in order to play) ... So this project send them IP Addresses of one of my game servers. My Projects with this add-on is able to manage this game and save full statistics. The match ends when a team reaches 16 win rounds, or both teams are in 15 rounds that is basically a "Draw"... So during the game this system gathers all the data for example...

Kills, Deaths , HeadShots , Team Kills (When a player kills his teammate) , Overall Damage Made to Enemies, Overall Damage made to his team , (+ hitplaces that made this damage (chest,head,arms,knees...) ), Overall damage taken from enemies, overall damage taken from allies, Bomb Plants, Bomb Defuses attempts, Bomb defusing Cancels, Bomb defuse attemps having a defusal kit, bomb defuse attempts not having a defusal kit , bomb explodes ,hostages killed, hostages attempted to rescue , hostages stole from ally , hostages got stolen by ally , hostages rescued ,

All these stats except (Bomb Events,Hostages Events) for Each gun approx 15 guns...

And all THESE stats without exception for each round :P (with each gun :P)

So i would need A LOT MySQL Tables for all these stats or a lot columns... So i though about building it with JSON Something like this: (it is incomplete and have missing fields because i made it so fast ) http://paste2.org/p/2836208

So what are your thoughts , shall i build it with many mysql tables? or add one "stats" column with LONGTEXT into my MySQL and retrieve them from there.. ?

ProIcons  -  Feb 11, 2013

@Hawkee @FordLawnmower @Conscious what are your thoughts?

Hawkee  -  Feb 11, 2013

What sort of game servers are you running?

ProIcons  -  Feb 11, 2013

Counter Strike 1.6 / Source / Global Offensive. I'm Storing Each Data in Arrays and then i will put them in database, The Thing is that i don't know how to store them. there are MANY and i want something fast, and also to be able to retrieved and proceesed fast.

enum Score { 
    Kills,
    Deaths,
    Assists,
    Tks,
    HeadShots,
    DHeadShots,
    Damage_n_Made,
    Damage_n_Taken,
    Damage_t_Made,
    Damage_t_Taken,
    Explodes,
    Defuses,
    Hostages_Saved,
    Hostages_Attempt,
    Hostages_Canceled,
    Hostages_GKDE,
    Hostages_Stole,
    Hostages_Got_Stolen,
    Defuses_With_Kit,
    Defuses_Without_Kit,
    XP,
    Plants,
    TeamFlashes,
    Spawned_With_Bomb,
    Got_Bomb,
    Dropped_Bomb,
    Defuse_Attempts_With_Kit,
    Defuse_Attempts_Without_Kit,
    Killed_Bomb_Carrier,
    Killed_Defuser,
    Killed_Hostage_Carrier,
    VIP_Killed,
    VIP_Escaped,
    Suicides
}

c{ new _:g_OverallData[MAXPLAYERS][Score][3]};//[User] Overall Data
c{ new _:g_RoundData[MAXPLAYERS][MAXPLAYERS][Score][2][3]};//[User] Round Data -> User ID : Victim ID : Action : Round
c{ new _:g_DamageData[MAXPLAYERS][MAXPLAYERS][g_DAction][g_DTarget][2][2][2][5]};//[User] Damage Data -> User ID : Victim ID : Taken/Made : Enemy / Ally : Weapon Index : HitPlace : Round
c{ new _:g_WeaponData[MAXPLAYERS][MAXPLAYERS][2][Score][2][2][5]};//[User] Weapon Data -> User ID : Victim ID : Weapon Index : Action : HitPlace : Round

The basic concept of storing data is:

public client_death(killer, victim, wpnindex, hitplace, TK)
{
    if (g_live == 1) {
        if (TK == 0) {
            if (killer != victim) {
                new g_HS;
                write_log("b","KILL %s %s %s %s",g_user[g_PlayerIDs[killer]][Username],g_user[g_PlayerIDs[victim]][Username],WeaponNames[wpnindex],HitPlaceStrings[hitplace]);
                if (hitplace == HIT_HEAD) { 
                    d{g_OverallData[g_PlayerIDs[killer]][XP]}+=10;
                    d{g_OverallData[g_PlayerIDs[killer]][HeadShots]}++;
                    d{g_OverallData[g_PlayerIDs[victim]][DHeadShots]}++;
                    d{g_RoundData[ g_PlayerIDs[killer] ][ g_PlayerIDs[victim] ][HeadShots][g_round]}++;
                    d{g_WeaponDamage[ g_PlayerIDs[killer] ][ g_PlayerIDs[victim] ][ wpnindex ][ Kills ][ HIT_HEAD ][g_round]}++;

....

Edit:

g_PlayerIDs = Array Holding Players Unique Database IDs
killer,victim = Ids retrieved from server's engine
wpnindex = number of weapon that triggered the event
hitplace = what was the last hitplace [chest,head..] etc...
TK = wether was a Teamkill or not...

g_live = variable to define if game is live or not...
HIT_HEAD constant that is defined into hitplace number
ProIcons  -  Feb 13, 2013

?

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.