Change difficulty cheat pls?

Talk about anything related to Legend of Grimrock 2 here.
Mwah
Posts: 8
Joined: Wed Oct 22, 2014 9:57 am

Change difficulty cheat pls?

Post by Mwah »

Hi!

I restarted with easy difficulty because on normal, fights were rather hard in first area (needed all healing potions plus the secret energy potion and barely managed to survive the first boss). I thought mobs would get even harder later, but now I'm 10 hours into the game and fights are boring. Haven't rested or used healing potions for the last 5 hours of gameplay and for most enemies I don't even need to "dance" or use my mage - just stand there, hit the attack buttons -.-"

Long story short: Is there a way to raise difficulty? Edit the savegame, use debug mode, anything?
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Change difficulty cheat pls?

Post by Dr.Disaster »

Nope. The difficulty is set on game start and can't be changed after that.
Mwah
Posts: 8
Joined: Wed Oct 22, 2014 9:57 am

Re: Change difficulty cheat pls?

Post by Mwah »

Why / how did you find that out?

Shouldn't changing the difficulty in the savegame affect the attributes of creatures that weren't spawned yet at least? Or does the game somehow generate a table with creature stats at game start and write those into the saves?

Or has simply noone been able to find it in the save (yet)?
Vardis
Posts: 97
Joined: Sat Oct 18, 2014 11:19 pm

Re: Change difficulty cheat pls?

Post by Vardis »

Obviously it's stored in the save game file somewhere, but no one has made something to let you change it yet. Maybe the developers will take pity on you and let you change it within the game, but just make doing so invalidate the hard achievement or something.
Mwah
Posts: 8
Joined: Wed Oct 22, 2014 9:57 am

Re: Change difficulty cheat pls?

Post by Mwah »

So I guess the problem is mostly that noone tried yet? Or did anyone fail already?

I suck at that sort of stuff, so if anyone more skilled already failed - please speak up before I break my brain :D

Also:
Are those saves cpp parameter structures compressed with zlib or something after I ditch the uncompressed header? Piping it trough openssl renders some stuff readable, but I have no clue how all that cpp memory dump stuff is supposed to looks (got not clue when it comes to programming).
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Change difficulty cheat pls?

Post by minmay »

After the 8 byte header is a zlib stream containing chunks. Each chunk starts with a 4-byte type like "STAB" (string table) or "DESC" or "LEVEL", followed by 4 bytes giving the size of the chunk. Chunks can contain other chunks. That's about all I've figured out so far. With some trial and error I managed to change some game statistics, which are in "STAT" chunks; the one I happened to land on corresponded to tiles_dived, and contained a 16-bit string handle I don't know how to dereference followed by the actual tiles_dived value, both preceded by a single-byte type. I only learned it corresponded to tiles_dived by loading the game after changing it and checking the statistics screen...

I've been working on this because I want to enable the PlayingAsToorum party flag, but it's a bit over my head as you can see.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Mwah
Posts: 8
Joined: Wed Oct 22, 2014 9:57 am

Re: Change difficulty cheat pls?

Post by Mwah »

Ouch, thanks!

That does NOT sound like something that I can easily parse any further with my crude bash one-liners :mrgreen:

And it explains why my experiments with cmp & diff lead nowhere - even freshly started vanilla savegames are too different in their structure to recognize the difficulty settings (without more pre-processing beyond the deflation). From the sound of it, someone who's used to working with yml shouldn't have too much trouble to write a simple de/reencoder as a first step... mmmh... at least if it was one consistent format... and I'm not entirely sure it is... there are big chunks that look very different from each others (like the small String on the top... then the bigger part with the chunks of "FF xx xx xx"... then something that looks rather arbitrary...) and I can't find a delimiter or anything for those that would suggest that they are part of a overlying order instead of just mashed together one... Argh. Could just be a memory-dump-like stream after all for all I know T_T

On top of that, the game seems to be very rather wasteful though when it comes to writing stuff into the saves - there seems to be a lots of creature / map / script data in there (that I would have expected to be loaded from the game data files, not from the game saves). Maybe that's supposed to ensure that savegames still work after updates... it explains the need to start a new game to get the fixed stats for items after the patch. Also that makes it entirely possible that changing the difficulty mid game won't be a viable option (have not managed to isolate difficulty related creature stats yet, but the presence of those alone means that the difficulty setting could already be in there instead of just in one valua :/ ).

Guess I'll try to find the creature speed somehow (my main problem with the easy difficulty is that mobs just stand around looking stupid for so long), maybe I can change that with brute force... and a lot of luck... somehow...

edit: Oh, now I see those big nested chunks (STATS etc). So, It's not as much of a mess as I intitially thought after all... but still waaaaay over my head.
edit: yay, at least I've been able to change the name/portrait of the one guy that I forgot on creation. That's been bothering me too although not as much as the difficulty :3
User avatar
Dr.Disaster
Posts: 2876
Joined: Wed Aug 15, 2012 11:48 am

Re: Change difficulty cheat pls?

Post by Dr.Disaster »

Mwah wrote:edit: yay, at least I've been able to change the name/portrait of the one guy that I forgot on creation.
Now that could have been done with simple console commands ;)
User avatar
PSY
Posts: 395
Joined: Sun Apr 08, 2012 10:10 pm
Contact:

Re: Change difficulty cheat pls?

Post by PSY »

I reckon there's a lot of data concerning monster stats that is saved in the savegame files, so the difficulty level is not just a byte or two you can switch.

Meaning the engine probably works like this:

Code: Select all

* Savegame with all monster stats is loaded (READ SKELETONDAMAGE)
* Skeleton encounter coming up:
Function DealDamgeToParty(Skeleton)
  HitParty(SKELETONDAMAGE)
End Function
..rather than this:

Code: Select all

* Savegame is loaded
* Skeleton encounter coming up:
Function DealDamgeToParty(Skeleton)
   If difficulty_level = 1 then SKELETONDAMAGE = 50
   If difficulty_level = 2 then SKELETONDAMAGE = 100
   If difficulty_level = 3 then SKELETONDAMAGE = 150
   HitParty(SKELETONDAMAGE)
End Function

Dunno, just my 2ct. Would make sense to me, though.

Cheers,
PSY
https://psy-labs.com
Coders don't die, they just gosub without return
minmay
Posts: 2780
Joined: Mon Sep 23, 2013 2:24 am

Re: Change difficulty cheat pls?

Post by minmay »

Hey Mwah, I think I'm making some progress.
Image
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Post Reply