Skip to content

Commit

Permalink
Change: put the result of every version on its own page (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueBrain authored Mar 1, 2024
1 parent 34f04d4 commit f1570f6
Show file tree
Hide file tree
Showing 43 changed files with 381 additions and 97 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/create-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,7 @@ jobs:
- name: Create summary entry
shell: bash
run: |
mkdir -p _summaries/${{ steps.dates.outputs.year }}
summary="_summaries/${{ steps.dates.outputs.year }}/wk${{ steps.dates.outputs.week }}.md"
echo "---" > ${summary}
echo "name: ${{ steps.dates.outputs.year }} - Week ${{ steps.dates.outputs.week }}" >> ${summary}
echo "title: Survey Result Summary - ${{ steps.dates.outputs.year }} - Week ${{ steps.dates.outputs.week }}"
echo "active_nav: summaries" >> ${summary}
echo "year: \"${{ steps.dates.outputs.year }}\"" >> ${summary}
echo "week: wk${{ steps.dates.outputs.week }}" >> ${summary}
echo "start_date: \"${{ steps.dates.outputs.start_date }}\"" >> ${summary}
echo "end_date: \"${{ steps.dates.outputs.end_date }}\"" >> ${summary}
echo "---" >> ${summary}
python -m create_markdown ${{ steps.dates.outputs.year }} ${{ steps.dates.outputs.week }} ${{ steps.dates.outputs.start_date }} ${{ steps.dates.outputs.end_date }}
- name: Commit and push
shell: bash
Expand Down
3 changes: 1 addition & 2 deletions _data/summaries/2024/wk01.json
Original file line number Diff line number Diff line change
Expand Up @@ -4807,6 +4807,5 @@
"count": 1164,
"ids": 623
}
},
"vanilla-master": null
}
}
3 changes: 1 addition & 2 deletions _data/summaries/2024/wk02.json
Original file line number Diff line number Diff line change
Expand Up @@ -4933,6 +4933,5 @@
"count": 1519,
"ids": 728
}
},
"vanilla-master": null
}
}
3 changes: 0 additions & 3 deletions _data/summaries/2024/wk05.json
Original file line number Diff line number Diff line change
Expand Up @@ -2957,7 +2957,6 @@
"ids": 618
}
},
"14.0-beta2": null,
"jgrpp-0.56.2": {
"game.settings.advance_order_on_clone": {
"false": 12280424,
Expand Down Expand Up @@ -7872,8 +7871,6 @@
"ids": 595
}
},
"jgrpp-0.57.0": null,
"jgrpp-0.57.1": null,
"vanilla-master": {
"game.settings.ai.ai_disable_veh_aircraft": {
"false": 885427,
Expand Down
2 changes: 0 additions & 2 deletions _data/summaries/2024/wk06.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"14.0-beta1": null,
"14.0-beta2": {
"game.settings.ai.ai_disable_veh_aircraft": {
"false": 2922715,
Expand Down Expand Up @@ -10654,7 +10653,6 @@
"ids": 307
}
},
"jgrpp-0.57.0": null,
"jgrpp-0.57.1": {
"game.settings.advance_order_on_clone": {
"false": 4197866,
Expand Down
4 changes: 0 additions & 4 deletions _data/summaries/2024/wk07.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"14.0-RC1": null,
"14.0-beta1": null,
"14.0-beta2": null,
"14.0-beta3": {
"game.settings.ai.ai_disable_veh_aircraft": {
"false": 13972707,
Expand Down Expand Up @@ -7412,7 +7409,6 @@
"ids": 266
}
},
"jgrpp-0.57.0": null,
"jgrpp-0.57.1": {
"game.settings.advance_order_on_clone": {
"false": 9659140,
Expand Down
4 changes: 0 additions & 4 deletions _data/summaries/2024/wk08.json
Original file line number Diff line number Diff line change
Expand Up @@ -3513,8 +3513,6 @@
"ids": 2482
}
},
"14.0-beta1": null,
"14.0-beta2": null,
"14.0-beta3": {
"game.settings.ai.ai_disable_veh_aircraft": {
"false": 5500674,
Expand Down Expand Up @@ -9834,7 +9832,6 @@
"ids": 159
}
},
"jgrpp-0.57.0": null,
"jgrpp-0.57.1": {
"game.settings.advance_order_on_clone": {
"false": 8925503,
Expand Down Expand Up @@ -14748,7 +14745,6 @@
"ids": 723
}
},
"jgrpp-0.58.0": null,
"vanilla-master": {
"game.settings.ai.ai_disable_veh_aircraft": {
"false": 1291189,
Expand Down
69 changes: 11 additions & 58 deletions _layouts/summaries.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,74 +9,27 @@ <h3>Survey Result Summary - {{ page.name }}</h3>
<div class="section-item">
<div class="content">
<p>
Below is the summary of the survey results from {{ page.start_date }} to {{ page.end_date }}.
Below are the versions with a summary of the survey results from {{ page.start_date }} to {{ page.end_date }}.
</p>

<ul>
{% for version in site.data.summaries[page.year][page.week] %}
{% if version[1] == nil %}{% continue %}{% endif %}
{% for summary in site.summaries %}
{% if summary.year != page.year or summary.week != page.week or summary.version == nil %}{% continue %}{% endif %}
<li>
<a href="#{{ version[0] }}">{{ version[0] }}</a>
<a href="{{ summary.url }}">{{ summary.version }}</a>
</li>
{% endfor %}
</ul>

<p>
The following statistics are based on "seconds played".
That is to say, if a setting was "true" for 100 seconds of play-time and "false" for 200 seconds of play-time, it would be 33% true and 66% false.
This is to avoid biasing the results towards shorter games.
<br />
Worded differently, the following statistics are not counting how often something was used, but how long it was used for.
</p>

<p>
Be mindful that these numbers are only based on those people willing to send us survey results.
It might not be representative of the entire OpenTTD player base.
</p>

<p>
Entries listed as "(other)" are the collection of all values lower than 0.1% of the total.
<small>
Note: some versions are not shown, as they do not have a summary created for them.
To protect the privacy of the participants and to avoid any misinterpretation of the data, a summary is only created if sufficient valid responses are received.
What is considered sufficient depends on a number of factors, like amount of reports received, amount of games reported, amount of time played, and so on.
What is considered valid depends on things like whether it was send by an official binary, whether it contains all the required fields, and so on.
For more details about these thresholds and validations, please check <a href="https://github.com/OpenTTD/survey-web/blob/main/analysis/__main__.py">the source code</a>.
</small>
</p>
</div>
</div>

{% for version in site.data.summaries[page.year][page.week] %}
{% if version[1] == nil %}{% continue %}{% endif %}
<div class="section-header" id="{{ version[0] }}">
<h3>{{ version[0] }}</h3>
</div>
<div class="section-item">
<div class="content">
{% assign seconds = version[1].summary.seconds | times: 1.0 %}

<p>
We received surveys for a total of {{ version[1].summary.seconds | divided_by: 3600 | round: 2 }} hours of games played, over a total of {{ version[1].summary.ids }} games.
This is an average of {{ seconds | divided_by: version[1].summary.ids | divided_by: 3600 | round: 2 }} hours per game.
</p>

<table class="summary-table">
{% for summary in version[1] %}
{% if summary[0] == "summary" %}{% continue %}{% endif %}
<tr id="{{ version[0] }}-{{ summary[0] }}" class="setting">
<th colspan="3">
<a href="#{{ version[0] }}-{{ summary[0] }}">{{ summary[0] }}</a>
</th>
</tr>
{% for line in summary[1] %}
{% assign percentage = line[1] | divided_by: seconds | percentage %}
<tr>
<td style="width: 40px;"></td>
<td><pre>{{ line[0] }}</pre></td>
{% if percentage == "0.0" %}
<td style="text-align: right;">&lt;0.1%</td>
{% else %}
<td style="text-align: right;">{{ percentage }}%</td>
{% endif %}
</tr>
{% endfor %}
{% endfor %}
</table>
</div>
</div>
{% endfor %}
</div>
65 changes: 65 additions & 0 deletions _layouts/summary.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
layout: default
---

<div id="section-full">
<div class="section-header">
<h3>Survey Result Summary - {{ page.name }}</h3>
</div>
<div class="section-item">
<div class="content">
<p>
Below is the summary of the survey results from {{ page.start_date }} to {{ page.end_date }} for {{ page.version }}.
</p>

<p>
The following statistics are based on "seconds played".
That is to say, if a setting was "true" for 100 seconds of play-time and "false" for 200 seconds of play-time, it would be 33% true and 66% false.
This is to avoid biasing the results towards shorter games.
<br />
Worded differently, the following statistics are not counting how often something was used, but how long it was used for.
</p>

<p>
Be mindful that these numbers are only based on those people willing to send us survey results.
It might not be representative of the entire OpenTTD player base.
</p>

<p>
Entries listed as "(other)" are the collection of all values lower than 0.1% of the total.
</p>

{% assign versions = site.data.summaries[page.year][page.week] %}
{% assign version = versions[page.version] %}
{% assign seconds = version.summary.seconds | times: 1.0 %}

<p>
We received surveys for a total of <b>{{ version.summary.seconds | divided_by: 3600 | round: 2 }} hours</b> of games played, over a total of <b>{{ version.summary.ids }} games</b>.
This is an average of {{ seconds | divided_by: version.summary.ids | divided_by: 3600 | round: 2 }} hours per game.
</p>

<table class="summary-table">
{% for summary in version %}
{% if summary[0] == "summary" %}{% continue %}{% endif %}
<tr id="{{ summary[0] }}" class="setting">
<th colspan="3">
<a href="#{{ summary[0] }}">{{ summary[0] }}</a>
</th>
</tr>
{% for line in summary[1] %}
{% assign percentage = line[1] | divided_by: seconds | percentage %}
<tr>
<td style="width: 40px;"></td>
<td><pre>{{ line[0] }}</pre></td>
{% if percentage == "0.0" %}
<td style="text-align: right;">&lt;0.1%</td>
{% else %}
<td style="text-align: right;">{{ percentage }}%</td>
{% endif %}
</tr>
{% endfor %}
{% endfor %}
</table>
</div>
</div>
</div>
2 changes: 1 addition & 1 deletion _summaries/2024/wk01.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 01
active_nav: summaries
year: "2024"
week: wk01
week: "wk01"
start_date: "2024-01-01"
end_date: "2024-01-07"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk01/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 01 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk01"
version: "jgrpp-0.56.2"
start_date: "2024-01-01"
end_date: "2024-01-07"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk02.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 02
active_nav: summaries
year: "2024"
week: wk02
week: "wk02"
start_date: "2024-01-08"
end_date: "2024-01-14"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk02/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 02 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk02"
version: "jgrpp-0.56.2"
start_date: "2024-01-08"
end_date: "2024-01-14"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk03.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 03
active_nav: summaries
year: "2024"
week: wk03
week: "wk03"
start_date: "2024-01-15"
end_date: "2024-01-21"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk03/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 03 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk03"
version: "jgrpp-0.56.2"
start_date: "2024-01-15"
end_date: "2024-01-21"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk03/vanilla-master.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 03 - vanilla-master
active_nav: summaries
year: "2024"
week: "wk03"
version: "vanilla-master"
start_date: "2024-01-15"
end_date: "2024-01-21"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk04.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 04
active_nav: summaries
year: "2024"
week: wk04
week: "wk04"
start_date: "2024-01-22"
end_date: "2024-01-28"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk04/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 04 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk04"
version: "jgrpp-0.56.2"
start_date: "2024-01-22"
end_date: "2024-01-28"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk04/vanilla-master.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 04 - vanilla-master
active_nav: summaries
year: "2024"
week: "wk04"
version: "vanilla-master"
start_date: "2024-01-22"
end_date: "2024-01-28"
layout: "summary"
---
2 changes: 1 addition & 1 deletion _summaries/2024/wk05.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: 2024 - Week 05
active_nav: summaries
year: "2024"
week: wk05
week: "wk05"
start_date: "2024-01-29"
end_date: "2024-02-04"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk05/14.0-beta1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 05 - 14.0-beta1
active_nav: summaries
year: "2024"
week: "wk05"
version: "14.0-beta1"
start_date: "2024-01-29"
end_date: "2024-02-04"
layout: "summary"
---
10 changes: 10 additions & 0 deletions _summaries/2024/wk05/jgrpp-0.56.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: 2024 - Week 05 - jgrpp-0.56.2
active_nav: summaries
year: "2024"
week: "wk05"
version: "jgrpp-0.56.2"
start_date: "2024-01-29"
end_date: "2024-02-04"
layout: "summary"
---
Loading

0 comments on commit f1570f6

Please sign in to comment.