Skip to content

The mobile game across atomic to galactic scale that I built over 4 years

License

Notifications You must be signed in to change notification settings

dshook/Macrocosm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Macrocosm

This is the game Macrocosm that I worked on for about 4 years. For all the details, check out https://dillonshook.com/what-it-takes-to-make-a-game-by-yourself/ and https://dillonshook.com/planned-app-solescence/ for why it's no longer on the app stores.

There are some things scraped from the repo to not publish assets I paid for or baked in credentials. Unfortunately this means I can't post the full git history since it's such a pain in the butt to scrape them from the history.

The game was last built with Unity 2019.4.x . Good luck if you try to upgrade it

Hope you have fun exploring and might find something useful!

Some General File Structure

Assets/Editor Custom Unity Editor tools and inspectors. They were especially helpful for the Stage 6 & 7 map generation. Also includes the Unity Save Game Editor which was also invaluable.

Assets/Plugins All the 3rd party code, most from the Unity Store but some just downloaded.

Assets/Resources All art/sounds/prefabs/materials. Kept them all in Resources folder for ease of loading in game. See ResourceLoaderService

Assets/Scripts All my code. The numbered folders correspond to the stages of course.

Assets/Scripts/Models The whole game state data (with GameDataModel.cs being the root), serialized into the save game.

Assets/Scripts/Services Some fun general game services. Check out GameSaverService, InputService, and StageRules.

Assets/Scripts/Shaders Like many game developers, shaders are one of the banes of my time developing the game. Luckily I didn't have to go too shader heavy on this game but countless hours were still spent in this folder.

Assets/Scripts/StrangeControls Root of StrangeIOC which is the dependency injection library I used that worked out very well. The GameSignalsContext.cs is the main starting point for setting up the whole DI container with all the services and injectible things.

Assets/Scripts/UI All the Unity UI control code. `nuf said

Assets/Scripts/Util Everyone has to have a util folder right? This is probably one of the better points to mine code for other games.

Some Fun Files to Look at

Snake Movement took unexpectedly long and lots of iterations to get to feel right

Beat Manager handling spawing cells in time with the song templates was also surprisingly challenging to get the audio synced properly since audio samples at a much higher rate than the game loop.

Creature Modifier Fun list of all the creature modifiers and their requirements / exclusions / upgrades.

TDGrid Who doesn't love dynamic (based on the players buildings) pathfinding from multiple sources to multiple destinations?

City Building All the possible city buildings based off the creature modifiers except even more complicated

Hex Map Generator Map generator for the civ like map. Based off of CatLikeCoding's Tutorial with lots of modifications.

HexRiverOrRoad path Crazy logic that took like a week to get right setting all the spline points for rivers and roads along a path to get a nice smooth windy curve that also has to take into account merging rivers or roads and how they overlap to look right.

Galaxy Generator Even crazier version of the Hex Map Generator, generating random stars in a galaxy based on some real science estimations of distributions of stars in their life cycle, then random planets around each star based on the system archetype each with resources for gameplay. Loosely based off the descriptions in the GURPS Space book

Star Name Generator The name generator for all the stars. As mentioned in the file, based off this awesome blog / code

Galaxy Ship Fun relativistic calculations for how fast ships move

Galaxy Transport Ships Manager Really insane logic for graph pathfinding (traveling salesman essentially) for the ships transporting resources over the connected star routes that has to meet a lot of gameplay constraints. This alone took weeks to nail down.

About

The mobile game across atomic to galactic scale that I built over 4 years

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages