Is this a good game mechanic: detecting sound/noise

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
togFox
Party member
Posts: 779
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Is this a good game mechanic: detecting sound/noise

Post by togFox »

So I'm making a top down submarine game where the player's sub sneaks around and torpedo's fleets. A massive part of this is sound/audio/detection/stealth. I need a model that implements noise and detection of noise in a realistic and sensible way.

There are two adversaries - the submarine and submarine targets. I'm going to call them destroyers - as in the boat with depth charges. There are two qualities to these parties:
1) noise profile = how much noise are they making right now.
2) detection profile = how well can they hear noises right now.

These are circles centred on each party. When a sub uses full engines it's noise profile goes up so the circle gets larger and can be detected sooner/easier. Destroyers can hear better when they idle engines so when they do that their detection profile goes up. Here are some graphical examples:

The submarine(s) are both stealthy and distant. The destroyer won't detect the subs:
soundmodel1.png
soundmodel1.png (6.61 KiB) Viewed 5358 times



The destroyer is now closer and now has some chance of detecting the bottom sub, but it is not guaranteed:
soundmodel2.png
soundmodel2.png (6.84 KiB) Viewed 5358 times



The destroyer is very close now but the sub has a small profile. Even when the sub is entirely inside the detection range, the small profile means detection is not guranteed:
soundmodel3.png
soundmodel3.png (6.57 KiB) Viewed 5358 times



The sub is close and noisy. Detection is almost guranteed:
soundmodel4.png
soundmodel4.png (6.44 KiB) Viewed 5358 times




As I was typing this, I thought of a flaw. I was going to determine % of detection based on how much of the destroyer detection profile is filled/overlapping. There are mathematical formula's to do this (https://mathworld.wolfram.com/Circle-Ci ... ction.html). I just realised that a destroyer with a large detection profile will actually be penalised because the percentage of area inside it's cirlce that is filled by the noise profile actually reduces as the detection profile gets larger.

I'll think some more but would love some ideas on how to determine when the submarine is detected by the destroyer, noting, noise profiles and detections profiles shrink and grow based on current actions.

Edit: do I need to determine detection % based off raw/actual area that is overlapped? That means a large noise profile provides a larger overlap area and is rightly punished while a large detection profile provides opportunity for a large overlap area and is rightly rewarded.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
togFox
Party member
Posts: 779
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Is this a good game mechanic: detecting sound/noise

Post by togFox »

omg - nerd fest! Sonar equations!

https://dosits.org/science/advanced-top ... -equation/

https://dosits.org/science/advanced-top ... ive-sonar/

It's going to take me a while to unpack this science.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

Re: Is this a good game mechanic: detecting sound/noise

Post by GVovkiv »

I think this is game-dependent rather "good mechanic/not good" but I'm personally not big fan of random chances in main game mechanics, such as stealth.
User avatar
dusoft
Party member
Posts: 510
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Is this a good game mechanic: detecting sound/noise

Post by dusoft »

GVovkiv wrote: Mon Sep 11, 2023 6:45 am I think this is game-dependent rather "good mechanic/not good" but I'm personally not big fan of random chances in main game mechanics, such as stealth.
Even stealth can be indicated (see legendary Thief for simple example). But, indeed a player should be somehow informed about it even if using multiple indicators.
User avatar
togFox
Party member
Posts: 779
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Is this a good game mechanic: detecting sound/noise

Post by togFox »

Sound is measured in decibels so I can certainly put a 'decibel meter' on the gui. That will help the player understand their actions.

Great tip!
Last edited by togFox on Tue Sep 12, 2023 11:04 am, edited 1 time in total.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

Re: Is this a good game mechanic: detecting sound/noise

Post by GVovkiv »

dusoft wrote: Mon Sep 11, 2023 8:56 pm Even stealth can be indicated (see legendary Thief for simple example). But, indeed a player should be somehow informed about it even if using multiple indicators.
It's not about indicating, it's about randomness in some game mechanic. I'm not big fan when some random number decide, if I will fail or not, or if game will easier or harder for me. I prefer something more consistent, that I can control and learn. And random numbers is goes against this!
User avatar
dusoft
Party member
Posts: 510
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Is this a good game mechanic: detecting sound/noise

Post by dusoft »

GVovkiv wrote: Tue Sep 12, 2023 7:55 am
dusoft wrote: Mon Sep 11, 2023 8:56 pm Even stealth can be indicated (see legendary Thief for simple example). But, indeed a player should be somehow informed about it even if using multiple indicators.
It's not about indicating, it's about randomness in some game mechanic. I'm not big fan when some random number decide, if I will fail or not, or if game will easier or harder for me. I prefer something more consistent, that I can control and learn. And random numbers is goes against this!
Sure, but I have found first mention of "random" in your previous post, not in the OP's description.

...

Sound indicator would work. I mean there are plenty of good inspiration in Silent Service et al.
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

Re: Is this a good game mechanic: detecting sound/noise

Post by GVovkiv »

dusoft wrote: Tue Sep 12, 2023 7:25 pm Sure, but I have found first mention of "random" in your previous post, not in the OP's description.
> The destroyer is now closer and now has some chance of detecting the bottom sub, but it is not guaranteed:
> on picture: "[...] 0% chance of detection."
Maybe my cognitive abilities is very low, but "chance of detection" sounds like something random related, otherwise I'm not sure how chance of something to happen supposed to work
User avatar
dusoft
Party member
Posts: 510
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Is this a good game mechanic: detecting sound/noise

Post by dusoft »

GVovkiv wrote: Tue Sep 12, 2023 8:37 pm
dusoft wrote: Tue Sep 12, 2023 7:25 pm Sure, but I have found first mention of "random" in your previous post, not in the OP's description.
> The destroyer is now closer and now has some chance of detecting the bottom sub, but it is not guaranteed:
> on picture: "[...] 0% chance of detection."
Maybe my cognitive abilities is very low, but "chance of detection" sounds like something random related, otherwise I'm not sure how chance of something to happen supposed to work
Ah, I see, maybe my misunderstanding. I understood that chance of detection is given by other factors such as distance/position and it is going to be arbitrary (or follow a formula).
User avatar
GVovkiv
Party member
Posts: 670
Joined: Fri Jan 15, 2021 7:29 am

Re: Is this a good game mechanic: detecting sound/noise

Post by GVovkiv »

dusoft wrote: Tue Sep 12, 2023 8:45 pm Ah, I see, maybe my misunderstanding. I understood that chance of detection is given by other factors such as distance/position and it is going to be arbitrary (or follow a formula).
Even in that case. Lets say, formula gives you 40% of chance, based on distance, on sound, etc
What this number will mean without applying random?
If you would trigger when this % become, for example, 50 and more without additional conditions, then there is no chance. You just need to hit that 50% or more for trigger to happen, so no chance. So yeah, it's sounds like something related to random for me, but again, I'm might be wrong
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 50 guests