Page 1 of 3

[Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Fri Oct 18, 2013 09:36
by webdesigner97
Please note: This mod is abandoned. A new project ("vehicles") has been created @GitHub

Hello everyone,
although there are already some car mods, I release the indev version of my very own one. It does not base on other mods, like boats or hovercraft; it was coded completely by me.
Using melkor's car01 model, it focusses on realistic physical behaviour. Well, at least it will do this one day (it isn't perfect yet). The goal is to improve them step by step and once the mod works well, it will be added to my StreetsMod.

Spawn the car using /spawnentity streets:melcar

Licenses:
./models : CC-BY-NC-SA
Code: CC-BY-SA

Download:
Github Repo
Download zip from GitHub

Image
Two Melcars meeting at an intersection

Image
Driver's perspective

The cars:



Melcar:
Image
Maximimum speed: 35 n/s = 126 kn/h (nodes/second; kilonodes/hour)
Acceleration Factor: 6.25
Deceleration Factor: 4.5
BrakeFactor: 9
Stepheight: 0.5
Gears: automatic (N, D (R)) <- not yet available

[u]Videos[{U]


(Might not be up-to-date)
Riding a Melcar (May 19, 2014)
Rubenwardy riding a melcar (May 17, 2014)

PostPosted: Fri Oct 18, 2013 14:31
by philipbenr
Testing now. :) I'm glad to see you got through with this.

PostPosted: Fri Oct 18, 2013 15:40
by webdesigner97
philipbenr wrote:Testing now. :) I'm glad to see you got through with this.

Yes, I am very very proud. Sometimes, the car goes crazy, but at least it drives :D

PostPosted: Sat Oct 19, 2013 02:53
by philipbenr
Problem: how do I enable? I have tried many different ways....

PostPosted: Sat Oct 19, 2013 06:54
by webdesigner97
philipbenr wrote:Problem: how do I enable? I have tried many different ways....

Oops, forget to explain that... I'll add it to first post :O

PostPosted: Thu Dec 05, 2013 20:27
by i love minetest
it won't load or run the mod what should it be named as

PostPosted: Fri Dec 06, 2013 05:40
by hoodedice
i love minetest wrote:it won't load or run the mod what should it be named as


This mod is indev. I wouldn't suggest you using it XD

Anyway, unzip it into the mods directory; rename it 'cars'.

Now fire up minetest, go to the mod config, enable this mod, open your world, type /spawnentity streets:melcar

If it works, gimme a high five.

---------------------------------------------------------------------------------

I checked out the code. It is the neatest code I've ever seen for a mod XD. Great work!

In https://github.com/webdesigner97/cars/blob/master/init.lua#L166 , you might want to set the deceleration rate by checking which block it is on. You could try setting a higher decel rate for stuff like sand and a lower one for asphalt.

And in here: https://github.com/webdesigner97/cars/blob/master/init.lua#L139
You could try changing the acceleration vector's angle, or add a perpendicular vector to the acceleration vector.

PostPosted: Fri Dec 06, 2013 10:57
by webdesigner97
hoodedice wrote:
i love minetest wrote:it won't load or run the mod what should it be named as


This mod is indev. I wouldn't suggest you using it XD

Anyway, unzip it into the mods directory; rename it 'cars'.

Now fire up minetest, go to the mod config, enable this mod, open your world, type /spawnentity streets:melcar

If it works, gimme a high five.

---------------------------------------------------------------------------------

I checked out the code. It is the neatest code I've ever seen for a mod XD. Great work!

In https://github.com/webdesigner97/cars/blob/master/init.lua#L166 , you might want to set the deceleration rate by checking which block it is on. You could try setting a higher decel rate for stuff like sand and a lower one for asphalt.

And in here: https://github.com/webdesigner97/cars/blob/master/init.lua#L139
You could try changing the acceleration vector's angle, or add a perpendicular vector to the acceleration vector.

Yes, different decels for differetn nodes are planned. And thx for the compliment :D All this vector stuff is quite new to me and I think I need to learn a lot about it, but one day this will be a real working car mod.

Edit: The interesting part of this mod is that I can try to use what I learned in my physics class :D

PostPosted: Fri Dec 06, 2013 12:34
by hoodedice
The interesting part of this mod is that I can try to use what I learned in my physics class :D


=D How did you guess I knew about vectors on my end? Physics ofcourse!

PostPosted: Fri Dec 06, 2013 12:46
by Krock
Wow, that's a nice car!
Would it be possible to change the yaw of a player too while pressing left or right?
Irritates me a bit when only the car turns, but not me :3

PostPosted: Fri Dec 06, 2013 15:31
by webdesigner97
Krock wrote:Wow, that's a nice car!
Would it be possible to change the yaw of a player too while pressing left or right?
Irritates me a bit when only the car turns, but not me :3

Sure, will be added as soon as the physics work :)

PostPosted: Fri Dec 06, 2013 20:12
by i love minetest
webdesigner97 wrote:
hoodedice wrote:
i love minetest wrote:it won't load or run the mod what should it be named as


This mod is indev. I wouldn't suggest you using it XD

Anyway, unzip it into the mods directory; rename it 'cars'.

Now fire up minetest, go to the mod config, enable this mod, open your world, type /spawnentity streets:melcar

If it works, gimme a high five.

---------------------------------------------------------------------------------

I checked out the code. It is the neatest code I've ever seen for a mod XD. Great work!

In https://github.com/webdesigner97/cars/blob/master/init.lua#L166 , you might want to set the deceleration rate by checking which block it is on. You could try setting a higher decel rate for stuff like sand and a lower one for asphalt.

And in here: https://github.com/webdesigner97/cars/blob/master/init.lua#L139
You could try changing the acceleration vector's angle, or add a perpendicular vector to the acceleration vector.

Yes, different decels for differetn nodes are planned. And thx for the compliment :D All this vector stuff is quite new to me and I think I need to learn a lot about it, but one day this will be a real working car mod.

Edit: The interesting part of this mod is that I can try to use what I learned in my physics class :D



yay it worked ps how do I delete it

PostPosted: Fri Dec 06, 2013 20:43
by hoodedice
i love minetest wrote:yay it worked ps how do I delete it


The ride? Keep punching it. To see the remaining health it has, watch the debug console.

PostPosted: Fri Dec 06, 2013 21:07
by qwrwed
hoodedice wrote:To see the remaining health it has, watch the debug console.

Or press F5 (and look at the car).

PostPosted: Sat Dec 07, 2013 07:28
by webdesigner97
As already said, this mod is not meant to be used on "real" worlds. It isn't finished ^^

PostPosted: Sat Jan 04, 2014 20:51
by neron
Any new updates to this awesome mod?

PostPosted: Sun Jan 05, 2014 08:54
by webdesigner97
neron wrote:Any new updates to this awesome mod?

Currently not, but pls don't think it's dead. I just don't have the time to continue at the moment...

PostPosted: Sat Apr 12, 2014 19:32
by jacobwellz
Wornt work just says fails to run or load and if I change it to cars the file when it's loading it just quits me please help

PostPosted: Sun Apr 13, 2014 08:06
by webdesigner97
Although the mod is quite unstable, crashes should not appear. Can you provide a full error message from the debug.txt?

Re: [Mod] Car extension for StreetsMod (indev, unstable)[car

PostPosted: Fri May 16, 2014 21:25
by webdesigner97
Update, Update!

The first alpha version (Download from GitHub) is available for public testing. Please don't use this in your "real playing worlds", it might cotain bugs.

What changed?
-> Rework acceleration to not use self.object:setacceleration() which caused odd behaviour
-> Remove gears and RPM
-> Tweaked Physics
-> Added a HUD

Please feel free to test it and please report bugs here or in the GitHub Repo, thanks!

Re: [Mod] Cars for StreetsMod (TESTERS NEEDED)[cars]

PostPosted: Sat May 17, 2014 06:40
by webdesigner97
Update to master: Added automatic gears (D, N). R coming soon.

Download latest Zip to check it out.

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Sat May 17, 2014 12:56
by webdesigner97
Fixed car driving in wrong direction. I calculated the speed vector in a method that only works with degrees, but Minetest uses radians.

Fun fact: A melcar needs 8.5 nodes to stop from high speed.

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Sat May 17, 2014 14:44
by rubenwardy

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Sat May 17, 2014 14:50
by webdesigner97
rubenwardy wrote:I made a video.

https://www.youtube.com/watch?v=jRZ9gtHWqlc

Really cool! I'll add it to first post later (with credits!)

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Sat May 17, 2014 17:17
by Jordach
I figured out something with the cars moving if you have multiple out:

Use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
 local variablename = "string text or number"


Once the variables are local, they will NOT ACT AND INTERFERE WITH OTHER CARS OF THE SAME COLOUR!

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Sat May 17, 2014 18:00
by webdesigner97
Jordach wrote:I figured out something with the cars moving if you have multiple out:

Use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
 local variablename = "string text or number"


Once the variables are local, they will NOT ACT AND INTERFERE WITH OTHER CARS OF THE SAME COLOUR!

You mean inside the entity definition?

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Sat May 17, 2014 18:10
by Jordach
webdesigner97 wrote:
Jordach wrote:I figured out something with the cars moving if you have multiple out:

Use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
 local variablename = "string text or number"


Once the variables are local, they will NOT ACT AND INTERFERE WITH OTHER CARS OF THE SAME COLOUR!

You mean inside the entity definition?

Yes. As well as in the functions else where. Any sort of leak like that can affect everything else, that's why the mobs in simple mobs don't move in the same directions.

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Sat May 17, 2014 20:41
by webdesigner97
Jordach wrote:
webdesigner97 wrote:
Jordach wrote:I figured out something with the cars moving if you have multiple out:

Use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
 local variablename = "string text or number"


Once the variables are local, they will NOT ACT AND INTERFERE WITH OTHER CARS OF THE SAME COLOUR!

You mean inside the entity definition?

Yes. As well as in the functions else where. Any sort of leak like that can affect everything else, that's why the mobs in simple mobs don't move in the same directions.

Thank you for trying to help! But now I did it the same way as in boats (or is there something I didn't see?), and it still moves all cars... Here's the code

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Mon May 19, 2014 18:23
by jacobwellz
Doesn't work fales to load and run please fix

Re: [Mod] Car extension for StreetsMod (ALPHA)[cars]

PostPosted: Mon May 19, 2014 18:30
by Evergreen
jacobwellz wrote:Doesn't work fales to load and run please fix

Okay, how do you expect anyone to fix anything with just a "fales to load and run please fix"? Give us more information.