Looking into the 5150-sample data set, it turns out that the stat increases work somewhat differently than what I had stated. It's
not simply that each stat has a uniform chance of increasing at each level-up. Instead, for the fighter:
* At level 2, 7, and 12, int will definitely increase (up to 20).
* At level 3, 8, and 13, dex will definitely increase (up to 20).
* At level 4, 9, and 14, str will definitely increase (up to 20).
* At level 5, 10, and 15, pie will definitely increase (up to 20).
* At level 6 and 11, vit will definitely increase (up to 20).
Basically, one of the stats is guaranteed to increase at each level. Then at the "off-levels" (where the increase isn't guaranteed), from the data it looks like the probability is pretty uniform (relative to the current stat just before leveling and the current level, anyway); it looks like:
* Str will increase 30.25% of the time (basically, 30%).
* Int will increase 10.12% of the time (basically, 10%).
* Pie will increase 9.88% of the time (basically, 10%).
* Dex will increase 9.84% of the time (basically, 10%).
* Vit will increase 44.68% of the time (basically, 45%).
From preliminary data, it seems like this is true of the other classes as well; for the priest, it looks like:
* Str will always increase at levels 2, 7, and 12, and 9.88% (basically, 10%) at other levels, up to 20.
* Int will always increase at levels 5, 10, and 15, and 10.10% (basically, 10%) at other levels, up to 20.
* Pie will always increase at levels 3, 8, and 13, and 29.85% (basically, 30%) at other levels, up to 20.
* Dex will always increase at levels 6 and 11, and 9.53% (basically, 10%) at other levels, up to 20.
* Vit will always increase at levels 4, 9, and 14, and 46.42% (basically, 45%) at other levels, up to 20.
For the priest, I have 304 samples of Monk level-ups (from level 1 to 15), 500 samples of Bishop level-ups, and 364 samples of Prophet level-ups. I don't see a difference in the chance of stat increases between them, nor in the HP gains. However, the encumbrance gain for Monk is 2*str, for Bishop is 2*str - 1, and for Prophet is 2*str - 2. Thus, as far as I can tell, it's best to aim for Monk.
For encumbrance, the order of specializations in the code is this:
Berserk, Warrior, Guard, Champion, Guardian, Protector, Monk, Bishop, Prophet, Conjurer, Sorcerer, Enchanter
Extrapolating from current data, it seems like the encumbrance for Berserk is 2*str + 6, for Warrior is 2*str + 5, etc. down the line until you get to 2*str - 5 for Enchanter. There's a minimum of a 9 encumbrance gain. So far, the specialization doesn't seem to affect anything else (stat gains, HP gains, etc.). This means that when generating your party, you should go for Berserk, Champion, Monk, and Conjurer. Of course, which one you get is random (it doesn't depend on the questions), so there's only a 1 in 3^4=81 chance of getting this. The difference between the best and worst specializations in terms of encumbrance is 28 at level 15, since it's a difference of 2 per level.
As a side note, since I'm collecting this data by modifying a save game, it's always possible that this stuff is encoded somewhere in the save game and it'll be different for each game, although I doubt this. At any rate, let me know if you observe something different, such as not getting a guaranteed stat increase at a level or different max encumbrance increases than what I've listed here.
Do you think it is possible that Vitality is used to reduce physical damage taken or effects the chance to avoid certain effects like poison?
Well, currently, anything is possible. In some games, dexterity is used to reduce your chance of getting hit (such as AD&D, via AC), while others, it's used to directly decrease the damage you take by a percentage (such as Yendorian and online MUDs). It's possible that vitality has a similar function in this game. I certainly hope it does something important. Right now though it's kind of just speculation, but if vitality doesn't affect your max HP, then I would expect it to affect something in combat.
Your dissection of the game is pretty impressive. Once you're done, I'll be happy to link your posts to Martin Buis (unless he's lurking this thread already - you never know!). Who knows, he might be interested in this, or maybe even have some comments.
Thanks, I like digging into games and looking at how they work. I tend to favor older games (previously dug into Space Rogue, Curse of the Azure Bonds, Master of Orion, and others) since they're more accessible than the newer games, and also because I think older games have better gameplay while newer games just try to cover up the gameplay with fancy graphics.
I don't know if I'll ever be "done" though, more like just focusing more and more deeply on what looks to be accessible. For example, I don't know if I'll ever figure out the actual combat equations, since I'd have to collect a lot of data to work them out.
Admittedly I don't know what Martin Buis's level of interest would be for this game nowadays. Some game creators don't like people digging into their files, while others are open to it for nostalgic reasons. Certainly I expect he knows the actual formulas (or knows how to get them, or has the source code), but it's all a matter of whether or not he'd be willing to release it or discuss it.
Also, I think in this game the creators were going for something different than most RPGs. Usually by making the formulas explicit, number-crunching is more straightforward but then players may end up focusing on the numbers while game creators are trying to tell a story. (I see games as simply interactive stories, like movies if you will except that you are engaged in order to advance the plot.) In other words players start focusing on whether a long sword +3 or a broadsword +2 is better statistically, rather than how the item fits into the story or which item their character would more realistically use.
It seems to me like in this game, the creators were making the numbers "under the hood" and not something to focus on, and hence this would be part of why in the late game, it comes down to whether or not the player is able to solve the puzzles, rather than (for example) whether or not the player "built" the characters correctly etc. The numbers more or less only help in the early- and mid-game while the player is stills struggling to "make it". Now certainly knowing the numbers is something that number-crunchers like me go for, but I can understand if the game creators preferred that players focused instead on playing the game, and thus don't encourage wading into the numbers.