Gerrudo / reticulating-splines

An isometric city building game.
0 stars 0 forks source link

Re-Implement Core Systems #43

Open Gerrudo opened 1 week ago

Gerrudo commented 1 week ago

Core Systems need to be re-added after the Tilemap Overhaul in #36.

Additional Requirements:

Gerrudo commented 1 week ago

https://github.com/Gerrudo/reticulating-splines/commit/2613d49dc66c4536d3d6ed4b0cf31a529393c3dc this is a pain in the arse trying to get this to play nicely.

I've tried a few different approaches, using state etc, but the best way seems to have be having raw values in a consumption vs production calculation and then setting a value based on if the resources available are sufficient.

Gerrudo commented 1 week ago

https://github.com/Gerrudo/reticulating-splines/commit/be8352387e59106ca0b03de87c5491a0814f8f71 Looking somewhat more like a game, added in goods which are produced at industrial areas and then sold in commercial ones.

A day is now 1 minute, after which taxes are other earnings are collected and deposited into player's funds which they can use.

Numbers certainly need tweaking but this is a good start.

It might even be worth a some stage splitting each zone type or building type into it's own class to keep things neat, as we'll end up with a lot of different values.

TODO: tilePosition isn't used in a lot of methods, need to add required values to our SO's

Image

Gerrudo commented 6 days ago

https://github.com/Gerrudo/reticulating-splines/commit/8d33856d1e49ecb03890193ae1bb1844539ce148 Added an interface for our placeable tiles to apply calculations

Using an interface for this will be much better when we start to add more buildings

Gerrudo commented 4 days ago

https://github.com/Gerrudo/reticulating-splines/commit/800dfc64333b25afecb439041a311031418f34ea Moved some classes around, ditched the interface as it was making things more abstracted for no real reason, but at least now I understand them.

We now need to look at creating a population pool to have population gradually increase, it also will work the same when it comes to workers for other buildings.

Not seeing much progress lately as I keep messing around with design patterns that just keep over complicating this small project lol

Gerrudo commented 4 days ago

https://github.com/Gerrudo/reticulating-splines/commit/c5f6999db70a2253e4d42582552ce0d950ab2e90 Half-baked factory pattern implementation.

God this is a pain, turns out using Scriptable Objects in Unity was a bad idea, they persist after each session and seem to save to disk in the editor, and general advice is they're good as static data containers that do not change, so no good for storing changing values. Hence our factory and attached data class.

Gerrudo commented 2 days ago

https://github.com/Gerrudo/reticulating-splines/commit/e624a687cd754d24106193e338159a455e9a1bc1 We now have a static data store for all our CityData, we can likely in the future find better ways to decouple this, but at least it means our buildings are not directly coupled to our City singleton.

Gerrudo commented 1 day ago

https://github.com/Gerrudo/reticulating-splines/commit/3aa84b49bc3092b89e88bfdff95dac68eca01f6e Almost done, some values just need adjusting to make sure the numbers for each resources do not go out of control and can be balanced.

Image

Gerrudo commented 8 hours ago

Just jotting down ideas here, I think we need to be batch processing jobs instead of doing what we're doing at the moment and calling an update each frame. As this is getting hard to manage the state of each building and the values of the city.

What I mean by processing in batches is for a building to gradually produce a resource over time and it then be taken into the city data once every day or so, this is the same as what we do for earnings and would make it simpler.

For power, we should be statically defining how much power is produced, I think having this affected by workers is causing issues so we should simplify it for now.