[mod] Bike for Minetest [1.2.2] [bike]

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

[mod] Bike for Minetest [1.2.2] [bike]

by Hume2 » Post

Hello everyone!
Image

I created a mod that adds bikes. Bikes are about 25 km/h fast but have one disadvantage: Bikes can climb 0.5 blocks maximum and don't ride fast on dirt and sand, so you have to build a road first and then you can ride.

Click the bike to get on, sneak to get off. W/D to accelerate/deccelerate, A/D to turn left/right. Press space to wheely. As you might know, bikes usually don't ride backwards. This bike doesn't ride backwards too. And it rides slowly on crumbly materials and very slowly in water. You can carry up to one bike at once. If you try to pick up another bike, you get 6 steel ingots instead.

Crafting:
Spoiler
W = wood, I = iron
Bike wheels:
...W...
W I W
...W...
If you have the mod "technic" installed, use rubber instead of wood.

Bike handles:
W = wood, I = iron
I . I . I
W...W

Bike
W = wood, I = iron, h = handles, w = wheel
h ...W
I . I . I
w ... w
The mod is derived from MTG's boat mod.
License: MIT
Dependencies: default

changelog:
Spoiler
Version 1.2.1
  • Added setting to enable turning by mouse instead of keyboard
  • Added a setting to make bikes ownable
  • Added a setting for step height
  • Fixed a few bugs which caused the mod to crash
Version 1.2
  • Added Mineclone 2 compatibility
  • Added Whynot compatibility
  • Added settings for speed, acceleration and such
  • Added "bike_" prefix to textures which didn't have it
  • on_step callback now uses dtime, so the efficiency of actions no longer depend on lag
Version 1.1.2
  • Added bike painter (how did it happen that this wasn't released before???)
  • minor fixes
Version 1.1.1
  • 3D Armour mod is now supported correctly.
  • Bikes are now always placed to the player's position, not the pointed position. Former behaviour allowed the players to get to places normally unaccessible because of his long hands.
Version 1.1
  • Bikes are dismounted by sneak key.
  • Added bike and player animation.
  • Bikes ride slowly on crumbly materials.
  • Bikes can be now picked up unless the player already has one bike in his inventory.
  • Press jump to wheely.
  • Limit speed to approximately 25 km/h.
Version 1.0 is initial version.
Special thanks to:
  • GreenDimond for bike animation and many other improvements
  • gpcf for testing and good ideas
  • AutumDeluge for a some fixes and new features
Download:
Last edited by Hume2 on Fri Mar 03, 2023 20:41, edited 10 times in total.
If you lack the reality, go on a trip or find a job.

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Bike for Minetest [bike]

by Andrey01 » Post

The model looks like nice. Interestingly to see how it`ll work :)
One obvious disadvantage: you should make animation of how player is riding and also his hands on grips.

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [mod] Bike for Minetest [bike]

by Hume2 » Post

Andrey01 wrote:The model looks like nice. Interestingly to see how it`ll work :)
One obvious disadvantage: you should make animation of how player is riding and also his hands on grips.
Thanks for response. The animation is missing but it's for a reason. I can't simply move any body part to any position, there are only a few animations those I can use. Adding another animation would require changing the player's model and it would ruin for example the 3D Armour mod, which changes the player's model too.
If you lack the reality, go on a trip or find a job.

User avatar
Krock
Developer
Posts: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [mod] Bike for Minetest [bike]

by Krock » Post

Well done, that one runs quite fast. I do have some suggestions:
1) Reduce the yaw change per second, depending on the speed. It's hard to stay on the road at full speed
2) Use `self.object:move_to(self.object:get_pos())` (L183) instead of `self.object:setpos ` to reduce the movement jitter
3) Just some modernization you could do in your mod:

Code: Select all

