TL;DR: Stats have stat experience which affects the stats of obtaining characters and level ups, Trunks's stats in the intro adds to his stats later in the game, and higher stat values are possible compared to what the TASes used.
Inspired by ASDQ's TAS, I've been researching the RNG and character stats of this game and have found many interesting and exciting results to share!
First as had already been shared by previous TASers, RNG in this game pulls from two different addresses: 3890 (4 bytes) and 3894 (4 bytes), and the formula for advancing RNG uses both values and then also updates both values. It can somewhat be thought of having 8 bytes worth of values for RNG, but I can't confirm if the stats use both of them, and it's also difficult to know if all 18.4 quintillion possibilities can naturally occur, or if the RNG would loop at some point, making some combinations impossible to reach. In any case, it's mega overkill for this game, but does make many potential results and research inconclusive until either the game is disassembled, the stat calculation is perfectly understood, or someone crazy brute forces all possibilities for every situation.
I wrote up a bit of Lua scripting to rapidly roll different character stats both when first obtaining the character and when leveling, and ran it thousands of times. Some of the results also came out better than what ASDQ was able to achieve, which I'll go into more below. RNG doesn't advance all that much during normal play, and often running around and bumping into objects helps move it forward. My method was to use the pause menu which advances RNG every frame. I would pause just as a blast is about to hit an enemy that would give me a level-up, and then test every frame that I could unpause on. I used similar methods for obtaining new characters.
It's worth noting that while there is a pop-up to show the increase to Strength, Power, and Endurance, HP and EP also are increased by random amounts, and also roll different values when first getting a character. These two can only be checked by manually going into the pause menu though. For an RTA run, good values for HP and EP are helpful, and for TASing, high EP values allow for extra blasts and longer Super Saiyan/Namek duration, making it valuable. I'm unsure if the previous TASers manipulated RNG to get good values for it, but there could be some potential time save with a better value.
Next, stat values also have fractional amounts and are not just the displayed amounts. For example, Gohan's Strength as shown on the character screen is at address 0EA7 (1 byte), and the fractional amount is at 0EA6 (1 byte), which ranges from 0 to 255. An alternative way of viewing it is like a stat experience value, as once it reaches 256, it goes back to 0 and increases the actual stat by 1. This is why it sometimes seems like no matter what you do, one stat only goes up by 1, or even sometimes 0, while other stats seem to be able to increase by 2. In fact, you can increase a stat by 3 with one level-up if the stat experience is close to 255, and you get a large increase to that stat after. These also vary when first obtaining a character. This means that when obtaining a new character, 20 strength and 20 strength or +1 Power and +1 Power for two different RNG rolls are not necessarily equal if the stat experience value is higher. Tracking these for every stat for every character would be very helpful for RNG manipulation for a TAS.
From what I can tell, capsules, hacking memory addresses where stats are, stat values in relation to other stat values, and other ideas have zero effect on how much you get on a level-up. My theory is that each level simply gives a random amount of stat experience to each stat, and once that amount goes over 255, it increases the corresponding stat by 1. How much of this is possible per level per character is a bit more difficult to test. I'm also curious if the way the game works when a new character is obtained is they are treated as a level 1 character and then instantly gained multiple levels to their starting level. Evidence for this is that all characters have very low stat values at the beginning of the game, that boost way up to what you normally see when obtaining the characters. For example, Piccolo's Strength when you boot up the game is 4, but when you first obtain him at level 10, it can vary from 11 to 18.
As an aside, when hacking the level experience values in memory, the level is instantly auto-adjusted based on the experience formula, but it has no effect on stats immediately or at level-up. If you were to take a level 50 character and set their level down to 20 for example, they would continue as normal as a level 20 character, just that they would have very high stats, but continue to gain them in a normal matter. Hacking stat values to be over 100 seems to function as if they were that high, but once you get a level-up, they are forced down to 100 and capped there.
Gohan at the beginning of the game at level 1 has no stat variance, including the stat experience. Going from level 1 to level 2 when defeating Frieza had the following ranges:
HP: 89-91 (increase of 4-6)
EP: 22-24 (increase of 2-4)
Strength: 4-5 (increase of 1-2)
Power: 6 (increase of 1)
Endurance: 6 (increase of 1)
However, the stat experience values all wildly ranged alongside these. In terms of the display values, it was possible to get everything maxed out, but even within different sets of those, there would be various stat experience values, so it's difficult to determine what is the absolute best possibility. As a test, I also hacked the Strength stat experience value to 255 and could get +3s when I would otherwise have got +2, which is supportive of these theories of how the game works.
For many other level-ups before I had learned about the stat experience mechanic, what's interesting is that there didn't seem to be patterns in individual stats, but I saw many patterns in the sums of the stats, sometimes alternating two different numbers for hundreds of rolls in a row, and other types. I'm not sure if this is a result of how the RNG formula ends up affecting the stat calculation, or if it was a coincidence due to the particular stat experience values, but I did see this for many level-ups, suggesting it's the stat calculation.
When already RNG manipulating to get critical hits, NPC actions, etc, specifically trying to get a good RNG roll for level-ups could cost more time than the extra stat increases would actually save, especially with the difficulty of even determining what the ideal roll would be. This creates a very wide open optimization problem for anyone who TASes this game in the future. TAS improvements would likely constantly be gaining and losing time in different areas, and it could be difficult to determine what the end result would be after some amount of optimization had already been achieved.
For Piccolo, these are the stat ranges when first obtaining him:
HP: 152-172
EP: 39-55
Strength: 11-18
Power: 12-19
Endurance: 12-19
TOTAL: 226-283
After over 16,000 rolls, the lowest and highest totals I obtained were 237 and 274, indicating that the limitations of the RNG and stat calculation formulas may mean most possibilities are not actually possible. I noticed this also with many level-ups of characters until I later realized the stat experience component. However, some of these Piccolos are still better than what the current TAS used. Some examples are 168/52/18/19/17 and 163/50/18/19/19. In particular with the second set, the Strength stat experience was high enough such that the next level-up could get +2 to 20, which ASDQ specifically said in his commentary he could not achieve and had to get 19, which is likely because his particular Piccolo with 18 Strength had low Strength stat experience and likely was just barely an 18. This is an excellent example of the importance of tracking stat experience.
For Vegeta, he is obtained immediately after a cutscene which doesn't allow for RNG manipulation within it. It takes significantly more time to check a different RNG roll, so my sample for Vegeta was much smaller, and it's possible that even better results are still possible. For a TAS to complete the game though, there are many NPCs roaming around just before the cutscene, allowing for ease of RNG manipulation, just that actually checking the result is very time-consuming.
HP: 272-310
EP: 64-81
Strength: 21-34
Power: 18-31
Endurance: 22-35
TOTAL: 397-491
Like Piccolo, the lowest and highest totals of actual rolls were 416 and 474. ASDQ mentions that he went for a Vegeta with 32 Strength and 30 Power, as higher Strength rolls generally had lower Power rolls. However, I found some very good Vegeta sets such as 287/78/34/31/34. Even with taking some extra frames to manipulate a good Vegeta stat roll, he's used quite a lot in the run and I think there would be a lot of time save.
For Trunks, the first important thing is that future Trunks in the opening of a new game has random stats as well, and the higher these are, the higher they will be when he becomes a playable character later in the game! RNG advances every frame before starting the game, so it's very easy to manipulate good rolls without losing too much time. Below are his stats in the beginning.
HP: 142-154
EP: 30-40
Strength: 11-15
Power: 6-10
Endurance: 7-11
TOTAL: 196-230
As with other characters, the lowest and highest totals of actual rolls were 203 and 224. The roll I went with was 150/37/15/10/11, and this is important to note because the rolls I obtained later in the game are dependent on these. I hadn't optimized for stat experience with this, so even higher stats may be possible when later obtaining Trunks.
For obtaining Trunks, his stats are rolled as the cutscene with Kami ends, which is thankfully quite a bit earlier than when you gain control again. Note that it usually takes 2 frames instead of 1 to calculate his stats, so make sure to adjust any Lua scripting to check accordingly.
HP: 502-582
EP: 90-111
Strength: 39-55
Power: 24-40
Endurance: 26-42
TOTAL: 681-830
The lowest and highest totals of actual rolls were 714 and 805. Trunks has highly varying stats, and he's important for fast runs, so good RNG manipulation is likely worth it even if you have to wait a number of frames. ASDQ's TAS had 52 Strength, and having 55 instead, especially as those extra points carry for the rest of the game, would likely save a lot of time. Other stats also don't necessarily need to be sacrificed, and it may also be helpful to have extra Power and EP. Some good sets I found are 543/108/55/40/27, 521/102/55/40/27, and 555/110/55/27/32.
For Goku, his stats are rolled when Dende activates the dragon. Manipulating these would be quite a bit harder to do, but they're also very important for a fast run after.
HP: 728-874
EP: 111-134
Strength: 38-65
Power: 40-67
Endurance: 32-58
TOTAL: 990-1144
The lowest and highest totals of actual rolls were 949 and 1198. ASDQ's TAS had found 65/49 Strength and Power, but used 63/65. The best set I found was 809/129/65/66/44, and there were a few more 65 Strengths with Power in the 60s, but I didn't find any 65/67 rolls. I wouldn't be surprised if some existed though, since it will likely be rare just by how much the stats vary in the first place.
---
I hope this information is found useful for TASing this game, or even just playing it normally! There's still a lot more to be discovered and optimized for anyone who is interested in this. For future data collection, I would recommend setting all of a character's values to 0, including the stat experience, and then measuring what's possible in terms of stat experience, instead of just the on-screen values. This would be far more precise is analyzing what's possible as it would also be impacting the stats that could be gained after level-ups after.