It is currently Sat Aug 19, 2017 8:29 pm


Forum rules


Please only use this forum for problems of a technical nature. If you're stuck somewhere in the game, post in the TNM Spoiler Zone forum. If the game crashes, you can't load a savegame, or something just plain isn't working, this is the place to post.



Post new topic Reply to topic  [ 9 posts ] 
TNM says I have no space to save a game...but I have loads?! 
Author Message
Thug

Joined: Wed Jun 02, 2010 12:32 am
Posts: 23
Post TNM says I have no space to save a game...but I have loads?!
8/2

I have just downlaoded,installed,fired up to play TNM on my new computer, having not played in years.
..but I can't save any game (except a single quick-save spot)
When I do it says TNM needs 100 mg of free space, windows needs to free-it-up, and then lists me asd having (-) 1.2 terabytes of free space
...thats right...'negative' free space (for the record i DO have 2.7 terabytes of free space)

If this helps to resolve the issue,here is my setup:-

1. Windows 10 Professional
2. steam Deus Ex GOTY installed
3. TNM 1.04 + (yup, the 'plus' fan patch)
4. New_Vision_v1-5 (installed first...)
5. HDTP-Release3 (installed 2nd)
6. steam (& thus Deus Ex GOTY & TNM) are installed on my secondary hard drive (internal)...my 'F' drive

...and I THINK thats all the relevant issue

So, anyone know:

1. whats going wrong?
2. ...and how can I get TNM to realize I have loads of free space??

just to say, Deus EX GOTY works fine...no 'saving/free' space issues
...and TNM otherwise LOOKS great...but I obviously can't play it without the ability to save

thank you anyone,in advance, for trouble-shooting
I REALLY REALLY wish to replay this :-(

ericjmz


Wed Aug 02, 2017 11:53 am
Profile
Off Topic Productions
Off Topic Productions
User avatar

Joined: Sat Apr 24, 2004 9:21 pm
Posts: 14183
Location: Hafnia
Post Re: TNM says I have no space to save a game...but I have loa
Well jeez, uhm... it's been about 8 years so I don't know how much help I can be any more. My only idea is to see if it helps to launch the game in administrator mode?

Maybe someone else who's still an active modder has a better idea.

_________________
Jonas Wæver
Chief Poking Manager of TNM

You can buy my games on Steam if you like 'em.
Expeditions: Viking
Expeditions: Conquistador
Clandestine


Wed Aug 02, 2017 12:06 pm
Profile WWW
Thug

Joined: Wed Jun 02, 2010 12:32 am
Posts: 23
Post Re: TNM says I have no space to save a game...but I have loa
nope...administrator mode does nothing

but I am assuming this is still an active forum,so maybe someone has an idea? :-)

ericjmz


Wed Aug 02, 2017 12:21 pm
Profile
MJ12

Joined: Thu Apr 02, 2009 7:55 pm
Posts: 446
Post Re: TNM says I have no space to save a game...but I have loa
You have too much space, so the integer overflows into the negative side. It happens at 2TB. Use Kentie's Launcher and launch it with the -localdata command, which will force it to use the F drive instead of the C drive, or without it if it's the other way around (I forgot which vanilla Deus Ex uses).


Wed Aug 02, 2017 3:46 pm
Profile
Thug

Joined: Wed Jun 02, 2010 12:32 am
Posts: 23
Post Re: TNM says I have no space to save a game...but I have loa
A GENIUS you are!
Yehaaah ! :-))

I thank you sir

ericjmz


Wed Aug 02, 2017 6:13 pm
Profile
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 387
Post Re: TNM says I have no space to save a game...but I have loa
One can actually go to 4 TB with an uc only fix btw, though afterwards it wraps unless backed by clamping native code.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Thu Aug 03, 2017 8:31 pm
Profile
MJ12

Joined: Thu Apr 02, 2009 7:55 pm
Posts: 446
Post Re: TNM says I have no space to save a game...but I have loa
Making the signed unsigned is easy - making the int long is hard.

Solution: remove the check (feed it max signed int at all times) altogether because it's an edge case that won't be realized by most players nowadays. There are games with bigger saves nowadays that don't check for that, while storage is getting bigger every year (we've reached 12TB now for consumers).


Thu Aug 03, 2017 8:37 pm
Profile
Off Topic Productions
Off Topic Productions
User avatar

Joined: Sat Apr 24, 2004 9:21 pm
Posts: 14183
Location: Hafnia
Post Re: TNM says I have no space to save a game...but I have loa
Those are quite a few terabytes.

_________________
Jonas Wæver
Chief Poking Manager of TNM

You can buy my games on Steam if you like 'em.
Expeditions: Viking
Expeditions: Conquistador
Clandestine


Thu Aug 03, 2017 9:38 pm
Profile WWW
MJ12

Joined: Sun Oct 04, 2009 6:54 pm
Posts: 387
Post Re: TNM says I have no space to save a game...but I have loa
For Rev I went the way to replace the GetSaveFreeSpace() native and make it clamp the maximum value to (unsigned int) 0xFFFFFFFF and use this as sort of a magic value in UC code to make it green and add a +.

Code:
// ----------------------------------------------------------------------
// UpdateFreeDiskSpace()
// ----------------------------------------------------------------------

function UpdateFreeDiskSpace()
{
   local GameDirectory saveDir;
   local int freeDiskSpaceMegaByte;

   saveDir = player.CreateGameDirectoryObject();
   freeDiskSpace = saveDir.GetSaveFreeSpace();
   //freeDiskSpace = -1545314777; // Testing.

   // Special value indicating 4GB+
   if ( freeDiskSpace==0xFFFFFFFF )
   {
      winFreeSpace.SetText(Sprintf(FreeSpaceLabel,"4194304")$"+");
      winFreeSpace.SetTextColorRGB(0,255,0);
   }
   else
   {
      // Emulate a logic shift.
      if ( freeDiskSpace>=0 ) // Checks sign bit.
         freeDiskSpaceMegaByte = freeDiskSpace>>10;
      else
         freeDiskSpaceMegaByte = ((freeDiskSpace&0x7FFFFFFF)>>10)+0x200000;

      //winFreeSpace.SetText(Sprintf(FreeSpaceLabel,freeDiskSpace>>10));
      winFreeSpace.SetText(Sprintf(FreeSpaceLabel,freeDiskSpaceMegaByte));

      // If free space is below the minimum, show in RED
      //else if ( (freeDiskSpace>>10)<minFreeDiskSpace )
      if ( freeDiskSpaceMegaByte<minFreeDiskSpace )
         winFreeSpace.SetTextColorRGB(255,0,0);
      else
         winFreeSpace.StyleChanged();
   }

   CriticalDelete(savedir);
}


Code:

#define GetDiskFreeSpaceX(a,b,c,d,e)   TCHAR_CALL_OS(GetDiskFreeSpaceW(a,b,c,d,e),GetDiskFreeSpaceA(TCHAR_TO_ANSI(a),b,c,d,e))

class XRevisionGameDirectoryNatives : public XGameDirectory
{
   DECLARE_CLASS(XRevisionGameDirectoryNatives,XGameDirectory,0)
   
   /*-------------------------------------------------------------------------
      Synopsis:
      Reported free space wraps at 4 TB. So clamp it to magic value 0xFFFFFFFF
   -------------------------------------------------------------------------*/

   INT GetSaveFreeSpace()
   {
      guard(XRevisionGameDirectoryNatives::GetSaveFreeSpace);
      ANSICHAR  RootPathNameA[4] = "C:\\";
      TCHAR     RootPathNameW[4] = TEXT("C:\\");

      RootPathNameA[0] = **GFileManager->GetDefaultDirectory();
      RootPathNameW[0] = **GFileManager->GetDefaultDirectory();

      HMODULE hKernel32 = GetModuleHandleA("KERNEL32");
      typedef BOOL (WINAPI *GetDiskFreeSpaceExAFunc)( ANSICHAR*, QWORD*, QWORD*, QWORD* );
      GetDiskFreeSpaceExAFunc pGetDiskFreeSpaceExA = (GetDiskFreeSpaceExAFunc)GetProcAddress( hKernel32, "GetDiskFreeSpaceExA" );
      if ( pGetDiskFreeSpaceExA )
      {
         QWORD FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes;
         if ( !pGetDiskFreeSpaceExA(RootPathNameA,&FreeBytesAvailable,&TotalNumberOfBytes,&TotalNumberOfFreeBytes) )
            return 0;

         QWORD FreeMegsAvailable = Min( FreeBytesAvailable/((QWORD)1024), (QWORD)0xFFFFFFFFu );
         return FreeMegsAvailable;
      }
      else
      {
         DWORD SectorsPerCluster     = 0;
         DWORD BytesPerSector        = 0;
         DWORD NumberOfFreeClusters  = 0;
         DWORD TotalNumberOfClusters = 0;

         if ( !GetDiskFreeSpaceX(RootPathNameW,&SectorsPerCluster,&BytesPerSector,&NumberOfFreeClusters,&TotalNumberOfClusters) )
            return 0;

         QWORD FreeMegsAvailable = Min( ((QWORD)SectorsPerCluster)*((QWORD)BytesPerSector)*((QWORD)NumberOfFreeClusters)/((QWORD)1024), (QWORD)0xFFFFFFFFu );
         return FreeMegsAvailable;
      }
      unguard;
   }

   void execGetSaveFreeSpace( FFrame& Stack, RESULT_DECL )
   {
      guard(XRevisionGameDirectoryNatives::execGetSaveFreeSpace);
      P_FINISH;
      *(INT*)Result = GetSaveFreeSpace();
      unguardexec;
   }
};
IMPLEMENT_CLASS(XRevisionGameDirectoryNatives);

In case anyone might have some use for it.

Afterwards we couldn't find anyone with 4TB+ free space to actually test it, but we never had any bug reports regarding this since. Probably a better approach is to just return the values as megabyte anyway, and well, probably one should probably also format to GB and TB instead for enough space.

_________________
I demand my DXE User ID back. Launcher for DeusEx, Rune, Nerf, Unreal & Botpack. HX on Mod DB. Revision on Steam.


Fri Aug 04, 2017 4:05 pm
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forum/DivisionCore.