2018-08-28 10:04:35: WARNING[Server]: Call to deprecated function 'setacceleration', please use 'set_acceleration' at /data/Minetest/run/bin/../mods/bike/init.lua:92
2018-08-28 10:04:35: WARNING[Server]: Call to deprecated function 'setyaw', please use 'set_yaw' at /data/Minetest/run/bin/../mods/bike/init.lua:217
2018-08-28 10:04:35: WARNING[Server]: Call to deprecated function 'getvelocity', please use 'get_velocity' at /data/Minetest/run/bin/../mods/bike/init.lua:158
2018-08-28 10:04:35: WARNING[Server]: Call to deprecated function 'getpos', please use 'get_pos' at /data/Minetest/run/bin/../mods/bike/init.lua:160
2018-08-28 10:04:35: WARNING[Server]: Call to deprecated function 'getyaw', please use 'get_yaw' at /data/Minetest/run/bin/../mods/bike/init.lua:86
2018-08-28 10:04:35: WARNING[Server]: Call to deprecated function 'getyaw', please use 'get_yaw' at /data/Minetest/run/bin/../mods/bike/init.lua:138
2018-08-28 10:04:40: WARNING[Server]: Call to deprecated function 'setyaw', please use 'set_yaw' at /data/Minetest/run/bin/../mods/bike/init.lua:148
2018-08-28 10:04:40: WARNING[Server]: Call to deprecated function 'getpos', please use 'get_pos' at /data/Minetest/run/bin/../mods/bike/init.lua:176
2018-08-28 10:04:40: WARNING[Server]: Call to deprecated function 'getyaw', please use 'get_yaw' at /data/Minetest/run/bin/../mods/bike/init.lua:182
2018-08-28 10:04:40: WARNING[Server]: Call to deprecated function 'getpos', please use 'get_pos' at /data/Minetest/run/bin/../mods/bike/init.lua:183
2018-08-28 10:04:40: WARNING[Server]: Call to deprecated function 'setvelocity', please use 'set_velocity' at /data/Minetest/run/bin/../mods/bike/init.lua:184
2018-08-28 10:04:42: WARNING[Server]: Call to deprecated function 'setyaw', please use 'set_yaw' at /data/Minetest/run/bin/../mods/bike/init.lua:154
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
AspireMint
Member
Posts: 415
Joined: Mon Jul 09, 2012 12:59
GitHub: AspireMint
IRC: AspireMint
In-game: AspireMint
Location: Stuck at spawn

Re: [mod] Bike for Minetest [bike]

by AspireMint » Post

Image
mt 0.4.16, mt 0.4.17.1 and mt 5.0.0, same problem

gpcf
Member
Posts: 382
Joined: Fri May 27, 2016 10:48
GitHub: gpcf
In-game: gabriel

Re: [mod] Bike for Minetest [bike]

by gpcf » Post

The bikes seem too big, the handle is almost 2m high...

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Bike for Minetest [bike]

by Andrey01 » Post

gpcf wrote:The bikes seem too big, the handle is almost 2m high...
Why? On the screenshot that bike fits much for a player. If it will be smaller, it will be too small.

User avatar
Krock
Developer
Posts: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [mod] Bike for Minetest [bike]

by Krock » Post

Works well here.
Image
Attachments
screenshot_20180828_174809.png
screenshot_20180828_174809.png (347.14 KiB) Viewed 2513 times
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [mod] Bike for Minetest [bike]

by Hume2 » Post

Thank you all for responses!

I made an update:
  • Bike is now harder to control when rides faster.
  • When the bike falls, player is dismounted and therefore is vulnerable to falldamage.
  • Bike now stops when crashing to a wall.
  • Bike's model is now 80% size. Is the size OK now?
Image

A question for you: Should be the player able to pick up the bike and place it somewhere else? Or it should work like in the advtrains mod, so breaking the bike would give only some resources back?
Attachments
screenshot_20180828_221810.jpg
screenshot_20180828_221810.jpg (272.52 KiB) Viewed 2513 times
If you lack the reality, go on a trip or find a job.

