Failed assertion tried to open directory as plain text

Issue: crashed when trying to save game
Crash (y/n): y
Platform (Windows/Mac/Linux): windows
Description:

I think this was caused because I saved the game initially with the default save name [FileName]
Then when I have tried to manualy save it again the game didnt like the name and couldnt offer me the option to overwrite it.

hence the error

MMORPG Tycoon 2
win64
0.12.34-g9aa189b
Checking supported resolutions…
Available Modes
0: 1600 x 900
1: 1440 x 900
2: 1366 x 768
3: 1360 x 768
4: 1280 x 800
5: 1280 x 768
6: 1280 x 720
7: 1280 x 600
8: 1152 x 864
9: 1024 x 768
10: 800 x 600
11: 640 x 480
12: 640 x 400
13: 512 x 384
14: 400 x 300
15: 320 x 240
16: 320 x 200
Initialising [1280x800] resolution…
Found 1 displays:
Display #0 Generic PnP Monitor (1600x900)

OpenGL Context:
Vendor: NVIDIA Corporation
Renderer: GeForce GT 540M/PCIe/SSE2
Version: 3.3.0 NVIDIA 372.70
Shading Language Version: 3.30 NVIDIA via Cg compiler
== Begin OpenGL limits ==
Max 3D texture size: 2048
Max array texture layers: 2048
Max clip distances: 8
Max samples in a color multisample texture: 32
Maximum atomic counters: 98304
Maximum fragment shader uniform components: 233472
Maximum geometry shader uniform components: 231424
Maximum combined texture image units: 192
Maximum combined uniform blocks: 84
Maximum cube map dimensions: 16384
Maximum samples in a multisample depth or depth-stencil texture: 32
Maximum simultaneous draw buffers: 8
Maximum simultaneous draw buffers with dual-source blending: 1
Recommended maximum number of vertex array indices: 1048576
Recommended maximum number of vertex array vertices: 1048576
Max fragment shader input components: 128
Max fragment shader uniform components: 4096
Maximum texels in the texel array of a texture buffer: 134217728
Maximum supported texture image units in a fragment shader: 32
Maximum texture size (rough estimate): 16384
Maximum uniform buffer binding points: 84
Maximum uniform block size: 65536
Maximum uniform locations: 65536
Maximum varying components: 124
Maximum floating point varying components: 124
Maximum atomic counters in vertex shaders: 16384
Maximum vertex attributes in vertex shader: 16
Maximum active shader storage blocks in a vertex shader: 16
Maximum texture image units in vertex shader: 32
Maximum uniform components in vertex shader: 4096
Maximum output components in vertex shader: 128
Maximum uniform blocks per vertex shader: 14
Maximum simultaneous viewports: 16
Maximum MSAA samples: 32
NVidia-only: Currently available video memory: 2037768
ATI-only: Currently available video memory: 2037768
== End OpenGL limits ==
VSync: ENABLED
TextureUnits: 32 from vertex shader, 192 total
Screen Ratio: 1.600000
– Initialising game “MMORPG”
TextInput was enabled by default; turning it off until we need it!
No joystick found. Using keyboard input.
Shown
Exposed
Event 0: Path event:/UI/window close end: min range 0.000000: max range 0.000000
Event 1: Path event:/UI/button slot deselect: min range 0.000000: max range 0.000000
Event 2: Path event:/UI/button slot desocket: min range 0.000000: max range 0.000000
Event 3: Path event:/old/general click: min range 0.000000: max range 0.000000
Event 4: Path event:/UI/general cancel: min range 0.000000: max range 0.000000
Event 5: Path event:/Title screens/loading screen world appear: min range 0.000000: max range 0.000000
Event 6: Path event:/UI/window open start: min range 0.000000: max range 0.000000
Event 7: Path event:/UI/button slot socket: min range 0.000000: max range 0.000000
Event 8: Path event:/Title screens/loading screen whoosh 01: min range 20.000000: max range 300.000000
Event 9: Path event:/Title screens/loading screen whoosh 02: min range 16.000000: max range 65.000000
Event 10: Path event:/Title screens/loading screen launch: min range 0.000000: max range 0.000000
Event 11: Path event:/UI/general notification: min range 0.000000: max range 0.000000
Event 12: Path event:/Title screens/loading screen white flash: min range 0.000000: max range 0.000000
Event 13: Path event:/UI/button click: min range 0.000000: max range 0.000000
Event 14: Path event:/UI/window close start: min range 0.000000: max range 0.000000
Event 15: Path event:/old/button release toggle on: min range 0.000000: max range 0.000000
Event 16: Path event:/UI/window open end: min range 0.000000: max range 0.000000
Event 17: Path event:/UI/window looping: min range 0.000000: max range 0.000000
Event 18: Path event:/Title screens/loading screen loop: min range 0.000000: max range 0.000000
Event 19: Path event:/UI/button click up new field: min range 0.000000: max range 0.000000
Bus 0: Path ‘bus:/UI/UI_UnD’: Volume: 1.000000
Bus 1: Path ‘bus:/UI’: Volume: 1.000000
Bus 2: Path ‘bus:/UI/UI_d1’: Volume: 1.000000
Bus 3: Path ‘bus:/UI/UI_d2’: Volume: 1.000000
Bus 4: Path ‘bus:/Reverb’: Volume: 1.000000
Bus 5: Path ‘bus:/’: Volume: 1.000000
Param 0: dramaticMIX [0.00-1.00] (default 0.00)
Rebuild front plate mesh
Rebuild front plate mesh
Found crash report; archiving it.
Sending crash report.
Platform: win64
Version: 0.12.34-g9aa189b
Rpt: -------------------

