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.
You all might have missed the part where he said he was rushing functions then later realized the resource commitment. He then decided to write some loops before unlocking functions. Notice how he threw away all his code when he got functions? He was going to do that regardless of how well factored or tooled up it was. So.....maybe he was showing off that senior dev knowledge by not writing extra code. When we write that in between code, we know we will further iterate over and refactor it because we couldn't show enough restraint not to write it in the first place....
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!
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
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.
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.
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.
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.
@@rendomstranger8698 NEVER read documentation, less reading = more coding
@@manfromaland less reading = more bugs and more time wasted on bug fixing.
@@rendomstranger8698 what are bugs
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
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!
This was an interesting watch, but I do wish you'd read the instructions all the way through
Thumbs up for describing your thinking so well. I play this game and did not think about passing functions. Time to refactor😊
24:50
Him:*not gonna use can_harvest*
Him also:types can_Harvest*
Nice work! Glad I found this channel
I love the RuneScape soundtrack. You got a sub just for that but I also love the gameplay
this makes want to programm again. So fun and colorful
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
I love the Runescape music in the background.
I was playing osrs while watching this and couldn't figure out why the theme was playing 😂
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.
You all might have missed the part where he said he was rushing functions then later realized the resource commitment. He then decided to write some loops before unlocking functions. Notice how he threw away all his code when he got functions? He was going to do that regardless of how well factored or tooled up it was. So.....maybe he was showing off that senior dev knowledge by not writing extra code. When we write that in between code, we know we will further iterate over and refactor it because we couldn't show enough restraint not to write it in the first place....
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
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.
22:42 you could use functions returning functions here.
Isnt that what he does at 25:47?
@@HannesMrg commented this when i resachedthe timestamp
Why am I suddenly nostalgic for Runescape🤣
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
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!
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
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
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.
You're not a senior dev neither a junior dev, you just a noob
Real dev hate using many while loop for nothing