Interkarma / daggerfall-unity

Open source recreation of Daggerfall in the Unity engine
http://www.dfworkshop.net
MIT License
2.65k stars 326 forks source link

Passing-out Notification can trigger again during burial cutscene and in main menu #1945

Closed jotoho closed 3 years ago

jotoho commented 3 years ago

When experimenting with the mods Interesting Terrain and Travel Options, I fell through the world. After a failed attempt to get back up using the console, I eventually decided to just disable God-Mode and die from the void.

I began to lose fatigue rapidly and after a few popups about me passing out and mobs spawning, eventually got the death-by-passing-out message and died.

When the cutscene started, I skipped it and a few moments after arriving on the scroll-screen (where you load a savegame or start a new character), the death sound played again and I got the death notification again. (See Screenshot 1)

When reproducing this using the console command "speedy 500", running off the world and disabling godmode the notification appeared on the scroll-screen again, so I decided that it is consistent enough to write a bug report.

Addendum: I also tried this again and this time, I did not skip the burial cutscene and both the sound and notification showed up during it, instead. (See Screenshot 2)

To Reproduce Steps to reproduce the behavior:

  1. Go outside
  2. Execute console command "speedy 500"
  3. Run until you fall out of the world (should only take a few seconds)
  4. Disable Godmode with console command "tgm"
  5. Die from the void
  6. Skip burial cutscene (optional)
  7. Wait a few seconds for sound and notification to appear again.

Expected behavior Only get one death notification before the burial cutscene and the load/start screen should wait for my next action, instead of giving the same notification and sound again.

Screenshots Dead in Main Menu Dead in Cutscene

System Information

jotoho commented 3 years ago

I do not think that it is relevant but here's my most recent save (just in case you need it for debugging). SAVE105.zip

EndlessVoid1 commented 3 years ago

From what I've seen looking through the issues that are currently open: 1. Nobody really is actively moderating this project and updating/getting consensus on bugs. 2. Interkarma doesn't seem to respond to bugs, ever. I've only seen him respond when he specifically gets called out or someone found a critical bug internally (not a mod).

Extra: 3. If it is an OS thing, nobody will probably be able to know since I doubt many develop on specifically arch linux. 4. Most of the time game creators don't really care if a bug occurs due to a mod because it's something external to the actual game which should, ideally (very ideally), work properly within the scope of itself. 5. If you are a developer or know somewhat about programming, then I wouldn't mind starting a conversation on trying to get this sorted out. 6. I hope you are having great day, where ever you are :P. (7. Oh, and if Interkarma does respond he'll probably tell you to ask the creators of the mod or speculate on what could be happening, but I highly doubt any plan of action will be created (no disrespect to Interkarma, it's just what I've noticed reading through the issues.) ).

jotoho commented 3 years ago

@EndlessVoid1 It's true that there isn't much activity on this issue tracker but I would say Interkarma is still pretty active on this project (Primarily reviewing and merging PRs from what I can tell of from my email notifications but still). His last commit on master was only a week ago.

I think it is important to remember it is an OpenSource Project that, as far as I know, no one is paid to work on and this is a rather minor issue compared to some other things like working on mod support.

As far as my installation of Daggerfall Unity is concerned, I somewhat doubt that this issue was caused by my installed mods as there was nothing that should interfere with the death logic. (Especially for falling into the void.)

Regardless of whether it was a modding issue, due to a recent mistake during file transfer between my PC and a server at home I accidentally deleted the folder my installation of DFUnity was stored in and failed to restore the files, so I will need to set up everything from scratch anyway.

As for my Operating System, there have been no indicators so far that the issue I experienced had anything to do with it, so until proven otherwise (which may be difficult since the installation was lost) I will presume that it is a cross-platform issue. I mentioned my OS because it was requested by the issue template.

As the autumn school break begins this weekend in my home region, I may experiment if this issue still occurs with the fresh install I will have to make.

As for my programming knowledge, I know and have some experience in C, C++ and Java with a bit of Python and ComputerCraft-Style Lua but have never learned C# and do not know this codebase, so I do not know how much help I would be in making a patch.

jotoho commented 3 years ago

