Glad to see the in-game graphs

For topics that do not fit in another sub-forum.

Moderator: Oberlus

Post Reply
Message
Author
User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Glad to see the in-game graphs

#1 Post by Dilvish »

Just wanted to mention, nice start with the graphs, Geoff!
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Glad to see the in-game graphs

#2 Post by Geoff the Medio »

Note that the statistics shown in the graphs are customizable: empire_statistics.txt.

The Statistic format has a name parameter, which is a string that is looked up in the stringtable, and then a value parameter, which is a ValueRef. The value is stored persistently in the universe (including in saved and loaded games), and is what's plotted each turn for each empire. The available values are listed in the graph directory in the pedia.

The most obvious / useful way to use the value expression is to calculate a statistic for empires, like a Count of objects or Sum of object properties (like meter values).

The way this works is that that a source object is selected for each empire, which is an object owned by that empire (usually its capital), and then the ValueRef is evaluating using that source object. This allows the expression to use Source.EmpireID to pick only objects relevant to the empire for which the statistic is being calculated.

However, due to how conditions work, there's no good way to use this to also get a graph for non-player stuff (ie. how many monsters exist in the universe).

If someone would like to implement a nice way to pick what axis values to mark with ticks (there's presently no scale shown) or a better automatic axis scaling method, that would be helpful. A legend showing which colour corresponds to which empire might be helpful, but it's already shown in the Empires window.

User avatar
Num7
Space Squid
Posts: 55
Joined: Thu Jul 04, 2013 12:48 am

Re: Glad to see the in-game graphs

#3 Post by Num7 »

I didn't know there are statistic graphs integrated in the game. Are they included in the current dev version?
If this post contains code, it's released under GPL 2.0 or later.

yandonman
Creative Contributor
Posts: 699
Joined: Thu Aug 30, 2012 12:32 am

Re: Glad to see the in-game graphs

#4 Post by yandonman »

Yup. Goto 'pedia, click on Graph, then choose which graph you want.
Code released under GPL 2.0. Content released under GPL 2.0 and Creative Commons Attribution-ShareAlike 3.0.

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Glad to see the in-game graphs

#5 Post by eleazar »

Cool

Graphs IMHO deserve their own icon among those in the upper right.
I already took the liberty of creating an icon button
icons/buttons/charts...

Hihoo
Space Kraken
Posts: 142
Joined: Wed Oct 23, 2013 8:50 am

Enhanced empire-statistics v6535 and up

#6 Post by Hihoo »

Created statistics-file containing some new graphs I find useful. Tested.
__________________________________________________________________
Attached patches are released under GPL 2.0 or later.
Attachments
empire_statistics.zip
(97.77 KiB) Downloaded 215 times

User avatar
MatGB
Creative Contributor
Posts: 3310
Joined: Fri Jun 28, 2013 11:45 pm

Re: Glad to see the in-game graphs

#7 Post by MatGB »

Planets, colonised planets and ships with weapons. I like, danke.
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Glad to see the in-game graphs

#8 Post by Dilvish »

FYI, there shouldn't currently be any distinction between the PopCenter graph and Planet graph -- all Planets are PopCenters (but in the future it could be possible to have other types of PopCenters). If you want nonzero pop you have to put constraints like Population low = 0.01
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Hihoo
Space Kraken
Posts: 142
Joined: Wed Oct 23, 2013 8:50 am

Re: Glad to see the in-game graphs

#9 Post by Hihoo »

So Gasgiants are Populationcenters - I'm perfectly happy with that!
May I assume "Productioncenter" is similarly just a synonym for "Planet"?

__________________________________________________________________
Attached patches are released under GPL 2.0 or later.


Including my replacements for v6557 (tested with gasgiant, should work with v6535)
(stringtables of v6535 break v6557 so v6535 is dead)
Attachments
empire_statistics-v6557.zip
(98.34 KiB) Downloaded 217 times

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Glad to see the in-game graphs

#10 Post by Geoff the Medio »

Hihoo wrote:May I assume "Productioncenter" is similarly just a synonym for "Planet"?
Presently, yes. In future, possibly no. I'd like the game to support production ships, both generating and spending PP (and RP or any other relevant resource), in order to have nomadic empires or scenarios.

shawndream
Space Kraken
Posts: 124
Joined: Fri Nov 22, 2013 8:47 pm

Re: Glad to see the in-game graphs

#11 Post by shawndream »

Geoff the Medio wrote:
Hihoo wrote:May I assume "Productioncenter" is similarly just a synonym for "Planet"?
Presently, yes. In future, possibly no. I'd like the game to support production ships, both generating and spending PP (and RP or any other relevant resource), in order to have nomadic empires or scenarios.
Oh yes! And be mobile repair/refit bases!
Everything I post is self-created unless noted otherwise. It is simultaneously released under GPL 2.0 or later, CC Attribution-Share Alike 3.0, and GNU Free Documentation 1.2. Make something awesome with it please!

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Glad to see the in-game graphs

#12 Post by Geoff the Medio »

Commited an edited version of the added statistics. You like to nest your And conditions unnecessarily it seems...
eleazar wrote:I already took the liberty of creating an icon button
icons/buttons/charts...
Could you make the graph button's border less prominent? It doesn't fit with the other buttons...

Edit: and I frequently want to click on it when meaning to close another screen, as the border makes it look like it's always highlighted...
Attachments
row of button icons
row of button icons
buttons.png (7.86 KiB) Viewed 3466 times

User avatar
eleazar
Design & Graphics Lead Emeritus
Posts: 3858
Joined: Sat Sep 23, 2006 7:09 pm
Location: USA — midwest

Re: Glad to see the in-game graphs

#13 Post by eleazar »

Geoff the Medio wrote:Commited an edited version of the added statistics. You like to nest your And conditions unnecessarily it seems...
eleazar wrote:I already took the liberty of creating an icon button
icons/buttons/charts...
Could you make the graph button's border less prominent? It doesn't fit with the other buttons....
It wasn't supposed to be that way. The transparent part got filled with white. Either i saved it in the wrong format the first time, or more likely somebody re-saved.

fixed revision 6956

Post Reply