Need Some Help on Hit Detection 😅

I came to you all about this because my loud, proud ego finally said, “Okay, you can’t do this on your own, SOR-REEEE,” and went off. I think it also muttered something about me being a doofus.

My main issues:
Using player IDs to relay to other players
Tracking everyone’s position and returning who’s closest to you for everyone
Don’t know how big the FOV is, need the in-between measurement of the extended and regular (Minor Issue)

How it will work:

  1. The system will check for anyone who’s in the FOV.
  2. If that returns completely false, it will check for who’s last been in the FOV.
  3. If that returns true, the system will check how long they’ve been out of the FOV.
  4. The system will track everyone’s coordinates the whole time, and estimate where the player shot if anyone’s been in the FOV
  5. The system will calculate how wide the estimating range is based on how long a player’s been out of the FOV (If for 5 seconds, it expands to 180 degrees, the limit)
  6. The system will pick a random trajectory
  7. The system will simulate the projectile so as not to be “instant”
  8. If a player is in the way of that “projectile”, the system relays to that player and takes away regular health (Hard) and/or pseudo-health (Easy)
    a. If using both (Medium), the system prioritizes pseudo-health. If the player dies before it reaches zero, it is a “false death”, meaning it “did not happen”.
    b. If using regular health (Hard), the system relays to that player and heals them fully. The damage is added to how much the player healed, and then that becomes the damage. i.e. Player is at 76/100 HP. Healed fully, so the system calculates how much they healed, 24, and adds that to a Common Pickaxe’s damage, 1. The player is now shown that they are at 75 health.
    c. If using pseudo-health (Easy), the system decreases by the gadget’s known damage. The player is not reported dead unless they reach 0.

Now, that may be a lot, but once we break this down, we might be able to figure it out and possibly make it as memory-efficient as possible.

Constants:
All players are tracked
The game MUST know that they have a certain gadget and uses its database to see the speed, range, and damage of the projectile
Measures the FOV

Ask me any questions and I’ll try to clear it up for you.

Happy Gimkitting!

I still think you should’ve done this by yourself.

Get out, ego.

[1]


  1. BH, I hope you’re here so you can help or watch ↩︎

2 Likes

Alright so here’s what I understand.

First, we are tracking everybody’s coords, that way we can see if they are in the FOV.
To check if they are in the FOV is simple enough.

Why are you using player IDs?
This sounds like FFA (correct me if I’m wrong), in which case triggering player’s team number would work much better.
We only need 9 properties (not including the basic coord variables). We’ll start with the first 4: xmin, xmax, ymin, ymax. These hold the player’s FOV in coordinates. We’ll have to make them global, which is fine. The 5th property is playerID (confusing, I know, it’s just saving which player we’re talking about).

The way this works is it cycles through each player, seeing if Player A’s adjusted FOV correctly fits the coords of B. To do this, we’ll save the correct values of A to the first 4 properties, then use a relay to call on B, use checkers to compare with B’s coords, and if ALL true, then they’re in the FOV, and we call back on A (using the playerID property), and add them to the list or remove them. Simple block code using text strings, like: “1,2,13,”. Just have our 6th property hold who’s in our FOV. Our 8th and 9th variables were used to hold B’s location (if in FOV), and those are stored in the 9th variable, FOVcoords. These hold the coords corresponding to the 6th property. These will have to be updated each time, and make sure they’re in the same slot as in the 6th property. Again, text string manipulation, not the hardest code in the world bid it doesn’t take over 75 blocks.

Well hopefully that helped, but I have to go to school now (first day) so I can’t talk about other stuff, but I tried my best :slight_smile:

5 Likes

Give me a bit to get off my watch on my computer to start gimkitting! I’ll edit this when I have anything!

5 Likes

Hmmm… Never have been good at devices, but let me cook

When you say FOV, do you mean each player’s FOV, or the FOV of something static?

Also, are you using gadgets in this game?

1 Like

I think they mean each’s players FOV, otherwise the system they’re describing wouldn’t make sense.

So like, the sender, AKA the player trying to see the closest player to them. Maybe use tracking devices and some comparing? I’ll try and find your solution!

1 Like
  1. Yes, the player’s FOV
  2. Yes, I am using real gadgets and not pseudo
1 Like

How much would you care if the FOV was one or two giant circles?

I would be triggered to the point where there was no point for me to go on.

Besides the FOV is a rectangle

I think the FOV they are talking about is the player’s view on their screen.

1 Like

To clarify on the “difficulties”, there are 3 possible ways to make it.
Just for those who were wondering.

I’ve found out 2 more ways to make hit detection.
1- Prediction. This is generally less “detection” and more “randomized”, but simpler and uses less memory than directional tracking.
2- Directional Tracking. This uses pseudo-projectiles. There will be 8 (or more) directions- North, East, South West, and all those in between.
It uses the changing coordinates to decide which direction it’s going. The more directions it chooses from, the more memory it uses, but it gets more accurate.
More complex…

So which should we work on?

  • Prediction
  • Directional Tracking
0 voters
2 Likes

Directional Tracking, because prediction is not reliable in a sense that the error possibility is higher. The cons outweighs the pros. However, as complex and memory-wasting as directional tracking may seem, it is the more direct approach as you are literally calculating which way you’re going, unlike prediction which is very indirect and does not calculate at runtime, instead it calculates the chances you would go that way .

2 Likes

Not sure if this would help, but I made directional tracking on a small scale in this guide:

There’s only 2 problems:

  1. The ball & goal limits
  2. I didn’t actually damage people. I guess we could use a zone system to match the capture zones and deal damages to them, but we’d have to put some thought into it.

Also, the system isn’t very accurate because of the ball & goal limits. Feel free to discus.

3 Likes

That was a nice system for the TD, Bird! Though it’s not what I was looking for.
That ball is kind of a nuisance when trying to move it across the map, if we were to try to solve the ball problem.
Zones are also inefficient, which means it adds much more memory than is needed. We need something else entirely, and that means…
THE COORDINATE DEVICE! (add popcorn crunch here, editor)[1]
I kinda have it set up in my mind, but as I said in other topics (with a little bit of ego boost), I need to model it to actually make a guide about it.
You actually have been a great help, Bird.
[2]


  1. Wait, what? We have no editor? Aw man :frowning: ↩︎

  2. Grammarly isn’t acting up? I have no issues with my writing? Good job, me ↩︎

3 Likes

Of course you could use the coord device, I was just worried about it not lining up.
… until I remembered grid snap lol I’ve never used that thing.

Care to elaborate? Exactly what is this model you have in your head?

3 Likes

Let me rephrase. I need to make it to make a guide.
I’d say to have an equal balance between accuracy and memory, there’d be 12 directions.
The coordinate device will track the nearest player and deduce which "direction they’re going.
Then the game heals the target to full, and damages them so that the regular health won’t interfere with the pseudo-health.

3 Likes

I don’t understand why you’re healing them to full again. Can’t you just have a damaged with the correct damage for every gadget type and then just deal the damage?

Also are we talking about directional tracking or random hitting? If the former, how to we know what direction they’re firing in? Or if they fire at all?

3 Likes

We’re using directional tracking, and I’m healing them to full because if they were “hit” by the system’s standards, but not hit by the actual game’s terms, then the regular health will interfere with the pseudo, by having too much health. Whereas the game will say that the player is hit and the system does not, which means they will have too little health, interfering with the pseudo and their location, if it was crucial. Finally, if both systems detect the player is hit, they will have too little health again because there was no healing taking place after that damage.
Healing to full, then damaging them so that it’s accurate, is crucial to gameplay.

Aren’t you holding back to farm likes from Bird?

No, I’m not holding back to farm likes. I haven’t started the model and they’re asking questions.
Get out, ego.

3 Likes