Light Bikey - That Game From That Movie

A forum to share your demonstrations stacks, fun stacks, games, etc.
Post Reply
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Light Bikey - That Game From That Movie

Post by xAction »

lightBikeyv1.gif
lightBikeyv1.gif (62.24 KiB) Viewed 109 times
LightBikeyv2.oxtStack
(664.75 KiB) Downloaded 25 times
Ya'll remember that Disney movie from the 1980s, the one with the arcade, bikes, frisbees and ChatGPT?

Was working on the maze stuff and figured I'd put it to use on some "AI" to try and see what it takes to get these light bike racers to not wreck themselves, in as minimal code as possible. Well of course it takes a mountain of code to make them halfway smart, so they are dumb as sticks right now. But ...there's nostalgia in there, like you can just feel the old Windows screen saver calling out: "Render me, render me, i'm just x,y points, i can be 3D!"

Anyway, figured this was the start of some basic simple game programming task for the old fun and games forum.
The next step appears to be to looking farther than one unit and choose the longest free path, and then find a way to fine tune their radical right angle turn temptations. Collision detect via points seems like it could get laggy....
How to clamp lists of values? like "here's this big list of all the points drawn by all the graphics on the map, show me whats within N units of this position, fast!"

Magic is in the stack script.
Card script has unfinished transfer of stack script stuff to object scripts work I was doing just before I reworked things in the stack script, as one does.

Oh and as usual scripts stop if mouse is outside stack or tool is not 'browse tool'. Couple of times I've been like "oh did it break?", nope, that's a feature not a bug!
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Light Bikey - That Game From That Movie

Post by xAction »

GridTrainer2024_03_01_2024_AM.oxtStack
(581.25 KiB) Downloaded 13 times
GridTrainer.gif
GridTrainer.gif (295.54 KiB) Viewed 99 times
I was working on Light Bikey and remembered this old stack. The idea was "I'm not smart enough to figure out computer AI, so I'll just train the bikes to do preset patterns and people will think they are playing against AI."

I tried the same thing way back in the 1980s. BOOP OUT OF MEMORY. I wonder why?
The stack stores every path the player makes, at one point this stack was 30 megabytes full of data, while only being 50K worth of script -minus the 7k or so of whatever stack data is stored by default.

W A S D keys to drive your bike.
Space will pause
MouseDown on the "GameGrid" will set the enemy bike to the mouseloc

Collision with the enemy isn't being tested for, this is just for training paths.
The enemy will reset to a new stored path when it finishes drawing it's current trail.

The Red bike doesn't collide with your walls, it's just there to test that my paths can be read and run by the enemy and to figure out how to get the speed reasonable, eventually figure out the AI, which sorta almost worked in Light Bikey but when that script is run here I get stuttering

There's a bunch of Light Bikey scripts in the stack , dormant, probably to be scrapped, I had that stack working great at one point and hope to recapture whatever thing I did to make it look like a real game for a minute. Collision with AI and AI with us was working in this stack for a bit but I got like 500 garbage trails saved from that...lots of short runs and hitting walls.

The review paths checkbox will let you view all the stored paths. minus and plus keys on top of the keyboard wlll let you cycle through them and delete key will get rid of unwanted paths. I think the arrows work too? Maybe, but plus and minus are close to the delete key.

The Draw ALL button makes post-modern art from 100 or less of the available paths, you'll see an option to get rid of that mess if you've pressed it. It was cool when I had 20 paths, now I have too many it's just a relic.

Hmm for some reason when the stack starts the enemy bike is off to the left of the stack, click in the 'grid' to reset it's position, or the rest button to start a fresh game.

The blue blocks you seen on the player trail are the markers indicating the points of the path, one extra point is drawn between each step of the path so that we can detect collision on it. Seems to work, although tight U-Turns seem too sensitive to crashing, something to fix because who doesn't love a tight U-Turn on the old game grid?

I think that covers most of it.
User avatar
tperry2x
Posts: 1607
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Light Bikey - That Game From That Movie

Post by tperry2x »

xAction wrote: Tue Feb 20, 2024 1:11 pm That's a feature not a bug!
I remember that quote from long ago!

I wondered, rather than keeping all that in memory, could it be written to files and read in as needed, reducing the memory usage?

This also made me wonder. What about pathfinding in OXT / LC?

I thought of a way you could test for collisions. In the original movie / game(s), the 'cycle' path would fade out over distance over time. So the paths created first would drop into the floor and disappear.
Rather than a line, imagine if this was drawn as a closed polygon outline. The path of the line is 1px thick, so imagine a straight line. It's actually a rectangle that looks 2px thick because it's a 1px box.

As you drive about in the game, it's drawing the polygon but outlined all the way around as an irregular 1px polygon, if you follow what I mean.

To check for collisions, you could use something that just checks if an object is within the points of the polygon.
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Light Bikey - That Game From That Movie

Post by xAction »

Oh memory is no issue now, we got gigs of it! And even file sizes are only a concern for uploading in a forum post.
Sure could write files too, this exports text files but better for us would be to export a stack with the data all neatly stored away in a custom property we can grab. I should demonstrate that with something...hmm I'll have to ponder.

Path finding, yeah that's something I've been meaning to get done. Definitely needed.
One of my ideas for this type of game was to draw an invisible maze and then have the AI do path finding through the maze to make it appear like it has some unfathomable motivations.
User avatar
tperry2x
Posts: 1607
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Light Bikey - That Game From That Movie

Post by tperry2x »

For the AI for this (I use the term loosely of course) it needs to follow or try to cut off the player in their tracks. So all it really needs to do is plot a course to get to the player.

Like an animal with whiskers, that uses them to work out if it can fit into a narrow gap, imagine invisible lines coming off the enemy. They need only be a few pixels long. If these invisible lines touch a wall, then a direction change is needed.
Then, pick an alternative direction. To do this, look at the 3 other possible directions, and see which wall is furthest away. Choose that direction as there's space to drive into.

http://cycleblob.com/
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest