MT-CTF / capturetheflag

Capture the Flag game using the Minetest Voxel Engine
https://ctf.rubenwardy.com
81 stars 88 forks source link

Giant magnet #217

Closed AKryukov92 closed 5 years ago

AKryukov92 commented 5 years ago

This idea is supposed to introduce something to counter good sword in enemy team. Giant magnet is a block, which magnetizes current tool from all players on line of sight in X block range. I expect X to be from 3 to 5, configurable in minetest.conf. It affects only tools from "good weapon list". Wooden and stone tools are not supposed to be affected by it. Magnetized tools should be stored in magnet 'inventory'. Its inventory accessible for all teams. Recipe for it: # 0 # # 0 # # # # where # is a iron ingot, 0 is an empty slot.

skittlemittle commented 5 years ago

So it takes away your weapons from you?

AKryukov92 commented 5 years ago

Only the one, which you currently hold in the hands.

ClobberXD commented 5 years ago

This sounds too OP, just like #117

AKryukov92 commented 5 years ago

Why do you think so?

Desour commented 5 years ago

What about instead of taking away the item, force the look direction of the player towards the "magnet"? It should of course affect both teams' players.

AKryukov92 commented 5 years ago

Is it ever possible to force players to look somewhere?

Desour commented 5 years ago

Yes: https://github.com/minetest/minetest/blob/3a992ce76d2c9261bcf35d9123d8c77a4c227eeb/doc/lua_api.txt#L5105-L5108

AKryukov92 commented 5 years ago

It is not magnet then. Do you have any idea how to name it?

Desour commented 5 years ago

Magnet is fine.

AKryukov92 commented 5 years ago

Scarecrow? Giant eye? Team banner?

ClobberXD commented 5 years ago

Just like the drop-on-arrow suggestion, players would be able to snatch an enemy's sword with just one click. While the range is not too high, it still allows the player to use the magnet even before being hit once.

AKryukov92 commented 5 years ago

I agree that ability to snatch an enemy's sword with one click is bad when you can use it in every fight. What if players will not be able to pick magnet itself back to inventory? It will work once installed and until the end of the fight. Even if you lose your sword once, you will know where magnet is and will avoid moving there.

Thomas--S commented 5 years ago

I opposed to adding these giant magnets (or however you want to call them) independently of their function (sword-taking or look direction forcing) because of the following reasons:

1) Both of these two function will need to make use of abm's or globlsteps iterating over the player list every second. This will introduce lag.

2) Both of these two functions seem overpowered to me.

3) In my opinion, this doesn't really fit into the theme of this CTF game. This giant magnet is more like a "magic" object and there is no "magic" in this CTF game.

AKryukov92 commented 5 years ago
  1. Most of improvements might introduce lag. If this is important reason to deny feature, then things like #203 or #181 should not be added too. Have you measured, how much time does it take to iterate over player list? If you don't have exact numbers, how can you use "lag" as argument?

  2. Why do you think so?

  3. We do have guns, but should not introduce magnets? We are not in medieval setting after all.

Thomas--S commented 5 years ago

1) As explained in https://github.com/rubenwardy/capturetheflag/issues/218#issuecomment-436980295

Things like this are generally considered very laggy. If you prove the opposite, it's ok, but until then I don't see a necessity to provide exact measurements.

Indeed, I'm also a bit worried about #203 and #181.

2) Taking the enemies sword away without fight seems overpowered to me, as it makes the enemy basically defenseless. "Locking" the view direction also makes players very vulnerable (attacks from the back) and restricts player movement very much, so I think this is overpowered, too.

3) Guns are used in reality too, but I don't know of giant magnets used in reality to take away metal equipment from people.

Desour commented 5 years ago

The lag is a big problems for things like magnets. You wouldn't just need to iterate through all players but also iterate through the node positions in a specific radius for each player. Let's say, you have 10 players and a "radius" of 5 nodes, it will be 10(5*2)^3 = 10000 nodes to check, and this multiple times in a second. Edit: Or a probably better way to implement it, search the players that are near to magnets. So for 5 magnets 510=50 times looking whether a position is near.

AKryukov92 commented 5 years ago

Let's say, you have 10 players and a "radius" of 5 nodes, it will be 10(52)^3 = 10000 nodes to check

I don't think that you really need to iterate over nodes around of magnet.

So for 5 magnets 5*10=50 times looking whether a position is near.

And for 1000 magnets it will be 10000. I can't take this argument seriously.

For 1 magnet you will do 60 (max amount of players I have seen) calculations of square root from difference in coordinates. If square root calculation takes significant amount of processing time, then we probably need to do some profiling of MT itself.

Most of lags comes from I/O, network activity and massive node updates. If we just run over all players and check their coordinates, processing time will be minimal. Magnet will do some network activity once some player comes close to it. MT have to take item from inventory and send updates to all players. Resource consumption will be almost equal to team chest interaction. Do you have lags when you put things in chest?

I don't agree with you on two points: 1) You are doing premature optimisation. 2) You denying whole gameplay feature with performance agruments,

skittlemittle commented 5 years ago

But why do you want magnets, they'll be super annoying

Desour commented 5 years ago

I don't think that you really need to iterate over nodes around of magnet.

Of course not, I've never written this.

And for 1000 magnets it will be 10000. I can't take this argument seriously.

I just wanted to give an example with a realistic scale.

Actually those were just thoughts about the lag argument. They were not meant as deny. : )

AKryukov92 commented 5 years ago

I want magnets mostly because they will block bridges, tonnels and base better than walls and doors. They might cover your escape route with flag. Now players are just do straight run to enemy base. Assuming that there are magnets, they will maneuver more.

May be magnets will be available only in map editor to allow map designers to make some unusual maps.

rubenwardy commented 5 years ago

Thanks for the idea, but it's not I'd like to see added