How to implement a ranking system for your map like dotacash?

Status
Not open for further replies.
Level 3
Joined
Aug 4, 2012
Messages
22
I'm trying to build a ranking system like the one they have in DotaCash for my map.

After a lot of searches, I could not find any information on how they did it. My guess is that they parse the replay files generated from the hosting bots, insert the relevant records into the database for users to query them in the ranking page.

All this is fine, but according to the W3G action format, there is no actions saved in the replay file indicating of units' deaths, so I'm not sure how they handled that part.

I'm thinking they must've manually injected the unit death event for the replay parser to pick up. Here are the action types available in W3G files:

AssignGroupHotkey
CancelHeroRevive
ChangeAllyOptions
ChangeSelection
DecreaseGameSpeed
DequeueBuildingOrder
DialogAnyButtonClicked
DialogButtonClicked
DropOrGiveItem
EnterChooseBuildingSubMenu
EnterChooseHeroSKillSubmenu
FogObjectOrder
GameCacheSyncBoolean
GameCacheSyncEmptyBoolean
GameCacheSyncEmptyReal
GameCacheSyncEmptyUnit
GameCacheSyncInteger
GameCacheSyncReal
GameCacheSyncUnit
IncreaseGameSpeed
MinimapPing
ObjectOrder
PauseGame
PointOrder
PressedEscape
PreSubGroupSelection
SaveGameFinished
SaveGameStarted
SelectGroundItem
SelectGroupHotkey
SelectSubGroup
SelfOrder
SetGameSpeed
TransferResources
TriggerArrowKeyEvent
TriggerChatEvent
TriggerMouseClickedTrackable
TriggerMouseTouchedTrackable
TriggerSelectionEvent
TriggerWaitFinished


So my question is, which of these events do I use in my map to indicate unit's death? (Maybe inject some sort of string in a defined format like P1(Unit ID)-K-P2(Unit ID), - being the delimeter)?

Or better, how does dotacash handle ranking system?
 
I'm not sure what you mean by ranking system ?

It would be better if you fully explain what you want to do.

If you're talking about a about a unit ranking system were the unit gets a certain amount of kills and gains a bonus you simply use a unit death event with a unit indexer.

You get the killing unit then with a unit indexer you use the custom value as a key in an array and increase the number. Then use an ITE to check if that number is what you want and do actions in the then block
 
Level 3
Joined
Aug 4, 2012
Messages
22
I'm not sure what you mean by ranking system ?

It would be better if you fully explain what you want to do.

If you're talking about a about a unit ranking system were the unit gets a certain amount of kills and gains a bonus you simply use a unit death event with a unit indexer.

You get the killing unit then with a unit indexer you use the custom value as a key in an array and increase the number. Then use an ITE to check if that number is what you want and do actions in the then block

See dotacash for an example of what I'm trying to implement.
http://www.dotacash.com/home/
http://www.dotacash.com/t1/player/?u=mrs(kia.&r=useast.battle.net

Basically, each game you play in dotacash are recorded and stored in the server database, which can be queried by the users in the ranking page.
 
Level 3
Joined
Aug 4, 2012
Messages
22
ooo i believe they do that by storing it in game cache but i've never done anything with that.

There are some game cache tutorials on here i believe.

I'm aware what game caches are but I don't think game cache data can be serialized into a format where they can be read/parsed by external processes. If this is a possibility, please correct me as this will make things much easier since I wouldn't have to parse byte data from w3g files.
 
I don't think the replay actions have a particular action to capture deaths, but you should still be able to take advantage of what you have listed.

Assuming you are able to change the triggers of the map, you could force one of those actions upon a unit's death (thereby, registering when a death occurs). For example, PointOrder or DropOrGiveItem.

I'm aware of what replay parsers are but I haven't dealt with them personally, so I apologize if what I said isn't feasible. Hopefully you understand what I mean though. Right now I'm assuming that all those items listed in your post are events.
 
Level 3
Joined
Aug 4, 2012
Messages
22
I don't think the replay actions have a particular action to capture deaths, but you should still be able to take advantage of what you have listed.

Assuming you are able to change the triggers of the map, you could force one of those actions upon a unit's death (thereby, registering when a death occurs). For example, PointOrder or DropOrGiveItem.

I'm aware of what replay parsers are but I haven't dealt with them personally, so I apologize if what I said isn't feasible. Hopefully you understand what I mean though. Right now I'm assuming that all those items listed in your post are events.

Thanks for the response. This was what I had in my mind too, but I wanted to see if there's a cleaner way of making this work. For example, if I can simulate a chat message via trigger that's invisible to other players, then I can just parse that string message based on unit death, but I don't think that's possible in WC3.
 
Status
Not open for further replies.
Top