Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request : Knockback #2394

Closed
C1ffisme opened this issue Feb 26, 2015 · 23 comments
Closed

Feature Request : Knockback #2394

C1ffisme opened this issue Feb 26, 2015 · 23 comments
Labels
Concept approved Approved by a core dev: PRs welcomed! Feature request Issues that request the addition or enhancement of a feature @ Server / Client / Env.

Comments

@C1ffisme
Copy link

Currently, there is no form of knockback. If you hit something/someone, he/she/it just get damaged, but not pushed back. Now, I could implement this and put it in the code for swords, but what would be the point? You would have to tell all the modders to code their weapons to be like the default swords.

Now, if we want a weapon or object that dosen't use knockback (e.g, __builtin:item) then we add a group to it like knockback = false. That way modders can chose to use knockback or not depending on what they are making. Also, I would optionally like an option called knockback_distance that tells how far you would fire the hit object.

If we add this, it might lead to more interesting mods. I can already see a soccer mod where you have to hit the ball with your hand and use knockback to push it along.

Now, suppose some griefers use knockback for griefing, by pushing people into lava, well, we can add a config option to disable knockback, in minetest.conf. Maybe something like do_knockback = true?

Anyway, I want to see what the community thinks of adding this.

@paramat
Copy link
Contributor

paramat commented Feb 26, 2015

Sounds fun, TNT could knockback players too depending on their distance.

@C1ffisme
Copy link
Author

Yes. Maybe a ObjectType.knockback(knockback_distance) function for, well, objects (Luaentities and Players).

@ghost
Copy link

ghost commented Feb 27, 2015

You have my vote!

@nerzhul
Copy link
Member

nerzhul commented Feb 27, 2015

agree, but need a protocol bump to implement to action

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Feb 27, 2015

Knockback is a great idea, it would greatly enhance gameplay.

The idea as such needs to be more clearly specified.

First, it is unclear how knockback strength should be specified. Punches should vary from no knockback over weak knockback to strong knockbacks, but where do you specify it?

One possibility is to give items/tools/weapons a base knockback strength, so if you punch an object with this item, this knockback strength is applied to the object.
So you could have items causing a lot of knockback, just a little or none at all.

Also, knockback should also apply for entities.

Also, I would suggest that knockback resistance is not specified on a yes/no basis but on a scalar basis. Every object should have a non-negative knockback factor, so the actual knockback is * . This is usual to make targets either more prone to knockbacks or more resistant, or even immune to knockbacks (knockback factor 0). The default knockback factor should be 1.

Lastly, all functions in the Lua API dealing with punches etc. should be extended with a knockback parameter. I.e. if you want to punch something with Lua, you can set the knockback strength of the punch.

nerzhul: Then its good that 0.5.0 is in the making, compability is allowed to be broken. :=)

@ghost
Copy link

ghost commented Feb 27, 2015

In mobs redo they use hitters tool capabilities as a multiplier to determine the strength of the knockback. I thought that was pretty clever.

@C1ffisme
Copy link
Author

@Wuzzy2 Basically, yes. I want that. Like I said, there should be a setting whether knockback applies to certain objects, like how there is a setting that gives objects HP. on_punch and such should be updated, but how about with a parameter that enables/disables knockback and one that defines how far the object is shot. Maybe even negative arguments to the latter one could be used to make a tractor beam or mob that is really rather hard to get rid of.

@paramat
Copy link
Contributor

paramat commented Feb 27, 2015

For some (not all) situations this could possibly be done in lua by setting player's velocity. The TNT mod could give players a little kick even when far away to simulate a shockwave: knockback being exponential with distance.

@C1ffisme
Copy link
Author

@paramat It could be done by just adding code, but I wanted to make it available for modders without having old mods have no knockback, and making swords have extra code.

@paramat
Copy link
Contributor

paramat commented Feb 28, 2015

Yes certainly i approve. I might try editing the lua TNT mod for a shockwave kick.

@ShadowNinja
Copy link
Member

It doesn't have that feature because it isn't currently possible. You can't set player velocity or acceleration.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Mar 1, 2015

Here is the issue for missing setvelocity for players: #1176

@BlockMen BlockMen added @ Server / Client / Env. Feature request Issues that request the addition or enhancement of a feature labels Mar 2, 2015
@paramat
Copy link
Contributor

paramat commented Mar 18, 2015

Issue #1176 shows that players do not actually have velocity.

@KarlHegbloom
Copy link

The parachute mod is worth looking at with regards to this. An object can be attached to the player and it's velocity and acceleration set, I think. The player stays attached to the object.

@wilkgr76
Copy link
Contributor

As for swords, perhaps add a way to hit players/entities with the flat of your sword, so that you knock them back further.

@Fixer-007
Copy link
Contributor

I would like to see this too!

@C1ffisme
Copy link
Author

Would it be worthwhile to rewrite Object:punch() to apply knockback based on where the hitter is?

@KarlHegbloom
Copy link

KarlHegbloom commented Mar 13, 2017 via email

@raymoo
Copy link
Contributor

raymoo commented Mar 14, 2017

I guess this feature can't be dismissed anymore now that we have CSM.

@sofar
Copy link
Contributor

sofar commented Mar 14, 2017

The player is still not a modifyable entity/object in CSM

@raymoo
Copy link
Contributor

raymoo commented Mar 14, 2017

I mean that nobody can say "Let's wait for client side scripting before implementing this"

@Fixer-007
Copy link
Contributor

Fixer-007 commented Apr 6, 2017

https://github.com/tenplus1/playerplus has knockback introduced by @tenplus1

@TS440S
Copy link

TS440S commented May 16, 2019

Is this still being worked on or at least in a todo list?

@paramat paramat added the Concept approved Approved by a core dev: PRs welcomed! label May 16, 2019
@sfan5 sfan5 closed this as completed Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Concept approved Approved by a core dev: PRs welcomed! Feature request Issues that request the addition or enhancement of a feature @ Server / Client / Env.
Projects
None yet
Development

No branches or pull requests