Sprinting should be in minetest_game!!

User avatar
Joseph13
Member
 
Posts: 265
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph

Sprinting should be in minetest_game!!

by Joseph13 » Sun May 12, 2019 00:41

For ever since minetest has been a thing, we have never had sprinting in the default minetest game. I think this is lame, as sprinting is such a core requirement of gaming. There are many mods out there that add sprinting, but it's hard to decide which one. Also, only some are compatible with the many hunger mods. We need a standard sprinting function in minetest. It's also lame how we have to use the special key to run in the mods. I have my special key bounds to CTRL right now. We need sprinting in the game. As a built in core function. That's my sales pitch.
Testin' mines since 1989
 

Hugues Ross
New member
 
Posts: 7
Joined: Mon May 06, 2019 22:52

Re: Sprinting should be in minetest_game!!

by Hugues Ross » Sun May 12, 2019 09:59

I agree completely.

Here's another reason to add sprinting, while we're at it: Minetest does a great job of making interesting terrain, but minetest_game doesn't offer any efficient means of traversal. As a result, exploring and finding interesting places without flight is harder than it should be. More ways to move quickly (like sprinting) would help a lot in this regard.
 

User avatar
benrob0329
Member
 
Posts: 1260
Joined: Thu Aug 06, 2015 22:39
Location: Michigan
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
 

User avatar
Joseph13
Member
 
Posts: 265
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph

Re: Sprinting should be in minetest_game!!

by Joseph13 » Mon May 13, 2019 04:42

benrob0329 wrote:It is, its called fast mode :P

No, it’s not. Fast mode requires a special privilege. Also it’s not sprinting. And it’s really fast.
Testin' mines since 1989
 

User avatar
TenPlus1
Member
 
Posts: 2516
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1
 

User avatar
Joseph13
Member
 
Posts: 265
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph

Re: Sprinting should be in minetest_game!!

by Joseph13 » Mon May 13, 2019 12:36

I have already done that, what I’m saying is it should be part of the default game. Also, when you hold the run key there is about a 1 second delay before you start running. That is really bad and has lead to my dying many times.
Testin' mines since 1989
 

User avatar
sorcerykid
Member
 
Posts: 1024
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: Sprinting should be in minetest_game!!

by sorcerykid » Tue May 14, 2019 15:33

The reason there's a one second delay is because there's no feedback provided by the engine when keys are pressed. Hence, mods are stuck having to constantly poll the state of keys in a globalstep. In truth, it would be fairly easy to add a callback mechanism for key state changes since these events are already captured in networkpackethandler.cpp. But as of now, no such callback mechanism exists.

Of course whatever solution is devised should be scalable as well as extensible. Is polling and tracking all keystates in a globalstep more efficient than repeatedly invoking an event notification hook? Both entail repetitive context switching. Assuming the difference is negligible, I think the latter implementation would be far superior from an architectural standpoint.
 

Astrobe
Member
 
Posts: 196
Joined: Sun Apr 01, 2018 10:46

Re: Sprinting should be in minetest_game!!

by Astrobe » Wed May 15, 2019 16:57

Joseph13 wrote:For ever since minetest has been a thing, we have never had sprinting in the default minetest game. I think this is lame, as sprinting is such a core requirement of gaming.


OMG we don't have a Core Requirement of Gaming, so unprofessional...

On a more serious note, if it is about mobility in MTG, the award-winning Hang Glider is a choice to be considered. Aside from the fact that flying is an even experience than "walking but faster" (or "swimming but faster"...), building it requires wool and using it requires climbing. This induces multiple gameplay elements: players have to start farming to build it, which in turn will make them look for and collect cotton seeds, and they might want to build stairways to climb faster on top of hills; maybe also build a tower there for extra range.
 

Astrobe
Member
 
Posts: 196
Joined: Sun Apr 01, 2018 10:46

Re: Sprinting should be in minetest_game!!

by Astrobe » Wed May 15, 2019 17:21

sorcerykid wrote:The reason there's a one second delay is because there's no feedback provided by the engine when keys are pressed. Hence, mods are stuck having to constantly poll the state of keys in a globalstep. In truth, it would be fairly easy to add a callback mechanism for key state changes since these events are already captured in networkpackethandler.cpp. But as of now, no such callback mechanism exists.

