|
Title: basic side-scrolling racing game ai Post by: GregWS on March 05, 2011, 07:40:43 PM I'm currently working on a 2 player side scrolling racing game for the Winnitron, but I'd quite like to add in a single player mode that includes races as well as the far-easier-to-implement time trials etc. And I'm just really not sure how I'd go about creating some non-crappy ai for the other racers.
The closest comparable game would be the Japan exclusive GBA game dotstream, so if you don't know exactly what I mean by "side-scrolling racing game" then just check out this video of dotstream: http://www.youtube.com/watch?v=zGzUEz7hAGk The left-to-right nature of the race makes it really easy to keep track of stuff like position, it's just the actual intelligence of other racers that I'm quite unsure about. Any advice would be really appreciated! :) Title: Re: basic side-scrolling racing game ai Post by: Moon Goon on March 16, 2011, 01:13:40 PM Maybe this example over at the GMC forum would help?
http://gmc.yoyogames.com/index.php?s=58c939f74057b51aa43254942fc3ce40&showtopic=462811 Also, although it's "side-scrolling" your games top-down perspective should still work well with Game Makers built-in pathfinding functions too. Title: Re: basic side-scrolling racing game ai Post by: Desert Dog on March 16, 2011, 04:12:56 PM I'd look at paths, yeah, but couldn't you try get away with something really cheap like simply use mp_potential_step? Make the point your aiming for 500 or so pixels in front of you, and watch him scoot away.
Title: Re: basic side-scrolling racing game ai Post by: BlueMoon on March 18, 2011, 02:38:02 AM Side scrolling racing game? Not topdown?
Could you give us some information about how the levels are built, how the gameplay works, that kind of stuff? Title: Re: basic side-scrolling racing game ai Post by: Desert Dog on March 18, 2011, 01:25:05 PM Side scrolling racing game? Not topdown? Just check out the vid. Could you give us some information about how the levels are built, how the gameplay works, that kind of stuff? Title: Re: basic side-scrolling racing game ai Post by: BlueMoon on March 19, 2011, 01:32:58 AM Side scrolling racing game? Not topdown? Just check out the vid. Could you give us some information about how the levels are built, how the gameplay works, that kind of stuff? Title: Re: basic side-scrolling racing game ai Post by: JobLeonard on March 19, 2011, 01:43:38 AM It's not mutually exclusive: sidescrolling just tells you in which direction the screen moves, top-down tells you from what point of view you're watching the scene.
Title: Re: basic side-scrolling racing game ai Post by: Triplefox on March 19, 2011, 01:44:03 AM A simple way to make a GM-oriented AI could be to place node objects throughout the course indicating valid points to traverse. Then the AI looks at the nodes "ahead" of it on the x-axis and picks one at random to move towards. Repeat indefinitely until crash or race is over.
If more complexity is needed to handle branching, you can elaborate by having different types of nodes that indicate "paths" to follow, and "merge" nodes when the paths come together. I'm assuming your game has an "auto-scroll" thingy going on where AIs have to keep up at the same pace and can't get knocked around or stuck. Letting them go off-course and have to recover can make it way more complicated. |