Too fast?

Discuss Chaos Strikes Back for Windows and Linux, an unofficial port of Chaos Strikes Back to PC by Paul Stevens, as well as CSBuild, an associated dungeon editor.

Moderator: Zyx

Forum rules
Please read the Forum rules and policies before posting.
Post Reply
FoxBat

Too fast?

Post by FoxBat »

CSB for Windows seems to be running kind of fast... the sounds are shorter and high-pitched, and not only can my party move at a very good clip but the monsters do as well. Is there a bug or something wrong, I thought this version was attempting to be authentic...

I have a 1.3 Ghz athlon (not overclocked) running Win2K if that makes a difference.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

Others have complained of this long ago. But I thought it had
been laid to rest. Maybe people gave up and decided to live
with it.

Here is what I always ask that people do:

1) Make the window small. Disable double size in Misc menu.
2) Note the time in the numbers listed to the right.
3) Play for one minute.
4) Note the time.
5) Subtract 2) from 4).

Perform the test twice....once while standing still and once while
moving back-and-forth rapidly.

The time is sixths of a second. So in one minute the time
should increment by 6 * 60 = 360. If it is significantly different
from that then report back with your results and the version
of CSBWin that you are using (See the Help menu).

There are three things to be aware of....

1) I am rather certain that in countries where the power is
50 Hertz CSB ran at five-sixths the speed it ran here in the USA.
It used the vertical retrace as a timer and made no allowance
for the power frequency.

2) Old versions of CSBWin were using the wrong sample frequency
for sounds. Fixed over a year ago.

3) Under normal circumstances (not overloaded and not wearing
Boots Of Speed) the party requires two ticks of the clock to
advance one square. The Atari code threw in an extra clock
tick (As best as I can tell) so that although the movement takes
two sixths of a second of game time it only takes one sixth of
a second of 'earth' time. So that if you move around rapidly the
game time can advance quite a bit more rapidly than it should.

I changed 2) in (I believe) version 8.2 of CSBWin. I have debated
whether to release it because it is very noticeable. You can feel
the delay when walking around the dungeon. I could make this
an option in the config.txt file so everyone could 'have it their way'.
But I hesitate to do that. Let us see if we can come to some sort
of consensus as to whether something is wrong and how best to
make it right.

The very best way to decide if it is wrong is to find someone using
60 hertz power, who has an Atari, and who can compare the
Atari with version 8.0 and version 8.2 of CSBWin to see which is
nearer to 'right'. Does such a person exist?

Next best is to dig into the Atari emulator and see how many
vertical retraces occur between party movements (or whatever
events you believe are too close together). This is perfectly
accurate but it is a LOT of work. And I ain't going to do a lot of
work until I exhaust the easier routes.

PAul
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

I have done some tests. These are very nearly worst case
tests.

I played an entire game using version 8.2 in 19 minutes 4 seconds.
On a 166MHz Pentium the 'earth' time was 19 minutes 24 seconds
for an error of 2.0 percent. On a 1.5 GHz Pentium IV the time was
18 minutes 39 seconds for an error of 4.1 percent. So at the very
least we can say it is not extremely CPU-speed sensitive.

Antman's record game using version 7.2 in 47 minutes and 40 seconds
took 38 minutes and 3 seconds on the 1.5 GHz Pentium IV for an
error of 20.2 percent. If you watch his game you will see that he
can really move around ye olde dungeon.

Twenty percent is not the end of the world but it certainly is
significant. Now it is my claim that the original Atari code would
have had the SAME error. But I have no evidence of this from
any measurements......only what I think the code does. And I
have been very wrong about the code on (shall we say?) more
than one occasion. Moveover, this section of code is the section
that has been reworked the most, for the obvious reason that I
cannot drive the Windows program with vertical retrace interrupts.
----Although what I have learned since could have made it better----

PAul
prsteven@facstaff.wisc.edu
FoxBat

Re: Too fast?

Post by FoxBat »

Well both standing still and moving the time comes close to 360.

Still it feels a bit too fast. The instant I do a punch it's ready again, I remember there being a short dealy. War cries I can do in under a second. Everything feels a little hyper.

US Atari STs 1040 and 512 is what I first played CSB on and it was alot slower than this. It feels almost (well not THAT fast) like how the PC version on a decent computer lets you zip around, except the monsters and spells do that as well. Yes, it does seem to me that monsters are zipping around a bit faster than the PC version!

I still have those Ataris lying around, take a bit of digging to find the CSB disk moreso than the Ataris... but they are US Ataris. Else they wouldn't run properly here would they :) Suppose I could download the CSB disks from here if I cant find em.

Maybe some people find the game more engaging when its hyper but I would like the option to get that slower DM atmosphere.

