How to Create a Race?

When trying to event a race between the player and a couple of NPCs, I noticed that either the events go WAY faster then you, WAY slower than you, or the same speed. Which means you either have no chance, it's too easy, or it's a tie!

How can I make it more... unpredictable?

Controlling event speeds? Player speed-up with buttons? Timed buttons?

(also, would top-down or side-view better better?)

Thanks!
At first, when you said race, I thought you meant as in elves, orcs, etc. XD
But anyway, if you want to make the NPC's remain at one constant speed, I'd put a conditional branch with a random variable on it. For each value of the variable, it turns on a self switch activates a page each with a different speed in its condition page.
If you want it so that the event is constantly changing speed, which I assume is what you want, put a random variable, and change the speed via move route instead. Have a wait command after all of that so that the event is not changing speed 60 times per second.
At first, when you said race, I thought you meant as in elves, orcs, etc. XD
Ha ha, I did as well! 🤣
But anyway, if you want to make the NPC's remain at one constant speed, I'd put a conditional branch with a random variable on it. For each value of the variable, it turns on a self switch activates a page each with a different speed in its condition page.
If you want it so that the event is constantly changing speed, which I assume is what you want, put a random variable, and change the speed via move route instead. Have a wait command after all of that so that the event is not changing speed 60 times per second.
That will cause lag but it seems to me to be the only way to do it.
Well, it worked but uh. Yeah the lag. I planned on obstacles, though I'm not sure if they would make enough difference to nix the speed factor.
At first, when you said race, I thought you meant as in elves, orcs, etc. XD

Ditto. I was going to tell you about a new plugin I've been working on. Lol!
This is kind of hard given the fact that I'm assuming you're using MV's default movement and not using any plugins to mitigate that limitation. That said, I can tell you that I easily achieved a racing minigame since I'm using Quasi's movement, speedmanager, and a stamina plugin to increase the intensity of the minigame and make it a bit more challenging/exciting, all while giving the npc a set command for his speed/path/etc... without the usage of variables/switches.

(Also, yes, I'm using the NPC as a parallel process.)

The basis of the minigame is to beat the NPC before it reaches the lap 3 times, leaving you plenty of room to modify anything as a developer. It's pretty simple.

I think the easiest way for you to do this with multiple NPC's without lag is to have everything pre-determined and not involve as much switches as possible, then design more levels of difficulty for the next race, which allows more room for customization. On the example below, I had the NPC change speeds at some points, giving the illusion of randomization. This is because you, as a player, will be focusing more on managing your stamina rather than the opponent's progress.

Spoiler: EXAMPLE


EDIT: I need to add that the whole area is a separate map built just for that one minigame. So, when i said "by making multiple difficulties", I meant, copy/pasting the maps so you won't have to deal with switches. This will increase the game's file-size, but it will reduce as much lag as possible. It's kind of a compromise, really.

Let me know if you need further help.
Have you tried experimenting with frequency?

Speed determines how fast an event moves, frequency is how often.
Giving the event a higher speed but lower frequency than the player should do what you want, especially if you disable dash. It' a bit of experimentation however...
@msazako - That's genius! Do you have any ideas on how I could event such a thing?

@Andar - Well, using speed and frequency... Frequency makes them go at a... weird pace. Like stop, then go.

Thanks for the tips!
I made a demo to save you some time. Just gonna have to remind you though that you will need Yanfly's Move Route Core so you can use the note tag <Always Update Movement> for your events in order for this minigame to work properly.

Good Luck!

Original thread: https://forums.rpgmakerweb.com/threads/how-to-create-a-race.91949/