Closed coderguy57 closed 2 years ago
What system are you using (Win/Linux/Mac)? Which file exactly did you try to open?
Running Ubuntu 20.04. I get the same result for all '.sim' files
Is the default simulation (https://github.com/chrxh/alien/blob/develop/img/screenshot1.png) loaded at the first start or do you just see a blank background?
If not I can think of 2 error causes:
Could you please try the following:
Change the following code block in Serializer.cpp
https://github.com/chrxh/alien/blob/develop/source/EngineInterface/Serializer.cpp#L157-L170
to (this changes deactivates the decompression.)
{
std::ifstream stream(filename, std::ios::binary);
if (!stream) {
return false;
}
deserializeDataDescription(data.content, stream);
stream.close();
}
Compile, start the program and load the attached simulation (this sim-file is uncompressed) test_sim.zip
If this works, the problem would be a cross-platform issue with the (de)compression.
Yep that worked. Thx !! We know that's the problem, I can look into why it compression libs don't work
Thanks, that would be great! Maybe some byte ordering Win vs Linux problem.... ?!
If the problem can't be solved so easily, I could also take out the compression for now (or use other lib) and resave all examples. The files are then unfortunately about twice as large :-/
Note: With the correction above, however, only the deserialization is done without compression. For saving it is still activated.
I'm currently trying to use zstr/zlib for compression. It would be great if you could try if it works? The source code is in the branch features/zlib. Here is the simulation file for testing: zlib_test.zip
Yep, that worked perfectly! You don't happen to have a discord or slack for the project?
Thanks for testing! I've now converted all examples and changed the Serializer.cpp completely to the new format. It's now on the develop branch. There is a subreddit for this project at https://www.reddit.com/r/AlienProject. I'd not created a discord or related yet. The development of this project kept me very busy the last few months (and as a result the new version 3.0 will be ready very soon :) .Then I hope to have more time for such things.
I close this issue. If there are further problems with the file format please let me know.
When ever I try to open an simulation I get 'The selected file could not be opened.' It is cause the Serializer::deserializeDataDescription throws "no data found". Any idea why it does this?