BREAKING NEWS: Knockback added!

User avatar
Wuzzy
Member
 
Posts: 3431
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

BREAKING NEWS: Knockback added!

by Wuzzy » Tue Aug 13, 2019 11:13

BREAKING NEWS!

Knockback has been added! Yes, yes, yesssss!

https://github.com/minetest/minetest/pull/8685

There will be 2 new functions, player:add_player_velocity and minetest.calculate_knockback.

lua_api.txt additions:
Code: Select all
    * `add_player_velocity(vel)`
    * Adds to player velocity, this happens client-side and only once.
    * Does not apply during free_move.
    * Note that since the player speed is normalized at each move step,
      increasing e.g. Y velocity beyond what would usually be achieved
      (see: physics overrides) will cause existing X/Z velocity to be reduced.
    * Example: `add_player_velocity({x=0, y=6.5, z=0})` is equivalent to
      pressing the jump key (assuming default settings)


Code: Select all
* `minetest.calculate_knockback(player, hitter, time_from_last_punch,
  tool_capabilities, dir, distance, damage)`
    * Returns the amount of knockback applied on the punched player.
    * Arguments are equivalent to `register_on_punchplayer`, except the following:
        * `distance`: distance between puncher and punched player
    * This function can be overriden by mods that wish to modify this behaviour.
    * You may want to cache and call the old function to allow multiple mods to
      change knockback behaviour.


This is huge news! Hopefully we can seriously improve how combat works in our games. I haven't tested this yet, however.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH
 

User avatar
texmex
Member
 
Posts: 1448
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex
 

User avatar
jas
Member
 
Posts: 384
Joined: Mon Jul 24, 2017 18:15
GitHub: jastevenson303
IRC: jas_
In-game: jas

Re: BREAKING NEWS: Knockback added!

by jas » Tue Aug 13, 2019 13:31

I use add_player_velocity to give a boost on a particular jump
https://github.com/jastevenson303/Laval ... it.lua#L64

And get_player_velocity to eliminate fall damage avoidance
https://github.com/jastevenson303/Laval ... it.lua#L85

Thanks for Minetest!
201902221552
 

User avatar
texmex
Member
 
Posts: 1448
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: BREAKING NEWS: Knockback added!

by texmex » Tue Aug 13, 2019 13:44

jas wrote:I use add_player_velocity to give a boost on a particular jump


Very nice! Special moves such as dashes should be interesting too.
 

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

Red_King_Cyclops
Member
 
Posts: 175
Joined: Sun Jun 16, 2019 20:17
Location: Earth

Re: BREAKING NEWS: Knockback added!

by Red_King_Cyclops » Tue Aug 13, 2019 22:53

The combat system hasn't been Minetest's best feature, so it's good to know that the development team has taken a step to improve it. When can this feature be a part of mobs mods?
2+2=4. Always.
 

User avatar
jas
Member
 
Posts: 384
Joined: Mon Jul 24, 2017 18:15
GitHub: jastevenson303
IRC: jas_
In-game: jas

Re: BREAKING NEWS: Knockback added!

by jas » Wed Aug 14, 2019 02:56

Add player velocity when punched by a mob, good idea.
201902221552
 

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

Re: BREAKING NEWS: Knockback added!

by Hume2 » Wed Aug 14, 2019 06:46

That's so great!
If you lack the reality, go on a trip or find a job.
 

CalebJ
Member
 
Posts: 141
Joined: Sat Dec 29, 2018 19:21
Location: Tunnelers' Abyss
In-game: CalebJ

Re: BREAKING NEWS: Knockback added!

by CalebJ » Wed Aug 14, 2019 14:10

Great feature! +10
If you want realism, you're in the wrong place. Get off your mobile.
 

User avatar
Pyrollo
Member
 
Posts: 303
Joined: Mon Jan 08, 2018 15:14
Location: Paris
GitHub: pyrollo
In-game: Naj

Re: BREAKING NEWS: Knockback added!

by Pyrollo » Wed Aug 14, 2019 16:13

At last :)

Many possible things: blasts, knocks, force fields, ...
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]
 

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

Re: BREAKING NEWS: Knockback added!

by Krock » Wed Aug 14, 2019 17:05

Anticheat was the only (but major) issue for such a feature. Many other PRs to accelerate players on certain node types are still held back to not cause false-positives within the anticheat detection. Note that the server (yet) does not calculate player physics to confirm the data.

Side note: Don't hit other players because the lag makes it way less spectacular.
>> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

Sokomine
Member
 
Posts: 3827
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: BREAKING NEWS: Knockback added!

by Sokomine » Wed Aug 14, 2019 20:39

Buuh! I don't want to be pushed around by mobs :-) It's worse enough that some of them attack. When will they finally learn that the players will eventually always win? :) Seriously: Hope the effect isn't too strong.
A list of my mods can be found here.
 

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

Re: BREAKING NEWS: Knockback added!

by Astrobe » Fri Aug 16, 2019 18:26

Krock wrote:Anticheat was the only (but major) issue for such a feature. Many other PRs to accelerate players on certain node types are still held back to not cause false-positives within the anticheat detection. Note that the server (yet) does not calculate player physics to confirm the data.


Rather than acceleration, I would like to see slowdown, more specifically let the liquid_viscosity work on non-liquid nodes. I'm thinking about plant-like nodes (and tree leaves that are walkable in MTG; with that feature they could be climbable instead).
 

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

Re: BREAKING NEWS: Knockback added!

by benrob0329 » Fri Aug 16, 2019 22:03

I feel like you could easily add a negative velocity to get that kind of effect.
Social: YouTube Peertube Matrix Room: #minetest:tchncs.de | Games: The Infinite IKEA
 

User avatar
PolySaken
Member
 
Posts: 333
Joined: Thu Nov 09, 2017 05:18
Location: djelibabi
GitHub: PolySaken-I-Am
In-game: PolySaken

Re: BREAKING NEWS: Knockback added!

by PolySaken » Tue Aug 20, 2019 01:45

Astrobe wrote:
Krock wrote:Anticheat was the only (but major) issue for such a feature. Many other PRs to accelerate players on certain node types are still held back to not cause false-positives within the anticheat detection. Note that the server (yet) does not calculate player physics to confirm the data.


Rather than acceleration, I would like to see slowdown, more specifically let the liquid_viscosity work on non-liquid nodes. I'm thinking about plant-like nodes (and tree leaves that are walkable in MTG; with that feature they could be climbable instead).

Why not use the player physics function?
Have an on_step function that iterates through players and sets their speed field depending on the material at their feet.
 

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

Re: BREAKING NEWS: Knockback added!

by Astrobe » Tue Aug 20, 2019 09:59

PolySaken wrote:
Astrobe wrote:
Krock wrote:Anticheat was the only (but major) issue for such a feature. Many other PRs to accelerate players on certain node types are still held back to not cause false-positives within the anticheat detection. Note that the server (yet) does not calculate player physics to confirm the data.


Rather than acceleration, I would like to see slowdown, more specifically let the liquid_viscosity work on non-liquid nodes. I'm thinking about plant-like nodes (and tree leaves that are walkable in MTG; with that feature they could be climbable instead).

Why not use the player physics function?
Have an on_step function that iterates through players and sets their speed field depending on the material at their feet.


True, but it is always more efficient if done by the engine. And I was hoping that maybe it was a minor modification for the engine. Additionally, it would only be a matter of overriding nodes to configure it, rather than having to use a specific API to configure the mod that offers that feature (Hmmm... actually said mod could fake it by detecting non-liquid nodes that have the liquid_viscosity property set).
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 2 guests