Error occurred on Sunday, September 25, 2016 at 13:45:21.

MT2.exe caused an Access Violation at location 0000000000700EE4 in module MT2.exe Writing to location 0000000000000000.

AddrPC Params
0000000000700EE4 0000000000000000 00000000427876D0 000000003C656FA0 MT2.exe!vsFailedAssert [/tmp/build/9ecbd07c/code/vectorstorm/VS/Utils/VS_Debug.cpp @ 81]
000000000055B72C BF7A67DDBE041122 000000003E26BB4C 433F73FF46181089 MT2.exe!mmoPath::GetClosestPointOnSegmentTo
000000000055BEC5 000000003D088889 0000000000000000 0000000000000000 MT2.exe!mmoPath::SqDistanceFromPoint
00000000004C7445 00000000014FF83F 0000000000410811 0000000000000000 MT2.exe!mmoPathManager::FindTraversableRoadNear
00000000005381A2 0000000000000001 00000000000001B8 00000000014FFA00 MT2.exe!mmoMonster::ConsiderRequestJob
0000000000539088 000000003D088889 0000000000000000 0000000040555556 MT2.exe!mmoMonster::Tick
0000000000530C0C 0000000000A2A610 00000000004A7AEE 000000000099B331 MT2.exe!mmoMapEntity::EntityUpdate
0000000000534765 000000002B8A4778 00000000004C7D8E 00000000014FFB40 MT2.exe!mmoMonster::EntityUpdate
00000000004BF8F6 000000003D088889 00000000244CFFC0 0000000000000000 MT2.exe!mmoMonsterManager::Update
0000000000505C2D 000000005C25F9C8 0000000000007CCB 0000000000000000 MT2.exe!mmoRegion::Update
00000000004EFF79 0000000000000000 00000000004D9519 000000003CC3EB60 MT2.exe!mmoMap::Update
00000000006AA9AE 000000003CC3EB60 0000000000000018 00000000014FFD70 MT2.exe! ?? [/tmp/build/9ecbd07c/code/vectorstorm/VS/Graphics/VS_Entity.cpp @ 150]
00000000006DA580 0000000000000000 0000000000000000 00000000034E14E0 MT2.exe!Update [/tmp/build/9ecbd07c/code/vectorstorm/VS/Graphics/VS_Scene.cpp @ 170]
00000000006DB967 00000000014FFD80 00000000034BF0F0 00000000014FFE20 MT2.exe!Update [/tmp/build/9ecbd07c/code/vectorstorm/VS/Graphics/VS_Screen.cpp @ 183]
00000000006955E5 00000000034BCF78 00000000034ACD10 00000000014FFE20 MT2.exe!Go [/tmp/build/9ecbd07c/code/vectorstorm/VS/Core/CORE_Game.cpp @ 201]
0000000000694DAB 0000000000000000 000000000098A064 00000000001B0FC0 MT2.exe!Go [/tmp/build/9ecbd07c/code/vectorstorm/VS/Core/Core.cpp @ 129]
00000000004016DC 0000000000000000 0000000000000046 0000000000B06E88 MT2.exe!SDL_main
00000000004013E8 0000000000000000 0000000000000000 00000000012D3370 MT2.exe!__tmainCRTStartup [/build/buildd/mingw-w64-4.0.2/build/x86_64-w64-mingw32-x86_64-w64-mingw32-crt/…/…/mingw-w64-crt/crt/crtexe.c @ 332]
00000000004014EB 0000000000000000 0000000000000000 0000000000000000 MT2.exe!WinMainCRTStartup [/build/buildd/mingw-w64-4.0.2/build/x86_64-w64-mingw32-x86_64-w64-mingw32-crt/…/…/mingw-w64-crt/crt/crtexe.c @ 184]
00007FFE7F898414 0000000000000000 0000000000000000 0000000000000000 KERNEL32.DLL!BaseThreadInitThunk
00007FFE7FF74EE1 0000000000000000 0000000000000000 0000000000000000 ntdll.dll!RtlUserThreadStart

