Forum:CPs and DOM Inspection

From Fallen London Wiki
Forums: Index > Archived topics > CPs and DOM Inspection


So I've been doing some poking around when trying to work out challenge point (CP) gains, and thought it was worth sharing my discoveries.

Generally I keep a document with the level and current points of various qualities e.g. Making Waves 28.10 = level 28 plus 10 CPs. When I gain a number of points it's easy enough to calculate the gain by looking at the previous level and the new level. This does require one to keep a record of the old levels, which is somewhat painful. But when an unknown gain hits a level boundary, there's no way to tell what the new level is - I have to mark it as, e.g., Making Waves 29.?, until the level changes by a known amount. If another unknown change occurs I won't be able to work out either amount.

Or so I thought...

It turns out that you can inspect the progress bar element in Chrome or Firefox (right-click and select Inspect Element). This brings up the DOM inspector, in which you'll see something like the following:

<img onload="$(this).animate({width: '83%'},1000);" class="progressBarFill" style="float: left; width: 83%; display: block;" alt="Progress"
src="//s3.amazonaws.com/images.echobazaar.failbettergames.com/you/rank.png" height="12" width="0%">

The relevant bits here are width="0%", which indicates the bar starting position, and the matching end width in either the onload or style attributes, which here is 83%. Since I know this occurred at level 5, it's easy enough to work out that the start position was at 0 CPs, and the end position was 5 CPs (83% of level 6), which gives a gain of 5 CPs.

The second discovery is that this still works when the gain hits a level boundary, but it's a little bit weird, and requires that we know the starting point. Let me concoct another example:

<img onload="$(this).animate({width: '100%'},1000);" class="progressBarFill" style="float: left; width: 100%; display: block;" alt="Progress"
src="//s3.amazonaws.com/images.echobazaar.failbettergames.com/you/rank.png" height="12" width="50%">

If this occurred at level 5, then the apparent rise is from 5.3 (50%) to 6.0, a gain of 3 CPs plus some other number of points above level 6. Except I know that this quality was actually at 5.5 beforehand, so the 50% part appears to makes no sense. The surprise is that this indicates that the gain is actually 3 CPs - the game engine has deducted this amount from the end width to work out the start width. If we add this to our known quality level, we can work out that we're now at 6.2.

I haven't yet looked at how this works when the number of CPs takes one across more than one level - it seems unlikely that the widths will be either less than zero or above 100%.
Edit: I was wrong: just saw

<img onload="$(this).animate({width: '100%'},1000);" class="progressBarFill" height="12"
width="-40%" style="float: left; width: 100%; display: block;" ... >

when increasing from 4.0 to 5.?. This would seem to indicate a gain of 7 CPs (meaning quality is now at 5.2).

In summary, CP gain equals (end width - start width)/100 * higher quality level.

Hopefully this makes sense and is useful to someone else!

Jemann (talk) 10:47, March 16, 2015 (UTC)


interesting findings, i never thought of that! we can find out a lot of missing cp changes from this method. let me state my findings:

L is the higher of the displayed levels, the one to the right K [||||||||||||            ] L

W is the starting width, shown in the 'width="x"' tag (in percent)

C is the changed width, displayed in the 'width=y' tag and the animate function (in percent)

  • changes within a level (gains or losses) are very easily calculated [like you showed] CP = (C-W)xL
  • changes that increase the level will result in C=100% and shift W so that the previous equation remains true CP = (100%-W)xL if we gain a single level, W <= 0. for several levels, W will be negative. [both like you showed] for example jumping from 0|0 to 3|0 (1+2+3=6 CP) will look like this 0 [|||||||||||||||||||] 3. C = 100%, W = -100%, 6 CP = (100%-(-100%))x3

we can do a lot of research on rare/elusive things like connected: masters, schemes, making waves or unique story actions now. take schemes for example, up to level 14 at least every other investing favours will gain you a level and mask the actual gain (... 10|? > 10|9 > 11|? > 11|8 > 12|? > 12|9 ...). but now when the mid level cps show up we can check the bar and see where it started to determine the exact gain from the previous action (10|? > 10|9 [inspect] 36% to 82% -> 5 CP). or we can check the progress bar after the level up action and deduce from there (9|? > 10|? [inspect] 50% to 100% -> 5 CP).

note: we can not yet be sure how all of these numbers work when we look at crossing levels downward and gaining any amount of levels where we need less cp than the displayed level (skills above 70 and stuff). i achieved dangerous 147 with Spar with a Black Ribbon Duellist and it showed W at 99%. i incidently also lost level 67 of connected: tomb-colonies and it showed W at -92%. both values make no sense yet. a lot of science needs yet to be done here! --mfive (talk) 22:15, April 9, 2015 (UTC)