Discuss Scratch

RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

So one of my first projects was Bady Drawn Racers. It's got a bit of interest again recently and it got me thinking about a rewrite to fix many of it's short comings.

I did attempt a rewrite a while ago making a radical departure from the way it worked before, a more bendy twisty road, but honestly I just couldn't get the game balance right and it was just too difficult to play.

So here's what I'm thinking, what's good, what's bad…

The good:
The physics are decent enough and fun
The collision is decent enough and gets the job done
The graphics are good
The sound is made with my mouth! So… Ya know!
The commentary radio chatter I was really pleased with
The way the map rotates is good.

The bad:
The track - Argh! Having to manually create the track in notepad, working out all the waypoints and complexities was WAY too hard, hence there only being one track. This approach was completely abandoned for Hover craft racing and I wrote a track editor, the AI waypoint system was also rolled into this algorithmically so there was no need to set each way point manually. This clearly is the way to do it!
Clones - Everything is made with clones so it's complicated as heck to map all the tiles and put them in the right place and in the right order so this needs to be rewritten using stamping of costumes.
Sprites - There's no good lay out here, it's just a hot mess of code hap-hazardly calling other bits… This needs to be uniformed.
No game timing - The game has nothing to keep the timing so if frames drop the game plays slow, this needs to be resolved so the game core runs at a constant speed.
Mobile friendly - Or not! See if this can be improved
Front End - It does the job but it's not very exciting is it!
Particle system - Well I've written enough particle systems in scratch now, this one needs to go!
Respotting - Yeah… It's rubbish isn't it!

Features:
So people talked about having power ups, shops, upgrades, pit stops etc. Although all of this is cool, it's a lot of work for not a lot of gain IMO, try and convince me otherwise!
Personally I'd like to add more scenery in the game, piles of tyres to run through and have them scatter… Cardboard boxes, leaves falling from the trees… None of this will really do anything to the game, but they add polish.
It needs a mini-map… I agree!

So I'd love to hear your thoughts on this. What changes would you make? What is good, what is bad, what you'd change. From my list there's clearly a lot more Bad than Good in the game, lots of things need rewriting and not a lot can be kept, but if there's enough interest in this I might give this a whirl!

Last edited by RobFarley74 (Feb. 7, 2024 22:07:28)

colinmacc
Scratcher
1000+ posts

Badly Drawn Racers 2?

Can't really argue with anything you've written here!

I just refamiliarised myself with the project. It's already one of the best racing projects on Scratch. I don't like the track layout it's true, that hairpin gets me every time, and yes the respotting is bad but what's the alternative, other than barriers all the way around…

So it would be nice to have a choice of tracks yeah.

Maybe different cars with different characteristics?


Sample Projects

RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

The track design was specifically built to test the AI, it was never meant to be the final product, it's just that the overall design of the game was so flawed creating new tracks was way too much like hard work!

Cars with different features is an interesting idea, I could probably play with traction, top speed and acceleration… The issue is trying to get that balanced so no particular car has an advantage over the others, but… I'll have a look!
X-Marshal
Scratcher
3 posts

Badly Drawn Racers 2?

