laitimes

Steamworks: Stats could better serve the demo

Steamworks: Stats could better serve the demo

Inconspicuous dilemma

In the early versions, a small number of games had a more eye-catching Stats community backend: mainly based on V Society's own games such as "Road to Survival" and "CS:Go", but they were not limited to that. However, this kind of interface is rare in today's Steam games.

Steamworks: Stats could better serve the demo

According to online sources, games with such Stats backend interfaces are usually released before 2012 and appear to be mostly made by the Source engine

Through the background documentation, we can roughly feel that the main functional intent of Stats has largely changed: it still focuses on recording and presenting for players, but it has shifted more from "explicit" to "hidden", from outside to inside - at present, only if developers take the initiative to make corresponding information display layers with the Steam API, players will have the opportunity to learn specific data in the game through a series of UI interfaces that may be named "player information".

Perhaps that's why Stats is often "marginalized and easily ignored, both in games and in everyday development"? The feeling of "it looks like it needs a little more effort, but it doesn't seem to be necessary" has always haunted it.

Web API

However, for Stats, in addition to the in-game Steam-API, Steam also provides a way called the Web-API.

It is typed directly from the browser's address bar, and the result is something like this:

Steamworks: Stats could better serve the demo

It may be that I didn't have enough knowledge of the web in the past, and I had a very serious attitude towards Stats itself, but for me personally, before I actually used it, either as a player or as a developer, I had very few people talking about it in my previous experience; Or even if you hear it, you may feel more abstract and seem to be far away from you.

It wasn't until recently that I started thinking about adding achievements and stats to the Next Fest for my game's demo......

This may seem complicated, but it's essentially a change from the SteamAPI to a web input - it may seem like a lot to enter, but it's nothing more than App IDs, function names, and parameters connected by not-so-intuitive symbols.

Like the first half of this line used in the image above:

https://api.steampowered.com/ISteamUserStats/GetGlobalStatsForGame/v1/?appid=xxxxxxx&count=4&name%5B0%5D=c1_start.....(后略)....      

is a call to the GetGlobalStatsForGame() function, the number of query Stats entries that are subsequently passed in, and the backend ID of the Stats entered separately.

What isn't shown are the last two optional parameters of the function - these two optional parameters can even be told by you the time range of the data you need, and it will return the daily data for the corresponding date range.

https://api.steampowered.com/ISteamUserStats/GetGlobalStatsForGame/v1/?appid=xxxxx&count=4&name%5B0%5D=c1_start......(中间部分略)......startdate=1718467200&enddate=1718553600
      

For example, the large string I just entered in the browser, followed by additional parameters (startdate=1718467200&enddate=1718553600), can be used to query data for me from 0:00 on June 16 to one day after Beijing time (corresponding to 16:00 GMT on the 15th to 16:00 GMT on the 16th).

The added parameter uses the unix epoch timestamp format - it represents the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), and you can convert it to Beijing time using https://www.extool.cn/timestamp/ (when using the conversion tool, note that the default parameter is "seconds" instead of "milliseconds", setting milliseconds to a millisecond will return the wrong data).

Steamworks: Stats could better serve the demo

As you can see, it additionally returns a history item separated by day.

  • The first of these [date 1718409600], after calculating the conversion of the website, shows that it shows 0:00 GMT on the 15th;
  • The second of these [date 1718490600], after calculating the conversion of the website, shows that it shows 0:00 GMT on the 16th.

It can be found that it uses date=xxxx to mark the current day by returning the timestamp of GMT 0 on the current day.

I didn't have the "hour-based" accuracy range I expected, but it was pretty much enough, and I was able to tell that "there were 13 players in the first chapter that day."

Steamworks: Stats could better serve the demo

And the next few queries return, which can make me notice:

1. story_c1_r3_bonus's history only returns one piece of data from 1718496000 (i.e., June 16), which means that there is no data update on the 15th;