MT2.exe
ntdll.dll 6.2.14931.1000
KERNEL32.DLL 6.2.14931.1000
KERNELBASE.dll 6.2.14931.1000
msvcrt.dll 7.0.14931.1000
SHELL32.dll 6.2.14931.1000
cfgmgr32.dll 6.2.14931.1000
windows.storage.dll 6.2.14931.1000
combase.dll 6.2.14931.1000
ucrtbase.dll 6.2.14931.1000
RPCRT4.dll 6.2.14931.1000
OPENGL32.dll 6.2.14931.1000
bcryptPrimitives.dll 6.2.14931.1000
ADVAPI32.dll 6.2.14931.1000
shlwapi.dll 6.2.14931.1000
sechost.dll 6.2.14931.1000
GDI32.dll 6.2.14931.1000
gdi32full.dll 6.2.14931.1000
USER32.dll 6.2.14931.1000
win32u.dll 6.2.14931.1000
kernel.appcore.dll 6.2.14931.1000
shcore.dll 6.2.14931.1000
powrprof.dll 6.2.14931.1000
profapi.dll 6.2.14931.1000
WSOCK32.dll 6.2.14931.1000
GLU32.dll 6.2.14931.1000
WS2_32.dll 6.2.14931.1000
SDL2_image.dll 2.0.0.0
libphysfs.dll
fmodstudio64.dll 0.1.8.4
ole32.dll 6.2.14931.1000
SDL2.dll 2.0.3.0
IMM32.dll 6.2.14931.1000
OLEAUT32.dll 6.2.14931.1000
msvcp_win.dll 6.2.14931.1000
WINMM.dll 6.2.14931.1000
libcurl-4.dll
WLDAP32.dll 6.2.14931.1000
VERSION.dll 6.2.14931.1000
WINMMBASE.dll 6.2.14931.1000
libpng16.dll
exchndl.dll 0.8.1.0
PSAPI.DLL 6.2.14931.1000
mgwhelp.dll 0.8.1.0
dbghelp.dll 6.3.9600.17298
fmod64.dll 0.1.8.4
MSACM32.dll 6.2.14931.1000
steamclient64.dll 3.61.93.65
CRYPT32.dll 6.2.14931.1000
MSASN1.dll 6.2.14931.1000
imagehlp.dll 6.2.14931.1000
IPHLPAPI.DLL 6.2.14931.1000
SETUPAPI.dll 6.2.14931.1000
Secur32.dll 6.2.14931.1000
vstdlib_s64.dll 3.61.93.65
tier0_s64.dll 3.61.93.65
SSPICLI.DLL 6.2.14931.1000
CRYPTBASE.DLL 6.2.14931.1000
gameoverlayrenderer64.dll 3.61.93.65
userenv.dll 6.2.14931.1000
uxtheme.dll 6.2.14931.1000
ltc_help64-115528.dll 1.0.0.1
WINTRUST.dll 6.2.14931.1000
dwmapi.dll 6.2.14931.1000
clbcatq.dll 2001.12.10941.16384
dinput8.dll 6.2.14931.1000
HID.DLL 6.2.14931.1000
DEVOBJ.dll 6.2.14931.1000
XInput1_4.dll 6.2.14931.1000
MSCTF.dll 6.2.14931.1000
nvoglshim64.dll 21.21.13.7270
nvoglv64.DLL 21.21.13.7270
WTSAPI32.dll 6.2.14931.1000
ntmarta.dll 6.2.14931.1000
WINSTA.dll 6.2.14931.1000
MMDevApi.dll 6.2.14931.1000
PROPSYS.dll 7.0.14931.1000
wdmaud.drv 6.2.14931.1000
ksuser.dll 6.2.14931.1000
AVRT.dll 6.2.14931.1000
AUDIOSES.DLL 6.2.14931.1000
wintypes.dll 6.2.14931.1000
msacm32.drv 6.2.14931.1000
midimap.dll 6.2.14931.1000
dxgi.dll 6.2.14931.1000
d3d11.dll 6.2.14931.1000
nvumdshimx.dll 21.21.13.7270
nvinitx.dll 21.21.13.7270
detoured.dll 2.1.0.207
nvd3d9wrapx.dll 21.21.13.7270
nvdxgiwrapx.dll 21.21.13.7270
nvwgf2umx.dll 21.21.13.7270
bcrypt.dll 6.2.14931.1000
nvspcap64.dll 2.11.4.0
WINHTTP.dll 6.2.14931.1000
nvapi64.dll 21.21.13.7270
CRYPTSP.dll 6.2.14931.1000
rsaenh.dll 6.2.14931.1000
gpapi.dll 6.2.14931.1000
cryptnet.dll 6.2.14931.1000
WINNSI.DLL 6.2.14931.1000
NSI.dll 6.2.14931.1000
ltc_game64-115528.dll 1.0.0.1
WININET.dll 11.0.14931.1000
iertutil.dll 11.0.14931.1000
ondemandconnroutehelper.dll 6.2.14931.1000
mswsock.dll 6.2.14931.1000
DNSAPI.dll 6.2.14931.1000
urlmon.dll 11.0.14931.1000
mdnsNSP.dll 3.1.0.1
rasadhlp.dll 6.2.14931.1000
fwpuclnt.dll 6.2.14931.1000

