Page MenuHomeWildfire Games

Removes active values from UserReport
ClosedPublic

Authored by vladislavbelov on Aug 26 2018, 3:35 AM.

Details

Summary

Currently we have active values in the UserReport, values that can be changed every second. They should go in a separate statistics group, but not in the hwdetect one.

Test Plan
  1. Apply the patch and compile the game.
  2. Run the game.
  3. Check that reports work and there is no problem with hwdetect.js.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

vladislavbelov created this revision.Aug 26 2018, 3:35 AM
Vulcan added a subscriber: Vulcan.Aug 26 2018, 3:37 AM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/differential/724/display/redirect

vladislavbelov edited the summary of this revision. (Show Details)Aug 26 2018, 3:38 AM

I looked at all values in the logfile from rP21868 and didn't see any dynamic values other than the ones removed here. So patch seems complete.

Also woudln't it be nicer to store the values as

{
   "build": {
      ....
    },
   "os": {
    ....
   },
   "gl": {
    ....
   },
   "cpu": {
   ....
   }
}

?

Also for the backend, you might want to consider that possibly many will continue to use v11.

Also I broke the build, fixing...

source/ps/GameSetup/HWDetect.cpp
276 ↗(On Diff #6875)

Agree that these can be nuked.
The screen resolution is more relevant than the window size before the application even initialized.
It gives me 1024*768, but that's not the real window size.
Since we have the screen resolution below, ok.

319 ↗(On Diff #6875)

Arugably removable (even though it gives a possibly valuable indication even if only measured at gamestart)

322 ↗(On Diff #6875)

Not sure about this one, it gives me

"cpu_frequency": -1,
"x86_frequency": 3392695955.358982,

So it gives an indication on the performance of the users CPU, even if inaccurate, no?

340 ↗(On Diff #6875)

should be moved to the top of the file, a const, like #define PS_PROTOCOL_VERSION 0x01010015 // Arbitrary protocol

vladislavbelov added inline comments.Aug 26 2018, 2:12 PM
source/ps/GameSetup/HWDetect.cpp
319 ↗(On Diff #6875)

But it's still active and it's not about hwdetect. My understanding of hwdetect, that the report data should change if and only if hardwares or drivers for hardwares were changed.

322 ↗(On Diff #6875)

It's not a static value, we measure it at runtime, so we have a visible error here.

340 ↗(On Diff #6875)

Why on top? I placed it here, because you may see it after making all changes, but on top it's easier to forget, no?

I'd prefer static cost int for on top to fix the type.

elexis added inline comments.Aug 26 2018, 2:24 PM
source/ps/GameSetup/HWDetect.cpp
319 ↗(On Diff #6875)

(or OS or build or those becoming separate reports too)

322 ↗(On Diff #6875)

So we have a somewhat inaccurate number instead of no number. Or can we deduce the frequency from the other data? (I doubt)

340 ↗(On Diff #6875)

I guess it's ok to keep it inside this function as long as this function is the only one relevant to the hwreport and the version only refering to the format of the hwreport part of the UserReport.
The comment itself above the number could be sufficient when keeping the number so close to the call IMO.
Or you could move the version to the top of the function. So every reader that starts reading at the top of the function notices the comment.
(Perhaps or perhaps not even something like { "hwreport", 11 }.)

source/ps/GameSetup/HWDetect.cpp
319 ↗(On Diff #6875)

OS = different drivers, build = possibly a different version, a different set of keys.

322 ↗(On Diff #6875)

We can deduce it from the CPU model or round it to few decimal places.

I can refactor it into the proposed format above if you agree it's better.

source/ps/GameSetup/HWDetect.cpp
322 ↗(On Diff #6875)

deduce it from the CPU model

Which source are you going to use for that, is it worth the hassle?

Vulcan added a comment.Sep 2 2018, 8:39 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/differential/728/display/redirect

vladislavbelov added inline comments.Oct 29 2018, 4:59 PM
source/ps/GameSetup/HWDetect.cpp
322 ↗(On Diff #6875)

Which source are you going to use for that, is it worth the hassle?

Vendor technical reports.

The current value is useless for us, because it can be any, it depends on a current machine loading. So I suggest to remove this value, until we have a better one.

Stan added a subscriber: Stan.Oct 30 2018, 9:52 AM
Stan added inline comments.
source/ps/GameSetup/HWDetect.cpp
322 ↗(On Diff #6875)

Won't the user report be false if the person overclocked his CPU ? If we have both values we can compare.

source/ps/GameSetup/HWDetect.cpp
322 ↗(On Diff #6875)

I'd say semi-false, because we'll know a value less than the actual value. The current value is pretty dynamic and has noticeable error (we should round it at least). Also we calculate it in the pregame, so the value will be less than possible.

Stan added a comment.Dec 28 2018, 4:01 PM

Just tested the patch, compiled enabled feedback, didn't get any errors.

source/ps/GameSetup/HWDetect.cpp
276 ↗(On Diff #6875)

What about people that play in windowed mode ? Don't we want know in what resolution they play ?

319 ↗(On Diff #6875)

Agree that it is irrelevant especially since we are still a 32bit process and knowing that 16GB are free on 20 doesn't seem like a really useful information.

322 ↗(On Diff #6875)

Not sure about removing it but the points seem good enough to remove it.

340 ↗(On Diff #6875)

Wouldn't it be nicer to have it in the default.cfg file ? to update it at each release ? This way if someone forgets you don't have to rebuild the whole game.

vladislavbelov marked 2 inline comments as done.Dec 28 2018, 6:09 PM
vladislavbelov added inline comments.
source/ps/GameSetup/HWDetect.cpp
276 ↗(On Diff #6875)

At least not here, because this is the hardware report, not all user statistics.

340 ↗(On Diff #6875)

The version is independent of the release cycles. Also default.cfg isn't in mods, so how to modify it without rebuilding?

Stan added inline comments.Dec 28 2018, 6:13 PM
source/ps/GameSetup/HWDetect.cpp
340 ↗(On Diff #6875)

Well you have mod.cfg, local.cfg, and user.cfg that should do the trick :)

→ The version is independent of the release cycles.

True. However you might want to separate the hardware by the version people play, so you can make stats per version. Like it's more useful to know the hardware used in the last 4 versions than in the last 20.

elexis accepted this revision.Dec 28 2018, 8:48 PM

I guess you were waiting for the green color.
One could do a completeness test and see if more stuff could be removed, otherwise there is nothing else to confirm that I see.

Btw I wonder if one couldn't use some C++ magic to avoid the hundreds of copies of scriptInterface.SetProperty and use something similar to init lists { std::make_pair("property", "value"), ... }

source/ps/GameSetup/HWDetect.cpp
319 ↗(On Diff #6875)

The purpose of the data processing is to see for what capabilities we can build. So it's (as) valuable to know whether people nowadays have more than 4GB ram.

One could argue that if the available memory is useful to be measured, it should not be deleted but moved to a new report. I don't see anyone caring about that number, so...

This revision is now accepted and ready to land.Dec 28 2018, 8:48 PM
elexis added inline comments.Dec 28 2018, 8:51 PM
source/ps/GameSetup/HWDetect.cpp
340 ↗(On Diff #6875)

But config settings are used to change the program flow, this is a piece of information that if changed by a user, would indicate something incorrect, no? So more comparable to the protocol version magic of the netclient, or the pyrogenesis engine version constant. The user can't change anything in JS or the GUI that would influence the version.

Stan added inline comments.Dec 29 2018, 3:31 PM
source/ps/GameSetup/HWDetect.cpp
340 ↗(On Diff #6875)

Fair point. I just imagined a random case where someone changed the feedback link for his server and wanted to start at 0 for his own mod.

elexis added inline comments.Jan 3 2019, 10:30 AM
source/ps/GameSetup/HWDetect.cpp
340 ↗(On Diff #6875)

He then either does not change this protocol and thus has no reason to use a different protocol version number,
or he does change the protocol, then he can also change the protocol number.

This revision was automatically updated to reflect the committed changes.