Saved Game Editor: Cracking the Code

Discuss all aspects of editing the data and databases in EHM here. Have a question about the EHM Editor, EHM Assistant, editing the .cfg files, hex editing the .dat or .db files? Want to tweak the EHM exe file to change league rules/structure, start date etc? This is the place!
Forum rules
This is the forum to discuss all aspects of editing the EHM data and tweaking the game.

Have a bug or feature request for the EHM Editor? Post them in the EHM Editor thread. Please start a new thread or post in another thread if you have a question about how to use the EHM Editor.

Given the large number of questions on similar topics, we ask that you start a new thread for a new question unless you can locate a similar question in an existing thread. This will hopefully ensure that similar questions do not get buried in large threads.

Useful links: EHM 1 Assistant (Download) | EHM 1 Editor (Download) | EHM 1 Editor Tutorials | Editing Rules & Structures Guide | Converting EHM 2004 / 2005 DBs to EHM 1 | Converting an EHM 2007 DB to EHM 1 | Extra_config.cfg | Import_config.cfg | Player Roles
Post Reply
Panfork
Prospect
Posts: 62
Joined: Thu Oct 08, 2009 9:35 pm

Saved Game Editor: Cracking the Code

Post by Panfork »

So, after it peaked my curiosity out of the blue this morning, I decided to be yet another person who took a stab at "cracking the code" to the SGE's weird number ranges that decide the final value for any given attribute in-game. I actually made progress with this, and compiled a fairly amount of data after extensive research.

About half of the attributes in the SGE, as we know, follow the basic 1-20 rating system. The other half, does not. People have previously speculated that there are different ranges for several of the remaining attributes that do not follow the 1-20 scale, and that age, CA, etc are a factor in how the scale works. I've come to realize, that the scale is not influenced by age, and is solely determined by CA; in addition to this, the scale follows a trend starting from 221 and 211 depending on the person's CA, up to 255, then overlaps back down to 0, up to 127. At 128 and up to the original value where the scale started, the attribute will be 1. This is true for all attributes that do not follow the 1-20 scale in the SGE.

I'm not so great at explaining things, so I've decided to just display some data in here for you all to look at yourself and understand what I mean. Below is a chart showing the SGE value ranges for each in-game attribute value from 1-20. I've compiled the ranges for CAs of 1, 50, 100, 150, and 200. We can thank Taylor Pyatt for being the guinea pig in this. :-p

Image

As you can see, The maximum value for all CAs, before reverting back to 1, is 127. From there, the attribute will be rated "1" until it hits between 222 and 212, depending on the CA. Then it will be rated '2" in game.

The interesting thing I have dragged from this, is that from where it breaks out of the 128 to 2## scale, and hits 2, it also, depending on the person's CA, will take a varied amount, to increase from there. For example, at 1 CA, it takes an increment of 10 to reach the next in-game value. So, at 222 it finally breaks out of "1," and hits "2." At 232 (+10), it hits "3." At 242, (+10 again), it hits "4," and so on. However, once it hits 255, and overlaps back to 0, the progression starts to take a static trend that is the same across all CAs: it will now take an increment of 8.33 to reach the next value.

So, the amount between each in-game value in the SGE slowly decreases the higher a player's CA is up until 255, then it will require the static value of 8.33 for each point up. I made a quick line-grape to represent the trend taken for this change:

Image

I haven't yet managed to work out an exact formula to represent the trend, but I will try to work on it after I take a break from this. If anybody wants to take some stabs, have at it. ;)
Last edited by Panfork on Wed Feb 06, 2013 8:36 pm, edited 1 time in total.
Panfork
Prospect
Posts: 62
Joined: Thu Oct 08, 2009 9:35 pm

Re: Saved Game Editor: CA/Attribute Research

Post by Panfork »

Two last notes.

1.
Once the SGE value overlaps back to 0, and starts taking the trend of an average of +8.33 for each in-game value change, it does it in the progressiong of +8, +8, +9, +8, +8, +9, and so on.

2.
Using 100 CA as a midpoint, the value needed for each in-game attribute change goes down by 1.66 from 100 to 200, and goes up by 1.66 from 100 to 50 (in half the CA), and then up by another 3.33 (roughly double the 1.66 change from 100>200 or 100>50) between 50 and 1... So the change needed is rather exponential, and thus, CA itself may be exponential in nature, not direct. If you take 3 players, one with 50 CA, one with 100 CA, one with 150 CA, it might be fact that the difference between the player with 100 CA and 50 CA is much greater than the player with 100 CA and 150 CA.


Sorry I'm a little rough at explaining things, my brain tends to encrypt information so only I can understand it. :roll:
User avatar
CeeBee
All-Star
Posts: 1140
Joined: Tue Dec 23, 2008 12:38 pm
Location: The old guy in Chase BC Canada

Re: Saved Game Editor: Cracking the Code

Post by CeeBee »

