poll:outrun for msx2

Page 8/10
1 | 2 | 3 | 4 | 5 | 6 | 7 | | 9 | 10

By Grauw

Ascended (8205)

Grauw's picture

19-07-2019, 20:25

Metalion, but the ISR can be disabled, right?

PingPong, I already said it was tight, and provide two effective ways to lower the CPU cost if needed.

Can you elaborate on the more tile based method you suggest to use?

By Grauw

Ascended (8205)

Grauw's picture

20-07-2019, 00:45

Metalion wrote:

A frame at 60Hz is indeed 59659 cycles

Informative nitpick:

262 * 228 = 59736 cycles (59.92 Hz)
313 * 228 = 71364 cycles (50.16 Hz)

The numbers 262 and 313 correspond to the nr. of lines in NTSC and PAL modes, and 228 to the number of CPU cycles it takes the VDP to draw one line (1368 / 6). Under the assumption the CPU and VDP are clocked by the same crystal of course. You can find these numbers in the appendix of the VDP manual.

Metalion wrote:

but you have got to substract the ISR service, which is around 6800 cycles on a MSX2.

In addition to entirely disabling or replacing it, you can also shorten it. The length of the ISR varies because it does not perform every task every frame. By setting SCNCNT to 0 every frame you inhibit the tasks such as the keyboard reading.

I just cycle counted the MSX2 BIOS code for fun and interest, by keeping SCNCNT zero the ISR service takes a mere 934 cycles (while still doing mostly things only useful for Basic Eek!).

By PingPong

Prophet (3339)

PingPong's picture

20-07-2019, 22:38

Mine is only speculation.
On c64 there are a lot of good race games like poleposition. They run fast.
Considering that the 6502@1mhz is not a beast in terms of speed I assume they use the character mode of c64 to do road animation.
So they put a similar amount of characters every frame. I think the secret is not how fast you can write to vram instead how you calculate what characters need to write to get road animation. I assume also that c64 uses hw scrolling that should be available on msx2 too.
So in the end : find the trick that some c64 games use and try to port on msx

By Grauw

Ascended (8205)

Grauw's picture

21-07-2019, 02:38

Just frame step through this video with , and . to see what they did.

While the horizon scrolls smoothly, the road is getting updated at only 10 fps ofso. There does not seem to be anything tile based or hardware scrolling going on (apart from the horizon). It looks to me like it’s just drawing to the screen in a bitmap fashion from the bottom up.

In my mind right now I can’t picture how something 8x8 character based could work. The shapes of curves including transitions in and out of them, road markings, and 8 horizontal offsets to keep the car centered, seem to me to require many more than 256 different patterns, not to mention how the game should know which to use.

I think the best example of a tile based racer is on our very own MSX: Penguin Adventure.

By Uninteresting

Expert (92)

Uninteresting's picture

21-07-2019, 08:18

This thread made me think of how to try making it on MSX1 in screen 2, and I'm probably shooting well over my level here. Haven't done any feasibility calculations or thought how bad this would look (likely answer: very).

1) Rather than having equally thick horizontal bars of alternating colours in the view, write to the pattern table just single lines (and erase the old ones) in the grass. Might not do good for the impression of speed, though. This would be eight characters in each 256-char set. I haven't thought of how to do road elevation changes yet.
2) The roadsides I'd try doing something visually a bit like Outrun on MSX2, based on the images I've seen. Split the character into just four sub-blocks, which means 16 ways to set the blocks up as road/grass (minus three unnecessary ones: full grass, checkerboard-alternating patterns). I'd try to mitigate the blockiness by having the edges horizontally jagged so that the road/grass boundary leaps between characters wouldn't stand out as badly. The horizontal lines in 1) wouldn't apply to these mixed tiles.
3) Road markings I haven't thought of at all beyond throwing out the lines on the sides.
4) With car centering, I'd probably work with those four-pixel increments or just full character ones. Or not have the car centered.

Probably not very helpful for your discussion at hand, though :/

By PingPong

Prophet (3339)

PingPong's picture

21-07-2019, 09:19

Quote:

While the horizon scrolls smoothly, the road is getting updated at only 10 fps ofso. There does not seem to be anything tile based or hardware scrolling going on (apart from the horizon). It looks to me like it’s just drawing to the screen in a bitmap fashion from the bottom up.

Not so sure, need to prove that, but i think the road, (bottom) is in so-called multicolor charater mode.
I do by the assumption that on the bottom part i see only four colors: red, white,green, gray.
in multicolor charater mode only 4 colors are allowed, and they are limited globally: you have the freedom of a different color per each 8x8 cell, but the remaininig three colors come from three registers ( like three Vdp(7) on msx).

If they used multicolor bitmap, they have more freedom because the global color was only 1 not three.
However, bitmap is more difficult to manage.

Not sure but for me it is likely a charater mode.

By Metalion

Paladin (999)

Metalion's picture

21-07-2019, 10:35

Grauw wrote:

Informative nitpick:

262 * 228 = 59736 cycles (59.92 Hz)
313 * 228 = 71364 cycles (50.16 Hz)

I do compute the number of cycle in a frame from the CPU point of view :

[50Hz] 20000 µsec x 3.579545 MHz = 71590 cycles
[60Hz] 16667 µsec x 3.579545 MHz = 59659 cycles

Grauw wrote:

I just cycle counted the MSX2 BIOS code for fun and interest, by keeping SCNCNT zero the ISR service takes a mere 934 cycles (while still doing mostly things only useful for Basic Eek!).

Very nice !
I never thought about that.

By Grauw

Ascended (8205)

Grauw's picture

21-07-2019, 13:07

PingPong wrote:

