Quick update on threaded file loading from .zip files (and threaded texture loading from .jpg):
Got everything rewritten to use the more sane system, where the whole zip file is read (compressed) into mem, and then each texture is uncompressed directly from there into a mip data buffer.
Right now it’s still quite naive about what textures to cache and things, and doesn’t have the system, for e.g., freeing up page 1 when the user hits page 4, and queuing pages 5, 6, and 7.
Right now I’ve also got a problem with the code that copies from the compressed zip buffer into zip data structures used to figure out the internal zip structure, as I had to replace IFileHandle Read/Seek/Tell with Memcpys and pointer arithmetic.
At some point I think I’ll abstract that out so I don’t have to manually do the pointer arithmetic, and just set it up so I can call my own Read/Tell/Seek functions to move around the buffer pointer.
So to debug that, I went back to JUnzip and got its little example compiling so I can manually step through and figure out the offsets and what they should be at each stage of reading the zip’s central directory structure (gives info about the files).
At Space Dust we just released our latest gameplay video for Space Dust Racing. Things have come a long way in just 4 months!
Space Dust Racing is a work-in-progress vehicular combat party game for up to 16 players, supporting local and online multiplayer. Cartoon competitors race on exotic planets, using weapon powerups to knock each other out and score points. Those that fall behind are eliminated until one survivor remains. Rounds repeat until a winner prevails!
Please subscribe or follow our developer blog for updates:
Space Dust Racing is looking great! I hope actual races will be as tight (I mean “close combat”) as in the videos in mario kart the players are usually pretty spread out with one maybe two on-screen at once.
It’s great to see what everyone is doing! Inspires me to keep going
Thanks ! Yep the combat is always as tight as , we don’t do splitscreen like Mario Kart (which allows players to spread out), everyone shares the same camera view. If you fall off-screen, you’re knocked out for the round (hence the game mode name “knockout”) - it’s a throwback to retro party games like Micro Machines and Mashed. What you saw in video are in-game highlights from our latest playtesting session.
Another quick update on my work threading zip loading and decompression of (at the moment) jpg files for loading into textures.
I finally got the rewrite working last night, though not without an occasional crash bug still present (did a bit of work cleaning that up morning).
Now it works like :
When a request comes in, check the zip file cache, if nothing there, create a new cached zip file object and call FIOSystem::LoadData to load the whole (compressed) file into mem, as well as set up the timer to check completion.
When the LoadData call finishes, go through the list of pending page requests, and create a new reader Worker to handle decompressing and filling a mipmap buffer (all Workers read from the single compressed zip buffer - threading ftw). Right now it’s set so only 5 workers can run at once.
When a thread finishes, copy the mipmap buffer into the Texture2D’s mip, free it up, remove the worker etc., and set the Texture2D into the cache.
Then in Blueprint I use a function to check the cache for a given zip file. When it’s available and Set Page is called to set it onto the material, it works
I need to debug getting rid of workers, as well as make it so that a loading material is used when Set Page is called but the desired page isn’t ready.
Best of all, the loading is 100% buttery smooth, no hitching or hangs in the main game thread - no mean feat when loading in images which are 2000x3000 resolution (roughly).
Eventually I’d like to make the file loading a bit more generic, and package up as a plugin on the Marketplace, so that other developers will be able to easily use .zipped files in their packaged games (works in editor, of course).
I can think of a lot of uses for being able to load in files inside a zip into in-game assets (I’ll probably not be supporting models, since there are issues with FBX import, at least not for the moment), namely being able to let users make their own mods
Lighting Test with Basic non-tiled material and BSP Geometry.
Anyway will do one more test and then im with the engine for a while while i work on my modeling and texturing workflow.
I have been working to get decent looking vegetation in Unreal Engine 4, since I have come from using Cryengine previously. Really like UE4, it has more possibilities I think.
Terrain has been neglected a little bit as I sorted out the vegetation, but now I am ready to start working on other aspects of the area.