It’s been a while! But I’ve been doing some pretty cool stuff I think.
The most recent bit has been an intelligent resource manager. I first had to learn how to use dirent.h, but, that was pretty much the hardest part. Gotta do some cool recursion, and after that, file type checking and sorting.
Now, I’ve always felt most games have terrible mod support, even if they do support it. Very few games have good mod management. Arma 3 for example. Modding it works, but, clunky. You have to activate a mod after putting all of the files in the right spots, sometimes having multiple copies of files for it to work. It gets frustrating after a while.
Skyrim, combined with either NMM/MO or Steam Workshop, is really simple. Especially Steam Workshop. The only thing you really have to watch out for is incompatibilities and destroying your saves. *only*
The “perfect” mod management system that I’ve envisioned was having a menu in the game listing all of the mods the engine detects. It will detect mods automatically, if, and only if they are in the right place. I think most games don’t document or are too flexible with modding. For modding to be secure, it needs to be clearly documented and fairly strict, but allowing for cool stuff to be done.
Here’s how the folder structure is setup:
You have a /mods folder in your game directory. Inside of that is one folder per mod. Each folder can be named most anything, but the name of the mod is preferred. Inside of the mod’s folder is a file called “info.txt”. This contains the mod’s name, version, author, and description. Then, there are up to 5 (really up to the engine, 1 folder per moddable resource type) folders named by resource type. Inside each is files of that type. I feel like it’s well structured. That way it is easy to understand, and easy on the engine too, it knows and expects what is there.
Code wise, it’s similar in structure. I have a Mod class that contains the name, author, version, and description, and then a list of files the mod folder contains. The Mod class isn’t really exposed though. I have a ModManager class that does all the loading of mod folders and contains a list of Mods it finds. It also keeps track itself of what mods are active or not. If a mod is active, it then requests the AssetManager to load those resources.
By doing that, I’m following the Single Responsibility Principle quite well I feel like. It’s a principle I’m quite a fan of. I tend to do it implicitly. That’s why Mods are not managed by the AssetManager, Mods aren’t really assets, just lists of files!
It’s tied into SFML at the moment, which for me is good enough (for use with my engine), but in the future I’d like to use templates to hopefully make it completely free of SFML. (Only the AssetManager is tied to SFML, the Mod Manager is not).
Now, I have error handling in it pretty well complete, but it needs a bit more. When I finish that, I’ll upload it to my Github and update this post with a link. I’m pretty proud of this little library, as I guess that’s what it is.
Beyond that, I’ve helped out with a Battlezone version of Call of Duty zombies. Ian S, a great map-maker, came to me with this idea and asked for help with scripting. It’s been really cool working with him on it. I hopefully made the last few fixes and tweaks today, so I guess we’re out of public beta and onto Release Candidates. It’s exciting to finish stuff!
Battlezone scripting with Lua has lots of possibilities, and I think people are starting to realize it, and I’m learning more about BZ’s innards, allowing me to script better (killed a few projects in the past). Zombies should hopefully be one of many more!
Filed under: Battlezone, C++, Computers, Programming Tagged: awesome, Battlezone, C++, computers, game engine, Games, gaming, github, Languages, Lua, management, principle, Programming, resource, responsibility, Scripting language, sfml, single, Video Games, videogames
via WordPress http://ift.tt/1fSrHPU
March 23, 2014 at 01:38PM
Thanks to IFTTT