2. That is, on the 15th, 7 of the 13 people who entered the first chapter pushed open the door, but not 1 discovered the secret of the room;

3. It wasn't until the 16th that 20 out of 27 players pushed open the door, and 2 finally discovered the secret...

As a developer, since you can still see the actual number of demo downloaders in the background (and this data is not updated every day like Wishlist, but in real time), then, combined with the above information, you can completely deduce very specific information such as "how many people actually play in the daily number of downloaders", and "what kind of chapter completion and easter egg discovery they have".

Background configuration points

So, what do you need to do to prepare for this?

In fact, you just need to use the "Global Stats checkbox" in Stats.

Steamworks: Stats could better serve the demo

For example, set the maximum value of an item to 1 so that, combined with the GetGlobalStatsForGame function, each number can represent a person.

It is also possible to count the amount of time that a player has spent on something.

Steamworks: Stats could better serve the demo

If you want to compare two interactable objects placed in close proximity to each other – which one is more attractive to the player, the cumulative interaction time data for juxtaposed can be a valuable piece of information.

Stats VS 统计型成就的迷思

Above, considering the usually small size of the demo and the flexibility that comes with its separation from the backend of the ontology, "you can configure unique backend stats separately for your own situation" - you can imagine how much convenience this can bring to developers when participating in events like the Next Fest (or making special packages). And what if the above ideas are implemented in the ontology? I think I can do so much more.

Especially in recent years, some games seem to have taken on a trend of "trying to replace stats with an achievement system". And if the information collection is placed in Stats in a centralized and targeted manner, maybe some of the potential effects of this trend can also be avoided?

Steamworks: Stats could better serve the demo

Statistic achievements in some games tend to evolve into challenges that are more difficult for players to achieve, or that require a more tedious process to achieve.

Sometimes it is manifested as "when it comes to branching routes, you need a new week to unlock" (represented by the Zotte achievement in Hollow Knight); Sometimes it manifests as a bunch of inconsequential checklist items to get the achievement.

If these achievements are not set up properly, they can often cause unnecessary distress and pain to some players (especially those who are not so aggressive in pursuing all achievements, but are eager to collect as many achievements as possible).

So, if you're just trying to gather some extra information for yourself as a developer, then it's clear that Stats could be a better choice. The distinction between clean stats and achievements will presumably also encourage developers to design a more appropriate achievement system.

Auxiliary tools

Finally, you may have just asked, "Web-API is so hard to read and write, how do you get started?" "After a little research, I found that some websites are already trying to help developers solve similar problems.

Steamworks: Stats could better serve the demo

https://steamapi.xpaw.me/#ISteamUserStats/GetGlobalAchievementPercentagesForApp

As you can see above, the site has compiled a summary of common APIs and listed them in a visual form (the link I used for my demonstration was quickly obtained through the tool).

Steamworks: Stats could better serve the demo

To improve readability, you can also add a suffix such as =xml to the end of the generated link, which will change the display format of the returned information.

More of this knowledge can be learned by simply reading the official documentation.

Finally, attach a Youtube video from developer AuroDev, "Data-Driven Game Development with Steam Stats? (Using Steam Stats for Data Driven Game Development?), thanks to him, this is also a video that inspired me when I started learning Stats.

Steamworks: Stats could better serve the demo

After explaining the mechanism, AuroDev also discussed the benefits of this data acquisition method from a data privacy perspective, to the effect that "because players have already allowed Steam to collect game data in an appropriate way when they accept Steam's terms of service, developers using Stats can get an additional layer of data security endorsement".

I hope this article can give you some inspiration in the preparation of the demo. I also wish that in events such as the Steam Next Fest, in addition to traffic and exposure, everyone can get more interesting data and more happiness.

* This article is submitted by a user and does not necessarily reflect the views of Indienova.

Steamworks: Stats could better serve the demo
Steamworks: Stats could better serve the demo

Read on