Sunflowers Completely Transformed My Automated Farm

Поделиться
HTML-код
  • Опубликовано: 25 ноя 2024

Комментарии • 62

  • @jack.hodkinson
    @jack.hodkinson  2 месяца назад +34

    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.

  • @sphinctor1208
    @sphinctor1208 27 дней назад +8

    Sittning here like an abstinenced junkie when I now realized that you haven't yet released the next part of this series... Please hurry, I love to follow your coding logic with this game, learning so much. Awesome videos and commentary man, 100%.

  • @maxmotion6371
    @maxmotion6371 2 месяца назад +14

    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!

  • @Soken50
    @Soken50 2 месяца назад +6

    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 2 месяца назад

      Agree!! I’m learning how to be a better programmer by focusing on building utility before main logic

  • @asseenontv247
    @asseenontv247 2 месяца назад +7

    I'm loving these! I really enjoyed the loger video for this one too!

  • @XBOkiXD
    @XBOkiXD 26 дней назад +1

    Still waiting for the next part , hope you're doing good, you've been a great help in learning to code

  • @chrisroberts1773
    @chrisroberts1773 2 месяца назад +5

    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 2 месяца назад

      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.

  • @РуменИвановАндреев
    @РуменИвановАндреев 2 месяца назад +4

    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 2 месяца назад

      Right, that's the best approach since the amount of energy you get is higher the more total sunflowers there are

    • @smjonas8616
      @smjonas8616 2 месяца назад

      Right, that's the best approach since the amount of energy you get is higher the more total sunflowers there are

    • @robertstoner6200
      @robertstoner6200 18 дней назад

      This looks like it could be faster if you have fertilizer to use on newly planted sunflowers otherwise it would be slower I think. Let say you plant the farm and harvest all the ones with 15 petals and only the last one came back as 15 petals you will have to wait for it to grow to harvest it and in that time you could have harvested the entire farm and started to replant giving a higher return on the energy than the one plant.

    • @РуменИвановАндреев
      @РуменИвановАндреев 18 дней назад

      @@robertstoner6200 Since the probability to get a new sunflower with max petals isnt 100% I still think its better this way

  • @ExplosiveDisregard
    @ExplosiveDisregard 2 месяца назад +9

    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.

  • @zakbenson5508
    @zakbenson5508 2 месяца назад

    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!

  • @billy65bob
    @billy65bob 2 месяца назад +1

    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.

  • @Luinwe
    @Luinwe 2 месяца назад +3

    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 2 месяца назад +2

    Sunflowers can be measured before fully grown so plant measure cuts out the extra traverse

  • @kingeddeh9327
    @kingeddeh9327 2 месяца назад

    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!

  • @devanholmes724
    @devanholmes724 2 месяца назад

    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

  • @morphide3359
    @morphide3359 2 месяца назад

    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!

  • @Zwaydi
    @Zwaydi 26 дней назад

    Need more episodes!
    You have that
    public void main(String[] args) energy. Way better than main char energy…

  • @joshgreen4524
    @joshgreen4524 6 дней назад

    Hey I just wanna say I hope you continue this series.

  • @Johan-iw6mb
    @Johan-iw6mb 2 месяца назад

    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. 😛

  • @VINAGHOST
    @VINAGHOST 2 месяца назад +3

    i think you misread the doc but you can count petal right after you plant, so no need for another just for counting petal

  • @nirmithra1
    @nirmithra1 12 дней назад

    Can't wait for more

  • @andrefelipearaujo9245
    @andrefelipearaujo9245 2 месяца назад

    Love from Brazil!
    How you do so much with so little is astonishing 😂😂

  • @replikvltyoutube3727
    @replikvltyoutube3727 2 месяца назад

    Mazes are the most interesting part. Looking forward to it!

  • @g45h96
    @g45h96 2 месяца назад

    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.

  • @lucasnogueira7068
    @lucasnogueira7068 2 месяца назад

    very nice, thanks for the video

  • @TheOpopoplo
    @TheOpopoplo 11 часов назад

    Love this

  • @davyverbogt149
    @davyverbogt149 2 месяца назад

    it might be worth while to use wattering or fertilizer when its waiting on the sun flowers growing. it could speed up the process

  • @mentalyunstable2872
    @mentalyunstable2872 2 месяца назад

    "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)

  • @AIvins
    @AIvins 15 дней назад

    this video went from difficulty 6 to 100 very fast.

  • @tannermuro7756
    @tannermuro7756 2 месяца назад

    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  2 месяца назад +1

      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

  • @Hoovy42
    @Hoovy42 2 месяца назад +2

    Can't you measure the sunflowers after you plant them rather than traverse again?

    • @jack.hodkinson
      @jack.hodkinson  2 месяца назад

      Yes, good point

    • @Hoovy42
      @Hoovy42 2 месяца назад

      @@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

  • @notanotherjosh
    @notanotherjosh 2 месяца назад

    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

  • @Warlord98
    @Warlord98 2 месяца назад

    This makes me wanna learn programming and game design

  • @brucea9099
    @brucea9099 2 месяца назад +2

    list[::-1] works as reversed.

  • @robertstoner6200
    @robertstoner6200 18 дней назад

    First off Tank You for the videos. It has been interesting to see how you go about solving the problems vs how I went about it as a non programmer. I got this game for my son who has showed some interest in coding and thought it would be a fun way for him to learn instead of just staring at lines of code. When I watched your first video I was like ok a K.I.S.S. then refactor approach this will be a good video for getting the toes wet. Then POW curve ball out of not where LAMBDA LOL. I did have a question for you. In the traverse farm function you are doing the for i in range(get_world_size()) and for j in range(get_world_size()) then you use get_pos_x() and get_pos_y() but with the structure you have i = x axis cord and j = y axis cord. You use Move_to_origin () before you start your loop could you not put your move_to(i,j) inside the j loop at the top and it would move you to 0, 0 at the start of the loop and then move you across the farm as it loops the remove the move(North) and move(East)?

  • @harywilke
    @harywilke 2 месяца назад

    Really enjoying this series. Learning quite a bit. My code looks primitive compared to yours. Looking forward to mazes and cacti.

  • @robin1489
    @robin1489 2 месяца назад

    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.

  • @Warlord98
    @Warlord98 2 месяца назад

    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

  • @RonPare
    @RonPare 2 месяца назад

    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 2 месяца назад

      Also water barrels take time to propagate water, That take time...

    • @RonPare
      @RonPare 2 месяца назад

      please show a screen of the code at the end.

  • @joshuamostyn6046
    @joshuamostyn6046 2 месяца назад

    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?

  • @jaycube5
    @jaycube5 5 дней назад

    chop chop carrot boy
    next episode pls 🥕

  • @-Shibbi
    @-Shibbi 2 месяца назад

    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

  • @oldnight5337
    @oldnight5337 2 месяца назад

    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  2 месяца назад +1

      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  2 месяца назад +1

      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  2 месяца назад +1

      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 2 месяца назад

      @@jack.hodkinson Thank you for this explanation, now I seem to get it. Love your let's play. Hope you will continiue this series ^^

  • @lachlanmason3918
    @lachlanmason3918 2 месяца назад +1

    0 VIEWS! FIRST!