Am I the only one wants to be warned on sprite collisions?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
malon3
Posts: 103
Joined: Fri Dec 26, 2008 4:41 pm

Am I the only one wants to be warned on sprite collisions?

Post by malon3 »

I made a feature request for this, but got denied.

I really don't see a reason to deny this. It doesn't affect any other mods and it's simply a warning message that it's happening.

"Overriding data like that is a core feature of the engine - it'd flag lots of perfectly valid mods."

Deprecation also flags valid mods, I don't see how that's an answer.
It's not like I'm asking for it NOT to override, just a warning when it happens.
Or at least a special commandline switch to check for sprite collisions.
User avatar
Enjay
 
 
Posts: 27334
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Am I the only one wants to be warned on sprite collision

Post by Enjay »

I get why you made the suggestion and now that we have the ability to store stuff in separate folders inside a project, it is even easier to accidentally create duplicate resource names (not just sprites).

However, Graf is, of course, right. Replacing a resource with the last one loaded that has the same name is a fundamental feature of the engine and always has been. There are many, many, many projects that rely on this. However, this is usually when a file containing those resources is loaded on top of something else, not when two resources in the same file have the same name (those are more likely just to be mistakes- and there are many files out there that have made that mistake).

There are also some other oddities. e.g. DOOM.WAD (Ultimate Doom version) has a duplicate patch that it shouldn't and all the sounds were accidentally included twice too.

All that being said, having some sort of "have I used this name in my project already" tool would be useful - perhaps as a stand alone util if someone wanted to make one, or as an addition to something like Slade.
malon3
Posts: 103
Joined: Fri Dec 26, 2008 4:41 pm

Re: Am I the only one wants to be warned on sprite collision

Post by malon3 »

I still don't understand this response

"Replacing a resource with the last one loaded that has the same name is a fundamental feature of the engine and always has been."

I'm not asking to change that behavior

I'm asking to be notified when it happens, at least making it an optional commandline switch to check for them if we want to ignore overrides by default
User avatar
Enjay
 
 
Posts: 27334
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Am I the only one wants to be warned on sprite collision

Post by Enjay »

As I said, having some way to track down such mistakes would be useful. I don't know if the game engine itself is the right place to do it (Graf is best placed to make that call), but a tool of some sort to do the check would be nice to have.

[Side point: I'm also keeping an eye on this thread just to make sure it doesn't turn into an "I didn't get the feature I wanted so I'll bash the devs" one. It's not there yet, so let's make sure it doesn't go down that path.]
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1120
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: Am I the only one wants to be warned on sprite collision

Post by Jekyll Grim Payne »

I know GZDoom renames some sprites on game start, like the BLOD/BLUD thing. I think what we need here (aside from long sprite names) is a probably a TEXTURES flag or something, that allows the author to make sure a specific graphic can't be overridden. GZDoom should be able to dynamically rename a graphic to make sure it has a unique name. Not having that is honestly a huge problem for projects that aim for high compatibility with other mods.

UPD: I'm now realizing that the problem is more complex, of course; that what we really need in terms of compatibility is to make sure that a specific class uses the graphic that come in the same archive where the code is... or some way to define an explicit path to the images. In any case, it's not easy. Just a notification about the name conflict is a lot easier to do.
Last edited by Jekyll Grim Payne on Mon Mar 21, 2022 6:32 am, edited 1 time in total.
User avatar
Enjay
 
 
Posts: 27334
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Am I the only one wants to be warned on sprite collision

Post by Enjay »

From my point of view, it's very easy to accidentally put two resources with the same name into one project, especially because we can now use folders. So it's very easy to accidentally re-use a sprite, patch, sound, whatever name without noticing. I actually did it myself this weekend with some patches I was working with.

So, having some method/tool/whatever to catch those mistakes would be useful.

Auto-renaming might not work if it doesn't catch things such as dynamic light definitions, model definitions, sndinfo entries, etc etc that reference resources by name.

Also, I'd suggest such a system could lead to confusion and/or lazy modders: "no need for me to get it right if the engine fixes it."
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Am I the only one wants to be warned on sprite collision

Post by Gez »

Just about 99.99999999999999999999999999999999999999999999999999999999999999999% of all existing Doom mods work by replacing a resource with another. Collision is the name of the game. Heck, even in the official IWADs there are some duplicated lumps (look at the sound and music lumps in DOOM.WAD, all those present in the shareware episode are duplicated).

Now I understand that what you want is to know if there are collision in a single archive, rather than collision between IWAD and mod. But that's really something that's in the jurisdiction of editing tools. And look: in SLADE 3, you can do Archive->Maintenance->Check duplicate entry names and Check duplicate entry content.
malon3
Posts: 103
Joined: Fri Dec 26, 2008 4:41 pm

Re: Am I the only one wants to be warned on sprite collision

Post by malon3 »

#1. Thank you Gez, I was unaware of that feature.

#2. I prefer to develop in VSCode so I can easily push to changes repositories, a slade-only feature is kinda rough in that regard. Though this doesn't mean I can't open the directory in Slade, but it does tie editing directly to slade and no other editors, which it would be nice to continue to dev in VSCode alone.

#3. What about an optional commandline switch like -checkcols that you can use while developing? This way it doesn't hammer current projects with flags, and you can use it while developing to check for such collisions?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Am I the only one wants to be warned on sprite collision

Post by Gez »

Really if you're developing your mods in directories, I'm sure there are hundreds of freeware programs that can find duplicate names. Or you could find a powershell script on Stack Overflow. There's really no reason to put such a functionality in GZDoom directly.
malon3
Posts: 103
Joined: Fri Dec 26, 2008 4:41 pm

Re: Am I the only one wants to be warned on sprite collision

Post by malon3 »

I concede
User avatar
Enjay
 
 
Posts: 27334
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Am I the only one wants to be warned on sprite collision

Post by Enjay »

Gez wrote:And look: in SLADE 3, you can do Archive->Maintenance->Check duplicate entry names and Check duplicate entry content.
I also did not realise that was a function. Useful to know.
Of course, I have also been working with a project that loads several different PK3s and I can still mess up with accidental duplicates there (even more likely I guess) but things are likely to be consolidated for any releases.
Gez wrote:Really if you're developing your mods in directories, I'm sure there are hundreds of freeware programs that can find duplicate names.
Doh! Of course there are. Loads of duplicate file finder utils of various types exist. I'll need to do a search and find one that suits me.
Post Reply

Return to “Scripting”