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.
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%.
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!
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.
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
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.
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.
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.
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.
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
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!
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!
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!
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.
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.
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. 😛
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.
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)?
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.
"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)
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.
@@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
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?
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.
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.
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
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.
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%.
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!
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.
Agree!! I’m learning how to be a better programmer by focusing on building utility before main logic
Still waiting for the next part , hope you're doing good, you've been a great help in learning to code
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
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.
I'm loving these! I really enjoyed the loger video for this one too!
Thank you!
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.
I'll look into it, thanks!
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.
Right, that's the best approach since the amount of energy you get is higher the more total sunflowers there are
Right, that's the best approach since the amount of energy you get is higher the more total sunflowers there are
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.
@@robertstoner6200 Since the probability to get a new sunflower with max petals isnt 100% I still think its better this way
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
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!
Need more episodes!
You have that
public void main(String[] args) energy. Way better than main char energy…
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!
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
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!
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.
Hey I just wanna say I hope you continue this series.
Love from Brazil!
How you do so much with so little is astonishing 😂😂
Sunflowers can be measured before fully grown so plant measure cuts out the extra traverse
Can't wait for more
i think you misread the doc but you can count petal right after you plant, so no need for another just for counting petal
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.
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. 😛
Mazes are the most interesting part. Looking forward to it!
Love this
very nice, thanks for the video
Really enjoying this series. Learning quite a bit. My code looks primitive compared to yours. Looking forward to mazes and cacti.
it might be worth while to use wattering or fertilizer when its waiting on the sun flowers growing. it could speed up the process
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.
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
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)?
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.
Also water barrels take time to propagate water, That take time...
please show a screen of the code at the end.
"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)
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.
this video went from difficulty 6 to 100 very fast.
Can't you measure the sunflowers after you plant them rather than traverse again?
Yes, good point
@@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
list[::-1] works as reversed.
Ooh yes, thanks!
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
This makes me wanna learn programming and game design
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
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?
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
chop chop carrot boy
next episode pls 🥕
I can't understand this position_tuple thing at all. Why is it there, and what does it do? Anyone can help?
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.
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.
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
@@jack.hodkinson Thank you for this explanation, now I seem to get it. Love your let's play. Hope you will continiue this series ^^
0 VIEWS! FIRST!