... and another real-time based problem

General discussion about the game. Pull up a stool and tell us your tale!
Post Reply
PowerWyrm
Balrog
Posts: 1574
Joined: Sun 27.11.2005, 15:57

... and another real-time based problem

Post by PowerWyrm » Mon 06.04.2009, 11:48

At high level, I tend to rely too much on the character symbol (@, 6, 5...) to check my characters health and react accordingly. In most cases it's ok, but in the most difficult fights it's not enough. I've already had high level characters die because the monster wiped a high amount of HPs in two consecutive turns (like Morgoth's mana storms or Ungoliant's darkness storms), and I didn't have enough time to react before the second HP loss.

The problem is as follows:

server timeline
-----|------------------------------|------------------------------------|------------------------------------|---------------------------|----->
beginning...........players actions processed......monsters actions processed.......player status bar refreshed.....end of turn
of turn


...keypress............................................................................................................client status bar refreshed
-------|-------------------------------------------------------------------------------------------------------------------------------|-------->
client timeline

In most cases, the time to react to any event happening to a player (like a heavy injury) is really small compared to the duration of a turn. In some cases (lag), the client could be refreshed after the next turn has started on the server, leading to the "character is dead, but I don't know it yet so I press keys in vain" effect.
Nothing can be done about lag... but would it be possible to increase the time between status refresh at end of turn and events processed at beginning of next turn? I need to check the "bullet time" feature to see if it's helping...

Ace
Crystal Ooze
Posts: 368
Joined: Fri 15.02.2008, 12:50

Re: ... and another real-time based problem

Post by Ace » Mon 06.04.2009, 12:03

Maybe this is just a balance issue.

Possible ways out
a) make those uber-monsters slower
b) limit the max. dam of these attacks
c) code it so they cannot do the most dangerous attack twice in a row

Emulord
King Vampire
Posts: 252
Joined: Mon 30.04.2007, 20:19
Location: UIUC

Re: ... and another real-time based problem

Post by Emulord » Mon 06.04.2009, 16:21

Or make time pass more slower deeper in the dungeon. Ive noticed at high levels, I cant react fast enough to not waste time running, and if you're resting at the bottom, you're foolish. Time passes too fast at the bottom.

schroeder
Giant Mottled Ant Lion
Posts: 204
Joined: Sat 14.06.2008, 04:23
Location: Somewhere in Illinois in the USA

Re: ... and another real-time based problem

Post by schroeder » Mon 06.04.2009, 17:16

But all that is just masking the problem. In an ideal world, you should always know your status by looking at the screen. I love mangband partly cus I know exactly what is going on, but i must admit that I do NOT know what happening sometimes when everything starts to go down at once, since things don't refresh enough. Masking the problem with bullet time, or just slowing it down more at greater depths just slows it down more so that it will refresh more. Creating a solution without slowing down gameflow would great. Its all about decreasing lag time between pressing a button and not dieing! No idea how this would get done, but yeah.
Anything worth being done, is worth being overdone.
My Mangband videos; http://www.youtube.com/user/Schroederband

Billsey
King Vampire
Posts: 272
Joined: Sun 12.02.2006, 14:36
Location: Oregon, USA
Contact:

Re: ... and another real-time based problem

Post by Billsey » Tue 07.04.2009, 02:40

It sounds like what you're asking for is two refreshes per player turn. One right away to refresh the player info based on what the player did (between 'players actions processed' and 'monsters actions processed'), then a second to reflect what the monsters did (that matches the current refresh). I'm not sure that that would really fix the problem, since the player info is liable to change (potentially radically) when the monsters do their thing. It would certainly double the bandwidth needed to 'feed' a client, which although it wouldn't affect stuff right now too badly, would certainly start to be a problem if we ever got a really busy server.

An overall solution (and also one that's not liable to happen) would be to run each player in their own thread, and the monsters in their own thread. This would allow a refresh of the player each time a player turn has passed, and monster effects at the first player turn after the monster does his thing.

Another path to take would be to optimize the monster processing. Things are fairly fast right now, but only because we're running on reasonably fast computers.

Anyone have suggestions on how best to implement any of these ideas? Or ideas that sound better? :-)
Mangband Project Team Member

Post Reply