[Game]Pokitto Grand Prix

Here is the video. I think there is now much less moire/flickering than before.

6 Likes

Looks great, @Hanski!
Not sure if someone has brought it up: do you intend to scroll the sky when the player turns?

2 Likes

Sure. I am just currently trying to keep fps as high as possible, but probably will eventually scroll the sky.

3 Likes

What technique are you using to draw the floor? Are you casting some rays too? Or is it some kind of warping?

EDIT: I can see how this could be done if the camera didnā€™t rotate in the curves ā€“ youā€™d simply shrink rows as they get further from the camera. But with this rotation I donā€™t knowā€¦ youā€™d have to rotate the textureā€¦ which could be done by traversing the texture along a rotated line, e.g. by the DDA algorithm. Is this how youā€™re doing it?

Exactly that. Plus optimized inner (x-direction) loop.

Edit: the codes are in github

4 Likes

Added gfx to the github using CC0-license (Public Domain)

3 Likes

Iā€™ve made a PR to add a full copy of the CC0 licence.

2 Likes

Finally, some real progress with billboard objects.

image

The hard part was to make the 3d world to move in sync with the Mode7-scaling.

7 Likes

Has the road tilted downwrds?
Whatā€™s the blue line beneath the cityscape?

I do intend to provide some more terrains at some point, but if youā€™ve been reading the forums youā€™ll know what most of my time has been spend on the laste few weeks.

Maybe I should make some trees while Iā€™m at it.

Who made the Pokitto sprite by the way?

1 Like

This still somewhat a test version, so it might look a bit odd. I will revert the old parameters back.

Trees would be great to have! I will take mipmapping into use also for billboard objects.

The Pokitto bitmap is from Jonneā€™s Bitmap example.

Edit: maybe some small rocks also? Just to keep the terrain more interesting.

2 Likes

Iā€™m not complaining, Iā€™m just wondering why it looks different.

If youā€™ve lowered the road, I think it gives a better sense of depth.
But if itā€™s going to stay like that then I think the skyline should be lengthened to meet the road.

Iā€™d need to know the size.

That explains why it looks familiar :P

Sure, but again, Iā€™d need a rough idea of dimensions.
E.g. how big that Pokitto image is.

That is 36x40.

1 Like

If you keep the bitmaps square, the sampling indices in U and V direction will be the same (e.g 0, 2, 4, ā€¦ for half size etc.) ā€“ you can then precompute these into an array. You can either have a LUT of sampling indices precomputed globally for different scale sizes, or you can compute the indices before you start drawing the bitmap. During drawing you then just look up the indices instead of computing them UxV times.

1 Like

Yes, indeed! So for a 40x40 texture the lut would be 1600/2 items, right? Supposing the 32-bit array is faster than 8-bit, that is 3.2 kb. Certainly doable!

I have to try how it works. Thanks for the tip!

So @pharap, you can use the 40x40 size for the bitmaps.

Edit: I forgot I am scaling up too. So the lut size would increase a lot. Or I just use different function for upscaling. Mostly, it is downscaling anyway.

1 Like

Yes, or if you want to save memory, you can do the other option, which is what I do because I need to upscale to very big sizes and a global LUT would take a lot of space.

Another tip I learned with my project: instead of mipmaps I simply use (precomputed) average color of the texture in the distance ā€“ itā€™s sooo much faster and also looks better in my demo (no aliasing) ā€“ but with your flat plane floor you might need to apply some smart transition or else it could be too noticable.

1 Like

Yes, the second option would be suitable for upscaling.

Hereā€™s a bunch of roughly done rocks and a cactus:

Cactus Rock RockSpire1 RockSpire2 RockSpireDuet RockSpireTrio

I was going to do a tree, but Iā€™ll have to pick out a nice brown to add to the palette so Iā€™ll save that for another day.

5 Likes

Thanks, I will try those.

1 Like

@pharap Few requests: Could you make 2 mipmap images for each object in a layout as in my example below? The mipmap textures should have less contrast and be a bit more blurred than bigger versions. Also could you use the equal width and heigh for the base texture, so I can use optimized blitting?

image_terrain_6

1 Like

Iā€™ll work on it some time in the next few days.
(Iā€™m juggling several projects at the moment.)

If you can post the mipmaps youā€™ve already been using that follow this technique then I can add the blended colours to my colour palette and make use of them for creating other images.