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?
@@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.
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!
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
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.
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.
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.
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!
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.
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?
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
@@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.
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.
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?
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
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.
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.
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.
You can tell this is a real developer! Skimming through documents and going at it, missing minor things like wrapping around edges ;)
Movement wraps around on edges which is faster than moving south manually i think.
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?
@@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.
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!
Your friend is a legend
If you plant right after harvesting, you dont have to loop twice and you end up not waiting so long to harvest
This was an interesting watch, but I do wish you'd read the instructions all the way through
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
It was interesting to see your approach. Thanks for the video
We need an episode 2!
Episode 2 out later today!
Thumbs up for describing your thinking so well. I play this game and did not think about passing functions. Time to refactor😊
Nice work! Glad I found this channel
24:50
Him:*not gonna use can_harvest*
Him also:types can_Harvest*
I love the RuneScape soundtrack. You got a sub just for that but I also love the gameplay
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.
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
this makes want to programm again. So fun and colorful
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.
before functions it was painful to watch
Actual suffering pre-functions lol. Especially because he was leaving entire tools on the table like senses for the longest time.
I love the Runescape music in the background.
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.
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.
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!
Man.. this Background music reminds me of Old Runescape :D
I don't know. I guess I was expecting something more from a "senior developer" than just a callback functions. Meh.
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.
@@bimdev This is peak developer. Not reading documentation and writing shit code that someone else has to deal with lol.
Why am I suddenly nostalgic for Runescape🤣
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?
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
@@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.
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.
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?
It's the right idea, we address this in the next video!
@Jack_Hodkinson nice to know I'm on the right trail! Love the video man, looking forward to watching the next
22:42 you could use functions returning functions here.
Isnt that what he does at 25:47?
@@HannesMrg commented this when i resachedthe timestamp
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
This is a fantastic game to start learning programming!
Do you know a game that use Java? or Java is not a good choice for this type of game?
You've got Robocode (real java) and Colobot (java-ish)
I do have a game that deals with JavaScript but it's called bitburner.
@@sky0kast0 Java and Javascript are different
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.
There isn't such a thing in java I believe. But you could play with it using Green foot or BlueJ
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.
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.
@@jack.hodkinson Ooh, I didn't catch that.
Great, I'll be patiently waiting then :D
@@jack.hodkinson This is what happens when you don't read documentation lol.
@@Gatrehs guilty
You're not a senior dev neither a junior dev, you just a noob
Real dev hate using many while loop for nothing