Chiantos
Member
Posts: 377
Joined: Sun Jan 15, 2017 09:04

Re: [mod] Bike for Minetest [bike]

by Chiantos » Post

Deleted message
Last edited by Chiantos on Mon Sep 30, 2019 05:19, edited 1 time in total.

User avatar
LegoLogger
Member
Posts: 39
Joined: Thu Sep 01, 2016 16:08
GitHub: BakerPrime
IRC: BakerPrime
In-game: BakerPrime
Location: Somewhere on mars.....
Contact:

Re: [mod] Bike for Minetest [bike]

by LegoLogger » Post

Awesome! Another high quality mod to download.... :D
~~Logger
PS: I'm BakerPrime, the player that you met on the LinuxWorks server.
For those who complain about radiation, I should remind you that every time you leave your house, you step into
the worlds largest radiation beam. (Why else do you think us programmers hide in basements? ;P )

if you need to speak to me, you can catch me on #VE-Minetest-Servers, #RRH-Servers, ##Minetestwithunk, or #Minetest

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: [mod] Bike for Minetest [bike]

by GreenXenith » Post

Bike still too big (:
Image
Sam can't reach the pedals! D:
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
Stix
Member
Posts: 1385
Joined: Fri Aug 04, 2017 14:19
IRC: nil
In-game: Stix [+alts]
Location: USA

Re: [mod] Bike for Minetest [bike]

by Stix » Post

GreenDimond wrote:Bike still too big (:
Image
Sam can't reach the pedals! D:
Woah! How did you get Sam into that pose (i'm assuming you didn't use a new model?)!
Hey, what can i say? I'm the bad guy.

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [mod] Bike for Minetest [bike]

by Hume2 » Post

Chiantos wrote:Hello,

I think this two choices are Good, use and place for creative enable, destroy and give ressource for Survival enable.
And enable or disabled, else this is Survival or creative ... In creative give ressource is useless.

For me, for my i use, i am for destroy and place a other bike.

You think i can use this, with my Player Model in sith animation ? (With modify maybe ?)

Good Day.
Thanks for your opinion. When you use the default model's sit animation, the player's feet appear on the handles. I haven't seen your player model but you might confront similar problem.
LegoLogger wrote:Awesome! Another high quality mod to download.... :D
~~Logger
PS: I'm BakerPrime, the player that you met on the LinuxWorks server.
Thanks and nice to meet you!

For the "bike too big" problem: I tried three other scales:
70%: Image
60%: Image
50%: Image
Also consider these facts:
  • Sam is too fat and clumsy. It's not a realistic player model. His arms and legs are too fat and he lacks elbows and knees.
  • Sam can interact with blocks those are meters away and noone actually complains about this.
  • A real-size bike ridden by big fat Sam doesn't look well either.
I'd keep the size rather bigger and unrealistic than having a small bike driven by a big fat player. What size do you prefer?
Attachments
bike_50.jpg
bike_50.jpg (269.58 KiB) Viewed 2513 times
bike_60.jpg
bike_60.jpg (277.8 KiB) Viewed 2513 times
bike_70.jpg
bike_70.jpg (78.89 KiB) Viewed 2513 times
If you lack the reality, go on a trip or find a job.

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Bike for Minetest [bike]

by Andrey01 » Post

Hume2, you should make a bike longer and the pedals above its to look like nice and player could reach the ones.

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Bike for Minetest [bike]

by Andrey01 » Post

Krock wrote:Works well here.
Image
Krock, does 5.0.0 have new texture of healthbar as i see?

User avatar
AspireMint
Member
Posts: 415
Joined: Mon Jul 09, 2012 12:59
GitHub: AspireMint
IRC: AspireMint
In-game: AspireMint
Location: Stuck at spawn

Re: [mod] Bike for Minetest [bike]

by AspireMint » Post

(If you make motorbike you dont have to make player animations x) just use GD's modified model.)
That 70% looks good.
Idea: add jumping so we can jump on 1node high obstacle x)

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Bike for Minetest [bike]

by Andrey01 » Post

AspireMint wrote:(If you make motorbike you dont have to make player animations x) just use GD's modified model.)
That 70% looks good.
Idea: add jumping so we can jump on 1node high obstacle x)
This is not motorbike, and simple bike. Therefore player should rotates the pedals to go and the animation of this is needed. And also animation of that how player turns his legs.

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [mod] Bike for Minetest [bike]

