Author Topic: Research Curve Formula  (Read 770 times)

UberWaffe

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Research Curve Formula
« on: January 09, 2015, 02:16:45 AM »
I'll start off by stating that I am not part of the Star Ruler 2 early access, so I can only speak from a Star Ruler 1 perspective. Nearly exclusively with the armory mod.

With that in mind, I mainly wish to refer to the research cost curve and level gain curve (i.e. how research cost changes based on level, and what impact it has on components based on level), and share what my modding attempts have revealed.

The default formula in Star Ruler is an exponential one (i.e. pow(gain, LEVEL)).
Pros:
  • Allows a nice start (little increase in cost and impact) until your a bit into the tree.
Cons:
  • Jumps in cost and impact become enormous once you pass the bend in the curve. This is even true when using small base numbers, the bend just happens later, but the overall shape is unchanged.

I personally disliked how that meant research both grinds to a near halt, and a single 'breakthrough' in research can suddenly mean a massive leap in technology.

So next I changed all research cost and tech gain formula to be a purely linear one (i.e. using the progress() function).
Pros:
  • Allows a nice steady increment in both impact and cost that doesn't turn to massive leaps at later levels.
Cons:
  • Small constants mean that research levels get researched at a ludicrous pace once large amounts of laboratories are available.
  • Large constants mess around badly with the start of the game (i.e. big leaps in cost between levels), when only small amounts of laboratories are available.
  • Rapid research of levels means you are constantly renovating and retrofitting.

At this point I figured I need an S-curve, as it allows the slow start curve of a exponential function, and avoids the big jumps at later levels.
(Refer to http://en.wikipedia.org/wiki/Generalised_logistic_function). I married this to a simple linear function (i.e. progress() with an offset on LEVEL) and thus got a nice S-curve that starts slow, flattens out later, (but thanks to the linear portion) ends in a nice steady increase.
(Refer to: http://postimg.org/image/4yt8ayo9t/)
I used (A = 0, K = 100, Q = 200, B = 0.1, M = 0, V = 1) as my Level_GAIN constants and (K = 100000, but otherwise the same) as my RES_COST_GAIN constants.
Then the linear function is = (LEVEL - Start_Level) * Gain_per_level (with start level = 50. I.e. about halfway through the S-curve.) This means that along with the use of a max(Linear_Val, 1) function, we can make the linear function only kick in later in, probably around the point that the S-curve start flattening off again.

I found that this formula works rather well, giving both a slow increase at game start, a decent late-game increase curve, and a slow but uncapped increase once you reach the end of the s-curve (around level 100).
Given the different values of K for the gain and research cost, it is very easy to make later levels be less return on investment. Allowing smaller empires to catch up (for the most part) in terms of impact, without the lead research empire losing their edge entirely.

And that's it.
I just wanted to share that so far an S-curve for cost and impact works the best for me.


EDIT:
Sidenote:
I haven't yet modded and tested this, but I feel that a research layout that separates improvement research (i.e. that makes existing stuff better) and unlock research (that unlocks new technologies and/or abilities) into different trees would be good.
(i.e. a super-laser does not unlock on energy weapons level 20, but rather you need to research into a research branch under which that is one of technologies. But to make the super-laser better, you invest into the recurring Energy Weapons research).
« Last Edit: January 09, 2015, 02:32:53 AM by UberWaffe »

dalolorn

  • Sentient
  • **
  • Posts: 199
  • Karma: +7/-0
  • ABEM Developer
    • View Profile
Re: Research Curve Formula
« Reply #1 on: January 10, 2015, 06:48:12 AM »
Eh, the SR2 research system moved away from levels some time ago. It's now a hex grid.