XRacing (MSXDev 2018 entry)

Pagina 13/13
6 | 7 | 8 | 9 | 10 | 11 | 12 |

Van santiontanon

Paragon (1105)

afbeelding van santiontanon

22-04-2019, 09:59

Btw, if anyone wants to read a bit more about how the scrolling routine in XRacing works, I wrote about it in my blog here:

https://santiontanon.blogspot.com/2019/04/smooth-scroll-in-x...

I should have written this a long time ago, but didn't get a chance to do it earlier :)

Van ARTRAG

Enlighted (6455)

afbeelding van ARTRAG

22-04-2019, 11:48

Great reading (and never the less I'm very interested in the details of the optimization technique you have used to build the common tile set and the two additional sets!)

About my suggestion, it is used in Uridium where there are 1024 tiles pre-loaded in VRAM. Uridium works like having two VRAM pages of 256x128 pixels, each with 256+256 tiles, sharing the same definitions of color. There is a lot of optimization needed to match color definitions in the 3rd and the 2nd bank, but all works nicely because the game only scrolls horizontally.

For vertical scroll, the 2nd and 3rd bank should share the same tiles. What holds here is that you can use the two pages with independent tile sets. You can use these pages to show 512 pre-loaded tiles or to double buffer the VRAM transfer of 256 tiles. You can see the 512 pre-loaded tiles on two pages in this demo here while double buffering is in the demo here.

The two pages are obtained by reducing to 2K the PCTs of the 3 banks (sometimes it is referred as half hybrid mode).

.page1: ; page 1 active
_setVdp 3,0x9F ; PCT at 0x2000 (hybrid)
_setVdp 4,0x03 ; PGT at 0x0000 (regular: used 0x0800 0x1000)
ret
.page0: ; page 0 active
_setVdp 3,0x1F ; PCT at 0x0000 (hybrid)
_setVdp 4,0x07 ; PGT at 0x2000 (regular: used 0x2800 0x3000)
ret
Note1:
The 1st bank becomes very difficult to be used, because its definitions host the colors of the other two banks in both pages. You can use a dummy pattern and and sprites (as in Uridium) or a split screen and screen 1 (as in the demos).
Note2:
You can reduce also the PGT to 2K, but on regular TMS9918 it will affect sprites on planes after the 8th one (sprite cloning), so this not convenient unless you can live with only 8 sprites.

Van santiontanon

Paragon (1105)

afbeelding van santiontanon

23-04-2019, 04:37

Thanks a lot for all the pointers Artrag!! I take note of all of this! Busy at the moment with a couple of other projects, but eager to start playing around with this!

Van santiontanon

Paragon (1105)

afbeelding van santiontanon

23-04-2019, 08:04

Oh, and I missed the part about the details of tile assignment. I write an explanation as an answer to your comment in the blog Smile (I don't think I was very clear, but happy to clarify. I wanted to put the code in GitHub, but it's such a mess from trying this and that, that I was ashamed to push it! hahaha)

Van enribar

Paragon (1082)

afbeelding van enribar

13-09-2020, 17:30

Don't know if this behaviour is unknown, but if you take the wrong way, all the other machines will crash on yours.
The only way to come out of this situatio, is to press many keys with the palm of a hand.
This is the screenshot: https://msx.pics/image/jGkge

Van santiontanon

Paragon (1105)

afbeelding van santiontanon

13-09-2020, 22:20

Oh! interesting, I don't know why "pressing many keys with the palm of a hand" solves the problem though! Maybe it's because you press "ENTER"? The "ENTER" key is to respawn your car inside the track in case you get off the track to a place that is hard to recover from!

But yeah, the AI of the enemies is VERY simple. They have a set of waypoints that they follow, and hey blindly go from one to the next. If you stop your car in the middle of their path, they will just crash into you, making 0 effort to avoid you Smile

Van enribar

Paragon (1082)

afbeelding van enribar

13-09-2020, 22:51

Oh now I understand! Maybe a combination of keys made the Return :-D
When I took the wrong way, my car didn't move from there and then the other came and crashed.
Btw, I'd like a XRacing chapter 2 for the MSX2, but less strict on the first stage... When you do even only 1 mistake, you're mathematically fired... Opponent cars are too speed and you have to arrive at least 2nd classified... a bit hard for a newby :-(

Van santiontanon

Paragon (1105)

afbeelding van santiontanon

13-09-2020, 23:44

hehe, yeah, if you crash you are pretty much out!! I made the decision to make the car accelerate slower, and that's the problem. If you crash, it takes a long time to get back up to speed! In games like "super cars", for example, cars back back up to max speed really fast, and thus, crashing does not affect your final time that much. I'll have to tweak it better next time! Smile

Pagina 13/13
6 | 7 | 8 | 9 | 10 | 11 | 12 |