Very interesting.......confusing but interesting. :-D
ccmequip
Junior League
Posts: 48
Joined: Thu Sep 11, 2008 9:31 am

Re: Saved Game Editor: Cracking the Code

Post by ccmequip »

Excellent job!! I've checked this all out and it seems to work perfectly =D>

Thanks a bunch!
NingDynasty
Junior League
Posts: 27
Joined: Wed Feb 08, 2012 10:36 pm

Re: Saved Game Editor: Cracking the Code

Post by NingDynasty »

Part of the numbers for the 1 CA player were incorrect but your formulas are pretty good. Unfortunately there isn't a pattern as to where the 8.333 (8,8,9,8,8,9,ect) starts, however the averages give me enough info the be within 1 on the 256 scale for the upper ranges. I've figure out also that 121.415 - (CA*.415) is where 20 starts so from 20 to wherever the 0 starts is adjustable at the moment. Wherever the 0 falls seems to be either the average between the 8.3 and the early value average or the early value average if it ends on the 0. Should be able to rough out the rest tonight/tomorrow.

However with that being said, because of the averages not having a pattern, extracting the exact values from the saved game will be close but +/- 1 depending on if the attribute falls on the upper, middle or lower end of the range. Creating/changing attributes will be easy though since we have a 3(200CA)-10(1CA) point range for each attribute just stick it in the middle and it will spit out the right number.
NingDynasty
Junior League
Posts: 27
Joined: Wed Feb 08, 2012 10:36 pm

Re: Saved Game Editor: Cracking the Code

Post by NingDynasty »

Alright so no luck on finding a determinable pattern but I've finished the formulas that'll convert a 1-20 attribute into a 0-255 attribute. I'm working on a C++ Proof Of Concept for you to try out as well as a function that can be included in C++ scripts. All you'll have to send is the CA and the 1-20 attribute you want and it'll convert it into the 0-255 format.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: Saved Game Editor: Cracking the Code

Post by archibalduk »

Nice work! =D>

If it helps, tomorrow I can run-off a spreadsheet showing the minimum and maximum attribute ratings for every CA from 1 - 200.

Something that might have a bearing on figuring out a relationship is that the attributes in staff.dat are chars (-128 to 127) whereas the Saved Game Editor and the spreadsheet created by Panfork is based on unsigned chars (0 to 255). So Panfork's calculations are based on how unsigned chars behave which might be why a clear-cut formula might not be possible (whereas perhaps it is clearer when using the unsigned char range) - and this is where generating a spreadsheet might help.
NingDynasty
Junior League
Posts: 27
Joined: Wed Feb 08, 2012 10:36 pm

Re: Saved Game Editor: Cracking the Code

Post by NingDynasty »

Those should be the same in theory but it would be interesting to see the data both ways. It would take one hell of an array and switch system but with the data you pull we could make the conversions exact it would just be a much larger/slower function as I just cant seem to find any patterns.
User avatar
archibalduk
TBL Admin Team
Posts: 20372
Joined: Tue Jul 06, 2004 8:44 pm
Custom Rank: Seaside + Fruit Juice Mode
Favourite Team: Guildford (EPL) / Invicta (NIHL)
Location: United Kingdom
Contact:

Re: Saved Game Editor: Cracking the Code

Post by archibalduk »

NingDynasty wrote:Those should be the same in theory but it would be interesting to see the data both ways. It would take one hell of an array and switch system but with the data you pull we could make the conversions exact it would just be a much larger/slower function as I just cant seem to find any patterns.
Yeah it's less than ideal, but it'll do the job I guess!! :D

A multi-dimensional array/vector is probably the way to go. If we use a binary search with it, it'll speed up the conversion process somewhat.
Panfork
Prospect
Posts: 62
Joined: Thu Oct 08, 2009 9:35 pm

Re: Saved Game Editor: Cracking the Code

Post by Panfork »

So I decided to revisit this after several years, and I've come up with some general theories behind these numbers.

1) There's no "function" to be drawn from this, and unfortunately the only way to really get accurate readings is to individualize it and get every point from 1 to 200 to test each output.

2) I actually think the values do not change across the player's entire career. I think CA is the only governing factor. A player with 1 CA and a "30" in his Wristshot skill -- 9 being the resulting in-game value-- will always have that 30. However, once his CA reaches 100, a "30" will be a 14, and if he reaches 200, a "30' will be a 19. Practice may affect these numbers slightly, but I think the values generally do not stray outside a certain range for the complete extent of his career. This may also be why most mental and physical attributes don't use the same system in the SGE. They naturally change and decay and don't follow CA as the governing factor.

3) If we can dissect this, it's very possible that when editting the attributes for up-and-coming prospects, we can actually "plan out" a player's development to ensure specific skills hit a specific number at the end of his development.


However, dissecting this would take quite a bit of frustrating time spent. Lots of closing out of EHM and reloading it to record each +1 to that 0-255 range.

Anyway, just wanted to drop that bit of information in this thread just in case someone decides to make use of it. ;)
Post Reply