If you want I can do the Atari testing for you, but right now I think my problem is a bit worse than the descrepincies you are describing. Maybe its some win2k wierdness? Or maybe I enabled some 3D-card GUI acceleration thats messing with it?
FoxBat

Re: Too fast?

Post by FoxBat »

Hmm well I just D'Ld the PC version and I think its more me. The punch/kick/warcry seem to recover just as fast on the PC version. Guess you were tuning CSBwin more to that.

Personally I would prefer an option to play it slower. I do like feeling the delay, and I thought being able to zip everywhere in PC DM made the game too easy.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

Believe me.......If you are getting 6 ticks of the clock per second
then you are getting the same responses that everyone else
is getting. There is nothing !!!!!NOTHING!!!!! that is going
to make your punches faster than anyone elses. It takes a certain
number of clock ticks. PERIOD. No graphic card can change the
integer that we put into the timer entries. No operating system
is going to change the integer we put into the timer entries. We
put the integer into the entry and wait for that many ticks of the
clock. And those are the ticks that you see counting in the 'time'
field.

Now, of course, I could be wrong. (Bet you $1000 I am not.)
Notice that this is not a bet about the timing being correct....only
that things like video cards are not going to affect it.

I fired up WinSTon and loaded CSB. I resurrected Toadrot.
I was able to do 50 WARCRY in 53 seconds.
I was able to do 50 KICK in 60 seconds.
I don't know how long 50 punches took because I could not
count fast enough.

I fired up version 7.2 of CSBWin. I resurrected Toadrot.
I was able to do 50 WARCRY in 46.5 seconds.
I was able to do 50 KICK in 38.5 seconds.
PUNCH too fast to count.

So what is happening here? WinSTon could be CPU-bound.
Emulators are not especially efficient. I could be wrong about
the 1/6 th of a second. Maybe it was dividing the 60 hertz
by something other than 10. I will go study this a bit more.
Meanwhile, if you could get yoiur Atari to work and do some
timing tests then that would be definitive. I hope you can do it.

PAul
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

Another thought occurs to me. There are several places that
the Atari code adds an extra clock tick. And of course I did the
same in the hope of duplicating whatever effect it had.

Could it be that the extra clock tick was put there because
the designers discovered that drawing the 3-d viewport was
so CPU intensive (And it is CPU intensive) that a clock tick
was being missed? So the extra one was to compensate for
the missed one? If that is the case, then I should not add these
extra ticks because I already average the time over many ticks
of the clock and if one is missed I make up for it automatically
elsewhere. Hard to know.

Mr. (Ms. ???) FoxBat. If I make a temporary version without any
of those extra ticks would you like to try it?

PAul
User avatar
Antman
DMwiki contributor
Posts: 517
Joined: Fri Nov 14, 2003 9:05 am
Location: Lost in TOC

Re: Too fast?

Post by Antman »

I have to say that when I started playing CSBWin I found that the badguys attacks were way, way faster than the badguys on my amiga and my amiga emulator. It took me quite a while to get used to thier speedy attacks and munchers especially (they killed me the most). Also, I would like the fast option better, sometimes without the boots of speed I get horribly confused when I'm moving fast and smash into the walls because its not fast enough. You can see this repeatedly in my game before I get the boots.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

Hi there, Anthony,

The confusion and smashing into walls may be partly due to the
fact that I save up more keystrokes in the queue. I am not sure
that this is true. But it could explain the confusion. You smash
into walls because when you stop pressing the 'forward' key several
'forward' keys are still queued up.

If we slow the game down to be more like the original Atari (and that
still is an 'if') then perhaps I should look into shortening the queue.
Of course this would have the effect of maybe causing keystrokes to
be lost when casting spells and such. That would be confusing
and frustrating, too.

I hope FoxBat can do some real measurements. Otherwise I will
dig into the emulator (I have been there before) and discover what
the vertical traces are doing. It may not be as hard as I first thought.

The monsters in CSBWin obey the clock in exactly the same way
that the monsters in the Atari do. I know this for a fact because
I have run them side-by-side for many minutes and they behave
exactly **** EXACTLY**** the same. Thousands of movements
and dozens of attacks. What I don't know is how fast the Atari
clock goes with respect to 'earth' time. Several people have said it
runs more slowly than I thought.

PAul
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

I have identified three sources of error....all in 'your favor'.

1) I goofed. I had been tuning for 10 vertical retraces per
tick of the clock. It should have been 11. The famous 'greater'
versus 'greater-equal' problem.

2) The Atari CSB actually appears to require 12 vertical retraces
per tick of the clock. Don't know why yet. I do see that it takes
about 8 vertical retraces to draw the viewport. Remember that
the Atari ran at 8MHz and had to share memory with the video.

3) I am off by as much as 20 percent from my original goal of
360 ticks per minute. We suspect the extra clocks but are not
certain.

