Sunflowers Completely Transformed My Automated Farm

  Рет қаралды 9,231

Jack Hodkinson

Jack Hodkinson

Күн бұрын

Senior Developer Automates Farming With Python in The Farmer Was Replaced
Support me on Patreon: / jackhodkinson
Purchase The Farmer Was Replaced: store.steampow...
Music courtesy of Jagex/OSRS.

Пікірлер: 51
@jack.hodkinson
@jack.hodkinson 20 күн бұрын
Thanks to everybody who has shown so much support for this series. It's humbling to see so many of you following along and taking learnings from these videos into your own gameplay! Keep it up.
@maxmotion6371
@maxmotion6371 19 күн бұрын
Something I found recently is that you can plant grass as well and you can even plant it on tilled soil! so if you are willing to plant the grass instead of tilling you could plant all crops on tilled soil! Another thing that could help you with sunflowers is that you can 'measure()' a sunflower right after planting, this way you don't have to traverse the grid again just to measure the sunflowers!
@ExplosiveDisregard
@ExplosiveDisregard 20 күн бұрын
I know you aren't really a gaming channel, but there is a game with very prominent programming mechanics called "else heart.break()" that if a little janky felt really magical to me. It let's your character use an in game device to re program the world. There is a little bit of in game documentation but most of how you learn is by looking at the code of all the objects in the world and modifying or extrapolating from there. Never came across a playthrough where the player already had a grasp on programming. Would be cool to see if that sounds interesting. Really enjoying this series by the way.
@jack.hodkinson
@jack.hodkinson 20 күн бұрын
I'll look into it, thanks!
@Soken50
@Soken50 19 күн бұрын
I'm watching a few people playing this game at various levels of familiarity with programming/python and yours is by far my favourite let's play, you're not always doing the optimal solution but you explain what you're doing and why so well while working through the problems. I can't wait to see your fully automated farm run.
@McSwagical
@McSwagical 19 күн бұрын
Agree!! I’m learning how to be a better programmer by focusing on building utility before main logic
@asseenontv247
@asseenontv247 20 күн бұрын
I'm loving these! I really enjoyed the loger video for this one too!
@jack.hodkinson
@jack.hodkinson 20 күн бұрын
Thank you!
@chrisroberts1773
@chrisroberts1773 19 күн бұрын
I hope to see a "senior developer" write something for the maze that takes advantage of the treasure respawn mechanic (basically learn to solve the maze optimally in memory), but here's a very useful function to get started. Of course, it is written to use dictionaries, you have to solve a few mazes first for this to work. I'm excited to see how you bootstrap that too, I just did a random walk that avoided turning back on itself. movement_map = {None:[North,South,East,West],North:[West,North,East,South],West:[South,West,North,East],South:[East,South,West,North],East:[North,East,South,West]} def move_follow_wall(last_move,movement_map): for direction in movement_map[last_move]: if move(direction): return direction
@chrisroberts1773
@chrisroberts1773 17 күн бұрын
After seeing this video I laid awake for two nights, my brain spinning on a "real" maze solving algorithm instead of the wall-following method, hoping to get something awesome before Jack releases his, so I wouldn't feel like he spoiled it for me. And I got it. It's WICKED FAST, 50000 gold in 130 seconds. Can't wait to doll out hints on his next video.
@VINAGHOST
@VINAGHOST 19 күн бұрын
i think you misread the doc but you can count petal right after you plant, so no need for another just for counting petal
@РуменИвановАндреев
@РуменИвановАндреев 19 күн бұрын
Apart from measuring right after planting you can just plant the full grid and then after harvesting the sunflower with most petals plant a new one, measure it and add it to the list. After that its just going to the next one with most petals, but that means that after each harvest you have a full grid planted. That way the amount harvested is always maxed instead of going down with each harvest.
@smjonas8616
@smjonas8616 17 күн бұрын
Right, that's the best approach since the amount of energy you get is higher the more total sunflowers there are
@smjonas8616
@smjonas8616 17 күн бұрын
Right, that's the best approach since the amount of energy you get is higher the more total sunflowers there are
@Luinwe
@Luinwe 20 күн бұрын
I just realized that you can summit your pumpkin code into the sunflower code, sure yes refactoring for what needs too be a part of the pumpkin code. Just thought about just having you get a bigger pumpkin all the time really
@Warlord98
@Warlord98 17 күн бұрын
Sunflowers can be measured before fully grown so plant measure cuts out the extra traverse
@billy65bob
@billy65bob 17 күн бұрын
If you want to make the pumpkins super efficient, you need to water them and then babysit them until can_harvest is true before moving on. There's probably an argument to be made for babysitting an entire horizontal/vertical strip at a time before moving to the next.
@Hoovy42
@Hoovy42 19 күн бұрын
Can't you measure the sunflowers after you plant them rather than traverse again?
@jack.hodkinson
@jack.hodkinson 19 күн бұрын
Yes, good point
@Hoovy42
@Hoovy42 19 күн бұрын
@@jack.hodkinson although the overhead of traversing again isn't so high when you have to go back and forth to collect the sunflowers anyway. Since you're going more modular with the design perhaps that map inspection of state will be moved to a reusable module
@mentalyunstable2872
@mentalyunstable2872 19 күн бұрын
"No, uh, POWER_THRESHOLD_TO_PLANT_SUN...no MINIMUM_POWER" so relatable lol like, i want people to understand what this is for but I am not typing all that every time lol (Also, huge bonus points for the OSRS OST)
@harywilke
@harywilke 19 күн бұрын
Really enjoying this series. Learning quite a bit. My code looks primitive compared to yours. Looking forward to mazes and cacti.
@morphide3359
@morphide3359 19 күн бұрын
I've just started to learn coding, with a goal of becoming a dev in the near future. And even tho I find it hard to follow what you are doing, I do understand the logic behind it. I know I have a long way to go to get to your level, but just got to keep grinding. Thanks for such entertaining and informative vids. Keep it up!
@Johan-iw6mb
@Johan-iw6mb 16 күн бұрын
I´ve played this game quite alot and is waiting for the optimization stage which I need to step up. Thanks for showing a Senior Dev way of developing. 😛
@robin1489
@robin1489 19 күн бұрын
I loved the game I'm not an real programmer but my best automated run was like 1, 5 hours, the journey was amasming but my code doesn't looks so organized like yours.
@zakbenson5508
@zakbenson5508 19 күн бұрын
Man I am really loving this series. Enjoying seeing the way you assess problems and work through the solutions. As someone who enjoys programming on a beginner/hobbiest level it is really interesting to see the logic applied!
@joshuamostyn6046
@joshuamostyn6046 19 күн бұрын
I've just started learning how to code in python but the speed at which your problem solving is amazing but no one seems as shocked as me. Is being able to problem solve like this a norm at this level of coding?
@-Shibbi
@-Shibbi 19 күн бұрын
when you are done with this series, can you share the save file to us? I want to learn more because I'm still new in programming
@davyverbogt149
@davyverbogt149 19 күн бұрын
it might be worth while to use wattering or fertilizer when its waiting on the sun flowers growing. it could speed up the process
@replikvltyoutube3727
@replikvltyoutube3727 19 күн бұрын
Mazes are the most interesting part. Looking forward to it!
@RonPare
@RonPare 19 күн бұрын
Yeah I was waiting for your approach I did the force too. Acceot I just duplicated Carrots and made Pumpkin. My only difference. The Because we didn't have lists to see where the pumpkins died it voids the plot. So I just Clear() many time to unlock everything I could.
@RonPare
@RonPare 19 күн бұрын
Also water barrels take time to propagate water, That take time...
@RonPare
@RonPare 19 күн бұрын
please show a screen of the code at the end.
@tannermuro7756
@tannermuro7756 18 күн бұрын
You don’t need the conditional in traverse farm, you can just pass state in. If it’s None, then it was same as the default value anyways, and if not, then you are passing state in just as you wanted.
@jack.hodkinson
@jack.hodkinson 18 күн бұрын
I think you do because of the way number of arguments works in this language, but I’ll check next time I open the game - thanks
@brucea9099
@brucea9099 19 күн бұрын
list[::-1] works as reversed.
@jack.hodkinson
@jack.hodkinson 19 күн бұрын
Ooh yes, thanks!
@lucasnogueira7068
@lucasnogueira7068 19 күн бұрын
very nice, thanks for the video
@devanholmes724
@devanholmes724 19 күн бұрын
I NEED MORE!! I CANT GET ENOUGH!! I am by no means a Python developer, only JS, C#, SQL. But damn you make it so easy to understand
@Warlord98
@Warlord98 19 күн бұрын
Just a curious thing learning here but ... For a full field of pumpkins.. if pumpkins needed traverse plant run a check like you did with sunflowers
@g45h96
@g45h96 19 күн бұрын
Maaaaannnn. This is why I watch these things. I'm by no means a programmer (I mean, hell, I'm probably most well versed in vba, if that tells you anything),and have very little python experience. I was racking my brain trying to figure out how to do this because I couldn't use a 3D array. I had no idea you could make a list of lists. I ended up using a single list with the coordinate tuple as the key and petal count as the value, checked for the highest petal count (breaking early if I found a 15), and then harvested every flower with that petal count. Visually it looks very similar to yours, and all things considered it's pretty damn fast. But maaannn it too me hours to figure out. Honestly, didn't even know how to separate the information in a tuple when I started.
@lachlanmason3918
@lachlanmason3918 20 күн бұрын
0 VIEWS! FIRST!
@kingeddeh9327
@kingeddeh9327 19 күн бұрын
Im learning so much about programming principles and actually seeing the benefits of following them (like creating many functions is better than trying to make the code smaller/shorter looking), thank you for the video!
@notanotherjosh
@notanotherjosh 19 күн бұрын
Seeing someone who actually knows what they’re doing play this game for the first time is crazy. Definitely have learned a lot from this series
@andrefelipearaujo9245
@andrefelipearaujo9245 19 күн бұрын
Love from Brazil! How you do so much with so little is astonishing 😂😂
@oldnight5337
@oldnight5337 19 күн бұрын
I can't understand this position_tuple thing at all. Why is it there, and what does it do? Anyone can help?
@jack.hodkinson
@jack.hodkinson 19 күн бұрын
A tuple is like a fixed sized list. It's a way of carrying around multiple items in one variable. When we talk about positions, we're often going to want to refer to pairs of x and y coordinates. It's useful to be able to define a variable that contains both the x and y coordinate together, rather than needing two variables. So instead of this: x = 3 y = 4 you can create a tuple like this: position = (3, 4) and pass the position around in one go. When you eventually need to access the x coordinate, you do position[0], which gives you the value 3.
@jack.hodkinson
@jack.hodkinson 19 күн бұрын
For the move_to function, I decided that I would like to have options when I call it. Either I'm typing in literal values into my code (like `move_to(0, 0)`), or I'm passing in a variable (like the sunflower positions). In the first case, it's nice to be able to call `move_to(0, 0)` rather than needing to pack the position into a tuple (which would be `move_to((0, 0))`). For the second case, it's useful to pass in the tuple. But that's just for style points, it only saves a couple of characters when calling it.
@jack.hodkinson
@jack.hodkinson 19 күн бұрын
Finally, just to confuse matters, sometimes the brackets are optional when you define tuples. So you can actually write: position = 3, 4 Like we do in the return value for get_pos() More info here: docs.python.org/3/tutorial/datastructures.html#tuples-and-sequences
@oldnight5337
@oldnight5337 18 күн бұрын
@@jack.hodkinson Thank you for this explanation, now I seem to get it. Love your let's play. Hope you will continiue this series ^^
@Warlord98
@Warlord98 20 күн бұрын
This makes me wanna learn programming and game design
I hope this game never ends. | Nodebuster Part 2
56:14
Haelian
Рет қаралды 28 М.
I Programmed a DRONE to Farm EVERYTHING
28:47
InterndotGif
Рет қаралды 57 М.
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,5 МЛН
when you have plan B 😂
00:11
Andrey Grechka
Рет қаралды 67 МЛН
哈莉奎因怎么变骷髅了#小丑 #shorts
00:19
好人小丑
Рет қаралды 54 МЛН
Senior Dev Scales Farm Empire in Python
22:07
Jack Hodkinson
Рет қаралды 11 М.
100 Days of Modded Stardew Valley
1:13:53
Salmence
Рет қаралды 358 М.
How Optimizations made Mario 64 SLOWER
20:41
Kaze Emanuar
Рет қаралды 440 М.
Sunflowers are my BEST Python-Automated Crop
34:57
Olexa
Рет қаралды 32 М.
Factory Design Pattern in Java Explained in 3 Minutes
3:10
Jack Hodkinson
Рет қаралды 4,4 М.
The Farmer Was Replaced Pt.1
1:13:39
codeWonderland
Рет қаралды 1,7 М.
Making a d10 spinner
15:59
Attoparsec
Рет қаралды 238 М.
Engineering the PERFECT factory in Satisfactory!
23:13
Real Civil Engineer
Рет қаралды 345 М.
🍉😋 #shorts
00:24
Денис Кукояка
Рет қаралды 3,5 МЛН