Legacy GM 2.5D Top Down vehicle collision issue

T

TOMSONO

Guest
I just started making a GTA-styled game - open-world, drivable vehicles etc. But I've ran into an issue. I don't know how to make collision system for vehicles. As the sprite is changing when the car turns the collision mask should change too but it makes the car get stuck in the walls etc. Right now I've removed the collision to the walls for the vehicles. Also, the vehicle engine is poorly made, any suggestions? Top down car game is new for me. Anyway, if anyone could help me with the issue then it would be great, I would include you in the credits and thank you very much.

LINK TO THE PROJECT
https://www.dropbox.com/s/1cmj6a4qu6mxnwe/#ELU.zip?dl=0


 
P

Paolo Mazzon

Guest
I'm gonna go ahead and assume you're not using physics. If you plan on having cars in your game, I would really use physics since there is a lot of moving things, and making collisions for all of that will be a major pain. Obviously with cars, you're going to hit the buildings at really strange angles, and you'll be turning so you may have corners of rectangles colliding with circles and all sorts of weird collisions. There is a good asset on the marketplace that does this pretty well.
 
T

TOMSONO

Guest
I'm gonna go ahead and assume you're not using physics. If you plan on having cars in your game, I would really use physics since there is a lot of moving things, and making collisions for all of that will be a major pain. Obviously with cars, you're going to hit the buildings at really strange angles, and you'll be turning so you may have corners of rectangles colliding with circles and all sorts of weird collisions. There is a good asset on the marketplace that does this pretty well.
First of all, thank you for the response! Physics is hard, I've never used it yet. I have that asset but it's not perfect. For example if you reverse with the car then turning the car is inverted. Also, the asset is in 2d but my game is 2.5d so this is a small problem. Is there any way you could help me with the game?
 
T

ThunkGames

Guest
Have you seen this? I've used it before for a GTA-style project. Vehicle physics aren't ultra realistic if that's what you're going for.

Edit:
I recall being able to import it into studio and having it work.
 
Last edited by a moderator:
T

TOMSONO

Guest
Have you seen this? I've used it before for a GTA-style project. Vehicle physics weren't ultra realistic if that's what you're going for.
Oh yeah, I rememnber this engine. I even used it few years back when I had no clue about GM. I'm probably giving it a shot. If I remember right then the 3d houses look really weird in it, how could you fix it?
 
J

jackhigh24

Guest
why dont you use that new open sorce project that yoyo made them selves, or should i say mike made its free its unfinished but has a lot done so not hard to add stuff, its a gta clone works good, i cant remember how to find it but someone should know where it is on there website, like mike, pm him then get the link and post it here for others so they dont go pestering him for it.
 
P

Paolo Mazzon

Guest
If you don't want to use physics, you could just check the rectangle of the car before moving. If you know where the player wants to go (maybe they're turning left and accelerating), just check x amount of pixels to the left and in front of the car before going there. I don't know if gamemaker's built in collisions will allow for non axis aligned collisions; so if they don't you could always invest some time in making a Gamemaker implementation of the Separating Axis Theorem, which would allow you to check the car's rectangle against any convex object in the game. (But that may be a bit overkill, depending on how complex the game's walls will be.)
 
Top