Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Very simple kart physics

Author
Message
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 16th Jan 2019 09:20
Sorry
fubar
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 16th Jan 2019 09:51
Not a problem at all. Still have lots to do not least of all RIcks Mirror
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 20th Jan 2019 01:41 Edited at: 27th Jan 2019 09:22
Been having a lovely break away from coding but today I thought
Ide start naming the opponents and count lap times (names were randomly chosen and not a go at any individual)

Video removed for space please see latest post

blinks car physics code really works well

Ive really only added ricks mirror which you cant see in this video
and the AI opponent code as previously explained how it works
and ofcourse track and car selection


The check point code was quite simple really two rectangular boxes across
the track near the start and two variables added to vehicle type
this is how it determines if you have done a lap. If you have reset ie fallen off
the start variable is set back to 1. With checkpoint 1 just being infront of the start
car position and checkpoint 2 just in front of that by about the length of a car


The only individual characteristics they have atm
is they all have different top speeds and "Bulldoze Bret" doesn't slow down if theres a car in front. (sounds like me lol)

Source can be downloaded here http://users.tpg.com.au/subarpk/KrazyGrandPrix.rar
fubar
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 20th Jan 2019 04:21
Looking great Fubes. If i get a chance i'd luv to design a track
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 20th Jan 2019 04:32 Edited at: 20th Jan 2019 04:48
Thanks

Sure I did what you said and used your track editor
loaded into Blender reduced vertices and extruded
I think by 1.00

I may try again with my extruder that worked well too
but only on normal settings and not smooth extrude.
Which would go well with the block theme