Not so sure, need to prove that, but i think the road, (bottom) is in so-called multicolor charater mode.
I do by the assumption that on the bottom part i see only four colors: red, white,green, gray.
in multicolor charater mode only 4 colors are allowed, and they are limited globally: you have the freedom of a different color per each 8x8 cell, but the remaininig three colors come from three registers ( like three Vdp(7) on msx).

If they used multicolor bitmap, they have more freedom because the global color was only 1 not three.
However, bitmap is more difficult to manage.

Not sure but for me it is likely a charater mode.

Sorry, let me make more clear what I meant: I’m not saying that it’s not using a character mode, however I’m saying that it is using it in a bitmap fashion (writing to the pattern table), rather than using it as a tile map (writing to the name table). Like the default configuration of screen 2, having the name tables filled with 0..255, and manipulating only the pattern and colour tables.

So there is no special trickery being used that a character mode allows, instead it is just writing bitmap data line by line. At least this is as much as I can tell by observing the screen updating (very slowly) while frame-stepping in the 50 fps video on Youtube. Please look at it yourself to form your own opinion.

Contrasting with my suggestion: I actually do use tiles (with a trick to make 8x1 ones), and can also easily achieve at least 30 fps and possibly also 60 fps, so 3-6 times as fast as Pole Position 2. Vespertino is also much faster (25 fps). I’m not really impressed by Pole Position 2, I think it mostly gives the illusion of smoothness because the horizon updates at 50 fps.

Metalion wrote:
Grauw wrote:

Informative nitpick:

262 * 228 = 59736 cycles (59.92 Hz)
313 * 228 = 71364 cycles (50.16 Hz)

I do compute the number of cycle in a frame from the CPU point of view :

[50Hz] 20000 µsec x 3.579545 MHz = 71590 cycles
[60Hz] 16667 µsec x 3.579545 MHz = 59659 cycles

Your base assumption that frames take 20000 µsec and 16667 µsec is incorrect though. It should be: 16688 µsec (59.92 Hz) and 19937 µsec (50.16 Hz).

The PAL and NTSC frequencies are often rounded to 50 and 60 for convenience, but the real frequencies are slightly above and below that. Also the MSX progressive video output timing is also slightly different (slightly off-spec) from the official PAL and NTSC interlaced outputs.

You can determine those exact numbers by calculating the number of VDP cycles in a frame from the information in the V9938 manual: multiply the number of lines with 1368 (VDP cycles per line). That’s 262 lines * 1368 = 358416, and 313 lines * 1368 = 428184. Then divide by the master clock of 21477272 to get the frame time in seconds, or divide by 6 to get the number of CPU clock cycles.

By PingPong

Prophet (3339)

PingPong's picture

21-07-2019, 13:12

@Grauw: I've understood what you are telling me. writing pattern table is like working in bitmap mode in effect.
Effectively, we msx users, call the screen 2 bitmap graphics, and effectively use it as it was. But from the point of view of VDP this is only a tile based mode where each tile have 1 to 1 fixed correspondence to the screen location.

From the point of view of moving data nothing changes between a linear bitmap mode or a screen 2 mode if we work on pattern table only.
I will try to look at the video.

But the problem is:
a road can been seen as a block of tiles each shifted of 1 to 8 pixels (maybe at two steps).
1) What is the number of tiles we need to simulate the borders (the red/white side area) in each possible curve angle?
2) in the number of tiles we need to also take in account the perspective, how this affect the n. of tiles?
3) If the number of tiles was not enough what kind of trickery one could apply? (upload from CPU ram, switch between vdp preloaded pattern table)

By Grauw

Ascended (8205)

Grauw's picture

21-07-2019, 15:10

Uninteresting wrote:

This thread made me think of how to try making it on MSX1 in screen 2

I think one aspect of MSX1 that needs consideration is, from the Pole Position 2 C64 example we can see that smooth horizon scroll is very important to give the impression of smoothness, even if the road updates at a lower framerate. Since MSX1 has no hardware scroll, this limits the background somewhat.

Uninteresting wrote:

1) Rather than having equally thick horizontal bars of alternating colours in the view, write to the pattern table just single lines (and erase the old ones) in the grass. Might not do good for the impression of speed, though. This would be eight characters in each 256-char set. I haven't thought of how to do road elevation changes yet.

Rather than lines, might as well draw the road edges in the pattern table then… Should be equally fast. And use name table updates for the full grass and full road tiles. The code sounds quite complex though… hard to predict how fast it will be.

Uninteresting wrote:

2) The roadsides I'd try doing something visually a bit like Outrun on MSX2, based on the images I've seen. Split the character into just four sub-blocks, which means 16 ways to set the blocks up as road/grass (minus three unnecessary ones: full grass, checkerboard-alternating patterns). I'd try to mitigate the blockiness by having the edges horizontally jagged so that the road/grass boundary leaps between characters wouldn't stand out as badly. The horizontal lines in 1) wouldn't apply to these mixed tiles.

Hmm, looking at Out Run MSX2, I can’t say I think it looks very good, though maybe if it had been more smooth it would have compensated for it. Super 60 fps smoothness makes it easy to forgive a low resolution or colour depth.

The variation of the method I suggested earlier with 8x2 patterns would also have blockiness like Out Run, at least vertically…

Uninteresting wrote:

4) With car centering, I'd probably work with those four-pixel increments or just full character ones. Or not have the car centered.

According to Lou Gorenfeld, “It's much less interesting looking to have a game in which when you steer, it only moves the car sprite. So, instead of moving the player's car sprite, you keep it in the center of the screen and move the road”… So I’m trusting him on that centering is important.

Page 8/10
1 | 2 | 3 | 4 | 5 | 6 | 7 | | 9 | 10