OS: [e.g. Windows 10]
Version: [e.g. 0.1.1]
Commit/Build: [e.g. 202244e]
This .DAT file makes OpenRCT2 crash on loading. I doubt the .DAT is configured incorrectly, as it was generated with X7123M3-256's ride generator.
Steps to reproduce:
object folder

Commit: ab38357
Dump created with task-manager
call stack;
[External Code]
> openrct2.dll!decode_chunk_rle_with_size(const unsigned char * src_buffer=0x0000022b7e3c3040, unsigned char * dst_buffer=0x0000022b0000d040, unsigned __int64 length=17801141, unsigned __int64) Line 261 C
openrct2.dll!sawyercoding_read_chunk_buffer(unsigned char * dst_buffer=0x0000022b0000d040, const unsigned char * src_buffer, sawyercoding_chunk_header chunkHeader={...}, unsigned __int64) Line 50 C
openrct2.dll!SawyerChunkReader::ReadChunk() Line 81 C++
openrct2.dll!ObjectFactory::CreateObjectFromLegacyFile(const char * path=0x0000022b77a43d10) Line 120 C++
openrct2.dll!ObjectFileIndex::Create(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & path) Line 101 C++
openrct2.dll!FileIndex<ObjectRepositoryItem>::Build(const FileIndex<ObjectRepositoryItem>::ScanResult & scanResult={...}) Line 190 C++
openrct2.dll!FileIndex<ObjectRepositoryItem>::LoadOrBuild() Line 120 C++
openrct2.dll!ObjectRepository::LoadOrConstruct() Line 212 C++
openrct2.dll!OpenRCT2::Context::Initialise() Line 337 C++
openrct2.dll!OpenRCT2::Context::RunOpenRCT2(int argc=1957755744, char * * argv=0x0000022b74b658f0) Line 155 C++
openrct2.dll!NormalisedMain(int argc=1, char * * argv=0x0000022b74b016e0) Line 62 C++
openrct2.dll!LaunchOpenRCT2(int argc=1, wchar_t * * argvW=0x000000000000002c) Line 53 C++
[External Code]
Autos on breakpoint
i 15837699 unsigned __int64
Locals on breakpoint
count Variable is optimized away and not available.
+ dst 0x0000022b0100dff2 "" unsigned char *
+ dst_buffer 0x0000022b0000d040 "" unsigned char *
i 15837699 unsigned __int64
length 17801141 unsigned __int64
rleCodeByte Variable is optimized away and not available.
+ src_buffer 0x0000022b7e3c3040 "ø" const unsigned char *
Well, it got caught with the assertion… It's clearly not a valid object.
That depends... does it work in vanilla?
I hope you aren't dismissing this issue out of hand. I have done numerous tests and I believe OpenRCT2's .DAT loader is somehow failing due to the file size. The ride in the .DAT included above is a flying coaster with swinging 13 swinging sprites per view. It has an insane number of sprites. I have tested other sprite counts, and with 7 sprites per view OpenRCT2 cannot load the file either, but 5 sprites per view works perfectly fine. 7 sprites per view on the upright rotations and 1 sprite per view on the inverted rotations also works perfectly fine (insofar as OpenRCT2 does not crash on loading). Unfortunately 5 sprites per view looks quite ugly ingame, so I hope something can be done so OpenRCT2 can load these monster .DATs.
Also, a .DAT with 7 sprites per view with fewer views does load in OpenRCT2, so I am convinced there is some file size limit I am hitting even with a ride that legitimately uses every frame.
The file size does not matter, at least not in this case. This file is simply invalid. It was not compressed properly. You can try exporting it without RLE compression
Sounds like the compiler program has an issue with RLE compression then. I will look into it.
As far as loading decompressed .DATS, I have never gotten it to work, but this could be because Buggy's Ridemaker does not properly decompress dats.
You didn't answer my question: does it work in vanilla or not?
I can't answer that because I don't have vanilla.
Does not work in vanilla
Crashes when loading objects

@Gymnasiast did this change the status of the issue? xox
IMO if it doesn't work in vanilla, it's not valid. Would be nice if we didn't just crash on trying to load an invalid object, but that's another issue.