[Game]Pokitto Grand Prix

game
release
racing

#264

I’m down to 31.1 lol


#265

Took me forever to get that low at first. But after finding some strategies I liked I got to the 24! You can do it!


#266

Anyone want to contribute? I can do this texture myself, but it is off from my coding time, which is already quite limited.

The size of 24x8, 24x16 or 24x24 would be fine.

Here is how the boost texture (“arrow”) looks in F-Zero. Let’s have something different.
image


#267

I could but it’s difficult to me without seeing it in game, I need to see it set in the environment in order to make it fit. But I guess even if it’s off it can at least be a placeholder. What palette should it use? Should the background be transparent?

EDIT: Here’s some quick pattern I’ve tried, really don’t know if it can work (as always, CC0):

image


#268

Thanks! I will try that.


#269

Just got 24"3 with the newest bin! :open_mouth:


#270

I have now 6 different Npc ships racing with you :wink: I will make a new release soon.

What is still have to do is to put the current rank on the screen during the race. That Is suprisingly hard to do well. I have about 20 waypoints on the track for the npc ships, so I know whereabout each ship is going on the track. I could use those also to find the player ship position, but there are a couple of problems: The player do not need to go near the waypoint, and the player can use shortcuts, and skip the waypoints. I do not want to calculate the player distance (or actually: x*x + y*y) to every waypoint in each frame (!).


#271

Would x + y be sufficient? Anyway, I think even Euclidean distance wouldn’t eat that much performance if you only calculate it in order of units per frame… I calculated a lot of distances in each frame in my raycasting demos and it’s not that bad.

Also don’t calculate it on each frame but rather only once every N frames.

EDIT:

Sorry, you meant to every waypoint. You could use some nearest neighbour searching acceleration. For example separate the level into a grid and for each cell precompute the nearest waypoints (will mostly be only one), then only check these.


#272

Surely the player would have to pass within a specific distance of all waypoints for a valid lap?


#273

I’ve been wondering about this too – @Hanski says shortcuts are possible, but you definitely can’t just make a small circle around the start line in order to finish. What magic is going on here?

EDIT:

Seems like there is one specific tile/waypoint you have to visit.


#274

You found it :wink:


#275

Use binary space partitioning or quadtrees to locate the nodes, that way you end up doing something like O(log n) comparisons instead.

(My favourite book to the rescue again.)


#276

Also k-d trees, but these seem like an overkill to me, I’d try that simple grid – perhaps the tiles that are already there could serve the purpose of the cells?


#277

I was watching a video about the Nintendo power glove and they mentioned this game:

It reminded me of PGP (Pokitto Grand Prix).


#278

Thanks for all lot for the good suggestions! I will first go to the (hopefully) easy route (pun intended!), and do as @spinal suggested. The player ship should go via all the waypoints. I just use the radius big enough for each waypoint.

I might need to handle some special cases to allow shortcuts.


#279

Looks nice even if do not use Mode 7. There cannot be tight corners, but on the other hand there can be up and downhills, which is nice.


#280

In this case you should visually show the checkpoints and indicate the player really visited it – it would be very annoying if you took some shortcuts and then weren’t able to finish because you missed a checkpoint without any way of even knowing which one it was.

Again my memories go back to TrackMania – they did it exactly this way, there were checkpoints you had to visit before finishing the track (or lap). This, and the fact they could be visited in any order, allowed some unimaginable creativity in finding cuts that no one suspected could exist (and this was in fact the single biggest reason why I’ve played it for so many years). So I think you can’t go wrong with this system.

EDIT: If someone’s interested in some TM cuts, take a look at this video for example :slight_smile:


#281

A status update.

Time to time there should be made some refactoring in the code. This time it was a bit more painful than usually, as I had to revisit transformations algorithms which is always laborious. Now, it works again.

Aside from refactoring, I thought I will quickly make the rank calculation before releasing a new version. That was a surprisingly big effort. My first idea was to use the waypoints, as they are already used for the NPC ships guidance. That was complicated as I just cannot calculate the distance to the nearest waypoint to get the position. I had to take into account the direction of the waypoint and handle the situations when the player skips waypoints.

After rethought I decided to do it completely different way. Now the track area is divided to 256x256 pixel blocks for position tracking. Each block is given an index. I also have one list of block indexes, which define the track: how the ships are supposed to go around, block by block.
In each frame:

  • I find out inside which 256x256 pixel the block the player is on the playground.
  • Then I check if that block index is found in the “track list” (which probably is always found unless the player is far off the track )
  • If this is the first time the player is inside this block (in this lap), I find out if other ships are already there or have passed it. That defines the player current rank.

That is the current plan until I found a major problem in that theory too :slight_smile:


#282

So what if there are multiple players inside the same block? How is the rank determined then?

Which is? :slight_smile:


#283

The ship (NPC or player) which first reaches the block has the highest rank.