by Hume2 » Post

AspireMint wrote:(If you make motorbike you dont have to make player animations x) just use GD's modified model.)
That 70% looks good.
Idea: add jumping so we can jump on 1node high obstacle x)
I like the 70% size too. My first impression was that it's too small so I made it 80% but now it seems me OK.

If the player is unable to put the bike back to his inventory, I will consider a way to jump on a 1-node high obstacle, so the players wouldn't have to craft a new bike each time they ride off the track. I'm worry that this ability can make the bikes overpowered, they are supposed to ride mainly on player-built roads.

For the player's animation:
Minetest and reality. I think, you are asking for too much. If any model animation is worth considering, it's the wheel animation. First of all, try to ride a bike (in reality) without bending your knees. If you can ride like this, you can work in a circus. Also consider that the real-world human legs are far thinner than Sam's legs. Any attempt of making this more realistic would actually make it worse. If I still haven't convinced you, I can add that it's possible to destroy blocks without touching them. The same with building blocks, opening doors, furnaces, chests etc.. You can open a door four meters away, no need to touch it.
If you lack the reality, go on a trip or find a job.

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Bike for Minetest [bike]

by Andrey01 » Post

I`ve made a bit change (the pedals have become above). Only i didn`t have a time to make updated texture (i hope you may make it yourself). Then i will try to make animation for player and bike:
https://ufile.io/7m69b

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [mod] Bike for Minetest [bike]

by Hume2 » Post

Andrey01 wrote:I`ve made a bit change (the pedals have become above). Only i didn`t have a time to make updated texture (i hope you may make it yourself). Then i will try to make animation for player and bike:
https://ufile.io/7m69b
Well, the pedals need to be redone completely because they wouldn't work this way either. If you are willing to make an animation, you're welcome. Just two notes: 1) Don't mark all edges seam, the UV map is totally messed up. 2) You managed to delete the chain, it's that weird rectangle face on the right of the back wheel and pedals.
If you lack the reality, go on a trip or find a job.

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [mod] Bike for Minetest [bike]

by Andrey01 » Post

Here i am making animation and it works strangely for me:
https://ufile.io/kmtqs
You can view my animation between first frame to second one. In fact it should rotate the pedals, once it animates the only pedal and incorrectly.

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [mod] Bike for Minetest [bike]

by Hume2 » Post

Andrey01 wrote:Here i am making animation and it works strangely for me:
https://ufile.io/kmtqs
You can view my animation between first frame to second one. In fact it should rotate the pedals, once it animates the only pedal and incorrectly.
Unfortunately, I can't help you with model animation much. Thanks for giving it a try.
If you lack the reality, go on a trip or find a job.

User avatar
Hume2
Member
Posts: 709
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [mod] Bike for Minetest [bike]

by Hume2 » Post

Update:
  • Bike is now 70% the original size.
  • Destroying the bike gives the player only 6 steel ingots back.
  • I added a crafting recipe.
The mod now has everything needed, so it's the 1.0 release. For the next releases, I plan:
  • bike racks
  • model animation if anyone is willing to do that for me
If you lack the reality, go on a trip or find a job.

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: [mod] Bike for Minetest [bike]

by GreenXenith » Post

Hume2 wrote:model animation if anyone is willing to do that for me
Currently working on that.
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests