[Added] Export MapData.GetChecksum to ZScript

Moderator: Developers

Export MapData.GetChecksum to ZScript

Postby phantombeta » Sun Oct 29, 2017 7:00 am

This feature would be useful for detecting specific maps and such without resorting to hacks such as checking every single actor's position in the map.

Examples of uses for this feature:
Spoiler:
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland (BRASIL CARAI)
Discord: phantombeta#2461

Re: Export MapData.GetChecksum to ZScript

Postby Graf Zahl » Sun Oct 29, 2017 7:12 am

No. For one very simple reason: This can very, very easily result in mods that don't work. A map checksum will change if you change as much as a single coordinate on a single vertex or remove some redundant hidden upper texture. So any even minimally modified version of a map will fail your check and render the feature inoperative.

This is perfectly acceptable for a compatibility lump but once mods start (ab)using this, all bets will be off.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Export MapData.GetChecksum to ZScript

Postby phantombeta » Sun Oct 29, 2017 7:30 am

So you prefer people using hacks to detect maps, then? Yeah, sure, a bad mod might break, but whatever. I'd say the way we currently check for specific maps is much more likely to break than this.
The main use for this would be for IWAD maps and older mapsets, which are very unlikely to be modified.
And if someone somehow made a mod that only works with a very specific version of a map, it's their own fault. The solution is simple: don't play it, and make it clear to other people that the mod is broken. Just like one should do with any broken mod.

And that's also not counting the fact that one could possibly make a hacky version of it using this feature that just got added, so now you can't really prevent people from making mods that break if you're not using a specific version of a map or mod, anyway.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland (BRASIL CARAI)
Discord: phantombeta#2461

Re: Export MapData.GetChecksum to ZScript

Postby _mental_ » Sun Oct 29, 2017 7:54 am

I agree that broken mods can be created with or without ability to verify map's checksum.
For me it's rather an opportunity than a hack: someone can create a mod that improves or fixes vanilla/old maps.
License for bunch of dated mapsets prohibits distribution of modified versions. The proposed feature can solve this problem.

Graf, I don't know why you are so strictly against this.
There are lots of features that could help to create a "mod" that is nothing more than a piece of crap.
And then use hype to bring attention to that crap. But yes, it's a totally different story.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Export MapData.GetChecksum to ZScript

Postby JPL » Wed Nov 01, 2017 1:10 am

There is a use for this that has nothing to do with trying to detect specific maps, and it's using a map's checksum as a unique random seed. I wanted to do this for Keymaster and ended up using a sum of all the verts, sectors, and things in the map.
User avatar
JPL
 
 
 
Joined: 09 Apr 2012

Re: Export MapData.GetChecksum to ZScript

Postby Kinsie » Wed Nov 01, 2017 5:11 am

