Devilutionx: Ability to play single player on Nightmare and Hell difficulty

Created on 27 Mar 2019  路  9Comments  路  Source: diasurgical/devilutionX

Hi!

As an enhancement it would be nice if you could implement in the future the possibility to play single player on other difficulties than normal, ie nightmare and hell.
There was som weird ways to force the original into nightmare and hell difficulty so this should be possible.
This was how it was done:
https://www.youtube.com/watch?v=0fwXdDBviBQ

enhancement good first issue

Most helpful comment

Looking at the save game there are 4 types of regions available in the save game data that could be used with varying degrees of backward compatibility BC.

  1. Alignment bytes. These are areas of a struct that exists simply to align data types in a CPU frindly way, they should always be 0 in a valinal savegame. There are 33 bytes in the singlplayer player data, 12 bytes pr monster, 3 bytes per missile, 6 bytes per object, 11 bytes per item and 3 bytes per quest. Adding data her should be safe as vanila Diablo will just leave it untouched.

  2. Values that never use all bytes of there type. The best example here is BOOL which is a 32bit value where only 1 bit is ever used. The downside of using the 31 remaining bits is that it can cause vanilla to incorrectly see the value as being TRUE/FALSE.

  3. Append to the end of the save game, this should also be fine as vanilla should stop reading once it hits the expected length. But it will overwrite our data if a save game is transferred back.

  4. Add a new file to the save game archive. The savegame is actually an MPQ-file containing several files. Again vanilla will probably discard any such data if a save game is transferred back to it.

I favor a mix of using 1 for basic/critical data that gets added to the related structs (like hellfire properties) and 4 for extending the game in any big way. Adding good support for 4 would also help any mod that needs to extend the save data.

Game difficulty would fall under 1 as it is present in Hellfire, but also because it's small and is preferable not to lose.

All 9 comments

Yes this is something I plan to look into, the main issue is how to handle it in terms of save game, the method you refere to requires that you trigger the same glitch when loading a game. If we can fin an unused part of the save file to store this (for BC) then that would be ideal.

Checkout loadsave.cpp. There's a ton of unused space in the save file. Should be something to the effect of:

ISave() = gnDifficulty;
gnDifficulty = ILoad();

This is weird . I originally allowed the selection of difficulties in the menu code.

I was pretty sure that just starting a new game and selecting a new difficulty was all that was needed. Am I wrong?

You would have to select the difficulty each time you load a save game and having the game change difficulty in the middle of the game is not a good experience.

It seems to happen when entering lower levels (likely on dungeon generation), making it hard to notice and change back. Certainly not a good experience.

What hellfire did was add the difficulty to the automap, so you can see for sure what setting you are on.

Looking at the save game there are 4 types of regions available in the save game data that could be used with varying degrees of backward compatibility BC.

  1. Alignment bytes. These are areas of a struct that exists simply to align data types in a CPU frindly way, they should always be 0 in a valinal savegame. There are 33 bytes in the singlplayer player data, 12 bytes pr monster, 3 bytes per missile, 6 bytes per object, 11 bytes per item and 3 bytes per quest. Adding data her should be safe as vanila Diablo will just leave it untouched.

  2. Values that never use all bytes of there type. The best example here is BOOL which is a 32bit value where only 1 bit is ever used. The downside of using the 31 remaining bits is that it can cause vanilla to incorrectly see the value as being TRUE/FALSE.

  3. Append to the end of the save game, this should also be fine as vanilla should stop reading once it hits the expected length. But it will overwrite our data if a save game is transferred back.

  4. Add a new file to the save game archive. The savegame is actually an MPQ-file containing several files. Again vanilla will probably discard any such data if a save game is transferred back to it.

I favor a mix of using 1 for basic/critical data that gets added to the related structs (like hellfire properties) and 4 for extending the game in any big way. Adding good support for 4 would also help any mod that needs to extend the save data.

Game difficulty would fall under 1 as it is present in Hellfire, but also because it's small and is preferable not to lose.

interesting!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

baszczewski picture baszczewski  路  15Comments

pbekesky picture pbekesky  路  27Comments

Chance4us picture Chance4us  路  27Comments

mgpat-gm picture mgpat-gm  路  21Comments

predator8bit picture predator8bit  路  22Comments