Windows 6.2.9200
DrMingw 0.8.1

Clearing crash data.
About to load save file
Processing save file
Finished processing save file
Unable to find requested power “TerrainEdit”
Unable to find requested power “ShapeEdit”
Unable to find requested power “ColorEdit”
Unable to find requested power “Business”
Unable to find requested power “Build”
Unable to find requested power “Terrain”
Unable to find requested power “EditSelect”
Unable to find requested power “EditSelectMulti”
Unable to find requested power “Buildings”
Unable to find requested power “Roads”
Unable to find requested power “CastleBuild”
Unable to find requested power “NPCs”
Unable to find requested power “Town Edit”
Unable to find requested power “Destroy Town”
Unable to find requested power “Build Capital”
Unable to find requested power “Ability0”
Unable to find requested power “Ability1”
Unable to find requested power “Ability2”
Unable to find requested power “Ability3”
Unable to find requested power “Ability4”
Created quest 0: Thin the Skeletons
Created quest 1: Find my left sock
Created quest 0: Waste the Assassins
Created quest 1: Locate my left sock
MISSING VARIANT INFORMATION
MISSING VARIANT INFORMATION
MISSING VARIANT INFORMATION
MISSING VARIANT INFORMATION
MISSING VARIANT INFORMATION
Failed assertion: Attempted to open directory ‘save/Heart of Swords/’ as a plain file
Failed condition: (!DirectoryExists(filename))
at VS_File.cpp:38

This is probably a more specific version of an earlier (yet unfixed) bug about not sanitising the names of user-specified save files.

A smarter thing to do would probably be for me to save the files using numbers, instead of user-specified names, and just save the user-facing “name” string inside the file. But it’s convenient to be able to see which file is which from inside Explorer. Maybe I just have to write some simple filename sanitisation code.

Bumping this bug for myself – this looks like yxxxx2003 was (accidentally) trying to save a game with an empty name. I don’t think my filename validation code will catch that; it’s only looking for illegal characters and a maximum string length; not a minimum string length! I must check this and fix, if it’s still a problem!

Validated: We now catch invalid save names, but it still fails if you try to give a saved game an empty name.

Needs to be fixed!