Help with racing game (mostly AI)

0 favourites
  • 6 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm about to start making a racing game, which will look like the image below.

    I'm probably going to use 8 directions movement behaviour for the player, direction relative animations, but I'm not sure about what would be the best approach to opponents AI, there will be 4 karts on the track (player+3ai).

    Does anyone have any experience on this? Should I use waypoints and have the AI following a pre-set path? That would result in really poor gameplay in my opinion, straight line of karts and I'm not aiming for a nascar like game. Having a different path for each opponent is a better solution but would take a lot of time depending on the number of tracks I'll have (5 at least).

    I'm also not aiming for a complex AI (my first thought was something like raycasting line of sight from the car and checking for collisions and simulating acceleration and steer control for each AI, that would take longer time than I have scheduled), it's a game for childrens, so it only needs to look fine, there won't be any pro racers playing it as training for formula 1.

    Also about the track, how should I set it up? Has anyone done a system to track player position and laps in a racing game (needs to prevent cheating), know if the player is going wrongway.

    This topic is already pretty big, so in fewer words, I'm looking for tips, plugins and behaviours, anything that can help making the development phase faster/easier.

    (Yes, I've checked the racing template, I'm looking for something more related to gameplay, not the player's car controls).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The AI can be as simple or as complicated as you make it, but I find it likely that the best simple solution to use a checkpoint system, then 1 step better then that is to use it in combination with ray casting to make sure the cars don't run into any walls or potholes.

  • Thanks Robsta

    Has anyone used either pathfinding or the MoveTo behaviour by rexrainbow?

  • I use MoveTo by Rex it's a really useful plugin and would be a great addition to Construct as an official type behaviour.

    About the AI I made a basic game prototype some years ago in Construct Classic using waypoints. I didn't get too far but my main plan was multiple waypoints for each "section" of track that the AI could choose. Each of these waypoints could also change the AI top speed, for example if a waypoint took the AI too wide on the track I would slow them down as if they needed to break hard.

  • Thanks Minor, that is a good idea, I might sub-divide the waypoints into 3 and have the AI to choose one of them to follow, the speed idea is also really good.

  • *bump*

    Does anyone have something else to add?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)