Author Topic: Implemented: Funding nations and activity scores  (Read 25735 times)

Offline smerch

  • Squaddie
  • *
  • Posts: 9
    • View Profile
Re: Implemented: Funding nations and activity scores
« Reply #30 on: December 04, 2012, 12:34:12 am »
Warboy1982, I have looked in to GraphState.cpp and find out that a bit of refactoring wont hurt as well as some tweaks. WDYT?

For example.
In original game the main formula to calculate scale factor for graph is (my guess)
Code: [Select]
scale_factor = ln(max(Val1, Val2, ..., ValN)/9)/ln(scale) where Val1...ValN is maximum value for each region/country/etc throughout a year, and scale is the first value on the scale of current graph, i.e. 50 for Income, 250 for Finance and 10 for rest. Pay attention, that these scale values ​​are the default values ​​that are used when no button is pressed. And also, scale factor is calculated only for currently visible values (whose buttons are pressed). So values on scale depends on scale factor and based on scale base (mentioned above).

So. Should I post a patch here or make a push request?

P.S. I'm not familiar with an english terminology, so if I screw it up somehow - I beg your pardon.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Implemented: Funding nations and activity scores
« Reply #31 on: December 04, 2012, 06:39:31 am »
DO IT

currently i'm iterating through all the countries/months and setting a "roof" value based on the highest value being DISPLAYED and basing the scale off that. an array of booleans keeps track of which are on and which are off.

i'm using the scale to represent the upward maximum rather than the first value to display, and dividing as i go down the scale (which for all intents and purposes is the same as multiplying the scale as i go up), then dividing the top end of the scale by the number of vertical pixels on the graph to figure out a "units" measurement (ie how many points = 1 pixel)

i think what i'm trying to say is that the METHODS are sound, i don't think you'd have to fiddle with the math.
The implementation probably sucks tho, there has to be a more efficient method than iteration,l and i could probably condense a lot of it down into smaller functions.

that said, if you can get it all working your way (stress WORKING) then i'd have no problem with it.

Offline smerch

  • Squaddie
  • *
  • Posts: 9
    • View Profile
Re: Implemented: Funding nations and activity scores
« Reply #32 on: December 07, 2012, 12:44:23 am »
OK. I'm on it. ASAP.
I have only one question left. May I change class GraphState in some way or should I stick to recent implementation (properties, methods, etc.)?
Be cause I don't want to break anything but in sake of refactoring some entities might gone.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Implemented: Funding nations and activity scores
« Reply #33 on: December 07, 2012, 01:30:24 am »
Quote
if you can get it all working your way (stress WORKING) then i'd have no problem with it.

note that i am making a few small changes to the current implementation in my bughunting branch, there are more to come (allowing for negative score values, for example), not sure if any of it will be of interest to you, but probably worth mentioning anyway.
basically i want this to be functionally identical to the original (as far as the player is concerned), how the back end is handled is of little consequence. just make sure to make it modifiable via the ruleset (ie adding a new country to the ruleset should add a new button)
« Last Edit: December 07, 2012, 01:37:20 am by Warboy1982 »

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Implemented: Funding nations and activity scores
« Reply #34 on: December 07, 2012, 10:08:59 am »
do you think it would be possible at all to mod the game in a way that the nation's funding can go to somebody else instead of the player?

what I mean is that especially in a modded game that supports factions, perhaps the countries can be "conquered", so the funding goes to the faction that currently has control over the country - or even partial funding by "influence"... I'm just wondering if something like that is possible at all with the current code, or completely impossible, or if perhaps it would become possible by including a few small things now that would make it easier later... if you catch my drift :)

Volutar

  • Guest
Re: Implemented: Funding nations and activity scores
« Reply #35 on: December 07, 2012, 11:50:18 am »
there is zero chance in current engine to have "faction" as beneficiaries except for xcom (player). it was about new country adding or modifying (changing set of) others.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: Implemented: Funding nations and activity scores
« Reply #36 on: December 09, 2012, 08:32:25 pm »
warboy, could you add a space between every three digits for the monthly funding change, to improve readability? in the end-of-month report as well as in the "funding" screen.
the actual funding is displayed as "x xxx xxx", but the funding change is displayed as "xxxxxx"

also, it would be even easier to read if the columns were aligned to the right :)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Implemented: Funding nations and activity scores
« Reply #37 on: December 09, 2012, 09:28:07 pm »
on it, thanks!  ;D