It is currently Sat Aug 22, 2020 4:27 am


All times are UTC




Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: LargeVolume on VS2012
PostPosted: Wed Sep 25, 2013 9:11 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I'm afraid I don't have much insight here - the exception in question is thrown from here:

Code:
FILE* pFile = fopen(filename.c_str(), "wb");
if(!pFile)
{
   POLYVOX_THROW(std::runtime_error, "Unable to open file to write out block data.");
}


so basically fopen() is apparently failing. A few points to try:

1) Try changing fopen_s() back to fopen(). You can ignore the warnings which Visual Studio gives. Perhaps the '_s' version has some different behaviour?

2) Can you step into the code and verify that 'filename' is valid?

3) Are you running from a folder where you have write access? Not in 'Program Files' or something?

4) Any chance it fails to open because it's already open? This could somehow be a big in PolyVox. Does it fail the first time it hits that line?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Tue Dec 31, 2013 12:06 pm 

Joined: Tue Sep 10, 2013 5:24 pm
Posts: 2
Since I created the thread, maybe I should chime in again (I've been occupied with a bunch of other projects).

I got the develop branch to compile and run now. I have some questions though.
I never used the LargeVolume before, just SimpleVolume. Should the FilePager store blocks permanently or is it just temporary? Right now I just tried doing this:

Code:
MaterialDensityPair88 voxel;
voxel.setDensity(MaterialDensityPair88::getMaxDensity());
voxel.setMaterial(1);

largeVolume->setVoxelAt(Vector3DInt32(0, 0, 0), voxel);

largeVolume->flushAll();


I get a temporary file that represents the valid region, but it's deleted after I close the program. Should I take care of storing the entire world data myself? (I think probably, but I'm not sure)
Should I just consider the FilePager a sample implementation?

Another minor thing, the FilePager destructor says
Quote:
Failed to delete 'data/blocks/5170-0_0_0_31_31_31' when destroying FilePager
even though the file is deleted.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: LargeVolume on VS2012
PostPosted: Wed Jan 01, 2014 7:22 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
tacospice wrote:
Should the FilePager store blocks permanently or is it just temporary? ... Should I just consider the FilePager a sample implementation?

Yes, the FilePager is just a sample. In practice you might want to save the data to a network, server, database, or whatever. Or you might not save it at all - if your world is procedurally generated then maybe you can just generate it again of demand.

The Pager mechanism just provides a way for the LargeVolume to cope with running out of memory. It hands the data off to you on the understanding that you will be able to provide that data again later. How you actually do this is up to you.

It's not intended as a serialization mechanism though you can abuse it for this purpose (and we do so in Cubiquity by storing the paged blocks into an SQLite database).

tacospice wrote:
Another minor thing, the FilePager destructor says
Quote:
Failed to delete 'data/blocks/5170-0_0_0_31_31_31' when destroying FilePager
even though the file is deleted.


I'm not sure... perhaps the file never got created? Or the deletion is delayed until the file is freed? Unfortunately standard C++ provides only very limited file access (e.g. you can't create directories, which is why we prepend the random number so that multiple runs don't confuse each others data). Boost.Filesystem is a better solution but we didn't want the dependency for something which users will override anyway.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net