@EndlessVoid1 Also I just saw that your github-account was only just created on the 28th and there is no other activity visible on your profile, so forgive me for being slightly suspicious.

EndlessVoid1 commented 3 years ago

Yeah, I'm not a professional lol. I don't work as a software engineer and contribute on the side as some other people do. I'm mainly just trying to get experience by helping with projects and look through code.

I got the basics of C# and have done scripting before so it's not that bad when I look at everything.

I think I remembered I tried to find where death is handled but I don't remember what I found or if I even tried looking.

Clearly, it has something to do with being outside of the world. Maybe, some scripts don't work properly due to where you end are when you fall through the world.

There's another sort of not-important type bug that hadn't been commented on in over a year before I commented. I investigated and found the quest script and according to the script the bugs should of never happened. The script was quite straight forward. Most likely the issue is somewhere else but I stopped caring as this community seems super dead and issues that aren't critical are basically swept under the rug - it seems. :/

I think it could be that sort of case where this is something that will never be looked at and you are just going to have to avoid it.

I could try. - but like I said it simply doesn't seem worth it when the community is just so dead.

The C# language isn't that bad if you drop by the C# tutorials at the Microsoft docs.

I probably made a general statement about how many people actually use Arch Linux. I actually have no idea generally how many people use that os for development.

I only created this account recently because I decided to finally put the things I've been learning over the summer to use - but that is widely off topic (not like there's people who actively moderate these issues anyway lol).

I wouldn't mind working on this together and start looking through the files. Although, ultimately to get a better take on this problem we would probably need to contact Interkarma.

Have a great day/night!

jotoho commented 3 years ago

@EndlessVoid1

I just did some more quick digging with a temporary install of DFUnity 0.10.26a that had no mods installed and have several things to note.

As I said, I have no knowledge or experience with C# or Unity. I have heard that C# and Java are very similar though and it seems that I can understand some of the code I've looked at.

My lessons on programming (mostly part of a three year school-based education in IT at a vocational college in Germany) have also been mostly limited to projects with only a few source files so I may have some trouble navigating a code base of this size.

A quick GitHub-Search for "death" led me to this source file, which probably contains most code surrounding player death.

This issue is of no particular importance to me, since if I fall through the world I probably have to reload anyway. I just wanted to document it here for others who may be experiencing the same issue and to make sure the maintainer(s) are aware of this.

If you wish for me to do more testing or another opinion on some piece of code, I will see what I can do but I do not intend to learn another programming language "just" for this small issue. I also have a good understanding of Git version-control if you want some help with that.

jotoho commented 3 years ago

I just took another look at the source file I linked in my last comment and from my rudimentary understanding it seems that the Sound I hear is triggered in the function PlayerEntity_OnDeath(DaggerfallEntity entity). As I do not see any loops in that function and the game is seemlingly paused before the sound is played, I do not think that is supposed to happen.

I would guess there either is another location in the code the death sound effect is played, the OnDeath is called multiple times or the EventHandler called at the very end of the function is responsible.

As I do not understand how Eventhandling works in Unity and System.EventHandler is apparently not defined in this codebase (Probably from C# itself or the Unity engine), I cannot say any more than that.

Also I think it's interesting that the EventHandler-call in PlayerEntity_OnDeath does not seem to communicate which Event it should process. Does it somehow read that from the name of its instance "OnPlayerDeath"?

jotoho commented 3 years ago

I think I need to correct myself. When I reproduced this issue in vanilla DFUnity, I made a screenshot of the notification appearing in the burial cutscene but forgot to upload it.

I just noticed that the text in the notification is regarding me running out of fatigue and not strictly a "death notification".

This makes me question whether the issue could be caused by the void damage to the players stamina still being applied even though the game was paused by the death. Or perhaps my fatigue was at zero when the character died and this is still being checked while the game is paused during the cutscene and main menu.

Here's the screenshot:

Same Issue in vanilla Daggerfall Unity

Interkarma commented 3 years ago

This popup is event driven, and in some circumstances events can be queued multiple times. I'm not able to reproduce just by running out of fatigue in the void, but I can see how this would happen if one system managed to trigger the exhaustion event several times in a row.

I'll add a check to prevent this popup firing when player is already dead, in addition to the UI stack prevention check already in place.