jeremyckahn / farmhand

A resource management game that puts a farm in your hand
https://www.farmhand.life
GNU General Public License v2.0
95 stars 23 forks source link

feat: first pieces for The Forest #475

Closed lstebner closed 5 months ago

lstebner commented 5 months ago

What this PR does

add the beginnings of the forest behind a feature flag

How this change can be validated

Questions or concerns about this change

As I was doing this change I started to think it might be cool to have the forest unlock at a certain level instead of requiring purchase for the initial forest, so this is why i put in the INITIAL forest size constants. then once unlocked the upgrades can be purchased to expand it. If we go this route I think it should be a decently high level, like maybe 20. I think that would also help justify higher prices for the expansions.

Additional information

image

Screenshot 2024-01-15 at 10 08 10 PM Screenshot 2024-01-15 at 10 25 27 PM
vercel[bot] commented 5 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
farmhand ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 11:53pm
lstebner commented 5 months ago

thanks for the review @jeremyckahn . i'll get the useContext update made and then it seems like we need to decide on how we want to model forest plots & foragables to move this forward. seems like that might be easiest to discuss in discord sometime when we're both around, but i'm also happy to continue the discussion here. both ways we've mentioned doing it seem equally valid to me at the moment.

jeremyckahn commented 5 months ago

it seems like we need to decide on how we want to model forest plots & foragables to move this forward. seems like that might be easiest to discuss in discord sometime when we're both around, but i'm also happy to continue the discussion here. both ways we've mentioned doing it seem equally valid to me at the moment.

Sounds good! My availability during the week is pretty limited now, so it might be easiest to stick with async communication via comments on this PR. I think we're set with a nested array to represent the Forest, but it's what the nested array contains that needs to be figured out. However, that's not something that necessarily needs to be set in stone now. We should minimally have an interface for dealing the data that's flexible enough to allow us to iterate on the model before we release the feature.

lstebner commented 5 months ago

@jeremyckahn just pushed some updates including some new typedefs as we discussed, and moving the forest to unlock from experience rather than a purchase. i used a simple constant for this instead of levels.js but just let me know if you'd prefer we do it differently.

lstebner commented 5 months ago

another round of updates is in @jeremyckahn, but I do have another question for you about the changes I just made. i added a new persisted state key called stagesUnlocked, but the only thing I put in here is the forest since it's the only stage that is unlockable through experience. i'm not sure if this is the best name, or the best way of going about this, so I wanted your opinion.

i also went ahead and made the update to unlockTool that i mentioned in discord

lstebner commented 5 months ago

I think it's worth changing this into a computed value. Doing so will avoid adding data to game save files and thus de-risk and simplify future maintenance.

excellent, this feels much better now!

I had a few other notes, but this is really coming together. Thanks for making code improvements as you go!

of course, and thanks for all the back and forth getting this one into the right shape!