UPM Packages & Boxxy
I started looking into Unitys UPM packages (The ones you can see in Package Manager) and have been moving a lot of my code to packages to use across games. The other alternative was to use sub-modules in git which I've tried to do with Gladiator Tycoon but really the UPM packages work much better especially as you can test the same code in multiple projects at the same time.
So for the moment I have several packages:
-TileLoader - loads in Tiled's TMX tile maps into unity, and creates prefabs from the object layer.
-BaseGM- An overall Game manager that can be used in all games, also features the pause menu.
-PlatformerGM- A gm for platformer games that handles respawns and level loading.
-ResourceManager- loads sprites,audio,etc from a text string & caches it in memory. Works on Desktop for StreamingAssets(for moddability), and uses the Resources folder in WebGL
-ObjectActors- a set of objects that inherit off BaseObject that makes about every object destructible. Is used in Faery Tales & Boxxy.
-WorldSystem- unlockable levels.save game functionality & lets you select different worlds.
-EasyUI- handles the menus & animations. Makes it easier to create lists of buttons as well.
After all these packages have been setup and were working, I also decided to update the old Faery Tales game I did a Ludum Dare for a while back. After a few days it was all good to go - and whats even better is that while I was working on that, I was effectively making improvements to Boxxy as well. It also means that the scripts & assets actually in the project can be kept to a minimum. I had like 100s of scripts in Faery Tales now the important ones are in packages and the rest of them are gone. Theres about 3 scripts in the Faery Tales project now. The only downside is you need to manually specify what other packages your custom package needs to use (for scripts). So you need to be able to keep things separated as much as possible. I had script in both Boxxy & FaeryTales that ties the platformer package to the tileloader package for levels.
The Tile package is required for both of these games, and now they both work exactly the same. When the package is updated, any improvements are automatically going to be in each game whenever its built again.
You can also create UPM packages that are just assets, I believe. It'd work well if its just for something you dont need to customize for each game, like a standard set of sound effects you use for menus, logos and stuff like that.
Anyway, I HIGHLY encourage programmers to start using UPM packages if you havent already. They make things SO much easier when you need to re-use code.
Get Boxxy Lite - 8 level mini game
Boxxy Lite - 8 level mini game
Action puzzle platformer
Status | In development |
Author | Chris Ashtear |
Genre | Puzzle, Action |
Tags | 2D, Unity |
Leave a comment
Log in with itch.io to leave a comment.