Git Product home page Git Product logo

Comments (4)

snake-biscuits avatar snake-biscuits commented on July 3, 2024

Some archives are nested, for example:
mappack.7z/surf.rar/maps/surf_exquisite.zip/Fortress Forever/custom/mymod/maps/surf_exquisite.bsp.bz2
have fun walking those, will definitely want to implicitly tell the lump system to just keep the whole file in memory

oh and don't forget the .cdi / .iso / .cue + .bin format for Quake III on the Dreamcast w/ nested .zips

We could drastically simplify building the MegaTest library if we walked these paths, at the cost of execution time

from bsp_tool.

snake-biscuits avatar snake-biscuits commented on July 3, 2024

Indexing into Dreamcast & Xbox360 disc images could get hairy
Quake III (Dreamcast): quakeiii.cdi/quakeiii.16.iso/QUAKE3/BASEQ3/MAPS/DC_MAP01/BSP.ZIP/maps/dc_map01.bsp
Three nested unique archive formats! (.cdi, .iso & .zip)

Orange Box (Xbox360): HalfLife2_TheOrangeBox.iso/
Source Engine Xbox 360 .iso XISO files are different to regular .iso, though can be interpreted as such
Assets (models, textures, audio etc.) are stored in a special .zip format for Little-Endian
Maps are just in the XISO filesystem

from bsp_tool.

snake-biscuits avatar snake-biscuits commented on July 3, 2024

Good luck writing back to the archive, unless you want to add a Read-Only mode...

Read-Only mode could be really powerful for faster tests!

It turns out that part of the RAM & time consumption of reading Apex Legends .bsp files comes from how python handles files
file.close() has to flush a buffer the size of the whole file, which is ridiculous for Apex Legends ~400 MB .bsp
Especially when you consider that .bsp_lump files roughly double that size, making a single map close to 1GB!

Unsure if using the with keyword is any faster
But if a read-only mode speeds up the MegaTest it'd be 100% worth the effort

from bsp_tool.

snake-biscuits avatar snake-biscuits commented on July 3, 2024

Look into using python's builtin bytearray (or bytearray-like behaviour) for RawBspLumps
The mmap module also looks convenient for handling files

TODO: test mmap read & close speeds on large files

Faking in-memory files w/ the io module is also pretty handy

Python file read costs in general could use more research, but also testing different approaches for read, write & close speeds

from bsp_tool.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.