Of course whatever solution is devised should be scalable as well as extensible. Is polling and tracking all keystates in a globalstep more efficient than repeatedly invoking an event notification hook? Both entail repetitive context switching. Assuming the difference is negligible, I think the latter implementation would be far superior from an architectural standpoint.


I think the callback solution is a bit more sensitive to lag: callbacks will be called at the end of a log spike and will give the state of the keys before the lag spike, while when polling you always get the freshest state. Also callbacks needs more management on both parts (engine and mod) and can be less convenient.

An intermediate solution could be that the game exposes the key states as a global read-only table. In the case of multiple mods wanting to read the keys, it removes the function call overhead and part of the GC pressure associated with the creation/collection of the key states table.
 

User avatar
Joseph13
Member
 
Posts: 265
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph

Re: Sprinting should be in minetest_game!!

by Joseph13 » Wed May 15, 2019 17:33

I think a new keybind should be added for sprinting, then the engine just checks to see if the key is pressed just like the walking keys (W, S, A, D) and if so, increase the speed of the player to running speed. This should also be accessible to hunger mods so they can use up food faster if sprinting.
Testin' mines since 1989
 

User avatar
paramat
Developer
 
Posts: 3337
Joined: Sun Oct 28, 2012 00:05
Location: UK
GitHub: paramat
IRC: paramat

Re: Sprinting should be in minetest_game!!

by paramat » Thu May 16, 2019 22:15

Key 'E' already does this, and it's clientside too as it should be, one problem is that it sets speed to 'fast' speed, which is 20 n/s by default, too fast.
Ideally, flying should be at the set 'fast' speed, and sprinting uses uses a new physics setting 'sprint_speed'.
Anyway, to do this well needs work on the engine, the existing sprint mods have problems, i think we can do better.

Keep in mind that the default 'walk' speed of 4 n/s is very fast for 'walking', so it's already halfway to sprinting to compensate for lack of different speeds.

> It's also lame how we have to use the special key to run in the mods.

We're considering splitting the 'special' key into 2 keys, one for 'special', one for 'fast', as this solves another issue.
 

User avatar
Joseph13
Member
 
Posts: 265
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph

Re: Sprinting should be in minetest_game!!

by Joseph13 » Thu May 16, 2019 22:23

Holy Moly, it’s paramat! Great to hear from you on this topic. So your saying that the walking speed should be slowed down and sprinting should be added?
Testin' mines since 1989
 

User avatar
runs
Member
 
Posts: 374
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: Sprinting should be in minetest_game!!

by runs » Sat May 18, 2019 15:21

Sprinting is important, all open world games have this feature. It's not related to copycut but the basics.
 

User avatar
Joseph13
Member
 
Posts: 265
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph
 

User avatar
sorcerykid
Member
 
Posts: 1024
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: Sprinting should be in minetest_game!!

by sorcerykid » Wed May 22, 2019 15:13

Astrobe wrote:I think the callback solution is a bit more sensitive to lag: callbacks will be called at the end of a log spike and will give the state of the keys before the lag spike, while when polling you always get the freshest state. Also callbacks needs more management on both parts (engine and mod) and can be less convenient.


I think it's actually the opposite. Polling would be more susceptible to lag, since the key states are only being checked during a globalstep callback (hence they are not captured in realtime). An event notification hook, in contrast could be invoked immediately from serverpackethandler.cpp in response to a PlayerPos packet.
Last edited by sorcerykid on Wed May 22, 2019 17:23, edited 1 time in total.
 

User avatar
sorcerykid
Member
 
Posts: 1024
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Re: Sprinting should be in minetest_game!!

by sorcerykid » Wed May 22, 2019 17:22

Here's an idea for one possible implementation to capture keystroke events. This of course is just a suggestion.

Code: Select all
minetest.register_inputcontrol( "key_aux", {
     on_pressed = function ( player, key_states ) ... end,
     on_released = function ( player, key_states ) ... end,
     on_repeat = function ( player, key_states ) ... end,
}
 

User avatar
Joseph13
Member
 
Posts: 265
Joined: Tue Dec 06, 2016 05:35
In-game: Joseph

Re: Sprinting should be in minetest_game!!

by Joseph13 » Wed May 22, 2019 18:06

I don’t know what any of this means but If it means sprinting in Minetest then I like it
Testin' mines since 1989
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 0 guests