BREAKING NEWS: Knockback added!

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

BREAKING NEWS: Knockback added!

by Wuzzy » Post

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.

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

Re: BREAKING NEWS: Knockback added!

by texmex » Post

Sweet mese, that's great.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: BREAKING NEWS: Knockback added!

by jas » Post

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!

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

Re: BREAKING NEWS: Knockback added!

by texmex » Post

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: 3225
Joined: Sat Oct 27, 2018 08:32

Re: BREAKING NEWS: Knockback added!

by runs » Post

Oh these are the additions that worth.

Red_King_Cyclops
Member
Posts: 324
Joined: Sun Jun 16, 2019 20:17
Location: x=123, y=120, z=534

Re: BREAKING NEWS: Knockback added!

by Red_King_Cyclops » Post

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?
Currently working on new mods.

User avatar
jas
Member
Posts: 593
Joined: Mon Jul 24, 2017 18:15
IRC: Freenode
Location: IRC

Re: BREAKING NEWS: Knockback added!

by jas » Post

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

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

Re: BREAKING NEWS: Knockback added!

by Hume2 » Post

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

CalebJ
Member
Posts: 407
Joined: Sat Dec 29, 2018 19:21
GitHub: KaylebJay
IRC: KaylebJay
In-game: CalebJ
Location: Tunnelers' Abyss

Re: BREAKING NEWS: Knockback added!

by CalebJ » Post

Great feature! +10

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

Re: BREAKING NEWS: Knockback added!

by Pyrollo » Post

At last :)

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

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

Re: BREAKING NEWS: Knockback added!

by Krock » Post

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.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: BREAKING NEWS: Knockback added!

by Sokomine » Post

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: 570
Joined: Sun Apr 01, 2018 10:46

Re: BREAKING NEWS: Knockback added!

by Astrobe » Post

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: 1341
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
IRC: benrob0329
In-game: benrob03
Location: Michigan
Contact:

Re: BREAKING NEWS: Knockback added!

by benrob0329 » Post

I feel like you could easily add a negative velocity to get that kind of effect.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: BREAKING NEWS: Knockback added!

by PolySaken » Post

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.
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

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

Re: BREAKING NEWS: Knockback added!

by Astrobe » Post

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).

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: BREAKING NEWS: Knockback added!

by FreeGamers » Post

This was a much requested feature on the server I run. Good to see its on its way. Best wishes.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: BREAKING NEWS: Knockback added!

by Extex » Post

WHAT?!?!?!
When Is the next release?!?!?!
When Is 5.1.0?!?!
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: BREAKING NEWS: Knockback added!

by rubenwardy » Post

Extex wrote:WHAT?!?!?!
When Is the next release?!?!?!
When Is 5.1.0?!?!
Feature freeze is scheduled for the 29th of September, meaning that 5.1.0 is expected for the 6th of October
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests