(fixed) mana regen too steady?!

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

(fixed) mana regen too steady?!

Post by zoom »

I found that the mana regeneration (mana regen) rates
are too gradual. (version 27)There is no pause, and no boost of
mana regain while sleeping as opposed to the original.
Can this be? I would like to hear some comments on this one,
because I think it is an issue.
while it is going on your nerves to wait for the mana to
replenish(come on,hurry up, mach hinne) I am missing the
mana regen and then the stop. It kind of puts a bit of a thrill
to the game and without it it is a bit boring to sleep and
watch the bar fill steadily up in equal portions.
User avatar
zoom
Grand Master
Posts: 1819
Joined: Tue Sep 23, 2003 1:27 am
Location: far away but close enough

Post by zoom »

for how it worked in odm:

http://www.dungeon-master.com/forum/vie ... ght=wisdom

beo posted some interesting stuff there about stamina,
mana total and mana regen..

form another thread:
(someone called shanderra or so posted:)

Oh...k..seems people don't know. If your mana is 40, it goes up in increments of 3 during sleep, at 80 it goes up in increments of 5, 120 it goes up in increments of 7, 160 it goes up in increments of 9, 200 it goes up in increments of 11 and so on. I don't know how this applies to health and stamina but it does for mana...hence some characters suddenly regaining mana quickly than others after levels.

(beo)
Without sleep, just walking around, you gain 2 mana at 40, and add another point per 20 mana after that I believe (damn that missing '0' in my last post). Obviously wisdom still determines how fast you gain these points. I didn't realise, when sleeping, you go up faster with 3 rather than 2 mana!
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Short answer:
I went digging through the CSBwin code, found where I went wrong, and I fixed this. :)

Long answer:
I still don't do things exactly the way DM did, but to the end user, you'd never know the difference.
DM used a lot of strange math to, based on the game clock, generate a sequence (in a rather strange order) of every multiple of 16 between 0 and 144 to use as a base pseudo-random value for timing regeneration. DSB iterates from 0 to 128, then from 16 to 144, by steps of 32 each time. This causes a slightly different order, but the same values, and the code is a lot nicer.
When sleeping, DSB will now cycle through this list four times as fast. This is not the same as DM, where the same value will be generated four times in a row. I reduce the step size to 16, in order to stay around the same values for more time, and this looks closer to DM, but it is still fundamentally different. However, over one complete cycle, all values will be generated the same number of times by both DM and DSB, so users will rarely notice any difference.
The stat bars do their DM-ish "stop and start" motion now, for example. ;)
Post Reply