Still lots to do to make a game out of it instead of just
a test a track theme
fubar
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 20th Jan 2019 10:16
@fubarpk
Looking good. Starting to look like a real nice F1 racer game. I miss 'my mirror' (=chafari's) view though.
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 20th Jan 2019 12:59 Edited at: 27th Jan 2019 09:23
Quote: " If i get a chance i'd luv to design a track"

Havent successfully done the double helix part of your track yet, haven't given up on the possibility tho just need to be a good driver

Following your track design I wipped up this track seems to work ok altho that nasty neville and bulldoze bret knocked each other off
the track in this attempt

Quote: "I miss 'my mirror' (=chafari's) view though."

That mirror is kinda handy for knowing whats behind you but I just find the driving a little harder that way but theres some of that here

Video removed for space please see latest post

Source can be downloaded here http://users.tpg.com.au/subarpk/KrazyGrandPrix.rar
fubar
puzzler2018
User Banned
Posted: 20th Jan 2019 13:05
AGK for Dummies required

I have this code


Have a camera,

Have a cube (red land)

Have a smaller object sitting just underneath the cameras location (object collisioning object for the camera/player)

How do we write this code to stop the camera from moving when the camera object hits the land object? (I.E landed on a surface of another object)

My skills at ray casting to and from objects is just not coming to me.

Any help tips would be great


PS Who the heck is ray anyway... he beginning to wind me up LOL
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 20th Jan 2019 13:20 Edited at: 20th Jan 2019 13:22
Raycasts are always a pain I find
if your using another object for positioning the camera
you can use the width, height depth of that object to determine if it is colliding with object 2



where objId might be your white block and objID2 your red block


PS when you find ray tell him im looking for him too
fubar
puzzler2018
User Banned
Posted: 20th Jan 2019 13:30 Edited at: 20th Jan 2019 13:34
Works beautifully. Smart peice of code there



The idea is to have 6 small .01,.01,.01 collission boxes surrounding the camera (will be invisible of course) to act on collisioning when move about.

These will be underneath, above, front, left, right, back of the camera

Is that how you all would do it or is there a better way
Cheers
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 20th Jan 2019 13:45 Edited at: 20th Jan 2019 13:46
that sounds like a good method to me,, that's how the AI cars work they have blocks in the front left middle and right
left and right ones keep them on the track while the middle one I use for deciding if brakes should be applied. So I
don't see any problem with using the same style to keep a camera on track. but blink is pretty good with his camera
movements he may have a better idea. but its late in Australia atm so you may have to wait until tomorrow for his
response
fubar
puzzler2018
User Banned
Posted: 20th Jan 2019 14:28
Thanks - finally figured something out with the 6 point collisioning




fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 21st Jan 2019 00:56 Edited at: 4th Feb 2019 12:52
And the true test of Crazyness a figure 8 track,
The AI doesn't know if its coming or going lol but they still do laps even if its the wrong direction

Video Removed for space but this one is kinda an improvement I think

fubar
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 21st Jan 2019 14:06
Awesome!
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 25th Jan 2019 15:26 Edited at: 25th Jan 2019 15:28
At times it appears when holding the Spacebar(brake) and then also still pressing Forward button then the speed value appears to accumulate and launch the vehicle faster then should, when Spacebar is released.

This has just became more noticeable when using KrazyGrandPrix by fubarpk, when I've lowered the track to terrain level, so that the vehicle can then sometimes in corners(when still has enough speed) get back on track when slipped off. If used the spacebar to brake then gets and increadible speed which launches it over to the otherside of the road, effectively shooting off track on the otherside.
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 25th Jan 2019 19:55
Ok. I'm a bit busy on other stuff right now but i'll check it out as soon as i can. Thanks!
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 27th Jan 2019 12:08
I have noticed since I added a speedo and sounds
that when a car runs off the edge onto the grass (in krazyGrandPrix)
velocity.current doesn't change. Which to me shows
that velocity.current needs to be set somewhere
to its actual current velocity. Il have a think about
that and see what might be the best way to achieve this
fubar
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Jan 2019 21:05 Edited at: 28th Jan 2019 00:50
That is true. When the vehicle leaves the ground it doesn't change the velocity.
I found that if velocity was reduced while in the air (as it should be) The speed of the vehicle when it
came in contact with the ground again was too slow (at least for mario style games).

Also if you think about it, when a car is in the air and you still have your foot on the accelerator then the wheels will spin faster as there is no friction
making the car think it's going faster

You might be better off converting GetObject3DPhysicsLinearVelocityX/Y/Z( objID ) to a distance and using that for your speedometer
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 28th Jan 2019 05:16
I ended up doing this


which kinda cuts out the engine when your on the grass

I did try a formula using those vectors which worked well for the sounds but the speedo needle was erratic
and kinda anoying but the engine stalling seems to work
fubar
fubarpk
Moderator
14
Years of Service
User Offline
Joined: 11th Jan 2005
Location: Adelaide
Posted: 28th Jan 2019 05:24
O am I stupid today lol


was all that was needed
fubar
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 30th Jan 2019 00:25 Edited at: 30th Jan 2019 00:32
Added some head & rear brake light mods. Not as pretty as could be(the quick & dirty method, just for fun)



LoadVehicle.agc


MoveVehicle.agc


main.agc
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 30th Jan 2019 01:20
Wow! That looks very nice. I gotta get around to sticking this stuff into the engine
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 1st Feb 2019 10:46
It's fun but not very sophisticated: When the car isn't level, the 'beams' can go up in the air and reveal it's a fake, destroying the illusion.
Not ideal on uneven terrain.

Perhaps a solution would be a raycast towards the terrain and extend the lightcone until the point of contact, but currently haven't got time enough to try that, so perhaps later.
blink0k
AGK Developer
Gold Codemaster
6
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 19th Mar 2019 23:24
Going to have to give this a go at some point
https://twitter.com/KenneyNL/status/1107783904784715788
Resourceful
5
Years of Service
User Offline
Joined: 29th Jan 2014
Location: every ware
Posted: 26th Apr 2019 17:23
@blink0k

Hey
Glad to see the Posting is Still Open

it's easier than it uses to be to make game compared to the real old days of the computer before windows
but is the Physics that can be confusing with not eacly knowing ware to start.

The Vehicle Physics I am after
are Grand Theft Auto and Need for Speed: Most Wanted
I wish they had dun a few more things with those games
I know a lot of effore whent into them

(Edy Vehicle Physics) vs (MS Vehicle System) vs (Realistic Cars)

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=2&cad=rja&uact=8&ved=2ahUKEwjW_52Dk-7hAhVHiqwKHdSIB4gQwqsBMAF6BAgHEAc&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Db5DFLwGaWaI&usg=AOvVaw0yyQb99i9yI6QycfBFViUS

and since i don't have or can get the program you use to make 3d with
it makes it a bit harder to achive the path I am after

saying all that and show the example video
I want to achive a Driving Game ware it dose not repate the same things over and over
and is expandable not by just me but the every one who want to play it .
Rick Nasher
1
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 29th Apr 2019 21:22
Heyyy an update in this thread.

Login to post a reply

Server time is: 2019-05-19 12:29:35
Your offset time is: 2019-05-19 12:29:35