Help with understanding turns

Jul 19, 2020, 10:48 am
#1
Joined: Jul 13, 2020
Occupation: Hardware engineer
Location: Belgrade, Serbia
Interests: All
Posts: 14
Hi, I'm new here and this is my first attempt to solve something by changing/looking at the code.

My problem was that I had too much trouble raising some stats - I just made it to Oree level with 11 agility and 17 dex and just couldn't dodge enough critical strikes from the knights. I wanted to see the code and figure out what was I doing wrong so I could finally get more jumpy in the future runs.

I edited ivan sc to print out changes in experience, and what I found out is that every turn of moving I get the normal ammount of agility, and then lose just a little bit because I'm burdened or satiated... except I was gaining exp once per turn and losing it 10 times!. Then I traced the problem back a bit and figured out that my character actually exists around 10 times each turn(this varies a bit). This is the edit I did on char.cpp:989:
void character::Be()
{
  if (IsPlayer()) ADD_MESSAGE("Ping!");
  ...rest is unchanged
Ping! would print at least 10 times every time I moved. This is a problem because every time the character happens, it loses a bit of experience which is at the end of the game so high that just being burdened, without any other modifiers, makes you lose AGI when moving.
Is this a bug, or is it intended to happen this way? I guess this is the way characters attack multiple times in one turn, but it don't match the agility gain.
Jul 19, 2020, 12:25 pm
#2
Ex-Tyrant of the IVANers


Joined: Dec 8, 2007
Occupation: Junior Scientist
Location: Not California
Interests: Physics and Astronomy, Exoplanets, Singing praise to Valpurus while smashing skulls with a bloody warhammer, Jogging
Posts: 2,920
Hmm - I don't have an answer (perhaps one of our resident devs knows something?) but I suspect this has something to do with the way time is handled. However, just a glancing thought on this makes me think that this could result in "snowballing" agility training. If it takes several turns to move, and each turn costs you training points, then it's in your best interest to minimize the number of turns it takes to move - that is, to increase your agility. So having high agility results in having higher agility.

Other tangentially related comments - R'u'nning will generate more agility training than walking, and obviously you should avoid being burdened when trying to train agility. Additionally, each character is created with certain aptitudes which modify how quickly they gain training points in each attribute - a quick character will train agility and dexterity faster, but may (for example) train arm/leg strength more slowly. Also, I suspect but have no evidence that evading attacks generates agility training, so being in combat is good for your AGI. Although this also leads back to the problem I mentioned earlier, where high stats lead to higher stats.
"Put more stuff in the... thing where... more stuff goes in."
Jul 19, 2020, 2:30 pm
#3
Joined: Jul 13, 2020
Occupation: Hardware engineer
Location: Belgrade, Serbia
Interests: All
Posts: 14
You are right about snowballing but that's not really the problem if agility loss is tied to agility gain, so they happen at the same time. This way the worst thing could be that you are leveling faster than monsters around you.

Dodging trains agility. And perception too!
(I scaled exp. to show only progress towards next level which would happen at 1000 exp. in that attribute). If I understand the code right, I scaled experience down 25 times from how original game sees it. Agility is tied to limbs, so the message pops up once for each limb trained. Message log gets clogged very quickly so I only use this for debugging, but if you want(and trust me not to send a virus to you) you can download my build(.exe) here:
www.bsedev.net/ozone/ivan_vlad1.rar
I removed the pings, you can't see anything from the ammount of them.
I also removed hungry, satiated, and burdened attribute loss so if you want to see the bad thing happening go for more extreme states.
Jul 19, 2020, 2:36 pm
#4
Joined: Jul 13, 2020
Occupation: Hardware engineer
Location: Belgrade, Serbia
Interests: All
Posts: 14
Also, running in the wild at the beginning of the game gives you an enormous boost to agility, from now on I'm just gonna buy all the bananas from new attnam and do this at the start of every run. You can easily get to 15 AGI.
Jul 20, 2020, 1:42 am
#5
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 773
The game has ticks where it runs Be() for all entities. A creature can act on any tick where it has 1000+ Action Points, and with 10 DEX/AGI, that's every 10th tick. So there are 10 sub-turns per turn at the start of the game, but as your stat get higher, you will be able to act more often.

Getting negative experience for hunger/encumbrance is intended and balances out the gains from movement, combat etc. Unless you are constantly Strained and Overfed, you will slowly train AGI; if you want to train it faster, you have to be unencumbered and run around. But as Ischaldirh mentioned, each character gets a modifier that changes the amount of experience needed to level a stat, so some characters will slowly loose AGI if they are burdened, while others will get it quite fast anyway.

No snowballing happens, increased gains of exp are balanced out by diminishing returns at higher stats.

Yup, you can train AGI fast by running in wilderness. Not sure if that is completely intended, but it works.
Jul 20, 2020, 4:07 am
#6
Joined: Jul 13, 2020
Occupation: Hardware engineer
Location: Belgrade, Serbia
Interests: All
Posts: 14
Thanks for the reply. It seems that I understood propertly how character::Be() works, it's just that it seems to happen way more often later in the game, like 40 times every turn, which ruins agility. I will just continue studying the code until I figure out what is going on, because after rescuing the Aslona kiddo I am now actually losing agility rapidly even if just burdened, and gaining almost none while unburdened. My char is at 16 AGI. Aren't characters supposed to be able to go above 25 AGI even without ommel supplements?
Jul 20, 2020, 5:00 am
#7
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 773
Vladivarius wrote
I am now actually losing agility rapidly even if just burdened, and gaining almost none while unburdened. My char is at 16 AGI. Aren't characters supposed to be able to go above 25 AGI even without ommel supplements?

Don't you have leprosy, or some other deletrious status effect? Leprosy would make you loose stat exp quite fast.

Yeah, you should be able to train past 20, especially when eg. running and unencumbered.
Jul 20, 2020, 9:19 am
#8
Joined: Jul 13, 2020
Occupation: Hardware engineer
Location: Belgrade, Serbia
Interests: All
Posts: 14
No, I cleared myself of all negative effects. I have played the game for long enough that I know almost all the stuff you can find out on the wiki and by yourself, I don't think I'm doing anything wrong in the game. Besides, I have definitely narrowed the problem down to Hunger() being called a lot of times every turn, and the part where the game checks for burdened/hungry state.
Jul 24, 2020, 12:01 pm
#9
Joined: Jul 13, 2020
Occupation: Hardware engineer
Location: Belgrade, Serbia
Interests: All
Posts: 14
Ah I figured out what is going on. Walking doesn't improve AGI beyond 17, and running doesn't improve it beyond 22. On the other hand the attribute drain will be there the whole time. Should I write an explanation of how experience system works, for others to see? And where should I post it.
Jul 25, 2020, 1:52 am
#10
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 773
Sure, that would be great. You could add it on the wiki, there may already be some stub of an article about experience?
Jul 25, 2020, 1:10 pm
#11
Joined: Jul 13, 2020
Occupation: Hardware engineer
Location: Belgrade, Serbia
Interests: All
Posts: 14
Jul 25, 2020, 1:28 pm
#12
Joined: Jul 13, 2020
Occupation: Hardware engineer
Location: Belgrade, Serbia
Interests: All
Posts: 14
IMO a rebalance is required here, and I have many different suggestions ranging from minor fixes to complete overhaul. I will write them down for the community later but for now I believe that burdened state should at least take into consideration a small AGI gain from walking rather than completely ignoring it after 17AGI and just draining it. There should be a way to finish the game without using artificial limbs, and I was under the impression that it would be possible when I get better at playing the game.
Jul 25, 2020, 1:55 pm
#13
Joined: Apr 2, 2014
Occupation: Navastating
Location: Aslona
Posts: 773
There definitely were wins with natural limbs, you just never reach the insane stats of artificial limbs. I don't think the player was ever intended to be able to train their stats much higher than cca 30ish.
Jul 25, 2020, 6:00 pm
#14
Ex-Tyrant of the IVANers


Joined: Dec 8, 2007
Occupation: Junior Scientist
Location: Not California
Interests: Physics and Astronomy, Exoplanets, Singing praise to Valpurus while smashing skulls with a bloody warhammer, Jogging
Posts: 2,920
red_kangaroo wrote
There definitely were wins with natural limbs

Can confirm. My first (and so far only) win was with natural limbs. I can't find the original post, but it involved twin maces and lots of starvation.

Natural limb victories are absolutely possible. Tough, but possible.
"Put more stuff in the... thing where... more stuff goes in."
Jul 27, 2020, 8:50 am
#15
Joined: Dec 17, 2007
Occupation: Taking Names, Formerly Kicking Ass
Location: New Jersey
Posts: 992
I got a high priest victory with natural limbs in .50. killed petrus first then went for oree.
Booooooooooo!
Jul 31, 2020, 3:43 am
#16
Joined: Sep 8, 2010
Occupation: Petty Functionary
Location: Drinking pea soup in the world map
Interests: Mangoes
Posts: 1,216
Vladivarius wrote

This documentation is exceptionally well written, with concise explanations and clear examples.

Three areas of the game that are in real need of good explanations are:
1) the combat system
2) the weapons system
3) the danger system

If you can write the documentation for these, you will be rewarded with
Batman? wrote
its been so long since i had gotten that far i didnt think it through. arrrr!!!!!!
Jump to