[WIP] Road Star

I have implemented some game mechanics: there are other cars, fuel is consumed, there’s a scoring system, the car crashes,… but there are some bugs and a lot to be coded yet (sound, level data, animations, title screen, difficulty selection,…).

Here’s a beta of level 2 so you can play if you want :slight_smile:

RoadFighter.bin (78.6 KB)

9 Likes

Feels like a top view outrun! Great job so far :+1:

4 Likes

There is really the feeling of speed! Great work!

3 Likes

Looking really good so far … will be watching progress as this develops!

3 Likes

What do you think about this title?

ezgif-2-0ae97ed5e125

I have to optimize the animation because it’s using too much space in Flash :sunglasses:

7 Likes

It is friggin awesome!

Is the effect many frames? Or is it a rendering effect? Either way it looks cool.

The press any button is a little hard to see if I had to nitpick.

1 Like

That is a coolest title screen I have seen in Pokitto!

3 Likes

The animation is pretty dumb. It’s just a GIF downsampled to 3 colors with 20 frames. Each raw frame is 19KB, so I’ve just encoded it with RLE which is fast to uncompress with this function:

void showFrame() {
    uint8_t* scrptr = Pokitto::Display::screenbuffer;
    const uint8_t* flgptr = flagFrames[flagFrameIndex];
    int i = 0;
    int length = flagFramesLength[flagFrameIndex];
    
    while (i < length) {
        int repeat = flgptr[i++];
        uint8_t byte = flgptr[i++];
        for (int r = 0; r < repeat; r++) {
            *(scrptr++) = byte;
        }
    }
}

And yes, I agree that the flashing text is hard to see… I’m going to change that. EDIT: Changed!

ezgif-2-fd2469222e4e

Thanks!

7 Likes

:confused: pre-rendered animation to make a waving flag? Generations upon generations of 8-bit demo / intro coders look upon you, and they are now sad (/joke, but only partial). Even I can think of about many ways of making that animation without pre-rendering (I never coded 8-bit demos)

Edit: you see stuff like that done on an Atari 2600

Edit: do not.take this in a bad way. But here in old coderland there are things that are part of the tradition

Edit3: i would make horizontal scanline rendering loop

  • fill bg with grey
  • draw second.loop of the black diagonal bars
  • third loop is the white chequer pattern
  • link white chequer pattern horiz position to sine function
  • increase amplitude of sine function with x

Edit4: and I apologize for being so harsh, it is a.lovely title screen. But tradition demands that demo tricks are upheld

Edit5: chequer pattern could also be done as 1-bit animation on top of the diagonal bars

2 Likes

Yes, don’t worry, it’s a very cheap trick :joy:

I’ve just used it to test if I liked the title screen with that kind of effect. I agree that coding a proper effect is cooler (and it can even look better). Besides, I don’t want to waste so much memory for that thing.

the-way-this-is-meme

1 Like

Phew. I am so happy you understand. I was worried about my feedback.

1 Like

I always love to receive that kind of sincere feedback, specially if it encourages me to improve.

Depending on compression levels it might actually be cheaper than some of the ways that you could procedurally generate it.

Generating a checker pattern is trivial, it’s effectively equivalent to drawing a tilemap,
but distorting it in such a way that it produces that wave effect is particularly difficult.

Ultimately it’s probably not worth messing around with unless there’s really a struggle for space.
@manuelsagra could spend an age tweaking effects until they look similar to his .gif,
or he could spend that time improving the actual gameplay.

I’m not saying there isn’t a place for low level hackery - there certainly is,
what I am saying is that I’m not sure that this is the place for it.
In particular, I’m doubtful that it’s an effective use of @manuelsagra’s time.

3 Likes

I reflected about what @jonne and @Pharap said and I thought: I need to found an “excuse” for using a prerendered animation AND I really need to cut the space needed for that.

So I started to look for a better compression algorithm. Reading about that I found LZ4 and an optimized assembly implementation for ARM-Cortex M0. Thanks to @FManga I integrated the code and I managed to reduce the animation from more than 100KB to about 16KB. That was great, but now that I have more space “to waste” I decided to improve the animation loop, make it more “wavy” and use more shades of grey… well, at least NOT FIFTY :joy:

I’ve to tweak some frames, but I really like the result. As a bonus, with a custom palette I have pure white (and five more shades of grey) and I think the flag looks cooler:

ezgif-2-aacb38fc39a3

(There’s some tearing in the GIF that is not present in the emulator / device).

@jonne I don’t discard completely making a demoscene effect… but sometimes you have to make compromises. At least this lead to tinker with LZ4 compression and I think that can help other projects :sunglasses:

10 Likes

The optimized LZ4 compression can come in very handy :+1:

2 Likes

The flag looks way better now.:+1:

3 Likes

Precisely.

You can always go back later to attempt something ‘demoscene’,
but if you attempted that now you’d possibly get sidetracked and loose sight of the goal.
(I know the perils of this because it happens to me a lot.)

We need more jokes like this. Much approved.

4 Likes

Here is a nice 3d like effect which might fit to this game.

3 Likes

@manuelsagra I am so waiting for updates on this project!

1 Like

Code and graphics are ALMOST done. I’ve a bug that only happens in the hardware but I’m close to solve it.

When the music/sounds are finished I’m going to publish a beta for testing :slight_smile:

5 Likes