Can't really say I get the logic here. It'd just remove the need for some of the excruciatingly gross hacks that mods are already using to acquire this sort of information (abusing A_RadiusGive to identify actors at specific X/Y variables in Brutal Doom, JPL's sum-as-a-seed trick, whatever fresh hell Doom Delta is using for a certain feature...)
User avatar
Kinsie
A Concept Utterly Obsolete
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: Export MapData.GetChecksum to ZScript

Postby Rachael » Wed Nov 01, 2017 5:46 am

I'm going to have to say I agree with _mental_ and Kinsie here. Not that my opinion counts for anything. It doesn't seem like blocking the function off is actually doing anything useful.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: Export MapData.GetChecksum to ZScript

Postby _mental_ » Wed Nov 01, 2017 6:36 am

Exactly. The idea is to expose level.md5 byte array and (maybe) to add a function that return a checksum as readable string like those we have in compatibility.txt file.

Sure this can be used by mods to stop functioning right on a particular map.
But this can be achieved via existing functionality even without reading lumps.
If somebody will create a mod that will explicitly refuse to work properly with some map(s) then player must blame such mod maker.

I agree that hash check is fragile. Although checking many properties of a map can break any moment too for the same reason.
At least this helps to stop the invention of more and more comprehensive hacks to detect an exact map.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: Export MapData.GetChecksum to ZScript

Postby Major Cooke » Sun Nov 12, 2017 10:56 am

Already people are inventing ways of doing it too.

From DrByspy on Discord:
Code: Select allExpand view
Class PyCodeGen
{
    play string levelCode()
    {
        //G_PickPlayerStart(int pnum, int flags = 0);
        string checkcode;
        int playerposes[4];
        for(int i = 0;i<4;i++)
        {
           
            vector3 getvec = G_PickPlayerStart(i);
            playerposes[i] = getvec.x+getvec.y+getvec.z;
        }
        checkcode = level.MapName..checkcode..playerposes[0]..playerposes[1]..playerposes[2]..playerposes[3]..level.Sides[0].GetTexture(1);
        checkcode.ToUpper();
        Console.Printf("PyCode: "..checkcode);
        return checkcode;
    }
}
User avatar
Major Cooke
Slaughterer of Sewers
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Re: Export MapData.GetChecksum to ZScript

Postby phantombeta » Sun Nov 12, 2017 1:30 pm

I'm pretty sure people were doing hacks to check maps before ZScript was even a thing.
And Brutal Doom (as bad as it is) somehow checks maps, and that can't use ZScript, so that shows it's certainly possible to hackily check maps with DECORATE + ACS.
User avatar
phantombeta
In the meadow of sinful thoughts, every flower's a perfect one
 
Joined: 02 May 2013
Location: The United Soviet Socialist Dictatorship of Hueland (BRASIL CARAI)
Discord: phantombeta#2461

Re: Export MapData.GetChecksum to ZScript

Postby Graf Zahl » Sun Nov 12, 2017 1:33 pm

Wait until I slightly randomize the spawn positions of monsters and players... :twisted: :mrgreen: :laff: :flamethrower:
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Export MapData.GetChecksum to ZScript

Postby Rachael » Sun Nov 12, 2017 3:06 pm

Graf Zahl wrote:Wait until I slightly randomize the spawn positions of monsters and players... :twisted: :mrgreen: :laff: :flamethrower:

I think the important question is, what exactly are you trying to prevent by blocking this feature?

It's literally 7 lines of code that are copy-pasted and modified from another 7 lines (so about 2 min worth of work max), so there's something wrong with this that you think will actually happen if it's exposed.
User avatar
Rachael
QZDoom + Webmaster
 
Joined: 13 Jan 2004

Re: Export MapData.GetChecksum to ZScript

Postby Kinsie » Sun Nov 12, 2017 6:28 pm

Rachael wrote:I think the important question is, what exactly are you trying to prevent by blocking this feature?

It's literally 7 lines of code that are copy-pasted and modified from another 7 lines (so about 2 min worth of work max), so there's something wrong with this that you think will actually happen if it's exposed.
Someone might make a mod that spawns an actor at the start of E1M1 that's just a big billboarded sprite of the text "XASER IS A BUTT AND ENJOYS LOOKING AT AND THINKING ABOUT BUTTS". Which is both libel and slander, for Xaser is a saint and incapable of impure thoughts and/or actions.
User avatar
Kinsie
A Concept Utterly Obsolete
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: Export MapData.GetChecksum to ZScript

Postby Xaser » Sun Nov 12, 2017 11:44 pm

Let's be real though: who doesn't enjoy looking at butts? 8-)
User avatar
Xaser
anarchivist
 
 
 
Joined: 20 Jul 2003

Re: Export MapData.GetChecksum to ZScript

Postby Marisa Kirisame » Mon Nov 13, 2017 2:14 am

Honestly I'd rather have this than the dozens of gross hacks that exist because this doesn't.

(Please, I even attempted to torture myself by implementing MD5 in ZScript itself)
User avatar
Marisa Kirisame
heh
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa Kirisame#4689
Twitch ID: magusmarisa

Next

Return to Closed Feature Suggestions

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest