Add MF8_SEEFRIENDLYMONSTERS.

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: GZDoom Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:
Image

Legacy Status:
Image Image

QZDoom Status:
Image

Add MF8_SEEFRIENDLYMONSTERS.

Postby inkoalawetrust » Fri Apr 22, 2022 7:18 am

Pull request

This pull request adds a new actor flag for monsters, that allows hostile monsters to be able to see and attack friendly monsters. Similar to how friendly monsters can already see hostile monsters, or monsters friendly to enemy players.

The flag uses pretty much the same code as friendly monsters use to see other monsters, including reusing the FriendlySeeBlocks property to specify the monster seeing range of the monster. The only difference is that monsters with MF8_SEEFRIENDLYMONSTERS, don't need to also check what specific player each friendly monster is allied to, since that's irrelevant for monsters hostile to all players.


I have also tested the PR to ensure it doesn't break how friendly monsters see other monsters. And performance wise this PR has minimal performance impact, producing even less overhead that friendly monsters already do. And significantly less overhead compared to adding this feature in by using a ZScript mod.
User avatar
inkoalawetrust
 
Joined: 26 Aug 2019
Discord: inkoalawetrust #9783
Github ID: inkoalawetrust
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Return to Code Submissions

Who is online

Users browsing this forum: No registered users and 0 guests