Page 1 of 2

KO2CV - 0.90

Posted: Thu Nov 16, 2006 1:04 am
by Steve Camber
Features

8 tactics mode temporarily removed for this release to allow PM tactics to be used.

75% speed added. 25% speed removed.

Due to the nature of how the speed is controlled, 75% speed can look a bit jerky.

Here's what the CPU decides to do every 1/50th of a second in the 3 modes
100% = DRAW DRAW DRAW DRAW DRAW DRAW DRAW DRAW etc
75% = DRAW DRAW DRAW Pause DRAW DRAW DRAW Pause etc
50% = DRAW Pause DRAW Pause DRAW Pause etc

So therefore 75% does not look as smooth as 100% or 50%. See? Good!

The system I have implemented allows for the speed to be changed anywhere from 1% to 100%.. Not over 100% unfortunately ;) Only these 3 speeds are currently available, but if someone feels their life will be incomplete without a 29% speed, then this is simple to do.

Download

http://www.camber.demon.co.uk/KO2CV

Posted: Thu Nov 16, 2006 2:34 am
by filippodb
what a pity, 75% is very bad!! :(

can you change the frame time from 1/50 to 1/33?? :D

or is 66% better??

66% = DRAW DRAW Pause DRAW DRAW Pause DRAW DRAW Pause etc

Posted: Thu Nov 16, 2006 3:34 am
by Steve Camber
66% looks quite similar to 75%.. just a bit slower!

Re: KO2CV - 0.90

Posted: Thu Nov 16, 2006 8:28 am
by Abyss
Steve Camber wrote:
8 tactics mode temporarily removed for this release to allow PM tactics to be used.



Bad bad bad

Let Robert play with his Oracle disk. Bring back the 8 tactics!

Steve Camber wrote:The system I have implemented allows for the speed to be changed anywhere from 1% to 100%.. Not over 100% unfortunately ;) Only these 3 speeds are currently available, but if someone feels their life will be incomplete without a 29% speed, then this is simple to do.


Shouldn't this be anywhere from 2% to 100% in steps of 2%?

Re: KO2CV - 0.90

Posted: Thu Nov 16, 2006 9:47 am
by Steve Camber
Abyss wrote:Let Robert play with his Oracle disk. Bring back the 8 tactics!

8 tactics are back in v0.91.

Abyss wrote:Shouldn't this be anywhere from 2% to 100% in steps of 2%?

No. :P

Re: KO2CV - 0.90

Posted: Thu Nov 16, 2006 9:59 am
by Abyss
Steve Camber wrote:
Abyss wrote:Let Robert play with his Oracle disk. Bring back the 8 tactics!

8 tactics are back in v0.91.

Abyss wrote:Shouldn't this be anywhere from 2% to 100% in steps of 2%?

No. :P


:?: Does this mean that the game logic is updated at a higher rate than the screen?

Posted: Thu Nov 16, 2006 10:11 am
by Steve Camber
Imagine drawing a frame, then waiting for 99 frames, that's your 1% speed.

Imagine drawing 99 frames, then waiting for a frame, that's 99% speed.

Game logic is updated once per render.. any faster and the game crashes, or frames would be dropped at least.

Posted: Thu Nov 16, 2006 10:55 am
by Abyss
Steve Camber wrote:Imagine drawing a frame, then waiting for 99 frames, that's your 1% speed.

Imagine drawing 99 frames, then waiting for a frame, that's 99% speed.

Game logic is updated once per render.. any faster and the game crashes, or frames would be dropped at least.


Therefore, and since the Amiga screen update is fixed at 50Hz for PAL systems, I think that screen updates can only be done 50 times per second, therefore skipping one results in 98% speed, not 99%.

Posted: Thu Nov 16, 2006 11:12 am
by Steve Camber
Yes, the VBL clock runs at 50Hz.

So at 1% speed, the amiga just counts up 50 frames in the 1st second. In the next second the amiga just counts up 49 frames. Then for the final frame of the 2nd second it goes through the logic loop and draw the players in their new positions.

At 99% speed, in the 1st second the amiga does 50 logic+renders. In the next second it does 49 logic+renders, followed by 1 wait where it does nothing.

Does that make sense?

Posted: Thu Nov 16, 2006 11:24 am
by Abyss
So you spread the drawing over two seconds?

Posted: Thu Nov 16, 2006 11:41 am
by Bounty Bob
It's the logical way to split it into single percentages. Two seconds=100 frames.

Posted: Thu Nov 16, 2006 11:58 am
by Steve Camber
Here's the offending code:

Code: Select all

gGameSpeeds:   dc.w      100
            dc.w      75
            dc.w      50


public DoVBlank:

            movem.l      d0,-(a7)
            move.w      GameSpeedOption(A4),d0
            lea         gGameSpeeds,a0
            lsl.w      #1,d0
            move.w      (a0,d0),d0


b_waitvbl1:
                TST.W      bVBlank(A4)
               BEQ         b_waitvbl1
            CLR.W      bVBlank(A4)

b_loopVBL:
            add.w      d0,gVBLcountup
            cmp.w      #100,gVBLcountup
            bge         b_noMoreVBL

                CLR.W      bVBlank(A4)
b_waitvbl2:
                TST.W      bVBlank(A4)
                BEQ         b_waitvbl2
            bra         b_loopVBL
b_noMoreVBL:
            CLR.W      bVBlank(A4)
            sub.w      #100,gVBLcountup
            movem.l      (a7)+,d0
            rts


Posted: Thu Nov 16, 2006 12:05 pm
by Freshmaker
Steve Camber wrote:Here's the offending code:

Code: Select all

gGameSpeeds:   dc.w      100
            dc.w      75
            dc.w      50


public DoVBlank:

            movem.l      d0,-(a7)
            move.w      GameSpeedOption(A4),d0
            lea         gGameSpeeds,a0
            lsl.w      #1,d0
            move.w      (a0,d0),d0


b_waitvbl1:
                TST.W      bVBlank(A4)
               BEQ         b_waitvbl1
            CLR.W      bVBlank(A4)

b_loopVBL:
            add.w      d0,gVBLcountup
            cmp.w      #100,gVBLcountup
            bge         b_noMoreVBL

                CLR.W      bVBlank(A4)
b_waitvbl2:
                TST.W      bVBlank(A4)
                BEQ         b_waitvbl2
            bra         b_loopVBL
b_noMoreVBL:
            CLR.W      bVBlank(A4)
            sub.w      #100,gVBLcountup
            movem.l      (a7)+,d0
            rts



I'm very offended by this post.