[Mod] hang-gliders [hangglider]
- Piezo_
- Member
- Posts: 219
- Joined: Fri Jul 20, 2018 21:36
- GitHub: is proprietary I use NotABug
- Location: (x,y,z)
[Mod] hang-gliders [hangglider]
There's nothing more simultaneously exciting and terrifying than leaping off the top of a massive, snowy peak and gliding over the valley below.
That feeling of the icy wind rushing over you, the excitement rushing through your body... It's a thrill to die for.
Unfortunately, there's no way a thrill-seeker like you could get that kind of high in such a simple game with (let's face it honestly) such a sub-par physics engine, right?
W R O N G .
Feast your eyes on the hangglider mod!
This mod adds a fully fun and functioning glider to minetest, that you can use to travel long distances through the air, without having to worry about fall damage!
This mod is based on cdqwertz's paraglider mod (LGPLv2.1), which I can't seem to find anywhere, and another parachute mod which I also can't seem to locate, but I remember was under the WTFPL, so it doesn't really matter.
(Jeez, it's like Amelia Earhart all over again with these mods...)
Feeling daring? Looking for thrills? Download now,and throw caution to the wind!
License: GPLv3+
Depends: default, wool
Supports: minetest_systemd, player_monoids, areas, wardzones
EDIT: I found the second mod (parachutes). It's here.
EDIT2: I found the first mod (Paraglider). It's in the rpgtest game
That feeling of the icy wind rushing over you, the excitement rushing through your body... It's a thrill to die for.
Unfortunately, there's no way a thrill-seeker like you could get that kind of high in such a simple game with (let's face it honestly) such a sub-par physics engine, right?
W R O N G .
Feast your eyes on the hangglider mod!
This mod adds a fully fun and functioning glider to minetest, that you can use to travel long distances through the air, without having to worry about fall damage!
This mod is based on cdqwertz's paraglider mod (LGPLv2.1), which I can't seem to find anywhere, and another parachute mod which I also can't seem to locate, but I remember was under the WTFPL, so it doesn't really matter.
(Jeez, it's like Amelia Earhart all over again with these mods...)
Feeling daring? Looking for thrills? Download now,and throw caution to the wind!
License: GPLv3+
Depends: default, wool
Supports: minetest_systemd, player_monoids, areas, wardzones
EDIT: I found the second mod (parachutes). It's here.
EDIT2: I found the first mod (Paraglider). It's in the rpgtest game
Last edited by Piezo_ on Wed Jan 09, 2019 02:30, edited 6 times in total.
while (true) { suffer(); }
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] hang-gliders [hangglider]
Nice one, Piezo! Need to try this out.
- voxelproof
- Member
- Posts: 1087
- Joined: Sat Aug 05, 2017 08:13
- Location: Europe
Re: [Mod] hang-gliders [hangglider]
Thank You so much! Was dreaming about real flying for long time. I'm going to test it this weekend in Eden. I wonder if I crash into some nasty angel again. Btw they are a little bit of nuisance in Heaven, for example they obscured nice screenies attached to the linked post ;)Piezo_ wrote:There's nothing more simultaneously exciting and terrifying than leaping off the top of a massive, snowy peak and gliding over the valley below.
As you can see there's a lot of space for mountain sports there and flying among these rocky walls would be very exciting:
EDIT: Instructions, please? :) How can I fly? (As for now I can only wield glider).
- Attachments
-
- Eden_mountains.png (699.68 KiB) Viewed 5158 times
To miss the joy is to miss all. Robert Louis Stevenson
- Piezo_
- Member
- Posts: 219
- Joined: Fri Jul 20, 2018 21:36
- GitHub: is proprietary I use NotABug
- Location: (x,y,z)
Re: [Mod] hang-gliders [hangglider]
Left-click (use) the glider while already up in the air to open it.voxelproof wrote:Instructions, please? :) How can I fly? (As for now I can only wield glider).
Left-click again any time to close it.
The glider will automatically close when you're less than 0.5 nodes off the ground (i.e., when landing)
Note: There is a bug (in minetest, not this mod) that means attached entities will not appear properly in third person until you change/update view position. If you can't see the glider, try hitting F7 a couple times.
while (true) { suffer(); }
- voxelproof
- Member
- Posts: 1087
- Joined: Sat Aug 05, 2017 08:13
- Location: Europe
Re: [Mod] hang-gliders [hangglider]
Great thanks once again! I've just checked it, it works (when I want a constant forward speed I just switch to auto-tap key function). Wonderful experience. Now the Minetest has gained a pair of truly awesome mountain mods (the other one is bike). And climbing has become yet more rewarding :))Piezo_ wrote:Left-click (use) the glider while already up in the air to open it.voxelproof wrote:Instructions, please? :) How can I fly? (As for now I can only wield glider).
Left-click again any time to close it.
The glider will automatically close when you're less than 0.5 nodes off the ground (i.e., when landing)
Note: There is a bug (in minetest, not this mod) that means attached entities will not appear properly in third person until you change/update view position. If you can't see the glider, try hitting F7 a couple times.
To miss the joy is to miss all. Robert Louis Stevenson
- voxelproof
- Member
- Posts: 1087
- Joined: Sat Aug 05, 2017 08:13
- Location: Europe
Re: [Mod] hang-gliders [hangglider]
I've made a "tweaking" of the gravitational parameters of your mod. This is how condors fly ;)
This can be enjoyed in full only in map generators creating really high mountains (this means that in none of the default ones, but the tweakings I've posted on the Forum are apparently created for your mod :) ) It would be also nice to see a constant forward speed added to this mod to get rid of the need of using the OS function of auto-tapping to emulate this feature.
Code: Select all
hangglider = {}
hangglider.use = {}
minetest.register_entity("hangglider:airstopper", { --A one-instant entity that catches the player and slows them down.
hp_max = 3,
is_visible = false,
immortal = true,
attach = nil,
on_step = function(self, _)
if self.object:get_hp() ~= 1 then
self.object:set_hp(self.object:get_hp() - 1)
else
if self.attach then
self.attach:set_detach()
end
self.object:remove()
end
end
})
minetest.register_entity("hangglider:glider", {
visual = "mesh",
visual_size = {x = 12, y = 12},
mesh = "glider.obj",
immortal = true,
static_save = false,
textures = {"wool_white.png","default_wood.png"},
on_step = function(self, _)
local canExist = false
if self.object:get_attach() then
local player = self.object:get_attach("parent")
if player then
local pos = player:getpos()
if hangglider.use[player:get_player_name()] then
if minetest.registered_nodes[minetest.get_node(vector.new(pos.x, pos.y-0.5, pos.z)).name] then
if not minetest.registered_nodes[minetest.get_node(vector.new(pos.x, pos.y-0.5, pos.z)).name].walkable then
canExist = true
if player:get_player_velocity().y > -1.5 and player:get_physics_override().gravity < 0 then
player:set_physics_override({
gravity = 0.005,
})
elseif player:get_player_velocity().y < -2 and player:get_physics_override().gravity > 0 then
player:set_physics_override({
gravity = -0.5,
})
end
end
end
end
if not canExist then
player:set_physics_override({
gravity = 1,
jump = 1,
})
hangglider.use[player:get_player_name()] = false
end
end
end
if not canExist then
self.object:set_detach()
self.object:remove()
end
end
})
minetest.register_on_dieplayer(function(player)
player:set_physics_override({
gravity = 1,
jump = 1,
})
hangglider.use[player:get_player_name()] = false
end)
minetest.register_on_joinplayer(function(player)
player:set_physics_override({
gravity = 1,
jump = 1,
})
hangglider.use[player:get_player_name()] = false
end)
minetest.register_on_leaveplayer(function(player)
hangglider.use[player:get_player_name()] = nil
end)
minetest.register_craftitem("hangglider:hangglider", {
description = "Glider",
inventory_image = "glider_item.png",
on_use = function(itemstack, user, pointed_thing)
if not user then
return
end
local pos = user:get_pos()
if minetest.get_node(pos).name == "air" and not hangglider.use[user:get_player_name()] then --Equip
minetest.sound_play("bedsheet", {pos=pos, max_hear_distance = 8, gain = 1.0})
user:set_physics_override({
gravity = 0.005,
jump = 0,
})
local stopper = minetest.add_entity(pos, "hangglider:airstopper")
stopper:get_luaentity().attach = user
user:set_attach( stopper, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
hangglider.use[user:get_player_name()] = true
minetest.add_entity(user:get_pos(), "hangglider:glider"):set_attach(user, "", {x=0,y=0,z=0}, {x=0,y=0,z=0})
elseif hangglider.use[user:get_player_name()] then --Unequip
hangglider.use[user:get_player_name()] = false
end
end
})
minetest.register_craft({
output = "hangglider:hangglider",
recipe = {
{"wool:white", "wool:white", "wool:white"},
{"default:stick", "", "default:stick"},
{"", "default:stick", ""},
}
})
To miss the joy is to miss all. Robert Louis Stevenson
-
- Member
- Posts: 96
- Joined: Mon Mar 27, 2017 21:56
- GitHub: kestral246
Re: [Mod] hang-gliders [hangglider]
Thank you, this is the mod that I've been looking for, especially after all the hours of paragliding around Hyrule I did last year.
I have also been playing around with your code, and have come up with my own additions:
I have also been playing around with your code, and have come up with my own additions:
- Added an overlay when the hangglider is equiped. I'm not an artist so it's quite simple, but it does its job. I don't know how to disable the overlay when minetest is in third person, but I find the third person walking animation while flying just too distracting to use.
- Added also unequipping the hangglider when landing in water.
- Attempted to linearize the parabolic flight path, by starting with a stronger gravity, and gradually reducing it as the descent velocity increases.
- Discovered that fast unequip/equip cycling min-flight would allow drastically longer flights than continuous flight. This shouldn't happen, and I've tried to fix it, but it's likely that I haven't taken care of all possible cases.
- I also added a hud debug display to show various parameters, which is still enabled.
- voxelproof
- Member
- Posts: 1087
- Joined: Sat Aug 05, 2017 08:13
- Location: Europe
Re: [Mod] hang-gliders [hangglider]
Maybe this 'bug' shouldn't be fixed :) I've checked it out in-flight and, well, in my opinion it adds a lot of reality to the flying experience. It enables 'climbing' or gaining altitude so that it resembles taking advantage of upward air currents, which are in fact exploited by pilots to prolong their flights.kestral wrote:
- Discovered that fast unequip/equip cycling min-flight would allow drastically longer flights than continuous flight. This shouldn't happen, and I've tried to fix it, but it's likely that I haven't taken care of all possible cases.
Thanks for the improvements :)
Last edited by voxelproof on Fri Nov 23, 2018 20:42, edited 1 time in total.
To miss the joy is to miss all. Robert Louis Stevenson
- voxelproof
- Member
- Posts: 1087
- Joined: Sat Aug 05, 2017 08:13
- Location: Europe
Re: [Mod] hang-gliders [hangglider]
If you set movement_speed_walk to 8 the immersion is nearly perfect when playing the 'tweaked' mod. In unmodified original version setting it to 20 makes real wingsuit base jumping experience. Thank you all for the great work!
To miss the joy is to miss all. Robert Louis Stevenson
- Piezo_
- Member
- Posts: 219
- Joined: Fri Jul 20, 2018 21:36
- GitHub: is proprietary I use NotABug
- Location: (x,y,z)
Re: [Mod] hang-gliders [hangglider]
Thanks! I'll look over it, and probably change a couple things. (Also: How do I merge to notabug from github? Never mind, I'll just put the link in the commit name)kestral wrote:Thank you, this is the mod that I've been looking for, especially after all the hours of paragliding around Hyrule I did last year.
I have also been playing around with your code, and have come up with my own additions:
My updates are available at: https://github.com/kestral246/hangglider
- Added an overlay when the hangglider is equiped. I'm not an artist so it's quite simple, but it does its job. I don't know how to disable the overlay when minetest is in third person, but I find the third person walking animation while flying just too distracting to use.
- Added also unequipping the hangglider when landing in water.
- Attempted to linearize the parabolic flight path, by starting with a stronger gravity, and gradually reducing it as the descent velocity increases.
- Discovered that fast unequip/equip cycling min-flight would allow drastically longer flights than continuous flight. This shouldn't happen, and I've tried to fix it, but it's likely that I haven't taken care of all possible cases.
- I also added a hud debug display to show various parameters, which is still enabled.
while (true) { suffer(); }
- Piezo_
- Member
- Posts: 219
- Joined: Fri Jul 20, 2018 21:36
- GitHub: is proprietary I use NotABug
- Location: (x,y,z)
Re: [Mod] hang-gliders [hangglider]
Update:
- Added improvements made by kestral, with some changes
- Glider now has durability
while (true) { suffer(); }
-
- Member
- Posts: 96
- Joined: Mon Mar 27, 2017 21:56
- GitHub: kestral246
Re: [Mod] hang-gliders [hangglider]
Piezo_,
Thank you, I really, really like your Nov 25 code release. Your "changes" were significant improvements to how well the hanglider flies and operates.
The only additional change I've come up with is to ramp the speed override, like we did with gravity. That makes your increase in speed to 1.75 feel much more natural.
With my tweak to your Nov 25 version, I feel your hangglider mod is close to gliding perfection. I went back to my Wii-U and tried paragliding around Hyrule again, and it's really a tossup as to which *glider I prefer.
I've added this version of hangglider to my minetest.conf initial_stuff line, so I'll always have it available when I play minetest.
Thank you, I really, really like your Nov 25 code release. Your "changes" were significant improvements to how well the hanglider flies and operates.
The only additional change I've come up with is to ramp the speed override, like we did with gravity. That makes your increase in speed to 1.75 feel much more natural.
With my tweak to your Nov 25 version, I feel your hangglider mod is close to gliding perfection. I went back to my Wii-U and tried paragliding around Hyrule again, and it's really a tossup as to which *glider I prefer.
I've added this version of hangglider to my minetest.conf initial_stuff line, so I'll always have it available when I play minetest.
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] hang-gliders [hangglider]
I like the general idea (of course), but I'm seeing a few bug here (player offset due to MT 5.0.0-dev):
Also, hang gliders need constant speed to not plummet to the ground, no? :)
Also, hang gliders need constant speed to not plummet to the ground, no? :)
- Attachments
-
- screenshot_20181128_165043.png (587.45 KiB) Viewed 5158 times
- voxelproof
- Member
- Posts: 1087
- Joined: Sat Aug 05, 2017 08:13
- Location: Europe
Re: [Mod] hang-gliders [hangglider]
Yes, they are in fact walking parachutes propelled by the character's legs ;) To stop thinking about it (i.e. to maintain so-called 'suspension of disbelief) I resort to switching "auto-tapping' function on to the "w" key (if this function is enabled in Windows it's just pressing quickly "w" and then "Fn" keys consecutively).texmex wrote: Also, hang gliders need constant speed to not plummet to the ground, no? :)
However the speed of descent doesn't depend on the forward speed as in this mod there isn't implemented aerodynamic lift (yet?).
To miss the joy is to miss all. Robert Louis Stevenson
-
- Member
- Posts: 96
- Joined: Mon Mar 27, 2017 21:56
- GitHub: kestral246
Re: [Mod] hang-gliders [hangglider]
texmex,
There's a line in the code with the offset for 5.x, but right now it's commented out and needs to be manually changed.
Is there some way for a mod to detect whether minetest is using the old 0.4.x character offset or the new 5.x character offset? That way it could be done automatically.
There's a line in the code with the offset for 5.x, but right now it's commented out and needs to be manually changed.
Is there some way for a mod to detect whether minetest is using the old 0.4.x character offset or the new 5.x character offset? That way it could be done automatically.
-
- Member
- Posts: 96
- Joined: Mon Mar 27, 2017 21:56
- GitHub: kestral246
Re: [Mod] hang-gliders [hangglider]
With my speed tweak, which hasn't been reviewed or accepted for inclusion by Piezo_, the forward speed is made a function of the speed of descent. Kind of backwards, but it gives a similar effect—yes, as long as you keep pressing the 'w' key.However the speed of descent doesn't depend on the forward speed as in this mod there isn't implemented aerodynamic lift (yet?).
I'm not sure what Piezo_'s final intentions are for this mod, but I doubt he's trying to make a hardcore flight simulator within minetest.
- voxelproof
- Member
- Posts: 1087
- Joined: Sat Aug 05, 2017 08:13
- Location: Europe
Re: [Mod] hang-gliders [hangglider]
Interesting, I haven't tried your version yet, but the idea is very reasonable. As a matter of fact a sandbox game is not the best place to implement real physics and it's charm is in all those tricks that allow to simulate reality in a simple way.kestral wrote:With my speed tweak, which hasn't been reviewed or accepted for inclusion by Piezo_, the forward speed is made a function of the speed of descent. Kind of backwards, but it gives a similar effect—yes, as long as you keep pressing the 'w' key.However the speed of descent doesn't depend on the forward speed as in this mod there isn't implemented aerodynamic lift (yet?).
I'm not sure what Piezo_'s final intentions are for this mod, but I doubt he's trying to make a hardcore flight simulator within minetest.
To miss the joy is to miss all. Robert Louis Stevenson
- Piezo_
- Member
- Posts: 219
- Joined: Fri Jul 20, 2018 21:36
- GitHub: is proprietary I use NotABug
- Location: (x,y,z)
Re: [Mod] hang-gliders [hangglider]
There is a version of the glider-spawning function on line 204 (commented out) that fixes this. Replace lines 67 and 198 with it to solve that issue. Once 5.0.0 shows up in more of the common repositories, I'll change this permanently. As of now, I'm on 4.17.texmex wrote:I like the general idea (of course), but I'm seeing a few bug here (player offset due to MT 5.0.0-dev):
Also, hang gliders need constant speed to not plummet to the ground, no? :)
Sorry, despite the tone used in the initial post, this is more of a maneuverable parachute mod than a high-speed skydiving experience. (Although, I'll definitely take a look at the speed adjustment function)kestral wrote:
With my speed tweak, which hasn't been reviewed or accepted for inclusion by Piezo_, the forward speed is made a function of the speed of descent. Kind of backwards, but it gives a similar effect—yes, as long as you keep pressing the 'w' key.
I'm not sure what Piezo_'s final intentions are for this mod, but I doubt he's trying to make a hardcore flight simulator within minetest.
while (true) { suffer(); }
- Piezo_
- Member
- Posts: 219
- Joined: Fri Jul 20, 2018 21:36
- GitHub: is proprietary I use NotABug
- Location: (x,y,z)
- voxelproof
- Member
- Posts: 1087
- Joined: Sat Aug 05, 2017 08:13
- Location: Europe
Re: [Mod] hang-gliders [hangglider]
The main obstacle is imo the dependency on the default walking speed. When I played around with speed parameters of MT Game I've obtained pretty good wingsuit base jumping simulator, however I like long steady hang glider flying more.Piezo_ wrote: Sorry, despite the tone used in the initial post, this is more of a maneuverable parachute mod than a high-speed skydiving experience. (Although, I'll definitely take a look at the speed adjustment function)
To miss the joy is to miss all. Robert Louis Stevenson
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
Re: [Mod] hang-gliders [hangglider]
Overriding player speed is easy. One should be able to get a always-speeding type of vehicle going which would be closer to a hang gliding experience.
-
- Member
- Posts: 55
- Joined: Wed Jun 20, 2018 18:55
- GitHub: random-geek
- In-game: Techy5 random_geek
Re: [Mod] hang-gliders [hangglider]
Great mod! MT definitely needed this. I was going to make a hang glider mod anyways, so I'm glad I don't have to now. :)
- Piezo_
- Member
- Posts: 219
- Joined: Fri Jul 20, 2018 21:36
- GitHub: is proprietary I use NotABug
- Location: (x,y,z)
Re: [Mod] hang-gliders [hangglider]
The next update might not be for a while. Between minetest_systemd, this, and the wield_redo mod I'm making, I've got my {hands, text_editor} full
while (true) { suffer(); }
Re: [Mod] hang-gliders [hangglider]
Just so you know a bug that often happens to me is that when I open the glider I am teleported to the last place I opened it at... or sometimes at 0 0 0 (and I die)
- Piezo_
- Member
- Posts: 219
- Joined: Fri Jul 20, 2018 21:36
- GitHub: is proprietary I use NotABug
- Location: (x,y,z)
Re: [Mod] hang-gliders [hangglider]
I'm sorry to say, I know about this one. It's caused by the airstopper, and I am still trying to find a solution, myself.Lord_Vlad wrote:Just so you know a bug that often happens to me is that when I open the glider I am teleported to the last place I opened it at... or sometimes at 0 0 0 (and I die)
while (true) { suffer(); }