ChrisNeedham24 / microcosm

A little 4X game written using Pyxel.
GNU General Public License v3.0
9 stars 8 forks source link

Add resources #139

Closed ChrisNeedham24 closed 9 months ago

ChrisNeedham24 commented 11 months ago

These can take the form of a basic or extended set of resources - basically we just need something else to act as currency or reward. In terms of exploiting the resources, I figured it could work by automatically doing so if it is on or within one quad of a settlement. This is something that will add more wrinkles to #20, and make overall questlines easier.

Some other things that this might involve could include changing existing models to require resources to construct them, so this could be quite the undertaking.

ChrisNeedham24 commented 10 months ago

I think it makes sense to have two sets of resources - core and rare. Core resources will primarily be for use in constructing improvements and units, while rare resources will provide passive bonuses to the player/settlement that exploits them.

In terms of what the actual resources will be called, and what each will do, I've got the following for ideas so far:

Core

Rare

It's important to note that the majority of improvements/units will not require resources, as that would place unfair restrictions on what can be built until a new settlement is founded/taken. There should still be a healthy balance that promotes exploration while allowing existing settlements to grow.

Naturally, core resources will appear more frequently in the overworld than rare resources.

We'll also need to add all this to the wiki, probably in a new section.

ChrisNeedham24 commented 10 months ago

Probably worth mentioning as well that core resources will accumulate, while rare resources maintain an effect.

ChrisNeedham24 commented 10 months ago

I think the current rates of 1 in 10 for core and 1 in 50 for rare might need to be decreased a bit - 1 in 20 and 1 in 100 might be better.

ChrisNeedham24 commented 10 months ago

In terms of keeping track of a player's resources, core resources will be displayed in raw numbers, while rare resources will be displayed in terms of the number of settlements being affected by them.

ChrisNeedham24 commented 10 months ago

Mustn't forget to add these to investigation results too.

ChrisNeedham24 commented 10 months ago

Backwards compatibility is an interest one - it's fairly easy to get old saves to work, but the new resources stuff in the overlays will still appear despite no resources existing. That's probably fine, though.

ChrisNeedham24 commented 10 months ago

Will also need to add a few achievements for this.

ChrisNeedham24 commented 10 months ago

The wiki changes will also need to include updating the improvements page to include required resources.

ChrisNeedham24 commented 9 months ago

The wiki on GitHub will also need to be updated - but do this post-merge.

ChrisNeedham24 commented 9 months ago

Probably makes sense to update the screenshot in the README as well as part of this, it's been out-of-date for a while.

ChrisNeedham24 commented 9 months ago

Seems like I decided at some point to not require resources for units, and I think that makes sense.

ChrisNeedham24 commented 9 months ago

So it seems like with these changes, the AIs are winning the game at a much slower rate, because they're currently not motivated to seek out resources if they don't have them. Previously I think the AIs would occasionally win games around the 100-150 turn range, but I haven't had any within 300 turns, with 2, 6, or 14 players.

I'll have to adjust the AI functionality to only settle where there is at least one core resources, and probably also encourage even hermit AIs to expand if they are missing resources.

ChrisNeedham24 commented 9 months ago

I did some more testing on the main branch, and it seems like there probably wasn't as big a difference between this branch and main as I thought.

Regardless, I've changed it so that new AI settlements always have at least one core resource. This hasn't seemed to have made a massive difference, but I still think it makes sense from a perspective on what a real player would do.

Looking at some save files, there are still some AI players without resources, but it seems like the players with the hermit expansion playstyle actually do have resources on occasion. More testing will be required for that, but perhaps that change will not be required.

ChrisNeedham24 commented 9 months ago

Having played another game with 14 players, it seems like game speed is really not slowed down that much, if at all, and all players are accumulating the necessary resources to make progress. All that's left now is tests then.