FileStream.cpp error when using Atlas2 in dedicated server...
by Jack Stone · in Torque Game Engine Advanced · 08/19/2006 (4:15 pm) · 6 replies
I have recently set up a dedicated server for my game. It works great until it starts to load the atlas terrain, which works fine in single player mode.
I get the following warning in the console:
(FileStream.cpp, line 80)
"FileStream::getStreamSize: the stream isn't open"
This is just a warning, but the function this warning occurs in, FileStream::getStreamSize() calls
File::getSize() in winFileio.cpp, which results in the following assert, line 259:
"File::getSize: invalid file handle"
Commenting out the assert results in another assert in the atlas code.
I have initialised the canvas on the dedicated server, as Ben Garney suggested in this thread:
http://www.garagegames.com/mg/forums/result.thread.php?qt=32015
which did fix my initial crash.
I tried my game with atlas 1 terrain, which resulted in another assert which I didnt look into too much. Running the game with no terrain at all works perfectly.
I am currently calling initCanvas from main.cs in my games directory like this:
if($Server::Dedicated == true)
initCanvas("StrongHold");
Is this correct?
I am relatively sure that it is a problem on my end, but considering the changes in going from Atlas to Atlas2, I wanted to make sure this is a fixable problem before I spend any more time on it.
Thanks for any advice.
JS
I get the following warning in the console:
(FileStream.cpp, line 80)
"FileStream::getStreamSize: the stream isn't open"
This is just a warning, but the function this warning occurs in, FileStream::getStreamSize() calls
File::getSize() in winFileio.cpp, which results in the following assert, line 259:
"File::getSize: invalid file handle"
Commenting out the assert results in another assert in the atlas code.
I have initialised the canvas on the dedicated server, as Ben Garney suggested in this thread:
http://www.garagegames.com/mg/forums/result.thread.php?qt=32015
which did fix my initial crash.
I tried my game with atlas 1 terrain, which resulted in another assert which I didnt look into too much. Running the game with no terrain at all works perfectly.
I am currently calling initCanvas from main.cs in my games directory like this:
if($Server::Dedicated == true)
initCanvas("StrongHold");
Is this correct?
I am relatively sure that it is a problem on my end, but considering the changes in going from Atlas to Atlas2, I wanted to make sure this is a fixable problem before I spend any more time on it.
Thanks for any advice.
JS
#2
08/20/2006 (3:21 pm)
I'll test dedicated before we release the next rev of TSE. Thanks for pointing this out!
#3
08/20/2006 (4:33 pm)
Yep, I tried it as well and it did the same thing, and it seems to be the same situation as what was happening for us in our expandScriptfilename loading code.. where the extension was too long
#4
Executing JackStone/data/missions/StrongHold.mis.
Warning: (c:\tsems3.5\tse\engine\core\resmanager.cpp @ 801) ResourceObject::construct: NULL resource create function.
ResourceObject::construct: NULL resource create function for 'AtlasMission.atl'.
AtlasFile::load - cannot open atlas file 'JackStone/data/terrains/AtlasMission.atl'.
AtlasInstance::onAdd - cannot open atlas file.
JackStone/data/missions/StrongHold.mis (0): Register object failed for object NewTerrain of class AtlasInstance2.
@Ben - no problem, I can wait that long :)
JS
08/20/2006 (5:37 pm)
Jeremiah, thanks, I tried that trick, but It didnt work. The game loaded, but I got no terrain. I got the following in the console:Executing JackStone/data/missions/StrongHold.mis.
Warning: (c:\tsems3.5\tse\engine\core\resmanager.cpp @ 801) ResourceObject::construct: NULL resource create function.
ResourceObject::construct: NULL resource create function for 'AtlasMission.atl'.
AtlasFile::load - cannot open atlas file 'JackStone/data/terrains/AtlasMission.atl'.
AtlasInstance::onAdd - cannot open atlas file.
JackStone/data/missions/StrongHold.mis (0): Register object failed for object NewTerrain of class AtlasInstance2.
@Ben - no problem, I can wait that long :)
JS
#5
We had same problem, but it was in a different part of our codebase, so we could easily workaround it. It at least loaded, so guess we just wait for Mr. Garney to fix0r it :)
Jeremiah
08/20/2006 (6:25 pm)
Not surprised, since I forgot the Construct functionality will look for .atlas to properly handle it.We had same problem, but it was in a different part of our codebase, so we could easily workaround it. It at least loaded, so guess we just wait for Mr. Garney to fix0r it :)
Jeremiah
#6
09/14/2006 (11:58 am)
This should be fixed in most recent release of Atlas2 (as I tried to repro it and couldn't, although I could previously. :P)
Torque Owner Jeremiah Fulbright
I had something similiar happen locally, and it was cause of the file extension (.atlas) being too long
try this:
rename your .atlas file to .atl and change your .mis to reflect it, and see if it still crashes. It may since some of the code is probably finicky/unstable, but it may not