Jump to content

Package Plugins


Josh

2,529 views

 Share

Many games store 3D models, textures, and other game files in some type of compressed package format. These can be anything from a simple ZIP file to a custom multi-file archive system. This has the benefit of making the install size of the game smaller, and can prevent users from accessing the raw files. Often times undocumented proprietary file formats are used to optimize loading time, although with DDS and glTF this is not such a problem anymore.

Leadwerks uses built-in support for encrypted ZIP files. In our new engine I wanted the ability to load game files from a variety of package formats, so our tools would have compatibility with many different games. To support this I implemented a new plugin type for package files. Packages can be used like this:

auto pak = LoadPackage("data.zip");
auto dir = pak->LoadDir("");
for (auto file : dir)
{
    if (pak->FileType(file) == 1)
    {
        auto stream = pak->ReadFile();
    }
}

I created a package plugin for loading Valve package files and added support for browsing packages in the new editor, alongside with regular old folders. Ever wanted to see what the insides of some of your favorite games look like? Now you can:

Image3.thumb.png.e7f668c43bb709516e89c7597040c172.png

This can work not just for textures, but for materials, 3D models, and even scene or map files.

I envision this system being flexible enough to support a wide variety of games, so that the new editor can be used not just as a game development tool but as a tool for modding games, even for games that don't have any official tools. All it takes is the right set of plugins to pull all those weird specialized file formats into our editor and export again in a game-ready format.

  • Like 2
 Share

11 Comments


Recommended Comments

If the editor would be compatible for making source maps that should mean it would have support for placing entities in via an fgd system which then a developer could use those systems for their own games after they implement it.

The Source I/O system was really nice and I would totally implement a similar system if I knew the editor can cook the io in the map file for my game to read it.

Link to comment

Not just Valve games, but everything. :)

I am designing the entity system to be extremely configurable. The properties are based on a bunch of JSON file templates:

{
    "ObjectType":
    {
        "name": "Spot Light",
        "root": "Light",
        "properties":
        [
            {
                "name": "Cone angles",
                "group": "Light",
                "type": "VEC2",
                "minimum":
                [
                    0.0,
                    0.0
                ],
                "maximum":
                [
                    90.0,
                    90.0
                ]
            }
        ]
    }
}

There will also be customizable build/launch paths.

  • Like 3
Link to comment

Funny enough, the original Quake on Steam recently received an update. It's the same game, but using a new engine. They did not make any huge changes, but now it is running with actual hardware acceleration and everything is a bit higher resolution. That's exactly the kind of thing you could do with this, an "engine mod" that loads the original game files but renders it all in another engine.

  • Like 1
Link to comment

Also can rip all the textures out of a BSP. Of course there are many different versions of WAD, PAK, and BSP formats, so supporting one particular game requires some mix and match code in the plugins.

sp.thumb.png.719e7c3577b7aa8886a181b026067c5a.png

  • Like 2
Link to comment

So you may notice the package files are appearing both in the file panel below and in the tree view as folders.

just realized that GLTF files could be treated the same way, since they can have texture files embedded in them.. Optional of course.

crazy possibilities.

  • Like 1
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...