Fighting mobs

Post Reply
Astrobe
Member
Posts: 324
Joined: Sun Apr 01, 2018 10:46

Fighting mobs

by Astrobe » Post

I'm a bit annoyed by the fact that currently in my game, the only efficient technique to fight mobs (without arrows) is to wait for them to come close, hit, back up and repeat (aka "kiting"). For mobs that throw things, the tactic is to wait for them to throw their thing, hit and repeat.

I'm looking for some variety. Something like mobs that teleport randomly around the player when they are hit. Preferably things simple and relatively easy to implement in Mobs Redo.

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

Re: Fighting mobs

by runs » Post

I am planning to make a Monsta Mod so that idea of a teleporting mob is cool.

The mobkit mod is better to do that. Mobs have a knockback feature and a jumping attack by default that makes combat slightly challenging.
Day 42 of the quarantine

User avatar
Hamlet
Member
Posts: 765
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: Fighting mobs

by Hamlet » Post

Astrobe wrote:I'm looking for some variety. Something like mobs that teleport randomly around the player when they are hit. Preferably things simple and relatively easy to implement in Mobs Redo.
I will work on this idea, at the moment I have a generic idea of its implementation.

1 - Use the on_punch function, available for any mob regardless of the API.
2 - Get the player's position - puncher:get_pos().
3 - Randomly choose one of the eight nodes - in other words, North, South, etc. - around the node where the player is standing; requires a 'is free space' check to prevent placing the mob into a wall, a tree, or whatever isn't 'air'.
4 - Set the mob's position on the chosen node (self.object:set_pos(pos)), maybe at random distance: not necessarily on the node immediately next to the player's node.
5 - Set the mob's rotation to face the player (self.object:set_yaw(radians)).

Your idea could also be used for piranhas: think about five fishes moving around the prey; instead of 'teleporting' the mob, it should move by itself to the randomly chosen points around the target.

Now that I think of it, it could also be applied to wasps, bees etc. both to keep them around the beehive (peaceful state) and around the foes (hostile state).

In a sci-fi environment, it could be something like the training drone used by Luke Skywalker in Star Wars: that little floating 'ball' shooting laser.
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

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

Re: Fighting mobs

by Astrobe » Post

I actually tried this teleportation idea but gave up on it eventually, because it made the game more difficult than I expected. However, I guess that it depends on the mobs - speed and reach notably, because they determine the reaction time for the player. The teleportation distance is therefore also very important.

I can give an update about what I eventually did:

- more mobile mobs. Don't be afraid to increase the run speed and jump height. With jump height using ridiculous values can even work. I have giant spiders and giant bugs that can jump over an apple tree. As a result meeting a giant bug in a forest gives quite "interesting" combats because by jumping so high, the mobs are often hidden by the leaves. This requires the soft-leaves mod though, otherwise it'd be silly.

- more shooting mobs that, even when you dodge the missile something happens. I have a big ice spider that shoots snowballs. When the snowball hits a player or a node, it spawns a smaller ice spider. That's effective because if the missile hits a tree behind you, then you are surrounded and you have to choose between going for the shooting spider or get rid of the smaller ones first.

- Custom knowbacks. I hacked MobsRedo so that knockback works only when the mob is not on the ground (jumping or falling). This one is only useful significant in tight places like caves where you cannot "kite" the mobs. Even though my players have enhanced mobility (speed boots and an ability that gives ridiculous jump height), a bunch of mobs that don't get blocked easily (see firs point) can force them to back up too much. So they have the option to hit them at the right moment to knock them back instead. Having a ranged weapon (gun, bow, or in my case magic wands) significantly helps.

- I introduced some variety with magic wands: a teleportation wand that let players swap place with mobs or other players, a simple fireball wand, a more expensive fireball wand that does splash damage (hits multiple targets if they are close enough), a very expensive (and dangerous) explosive wand, and an invisibility wand (usable in PvP).

All this doesn't eliminate kiting, but it does introduce some back-and-forth and fights are dependent on the environment in a more satisfying way.

Regarding your "Skywalker" idea, which is interesting, a perhaps a simple way to do it is to use the runaway behavior: for a shooting mob, it makes sense that it tries to keep its distance with its target. You probably need a distance-based criteria in addition of the timer-based criteria to stop them from running away (you need both because otherwise they will probably run just on pixel out of range; or you need a different "start fleeing" and "stop fleeing" distance).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest