Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Top Down Racing Game Starting Grid Randomiser

Archive: 6 posts


Hey guys,

I'm making an F1 based top down racing game. I'm making good progress but I've hit a bit of a wall when it comes to randomly generating a grid postion for each player at the start of the race.

The game is for 2 to 4 players. Each player taking part sits in a controlinator which corresponds to 1 of 4 cars. Once the 1st player is seated I am going to have a timer triggered for 10 to 15 seconds to give other players a chance to choose their cars. Once the timer has run out the cars involved in the race will get emitted at the starting grid. The track is quite narrow so there isn't enough room for potentially 4 cars to start side by side.

To make it as fair as possible I want each player involved's car randomly emitted at a starting grid position (1st to 4th). What I'm having trouble getting my head around is if there are only 2 players I would want the randomiser to chose only between 1st and 2nd place on the grid. 3 players - 1st, 2nd and 3rd on the grid etc.

I'm pretty sure this is possible but I could do with a little advice if anyone can help?

Sorry if I haven't explained myself very well!
2011-06-26 11:18:00

Author:
superfurryanimal
Posts: 11


Maybe using an AND gate for the emitter so it only spawns the cars activated.

But I think it would be fair if you just made it a little bigger. Or make the cars spawn in a square instead of a line
2011-06-26 18:45:00

Author:
Zero10100
Posts: 385


Thanks Zero. AND gates are definately the way forward. I've been playing around with it today and I think I've cracked it. I still need to test it properly and iron out any glitches but this is what I've got so far:

Feed all 4 Controlinators into a seperate Microchip.
On the chip hook each to a seperate timer to give enough time for others to join.
Next place 3 new microchips. One will be for 2 player games, one for 3 player games and one for 4 player games.
Hook all 4 timers to the first chip (2 Players).
In this chip there is an AND gate for each combination of cars being used in the race (6 Combinations)
Run each seperate AND gate through an invidual randomiser
There should be 2 outputs to each randomiser. I've used circuit nodes to acheive this.
Connect each node to 2 emitters.
The first emitter will spawn car A in pole position and car B in 2nd place. The second emitter Car B in 1st and car A in 2nd.
Repeat for all randomisers/car combinations (4 emitters per randomiser/24 emitters in total)
Go back and hook all the timers to the 3 player race microchip and repeat the above process but this time the AND gates will have 3 inputs because there will be 3 cars in the race.
Again run each of these through a randomiser and into emitters. I'll need considerably more emitters this time for each combination of grid postions!
Finally hook up the timers to the 4 Player race chip. I'll only need one AND gate this time with 4 inputs but even more emitters than before (I haven't worked out how many yet!)

In theory I think this should work although I may be doing it the hard way. Let me know if you have any thoughts or improvements to this system.
2011-06-26 23:42:00

Author:
superfurryanimal
Posts: 11


Glad I could help. If you hooked up the emitters with OR gates with the AND gates as the inputs it should lower the number of emitters2011-06-27 01:30:00

Author:
Zero10100
Posts: 385


Update: I have published a beta version of my level 'Little Big Monaco Grand Prix'.

http://lbp.me/v/3wx5nv

Also a single player time trial version:

http://lbp.me/v/3wx6s0


I'd appreciate any feedback!
2011-07-23 13:23:00

Author:
superfurryanimal
Posts: 11


Seems like a game I would enjoy, since I LOOOOOOVE cars.
I like high ramps, crashing and racing the most, hopefully you will be able to include all of those things!
2011-07-23 17:31:00

Author:
Unknown User


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.