PAul
FoxBat

Re: Too fast?

Post by FoxBat »

Im having a little trouble getting my ST up and running. I found the ST, disk, and monitor, and was able to boot a few games. But I can't seem to find my mouse or the CSB disk. I was hoping I could somehow get at least some champions by wiggling the joystick like mad but I need the CSB disk for that. I've been trying to transfer the CSB image to a disk from the PC with Makedisk but I can't seem to do it. Anyone have experience with writing CSB image to an ST disk?

I dunno if you ever played it on a real atari, but adding extra ticks for the processor load makes sense. Unlike in CSBWin and the PC version, there is a noticable delay walking around the dungeon, even when you are just theron and dont have to worry about speed limitations.

Heck even the intro where the gates open, in the original its a very low "cluuuuunk, cluuuunk, cluuuunk, cluuunk cluuunk cluunk clunk" as the gates slowly move, and accelerate a bit near the end. But in CSBWin you just hear the usual higher-pitched "chink chink chink" of the doors in the actual game. You can see the same thing with WinUAE on the Amiga version. I suspect here that processor load or whatever really slowed down the opening doors and likewise the sound frequency. Now it would be damn purist to expect you to fix the doors ;) but I mean it as an example of how the slow processor is likely used partially for timing.

I think the same sort of issues apply to monster speed, weapon speed, and such. Actually I wonder if when FTL ported DM to the PC they left everything running "faster" on the decent processor except they slowed the monsters down somewhat closer to the originals "real-time" speed. Because the game is a hell of a lot easier on the PC. I barely struggled through the Atari ST DM with four characters, yet on the PC with just zed I blitzed down to 8 so fast with minimal resistance that I gave up out of boredom. You can just dance around the monsters in ways that you couldn't on the Atari.

Now this doesent seem to be an issue on CSBWin because all the monsters are moving fast too, probably harder having it all play so fast. But I'm trying to suggest that indeed there is quite a difference of speed between the Atari/Amiga versions on their own computers vs CSBWin or the PC DM, maybe all this "timing" was done by virtue of the slow processors. And if someone can help me out with the disk images maybe I can get some hard numbers for you. I can run the Amiga emulated version but I find that emulator actually feels slightly slower than the ST version! I tune the amiga speed just slow enough that I stop getting those pink artifacts between moving. But I think thats closer to the ST than CSBWin is. I could give you some war cry/second values from that if it is useful.
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

No...I would like to see a real 8MHz 60Hertz Atari if possible.

I have been putting trace code into the WinSton emulator.
My first impression is that the Atari code is very erratic. It
takes between 7 and 16 vertical retraces per clock tick.
I want to understand why before I do anything dramatic.

If my first impressions are correct then it may be that the best
we can do is to make the average come out right. I certainly
do not want to reduce CSBWin to an emulator.

PAul
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

Oh, my! It is worse than I imagined.

I added some traces to the WinSTon emulator. I gathered a party
of four and tried two tests.

1) Sit still and let the worms devour me. The results were not too terrible.
The clock ticked about every 11 retraces with an occasional number
as high as 16.

2) Go straight to the basement and kick two purple worms to death.
Terrible. During one period that should have taken 13 seconds it actually
took 23 seconds with an average of 18 vertical traces per tick of the
clock. One tick during this period required 47 retraces! That, my
friends, is a broken clock. What in the name of all that is holy could that
program have been doing for over three-fourths of a second? I am not
looking forward to the effort that will be required to find out. Oh, well....
It all pays the same.

PAul
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

It appears that the Atari program is very much compute-bound.
Especially the time required to draw the viewport. Much of the
time the clock has very little to do with the game speed. It goes as
fast as it can. Other evidence of this is the obvious effort that went
into making the graphics routines efficient of CPU cycles. It is the only
part of the program that seems to have gotten such attention and
was probably recognized as the performance bottleneck.

Therefore....Since I am not going to intentionally write a program
that goes slower or faster depending on the number of Worm Rounds
in sight, I have decided to try to make everyone happy by providing
a way to change the variables in the game that control the speed.

See the separate Forum thread if you would like to try this experimental
release. And be vocal about your concerns.

PAul
User avatar
Paul Stevens
CSBwin Guru
Posts: 4318
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Re: Too fast?

Post by Paul Stevens »

I put together a 286-based machine and turned off 'Turbo' mode.
Then I ran Dungeon Master PC. It is very slow. For example, when
you pick an item off the floor it takes a quarter-second or so and at
first I found myself clicking again, causing the item to be picked up and
then dropped. One does not 'run' down the hallways. If the Atari
ran anything like this then I can understand why you find CSB for
Windows so different.

PAul
Post Reply

Return to “Chaos Strikes Back for Windows & Linux (CSBWin) / CSBuild”