9 ms·
Building a command line tool to design a farm layout in Stardew Valley
- roel_v 7y agoHow are these layouts better than equidistant sprinklers? I think this article is missing some description of what it tries to achieve.
- akincisor 7y agoAlso missing optimal placement of scarecrows for larger farms.
- zeeZ 7y agoA basic sprinkler in Stardew Valley waters the four orthogonally adjacent plots. Space and walking time are somewhat limited, so you want to optimize for that. Looking at those outputs is a little confusing since not all dots will actually be watered. The partitioning also adds to that.
- roel_v 7y agoI was assuming the OP was talking about iridium (or at least quality) sprinklers, the graphs don't look like good placements for basic sprinklers at all. I guess basic sprinklers do pose a somewhat more interesting problem - then again you use them only for a very short time before moving on... Now if it included scarecrow placement and shortest distance for non-traversable crops like beans, that would be something else...
- aspaceman 7y agoI had the same thought. This is super interesting but just needs one more paragraph up top explaining the rules and what the goals of the problem are. I think this could be reframed into an interesting homework assignment given the right description of the rules. I really want to emphasize that this is a very cool article though. Big fan.
- floatingatoll 7y agoFor those wondering “What is Stardew Valley and why are sprinkler layouts relevant?”: 1) Stardew lets you grow crops, but it’s time consuming to water them 2) Sprinklers water crops for you, but starter sprinklers water 4 squares only 3) Better sprinklers are your reward for growing lots of crops 4) So having an optimized basic sprinkler layout is time-efficient and useful Scarecrows are necessary to keep crows from stealing crops, and have their own protection radius - similar to sprinklers, but wider. The python script linked here is a useful programming exercise for trying to start developing these layouts by code, and many improvements could be made to improve the aesthetic - but if you just want to write a quick layout generator and grow some crops, it’s perfectly sufficient as-is for basic sprinklers. Once you progress to advanced sprinklers, you don’t need this algorithm as much as you need a tesselation pattern that fits within the game’s constraints, and that’s what shows up in the player-built maps linked above. If a picture is worth a thousand words, then go to https://stardew.info/ https://stardew.info/ and scroll down to the “Useful” collection maps. The first map shown is a gloriously efficient honey farming operation: you have to plant a flower within the beehive’s radius, and you have to be able to walk up to the beehive, so this layout meets those rules, while doing so in a way that’s pleasing to the eye. https://storage.googleapis.com/planner-renders/pink-mayfly-38.png https://storage.googleapis.com/planner-renders/pink-mayfly-3... SimCity fans may remember “Magnasanti”, where the same rules and principles were applied: Tesselations of constructs designed for maximize people per square, with the bare minimum of infrastructure necessary to deliver that. Magnasanti was designed by a human being using graph paper and is optimized beyond imagining, just like those Stardew “Useful” maps. HN discussed Magnasanti before: https://news.ycombinator.com/item?id=16933265 https://news.ycombinator.com/item?id=16933265 And I’d just like to highlight how much this image from Magnasanti map development could be an image from Stardew beehive map development: https://rumorsontheinternets.files.wordpress.com/2010/10/magna21.jpg https://rumorsontheinternets.files.wordpress.com/2010/10/mag...
- excalibur 7y ago> The first map shown is a gloriously efficient honey farming operation: you have to plant a flower within the beehive’s radius, and you have to be able to walk up to the beehive, so this layout meets those rules, while doing so in a way that’s pleasing to the eye. Not sure if you're referring to the same map I'm seeing first: https://storage.googleapis.com/planner-renders/pink-mayfly-38.png https://storage.googleapis.com/planner-renders/pink-mayfly-3... It looks to me like there are a number of beehives that can't be accessed. Also some of them may be a bit far from the flowers. EDIT: Additionally, when collecting from the beehives on the inside you would be more or less guaranteed to pull up your flowers on accident once they were full grown.
- mieses 7y agoYou dig a hole, you put a seed in, you put dirt on top, you install gentoo..
- samdoidge 7y agoA nice application, but I think a screenshot from the game next to the ASCII layout would improve this article.
- oefrha 7y agoA Stardew planner[1] plan would be easier than laying it out in game and comes with the ability to screenshot at any resolution. Personally I wouldn’t use that random layout on my farm, it would be an assault on my eyes ;) Form trumps function. [1] https://stardew.info/ https://stardew.info/
- prepend 7y agoThis doesn’t take into account the need for scarecrow placement to ward off crows. This seems to account only for basic sprinklers that water 4, it would be more useful to account for 8 and 24 models.
- djsumdog 7y agoYea I was hoping this would talk about scarecrows and those little huts you can get later than can automatically harvest crops up to 15 squares away. You'd want to optimize for all three (with the huts, you can even plant vine plants right new to each other; the little creatures can get to them even though you can't). Would the optimal placement for iridium sprinkers just be in the center of their coverage area? Seems like this script would always have waste areas too.
- joshvm 7y agoIt seems like this is a variant of the N-queens problem, which you can solve by backtracking. So it should be fairly easy to modify to include more sprinklers including using tiles for other things like scarecrows. And actually it's a more complex problem - what happens if you include crops which you can't walk over, but have repeat harvest (like beans)? Back in the day of Harvest Moon you often had to waste a square because you couldn't access the centre. In the original game(s) there were other constraints like seeds being scattered in a 3*3 grid centred on you. You couldn't sow individual tiles. At least now you don't waste 1/9 of your seeds on inaccessible tiles. It would be fun for Stardew to model things like companion cropping, where you could get a productivity boost by planting certain things next to each other. Or if trees/buildings would shade areas. Or if pests were actually a thing, but maybe that would give real life gardeners PTSD when your whole farm dies of blackfly.
- rickyc091 7y agoFor those who have played Harvest Moon, it's basically the same game, but with more layers.
- robert_g 7y agoThis shouldn't matter but it appears spiral_coordinates() is generating in a clockwise rotation when the doc string states counter-clockwise.
- excalibur 7y agoWhat is the point of building a wall around your crops?
- jabyess 7y agoIf you're a programmer, and this interests you, then I urge you to check out the game Factorio[1] which is all about hyper optimization and layouts. Stardew valley is a great game too, and much more peaceful. [1]https://factorio.com/ https://factorio.com/
- fakeNewsIsHere 7y agoI totally agree. This game is not fun, but addicting. I don't recommend it. It cellphone quality. How'd it get popular?
- rideontime 7y agoDisregarding your opinion of the game, cellphone games are the most popular games...
- chabes 7y agoI’m currently working on irrigation design for an actual farm. Would be nice to have tools to help with layout. Unfortunately, I don’t think this is the right thread for that..
- lapidary 7y agoGreat blogpost and impressive code! But don’t starter sprinklers (3x3 plus shapes) already tesselate? You can place them as a knight moves in chess, essentially. What is this accomplishing that tessellating the sprinklers doesn’t? Or is this ignoring that as an option? Or am I missing something else obvious?