Engineering the Perfect Python Farm (I took it too far)

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 พ.ย. 2024

ความคิดเห็น • 55

  • @limeboat
    @limeboat หลายเดือนก่อน +7

    You can tell this is a real developer! Skimming through documents and going at it, missing minor things like wrapping around edges ;)

  • @ar_chbtw
    @ar_chbtw 2 หลายเดือนก่อน +49

    Movement wraps around on edges which is faster than moving south manually i think.

    • @Ben_R4mZ
      @Ben_R4mZ หลายเดือนก่อน +6

      Definitely a minor oversight.
      But understandable since he's viewing it from an higher experience level when it comes to programming.
      Why read the tutorial for a move() command when you program for a living?

    • @rendomstranger8698
      @rendomstranger8698 หลายเดือนก่อน +18

      @@Ben_R4mZ To answer your rhetorical question, because reading it allows you to properly understand how a function works.
      Never assume you know how a function works that you haven't written yourself.

  • @knuffidimi1086
    @knuffidimi1086 หลายเดือนก่อน +5

    My Friend told me to watch this video after I started my new job as programmer. What i rly love about this video is the fact how easy it is to follow along. Keep it pls up!

    • @jack.hodkinson
      @jack.hodkinson  หลายเดือนก่อน +3

      Your friend is a legend

  • @diogo24m
    @diogo24m 2 หลายเดือนก่อน +24

    If you plant right after harvesting, you dont have to loop twice and you end up not waiting so long to harvest

  • @Orblets
    @Orblets หลายเดือนก่อน +12

    This was an interesting watch, but I do wish you'd read the instructions all the way through

  • @candybluebird
    @candybluebird หลายเดือนก่อน +2

    Other people have mentioned planting after harvesting, but I'd also like to share the idea of buying seeds instead of flipping while harvesting carrots. Like flipping, trading gives time for the carrot to grow, but it also reduces the amount of buying you need to do at the start of each cycle, giving you an overall decrease in the time per cycle

  • @KerboOnYT
    @KerboOnYT 2 หลายเดือนก่อน +7

    It was interesting to see your approach. Thanks for the video

  • @AureliusAurelius
    @AureliusAurelius 2 หลายเดือนก่อน +15

    We need an episode 2!

    • @jack.hodkinson
      @jack.hodkinson  2 หลายเดือนก่อน +2

      Episode 2 out later today!

  • @dropjesijs
    @dropjesijs 2 หลายเดือนก่อน +8

    Thumbs up for describing your thinking so well. I play this game and did not think about passing functions. Time to refactor😊

  • @edwinboon9574
    @edwinboon9574 หลายเดือนก่อน +1

    Nice work! Glad I found this channel

  • @IndonesiaEmpire5
    @IndonesiaEmpire5 3 วันที่ผ่านมา

    24:50
    Him:*not gonna use can_harvest*
    Him also:types can_Harvest*

  • @penta4568
    @penta4568 หลายเดือนก่อน +3

    I love the RuneScape soundtrack. You got a sub just for that but I also love the gameplay

  • @rob_boss420
    @rob_boss420 2 หลายเดือนก่อน

    Amazing and insightful videos!!! Hope you plan on macking another. I've got to see how you make the farm harvest multiple crops at once.

  • @luisdss
    @luisdss หลายเดือนก่อน

    Honestly as a CS student once you got functions I was left amused, awesome stuff I’ll have to play around with the game myself

  • @DenerWitt
    @DenerWitt หลายเดือนก่อน

    this makes want to programm again. So fun and colorful

  • @itssandman2u
    @itssandman2u หลายเดือนก่อน +7

    ngl, before you had access to functions, your code was garbage. That said, your senior dev title was much more apparent as soon as you got those functions.

    • @D.S69
      @D.S69 หลายเดือนก่อน +3

      before functions it was painful to watch

    • @Patchumz
      @Patchumz 5 วันที่ผ่านมา

      Actual suffering pre-functions lol. Especially because he was leaving entire tools on the table like senses for the longest time.

  • @AllHailMafakas
    @AllHailMafakas หลายเดือนก่อน

    I love the Runescape music in the background.

  • @Ben_R4mZ
    @Ben_R4mZ หลายเดือนก่อน +3

    The skill ceiling on this game is way higher than I was expecting.
    I feel like you need a degree in python just to unlock everything, let alone build a massive, auto expanding farm.

    • @OfficialSlippedHalo
      @OfficialSlippedHalo หลายเดือนก่อน +3

      The skill ceiling is high, but barrier to entry is fairly low actually. Im sure a lot of what he was doing is very complicated to some, but you can take the way he was originally doing things probably to the end if thats your skill level.

    • @jack.hodkinson
      @jack.hodkinson  หลายเดือนก่อน +4

      Agreed! The game is a really nice playground that can accommodate a wide range of skill levels. I have fun by architecting systems like this, but it’s by no means required in order to enjoy the game, and some may say it’s even overcomplicating things. But the fact is, it’s a game, and this is the way that I have fun!

  • @AlexandrePansan
    @AlexandrePansan หลายเดือนก่อน

    Man.. this Background music reminds me of Old Runescape :D

  • @the_xyzt_eht
    @the_xyzt_eht หลายเดือนก่อน +12

    I don't know. I guess I was expecting something more from a "senior developer" than just a callback functions. Meh.

    • @bimdev
      @bimdev หลายเดือนก่อน +10

      And maybe read documentation first! Not knowing tile edges loop around or that you need to till before planting carrots...
      Also, even before getting functions, could have done nested while loops.

    • @Patchumz
      @Patchumz 5 วันที่ผ่านมา +1

      @@bimdev This is peak developer. Not reading documentation and writing shit code that someone else has to deal with lol.

  • @Rouverius
    @Rouverius หลายเดือนก่อน

    Why am I suddenly nostalgic for Runescape🤣

  • @HannesMrg
    @HannesMrg หลายเดือนก่อน +1

    What is the advantage of the Create functions?
    Instead of calling traverse_farm(create_planting_function(Entities.Bush))
    Couldnt you just use
    traverse_farm(plant(Entities.bush))?
    Or is that the work around for what didnt work with the lambda at 22:00?

    • @joshuacleverley3929
      @joshuacleverley3929 หลายเดือนก่อน +2

      putting the parenthesis after a function name calls the function, so here it would run the plant function then pass the return of that into the traverse_farm function rather than the function itself. The create_planting_function returns a function, which is then passed to the traverse_farm function and called there so that it can be called for each tile of the farm

    • @HannesMrg
      @HannesMrg หลายเดือนก่อน

      @@joshuacleverley3929 ooh, thanks! Now i got it =)
      For all the things that are more complex in c than in python, this seems to be one thing that is easier in c. You just pass a pointer to a function, without any additional 'create' functions.

    • @jack.hodkinson
      @jack.hodkinson  หลายเดือนก่อน +2

      In real python you could use a lambda for this, but it would still be more painful than C or Java, since Python lambda syntax is verbose and limited. I agree that this is something C-like languages do better.

  • @goldenoreo9171
    @goldenoreo9171 หลายเดือนก่อน

    Instead of
    while not canHarvest():
    do_a_flip
    would it be fine to do
    while canHarvest():
    harvest()
    move()
    ie incorporate moving onward into the harvest function so it doesnt move until it harvests, without potentially wasting slight bits of time each harvest by flipping which might take more time than the plant needs to finish growing?

    • @jack.hodkinson
      @jack.hodkinson  หลายเดือนก่อน +2

      It's the right idea, we address this in the next video!

    • @goldenoreo9171
      @goldenoreo9171 หลายเดือนก่อน

      ​@Jack_Hodkinson nice to know I'm on the right trail! Love the video man, looking forward to watching the next

  • @ar_chbtw
    @ar_chbtw 2 หลายเดือนก่อน

    22:42 you could use functions returning functions here.

    • @HannesMrg
      @HannesMrg หลายเดือนก่อน

      Isnt that what he does at 25:47?

    • @ar_chbtw
      @ar_chbtw หลายเดือนก่อน

      @@HannesMrg commented this when i resachedthe timestamp

  • @Deagin
    @Deagin หลายเดือนก่อน

    as someone with very little coding experience would it be reasonable to play this game and try to learn some stuff or am i better off doing something else

    • @jack.hodkinson
      @jack.hodkinson  หลายเดือนก่อน

      This is a fantastic game to start learning programming!

  • @vladtudorache2483
    @vladtudorache2483 2 หลายเดือนก่อน +2

    Do you know a game that use Java? or Java is not a good choice for this type of game?

    • @Ryndae-l
      @Ryndae-l 2 หลายเดือนก่อน

      You've got Robocode (real java) and Colobot (java-ish)

    • @sky0kast0
      @sky0kast0 หลายเดือนก่อน +2

      I do have a game that deals with JavaScript but it's called bitburner.

    • @awesome.rats159
      @awesome.rats159 หลายเดือนก่อน

      @@sky0kast0 Java and Javascript are different

    • @awesome.rats159
      @awesome.rats159 หลายเดือนก่อน

      Java isn't a great choice for this type of game, because it has a lot of overhead. For example, in order to run any code you would need to have unlocked classes and methods in order to have a main method. Another good reason to use python is because it has primitive types for lists, sets, and dictionaries, which means new programmers don't need to worry about how to create these types themselves.

    • @replikvltyoutube3727
      @replikvltyoutube3727 หลายเดือนก่อน

      There isn't such a thing in java I believe. But you could play with it using Green foot or BlueJ

  • @Soken50
    @Soken50 2 หลายเดือนก่อน

    Why do you not simply keep moving in the same direction to wrap around to the opposite edge rather than backtrack the entire length of the farm ? That's a lot of wasted cycles when you can move from diagonally opposite corners of the farm in 2 moves instead of 2*world_size moves.
    Also, how often do you plan to upload this series? Thoroughly enjoyed the first episode.

    • @jack.hodkinson
      @jack.hodkinson  2 หลายเดือนก่อน +2

      Thanks! I discover that the grid wraps around at 15:30 and start making use of this after that. Before then, I assumed that the grid worked more like the physical world. There are probably still more efficiencies to be had, though. Thanks for pointing this out.
      Hopefully should have another episode out this week or the next.

    • @Soken50
      @Soken50 2 หลายเดือนก่อน

      ​@@jack.hodkinson Ooh, I didn't catch that.
      Great, I'll be patiently waiting then :D

    • @Gatrehs
      @Gatrehs หลายเดือนก่อน +1

      @@jack.hodkinson This is what happens when you don't read documentation lol.

    • @jack.hodkinson
      @jack.hodkinson  หลายเดือนก่อน +1

      @@Gatrehs guilty

  • @ShabbySatyr-de1fw
    @ShabbySatyr-de1fw หลายเดือนก่อน

    You're not a senior dev neither a junior dev, you just a noob
    Real dev hate using many while loop for nothing