[0.11.2] Guards Vanish At Edge Of Town

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
User avatar
Teralitha
Posts: 359
Joined: Wed Jul 17, 2019 3:44 pm

[0.11.2] Guards Vanish At Edge Of Town

Post by Teralitha »

So, when Ive got guards chasing me in town, if I run to the edge of town they simply vanish into thin air upon reaching the town border. This did not occur in previous versions of unity, nor in classic. Guards used to chase you well into the wilderness. I can only assume this is a bug in recent version.

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Interkarma »

This is intentional and does in fact match classic. It was added back in 0.10.27. The only difference is that DFU's town borders are a little tighter for this check and guards might despawn sooner. Other than needing to lead them a bit farther into the wilderness in classic, the despawn behaviour is the same. Any active crime state is also cleared when player leaves town area.

User avatar
Teralitha
Posts: 359
Joined: Wed Jul 17, 2019 3:44 pm

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Teralitha »

More than "a little" tighter. Here is a little video I made showing the difference between classic and unity, I think you would agree it is a bit silly - https://www.youtube.com/watch?v=gasYqzoVcC8

Why did you change it anyway? To improve performance?

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Interkarma »

This wasn't "changed" as such - these two games are totally different implementations with different codebases on different engines. Daggerfall Unity is not a source port, it's an entirely new code base created from the ground up, which means sometimes things behave differently and have unique requirements under the hood. In this instance, the way location rects are manged have tighter boundaries in DFU due to its unique implementation.

I'm happy to look into extending the distance guards will follow player outside of town before despawning, but it's possibly not a trivial alteration.

Edit: What I can do trivially is extend the "player in location" rect check in virtual coordinate space by 4096 units (a full RMB width). This will match classic when determining town border for player and not affect anything else critical in world, such as town injection over terrain. I'll roll this into next release. Guards will then pursue player farther into the wilderness before despawning.

User avatar
Teralitha
Posts: 359
Joined: Wed Jul 17, 2019 3:44 pm

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Teralitha »

Awesome, thank you.

User avatar
Teralitha
Posts: 359
Joined: Wed Jul 17, 2019 3:44 pm

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Teralitha »

Interkarma wrote: Sat Apr 03, 2021 2:13 pm This is intentional and does in fact match classic. It was added back in 0.10.27. The only difference is that DFU's town borders are a little tighter for this check and guards might despawn sooner. Other than needing to lead them a bit farther into the wilderness in classic, the despawn behaviour is the same. Any active crime state is also cleared when player leaves town area.
An interesting update to this. I was just messing around killing npcs on the street, and I discovered that if you are standing just outside the town border yet kill an NPC that is just at the edge of the town border, the guards that appear in response for that murder do not vanish at the town border but will in fact literally chase you forever into the wilderness. (Might be easier to do this with a range weapon since NPCs are not always at a border)

So evidently, this is possible to do. Maybe its then possible to make it so this is the standard behavior. If they can ignore the town border to chase you forever in this instance, I would assume they always can. Assuming you could figure out how to code it so guards are not affected by the town borders.

This IMO would be the most realistic behavior you could expect when breaking the law and being chased by guards. You can always escape by out running them if you wanted to.

Testing this further, if you get them chasing you outside of town in this manner, and you run back into town then back out of town the guards then vanish as usual. They are not vanishing when "they" reach the town border, they vanish when "you" do. Crossing the border going "in" to town doesnt make them vanish, only when you cross "out". It should be possible to change this I would hope..

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Interkarma »

Teralitha wrote: Fri Apr 16, 2021 3:29 pm They are not vanishing when "they" reach the town border, they vanish when "you" do. Crossing the border going "in" to town doesnt make them vanish, only when you cross "out". It should be possible to change this I would hope..
This is already how it works. It's the player exiting town border that causes guards to despawn and active crime state to be cleared. The only difference is that DFU had tighter borders, which is fixed in next release as described above.

I have no plans to make guards chase player indefinitely into wilderness. The intent in classic is very clearly to despawn guards and clear active crime state when player is run out of town. That you're able to find a logic gap to exploit this doesn't change the intent.

I'm perfectly happy with how this functions in DFU now and will spend no more time on this topic.

User avatar
Teralitha
Posts: 359
Joined: Wed Jul 17, 2019 3:44 pm

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Teralitha »

Interkarma wrote: Fri Apr 16, 2021 10:57 pm
Teralitha wrote: Fri Apr 16, 2021 3:29 pm They are not vanishing when "they" reach the town border, they vanish when "you" do. Crossing the border going "in" to town doesnt make them vanish, only when you cross "out". It should be possible to change this I would hope..
This is already how it works. It's the player exiting town border that causes guards to despawn and active crime state to be cleared. The only difference is that DFU had tighter borders, which is fixed in next release as described above.

I have no plans to make guards chase player indefinitely into wilderness. The intent in classic is very clearly to despawn guards and clear active crime state when player is run out of town. That you're able to find a logic gap to exploit this doesn't change the intent.

I'm perfectly happy with how this functions in DFU now and will spend no more time on this topic.
I take offense to your accusation. I wasnt looking for an exploit. I stumbled upon this by accident and was reporting it. If I wanted to exploit something, I wouldnt tell you. This wouldnt even be possible if DFU didnt make the borders so close to the actual town.

User avatar
Interkarma
Posts: 7234
Joined: Sun Mar 22, 2015 1:51 am

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Interkarma »

Teralitha wrote: Fri Apr 16, 2021 11:20 pm I take offense to your accusation. I wasnt looking for an exploit. I stumbled upon this by accident and was reporting it. If I wanted to exploit something, I wouldnt tell you.
Saying something is an exploit isn't an accusation of anything. Seriously! It just means you've found a way to leverage gaps in code logic to make it behave differently than intended. I wouldn't have expected anyone to take offense to such a dry concept, and I apologise for having done that. If anything, you're bloody clever finding it.

Teralitha wrote: Fri Apr 16, 2021 11:20 pm This wouldnt even be possible if DFU didnt make the borders so close to the actual town.
This will be lot better from next release with expanded town borders. We've already had a good outcome from this topic, and I'm happy with how this is functioning. I'm not going to spend any more time working on this unless someone finds a serious problem that impacts normal play.

User avatar
Teralitha
Posts: 359
Joined: Wed Jul 17, 2019 3:44 pm

Re: [0.11.2] Guards Vanish At Edge Of Town

Post by Teralitha »

Ok I see. Thank you for clarifying and finding a good fix for it.

Post Reply