It would be so cool to have different cars to choose from, with different speed, turn rate, traction, acceleration etc., especially if they look visually different. My main suggestion (which I think I've mentioned before) is to make the car select system (and other settings, I guess) a grid of options to choose from rather than ‘click for next’.

I would absolutely love for a remake to be done.

This is a properly good game.

The next generation of Scratch car driving simulators

Dream Garage:
- H O R I Z O N -

https://scratch.mit.edu/projects/938174063/
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

The effort involved in drawing new cars is crazy! When I drew the one car I didn't expect it to take as long as it did turning it into a workable sprite! So cars looking different beyond the livery is not going to happen this time round. However, I have been thinking about the driving characteristics and how to resolve that.

I think a method of tuning might be doable, whereby you can for example improve acceleration at the cost of top speed, likewise improving traction may cost acceleration… Something like that anyway… So if there's a bendy twisty track you could tune the car for that, likewise if there's a track with lots of long straights you could tune it for that. Getting the balance right is going to be difficult though, but that feels like an achievable compromise.

These sliders could also be randomised for the computer players to give them a more unique AI performance

The whole front end and car selection stuff on the original was all bolted on afterwards with not thought towards it, hence it being a touch janky!

I started to take a look at the code last night, and it's a mess! Not sure how much of it will survive! They'll be a lot of rewriting to do!
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

We have the start of a track editor. Track size is now 32x32 tiles.

Development so far allows you to pick a tile and draw it on the grid, not particularly exciting, next step is to get it to verify the track as valid and automatically create waypoints for the AI

Last edited by RobFarley74 (Feb. 9, 2024 22:54:38)

RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

So, it can now run the track by itself working out the route, and dropping waypoints on the way for the AI to aim for.

This screenshot shows the track rendered as a grey blobs, the red dot is the start/finish line and the white dots are the tiles identified as a valid route. This means each of the racers will need to pass through of these tiles to complete a lap. I'll add some allowance for missing the odd route tile if you come off the track. If you miss too many it will respot you back to where you were last on a valid tile.

Waypoints are dropped on each corner. I'll likely need to finesse this somewhat to make it more robust and to improve the AI, but for now, it understands all the corners from all directions and which direction this will next take you in.

Last edited by RobFarley74 (Feb. 11, 2024 22:58:49)

RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

So the next stage is to rewrite all the AI and car control, and try to salvage as much as the physics and collision code as possible. If all goes well I'll have cars driving round the track in a convincing way… Then it's down to racing them and see how good or bad the AI is and make it so they're good enough to be a challenge and adaptable enough to allow them to be beaten by the players who may not be so skilled!
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

Actually… Missed a bit… Need to make the tile engine render the map!
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

So I have got the tile engine working now. Independent rotation and camera position. So that's nice. Feels like it makes sense to add the passive scenery (trees) in there too now as this will be generated as part of the track editor, likewise now I have the route calculated I should be able to make it automatically add road signage for corners.
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

So level designer now automatically decorates the track with the correct arrows for the up coming corner, and also adds trees around the edges of the track. Time to make the start line work now. And once that's all done onto the exciting part of trying to make cars go round the track!

And I appreciate this looks no different that the version you see, but behind the scenes it's night and day! This effectively means anyone can draw a track and the game will “just work”… that's the dream anyway!

Last edited by RobFarley74 (Feb. 18, 2024 14:13:14)

Stickmanongoing55o7
Scratcher
11 posts

Badly Drawn Racers 2?

The effort you're putting in this project is insane!

when green flag clicked
ask [Do you want games that are not your generic platformers you see everywhere on scratch?] and wait
if <(answer) = [yes]> then
say [Then come check out my profile!]



else
say [Okay I guess...]
end

Last edited by Stickmanongoing55o7 (Feb. 20, 2024 02:15:39)

RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

So much for not needing to write too much new code…
  • Physics entirely rewritten
    Tile drawing entirely rewritten
    Car control entirely rewritten
Not sure there's much code left from the original… Actually… Probably keep the team radio stuff!

On the upside I've got a car with manual control zooming around a track

Next steps are completely rewrite the AI, completely rewrite the Particle system (I've even drawn some new particles for this too which I hope looks cool!)…

Then it's collision, ordering of cars, race positions, re-spot, etc etc… Argh… I didn't expect this to be a complete rewrite!

I'll post some progress up soon!

Last edited by RobFarley74 (Feb. 22, 2024 11:50:20)

Stickmanongoing55o7
Scratcher
11 posts

Badly Drawn Racers 2?

RobFarley74 wrote:

So much for not needing to write too much new code…
  • Physics entirely rewritten
    Tile drawing entirely rewritten
    Car control entirely rewritten
Not sure there's much code left from the original… Actually… Probably keep the team radio stuff!

On the upside I've got a car with manual control zooming around a track

Next steps are completely rewrite the AI, completely rewrite the Particle system (I've even drawn some new particles for this too which I hope looks cool!)…

Then it's collision, ordering of cars, race positions, re-spot, etc etc… Argh… I didn't expect this to be a complete rewrite!

I'll post some progress up soon!
Sick!
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

So here's the first attempt at AI completely generated automatically by the track… For a first hit I don't think that's too bad, but clearly we need to generate more way points to describe the track better. Also currently it's just locating the way point in the middle of the tile, this needs to be improved to try and generate a race line

Click here for the video

The frame rate is low on the screen recorder not the game itself!
Stickmanongoing55o7
Scratcher
11 posts

Badly Drawn Racers 2?

RobFarley74 wrote:

So here's the first attempt at AI completely generated automatically by the track… For a first hit I don't think that's too bad, but clearly we need to generate more way points to describe the track better. Also currently it's just locating the way point in the middle of the tile, this needs to be improved to try and generate a race line

Click here for the video

The frame rate is low on the screen recorder not the game itself!
try checking out @Minoru07 he has a project that has similar features but works way better

heres the link: https://scratch.mit.edu/projects/938057740/
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

Stickmanongoing55o7 wrote:

RobFarley74 wrote:

So here's the first attempt at AI completely generated automatically by the track… For a first hit I don't think that's too bad, but clearly we need to generate more way points to describe the track better. Also currently it's just locating the way point in the middle of the tile, this needs to be improved to try and generate a race line

Click here for the video

The frame rate is low on the screen recorder not the game itself!
try checking out @Minoru07 he has a project that has similar features but works way better

heres the link: https://scratch.mit.edu/projects/938057740/
As I said, this is the first iteration of the AI this was my first hit of “I should probably drop waypoints here” and see what happens. The thing with mine is that it creates the way points automatically from the track so you don't need to set them yourself, that was always the problem with bdr and why it only had one track because it was a massive manual process. I've been sketching up ideas of how to improve it and should have an updated demo soon.
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

This was my thought process last night, each waypoint will have an XY of the tile location but also an extra value (1,9) which will be the location on that tile, this way I can make the cars follow a more accurate line through corners. Then there's the issue of how to auto allocate the way points, and what to do when you get fast changes in corners and how to resolve clashes in potential waypoints. And finally there's the issue of if a car comes off the road and the next waypoint is a long way off it'll just ease itself onto the road rather than trying to get back on the road. I'm thinking I might just be able to distribute waypoints along a straight say every 3 or 4 tiles if there isn't a waypoint for a while… I'll try some different things.



So essentially there'll be a couple of waypoint passes, the first will just place then by running along the route, then they'll be another pass to clear out and/or resolve conflicting waypoints, and finally a pass to drop waypoints in any big gaps to keep cars on the road generally.

Last edited by RobFarley74 (Feb. 23, 2024 08:19:50)

RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

Latest update on the AI

There's still a bit of work to be done, adding randomisation in so not all cars will follow the exact path etc, but going to declare this “done” for the moment to allow me to move onto multiple cars etc. Then I can race them and finesse the AI.
RobFarley74
Scratcher
100+ posts

Badly Drawn Racers 2?

Another update with multiple cars… collision needs work, but I think we're more or less there with the AI and auto waypoint system. I added in some pretty extreme corners and it seems to handle them pretty well. Again, frame rate is poor due to the screen recorder not the game itself.

Need to get a better screen recorder!

So next is to sort out the collision, then sort out particles, race order, respotting if you come off the track too much, race timing, um… yeah, still quite a few things to do!

So much for this being a quick and easy fix up!

Powered by DjangoBB