[SOLVED] Racing Game, collision, getting stuck problem

Get help using Construct 2

Post » Thu Jul 31, 2014 10:09 pm

Hi, I'm working on a simple racing game, and while trying to make some collision between the AI I ran into some problems.
Just so you know I'm using 2 plugins by rewrainbow, "MoveTo" and "PushOutSolids", those can be found here:
http://c2rexplugins.weebly.com/rex_moveto.html
http://c2rexplugins.weebly.com/rex_pushoutsolid.html

Move to is used to make the ai cars move around the track, and PushOutSolid I'm trying to use for collisions, adding Solid and PushOutSolid behaviour to the AI controled cars seemed to be the best option so far.

The problem I'm having is that sometimes the AI get stuck and stop moving. I'm still not too sure about what is happening.

It's fine if them bump into each other or even have a little bit of overlapping, I just don't want them to completely run over each other.

I'm looking for any tips on how to improve collisions, different approachs are also welcome.

Below is the current capx I'm working on.

Stuff to look at:
AICar object (collision polygon and behaviours)
AI eventSheet (makes everything move)
You do not have the required permissions to view the files attached to this post.
Last edited by caiorosisca on Mon Aug 04, 2014 6:08 pm, edited 2 times in total.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Fri Aug 01, 2014 6:09 am

Cant open your file right now , but avoid on a certain radius will probably solve your problems, from those that i am reading of at least.
Hire or Offer a project

Portfolio

Scirra new Shop
B
34
S
5
G
1
Posts: 118
Reputation: 2,663

Post » Fri Aug 01, 2014 1:13 pm

@Michaelb how would you go about coding that avoidance? As I'm using the MoveTo behaviour I feel I'm a bit limited on what I can do. If you got the time please have a look at the capx
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Fri Aug 01, 2014 8:48 pm

anyone?
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Sat Aug 02, 2014 4:03 am

Hello Caio ,

i will look at it today and message you.

Take care.
Hire or Offer a project

Portfolio

Scirra new Shop
B
34
S
5
G
1
Posts: 118
Reputation: 2,663

Post » Sat Aug 02, 2014 6:55 am

Just a thought (don't have the plugins, so can't see your capx), have you messed with the cell size and cell border setting of the pathfinding behavior? (or do those plugins replace pathfinding?)
B
88
S
43
G
71
Posts: 601
Reputation: 43,669

Post » Sat Aug 02, 2014 9:45 am

So I took a look to the capx.
I tried several adjustment, but still there is a chance the cars will eventually stop moving when they are overlapping. I did an inspection on debugger & watch the remain distance of stopped car was negative value. While other cars that still run, show positive value.

Yes it is something to do with the plugin 'move to'

I suspect the negative value cause the error
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394

Post » Sat Aug 02, 2014 10:44 pm

@spacedoubt MoveTo is replacing the pathfinding behaviour

@alextro thanks a lot for having a look at it. I've never messed with the debugger in Construct, I'm gonna have a look at it, maybe I can acess remaining distance as a variable and I don't know, this way I might be able to make a quick fix restarting the move behaviour. I might even try to modify the behaviour and make it acessible for debugging purposes, in case it's not.
Thanks for pointing that out.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Mon Aug 04, 2014 6:07 pm

I modified(broke) the plugin to work in this case, thanks everyone, specially @alextro for pointing out what could be causing this problem.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Mon Aug 04, 2014 6:12 pm

Oh well it's really good for you then, if you can handle the problem & modified the situation ;)
Good luck with your racing game.
ImageImage
B
111
S
51
G
24
Posts: 787
Reputation: 23,394


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests