[Behavior] Car physics

Post your completed addons to share with the community

Post » Tue Apr 09, 2013 5:19 am

@trollface

Are you certain that the error comes from this behavior and not from something else? The behavior is still in beta, so it is not finished.

All behaviours/plugins are open source, so if you feel like it, you can always try to change around in the source code to fix the issue, if the issue do come from this behavior.
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Tue Apr 09, 2013 6:24 pm

I already built my way around today using physics, the error came definitely from the plugin, I got my game up and running and it is currently waiting for approval. You should try to test debugging on visual studio to see if you get the same error. I hope that you find the bug and fix it.
B
14
S
5
G
4
Posts: 107
Reputation: 4,758

Post » Fri Apr 12, 2013 4:38 pm

@CodeMasterMike Thank You for your great plugin. I would like to ask if there is a tested routine to mirror (set it to the orher direction) a side view car?!

I've try to make a container, mirror pieces one by one, and setup the sideview again, but with no success, the pieces of the car falling off.

Do anyone done it? Please help me if you can.
B
19
S
5
G
4
Posts: 109
Reputation: 4,195

Post » Sat Apr 13, 2013 9:02 pm

@Epox

I don't know any easy way to do that, sorry.
In theory, you would have to destroy the behavior, mirror the car, and add the behavior to the car physics in order to make it go the other direction. How and if this is possible, I don't know since I haven't tested it.

Maybe another way is to have one car pre-created in each direction and switch between them somehow, depending on which direction you want to go.
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Wed Jun 12, 2013 11:41 am

Hey CodeMasterMike,

This behaviour is pretty cool. It took some tweaking but I have a car that's acting pretty nicely.

A couple of things though;

1 - I'd like to be able to compare the "speed" of the car, in order to apply some other forces for turning (like extra friction for slowing down, etc) but there appears to be no comparison for "speed".

2 - The car always feels a bit "floaty" like it's driving on dirt. I've tried messing about with mass, friction, etc. but to no satisfying result. Any tips to get the car to feel more like it's driving on asphalt?

Never-the-less... pretty nice all round :D

*EDIT*
Nevermind, I found the speed comparison. I must be blind! Still wondering about point 2 though ;)

*EDIT AGAIN*
One last thing I noticed, is you have to create the vehicle in a up/down direction, with the car facing up. Construct default direction is left/right, with the 'front' of the object facing right. This can make things confusing when trying to compare object directions. Any chance you can change it to suit the default Construct "rules"?

*ONE MORE THING*
When I export my project, be it HTML5, EXE, whatever... I get a plain black screen when I run it. If I remove the custom car physics behaviour, it works fine (but the car doesn't work any more, obviously). Must be a bug somewhere :/ Using Construct 2, R131, but about to update to 132 or 133 (whatever the latest is, as of today). *JUST TESTED R133* and it's still bugging out on export. I hope it's something simple to fix... I'm really enjoying this behaviour.

~SolSoldjahBoy2013-06-12 14:25:44
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Thu Jun 13, 2013 5:25 am

A few more things/notes I have noticed since experimenting pretty heavily. There may be ways around these "missing" features, but I'm not seeing them. Perhaps you can clear some other things up too :)

1 - Since braking/reverse is a single action, and there is no negative for "speed" of the object (IE, a reverse speed) it's difficult to set maximum speed for reverse while still allowing braking above the desired maximum reverse speed. Any chance of either separating the brake/reverse actions, or applying a negative to a reverse speed?

2 - Moving the car "body" or "chassis" as I have called it, on start of layout, causes some crazy effects. If I want the car to start on a random position and angle on the layout, what's the best way to do this? I have tried setting the X,Y, and Angle of the "chassis" and all of the "wheels" on start. The front wheels seem to be fine, but the rear wheels are usually not present, and come 'flying' in to the car from some random position in the layout.

This also applies some pretty heavy physics forces to the car, sending it driving/spinning away. Setting the chassis to 'immovable' temporarily fixes this problem, but stops the vehicle from appearing at a random X,Y (though the angle is still random).

I have tried ordering when the "carphysics created" from your behaviour takes effect, but it still causes the problem. Any hints/tips?

3 - What does the "topdown car settings - specific settings for topdown car behaviour" option do? I can figure out the rest of the behaviour options, more or less, but that one has me stumped.

4 - Is there a way to 'set' the speed of the vehicle directly? I know you can do a speed comparison (for making shifting gears, etc) but I can't seem to 'set' the speed without applying forces via physics. When the car hits an object, it seems to maintain it's forward momentum, even when it's hard up against a wall or other obstacle. It then takes a while (depending how fast you're driving) until it will reverse, (or go forwards if you've hit the obstacle in reverse). I'd like to be able to do something like "car hits obstacle -> set speed to current.speed - X" in order to quickly scrub off a percentage of the speed.

Again, awesome addition. Hopefully I can figure out some of these minor issues :)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Thu Jun 13, 2013 5:52 am

@SoldjahBoy Thanks for the input! Some nice ideas you have written down.

Although I have to say, that I haven't updated this behaviour for around a year now. The company I worked for where I started to developed this behaviour doesn't exist anymore, and Im working at another company, where we don't use Construct.

I do have a Construct licence myself and my plan was to work with Construct on my spare time, but work and family is taking all my time, so I haven't been able to work with Construct at all for the last year, and I don't know when I can sit down and update my plugin/behaviour projects I enjoy working on.

Now to your comments!

- With the crashing on export, I cant say why. I was working when I did the behaviour, although that was around the r100 update, so things have changed and therefor it probably doesn't work as it should. The behaviour relies heavily on the internal physics engine in Construct, so if there was a internal change, the risk is it affects this behaviour. Try to export without using "minify script", and see if that helps.

- With getting a more feeling of "asphalt" then I cant straight out say what you need to change, since changing one parameter can change the feeling of the car, so the sollution lies there somewhere, just takes amount of time to get it right. But I would think it lies in the wheels and how their settings are set.

I used to work with Virtools and their car physics, which had loads and loads of settings to play around with. And it could take very long time with fine tuning to get the car behaviour you wanted.
In my todo list, there is more settings I would like to test and develop to change the behaviour of the car physics.

2. Stuff like that is what I want to develop for the behaviour in the future, but as I stated, I don't know when that will be.

3. I can't remember really what caused this. But normally you need to place the car objects before you add the car physics. moving the car after the physics is set, then issues like this can appear. Don't know if that is the cause of your issue though.

4. This setting doesnt do anything. I put it there to make it easier to seperate the setting parameters. There is probably a better way to do it now :-)

5. Maybe its possible to make some function for that. But generally you would need to use some kind of force since that is how you make a pyhsics object to move, to make the movement and physics behaviour realistic.

Im glad that you enjoy using this behaviour, and I hope I get some time soon to update it, and add my list of features and fixes that I have in my head.CodeMasterMike2013-06-13 06:01:07
B
38
S
13
G
9
Posts: 151
Reputation: 8,427

Post » Thu Jun 13, 2013 7:35 am

Hey Mike,

Thanks for the answers :)

I tried exporting without having "minify script" and it's now working, thank you :D

To the rest of my questions, I will just figure out creative work-arounds for those issues for the time being. ;)

I hope you find the time to get back in to doing Construct 2 plugin/behaviour development. Stuff like this behavior is really nice for code-lamens like me.

Thanks again, and peace ;)

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Jun 17, 2013 5:06 am

This is awesome man!!! Can i use the sprite that is in the CapX? I want to try and make a free to play game.
GMO FOOD = DEATH
B
18
S
5
G
3
Posts: 518
Reputation: 4,662

Post » Fri Nov 15, 2013 10:25 am

hello mike
thank you for the behaviours
Could you please add a prismatic joint to your behaviours or help me or guide me to create a prismatic joint behavoiurs my own to use along with yours.
plz reply as soon as possible
B
7
S
2
Posts: 44
Reputation: 668

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests