Page 1 of 2

There Are Enemies Nearby mod suggestion

Posted: Fri Oct 25, 2019 11:25 am
by Ralzar
Trying to find some magic spot in the dungeon where you can rest is frustrating and very often feels dumb. You know the enemies are not near you at all, they are half the dungeon away in walking distance, but happen to be on the other side of a wall you are near.

Would there be some way to mod this? I can think of a couple of ways to go. But really uncertain of what could be done from a code perspective.
Alternatives:

Adjust range
Either turn off the mechanic or make the range shorter.

Prompt
"There are enemies nearby, do you still wish to rest? YES/NO. "
The chance of monsters spawning is higher if you sleep here.

Smarter Mechanic
The game calculates paths and distance instead of a direct line.
If it does this correctly, you should be able to lock yourself in a room to create a safe spot to sleep.

Resting Spots
Create some kind of safe spots where you can sleep uninterrupted.

Wandring Monster
Ditch the random monster spawning and let monsters allready spawned in the dungeon wander around and bump into you.

Re: There Are Enemies Nearby mod suggestion

Posted: Fri Oct 25, 2019 3:43 pm
by MasonFace
I think the ultimate goal would be the "smarter mechanics" route, but it would take someone smarter than me to implement.

It would be nice to have a quad tree (although I think there are more modern techniques that may be more appropriate) generated when the dungeon is initialized that computes the visibility from one area/volume to another.

The generated data could accomplish two really important things:
  • Increase performance by allowing for simple table-based vis culling.
  • Approximate distance between two volumes by traversing the vis table data.
For the first point, at the very least, dynamic lights that are not visible can be disabled if the player is in a volume that cannot possibly see another volume. Performance could be increased further by more intelligently "chunking" the combined dungeon meshes so that their renderers could also be disabled dynamically based on vis data. Additionally, this could be used to fully disable those pesky disjointed rooms in some dungeons that have enemies inside them, but no path to get to them (may need to allow for exceptions for rooms that are designed to be teleported to).

For the second point, the data could help to prevent the enemy directly on the other side of the wall that is actually far away by walking distance, from interrupting rest. A bonus of this data could be to adjust the audio volume of enemies based on the approximate distance from the player according to the vis table data.

I think some of this has been discussed before at some point, but to my knowledge, no one has actually taken a crack at it yet.
Would there be some way to mod this?
The above method would require changes/additions to code in core DFU, but your other suggestions would probably work as a mod (except the wandering monsters may require some sort of Nav mesh and that may need to tap into core).
Resting Spots
Create some kind of safe spots where you can sleep uninterrupted.
It would be funny if this put a "do not disturb" card on the doorknob of whatever room you're in. :lol:

Re: There Are Enemies Nearby mod suggestion

Posted: Fri Oct 25, 2019 5:03 pm
by Ralzar
MasonFace wrote: Fri Oct 25, 2019 3:43 pm
Resting Spots
Create some kind of safe spots where you can sleep uninterrupted.
It would be funny if this put a "do not disturb" card on the doorknob of whatever room you're in. :lol:
Haha, true. But I have been thinking about the Wizard Lock spell that's not really used a lot is it? Last character I played I ran into scorpions before I was able to fight them. I kept locking them into dungeon rooms because they couldn't open doors and it made me realize that being able to lock doors would be a interesting mechanic to make things more complex. Being able to lock the doors to a room to create a safe zone would be one such example.

But as for the rest of your post, yeah. Much what I figured. It's the best solution but very likely not the easiest :)

Re: There Are Enemies Nearby mod suggestion

Posted: Fri Oct 25, 2019 8:09 pm
by l3lessed
This is really critical to get in at some point for all the reasons plus more you listed. I'll keep an eye on this, and if I ever get some free time outside of working on my combat coding stuff or get to a stopping point with it, I may start researching and digging into this. So much I would like to do, so little time. :D

Re: There Are Enemies Nearby mod suggestion

Posted: Sat Oct 26, 2019 12:21 pm
by BansheeXYZ
The obvious solution would be some kind of HUD indicator for rest so you don't have to keep mashing "R" to find out if you're in the clear.
resticon2.gif
resticon2.gif (268.52 KiB) Viewed 2269 times

Re: There Are Enemies Nearby mod suggestion

Posted: Sat Oct 26, 2019 1:53 pm
by Ralzar
True, that would be really handy for avoiding having to "hunt" in the same way for a spot to sleep.


It struck me that the problem with monster detecting is really also a sound problem. It's caused by how the dungeons does not care about walls. You can walk around empty hallways and hear a skeleton continuously scream in your ear because he is one wall away in a different part of the dungeon.
And when you can't sleep isn't it really implied that you can hear monsters nearby? Maybe it's the same function that detect both? So if you could make the player only hear monster he should be hearing, you can't sleep as long as you hear monsters. Which would make sense.

Re: There Are Enemies Nearby mod suggestion

Posted: Sat Oct 26, 2019 2:53 pm
by BansheeXYZ
Enemies close enough to disable rest aren't always audible. That's kind of the main problem.

And no, walls don't matter and shouldn't. If they did, you could sleep almost anywhere. I'd rather a mod go in the opposite direction and disallow rest in dungeons. Have the player prep for dungeons with mana potions and bandages.

Re: There Are Enemies Nearby mod suggestion

Posted: Mon Oct 28, 2019 9:24 am
by Ralzar
BansheeXYZ wrote: Sat Oct 26, 2019 2:53 pm And no, walls don't matter and shouldn't. If they did, you could sleep almost anywhere. I'd rather a mod go in the opposite direction and disallow rest in dungeons. Have the player prep for dungeons with mana potions and bandages.
I would actually be ok with this. Just remove the entire problem area instead of finding some way to fix it. Allthough I'm not sure the game is balanced for making this work. When you are higher levels and have the money and guild ranks to stock up with potions and magic items it would work fine. But at lower levels I could only see it work if you combined it with the Persistent Dungeons mod that would let you leave the dungeon, sleep outside and go back in. But that would also be tedious, having to backtrack out of the dungeon every time you got hurt.

This would actually work better with some kind of "safe spot" mechanic where there would only be some specified rooms that you could use to rest. For example, all quest rooms. Each dungeon has, what? 5 or so spots where the quest goal can be placed? Designating them as safe spots unless monsters actually are near, would work pretty nice.
Alternatively, if there were static items in the dungeons that let you replenish your health, mana and stamina. For example fireplaces?

Re: There Are Enemies Nearby mod suggestion

Posted: Wed Oct 30, 2019 3:14 pm
by jedidia
I'd rather a mod go in the opposite direction and disallow rest in dungeons. Have the player prep for dungeons with mana potions and bandages
That would make dungeons suicide for low-level characters, though. Not to mention that it would make it almost impossible to get out of privateers hold for people that don't know the layout already.

Re: There Are Enemies Nearby mod suggestion

Posted: Thu Oct 31, 2019 7:48 am
by Ralzar
jedidia wrote: Wed Oct 30, 2019 3:14 pm
I'd rather a mod go in the opposite direction and disallow rest in dungeons. Have the player prep for dungeons with mana potions and bandages
That would make dungeons suicide for low-level characters, though. Not to mention that it would make it almost impossible to get out of privateers hold for people that don't know the layout already.
True. You would either have to include a bunch of starting items for healing etc, or you would have to implement something like what I suggested above with resting spots. The cave with the fireplace where you start being an obvious resting spot you could keep backtracking to in order to heal up.