Weekly devlogs: Rogue Legend 2
Get Rogue Legend 2
September 13 - How To Fish
Continue Reading in the Dev Forums >>
September 20 - How Fishing Works
Hello again! There are A LOT of fixes, tweaks, and new survival gameplay in this week. Far too many to cover, so check out the patch notes. I'll do a quick summary: sprains, painkillers, lettuce plant, ice cream, lakes, console commands, wind, clothes, snow, weather, and like a page's worth of bug fixes.
Instead, let's talk fishing, and how it was implemented. Fishing was one of the most complicated tool interactions so far and I ended up breaking it up into 3 components. The rod itself, the fishing bobber, and the fishing line.
I wanted to avoid adding a bunch of new variables to handle fishing since multiple players could fish on the same server at the same time, so I decided to piggyback onto my buffs and debuffs system. When you first use your fishing rod you gain the "cast line" debuff which counts up how long you have the button held down. Once released, it fires a line straight forward from your character based on their facing out to a certain distance based on the range of the rod and how long you held the button down. It then shoots another raycast straight down to find the terrain and checks if the point it hits is a water block. If it is, the debuff expires and you gain the fishing debuff. Why debuffs? Because you can remove buffs by right clicking, and I didn't want you to accidentally remove these.
We then add the fishing bobber to the point the raycast hit, which sits there and floats up and down occasionaly. It's linked to the player so it knows it's yours, and will be automatically cleaned up if anything makes you stop fishing.
I added a new behavior to fish that will check for nearby fishing bobbers and go investigate. A nibbling fish causes the bobber to bounce up and down.
While fishing you can press the button to pop the bobber back to the surface and reel it in, which causes it to move towards the player and check for valid water spots as it does. If it ever can't find one, you've reeled it in completely. When the bobber is bouncing from a nibbling fish, if you reel it in while it's below the surface of the water, that's a bite and you move to the "reeling it in" debuff.
The final component is the fishing line, attached from the rod to the bobber. This uses a simple line render with 3 basic points: The rod, the bobber, and the halfway point. I added a bezier curve script to smooth out the line render and create a nice curve from the rod to the bobber by dropping the halfway point down a bit. To simulate tension on the line while reeling, I turn off the curve when you're reeling in the bobber and add a lerp to Y position of the halfway point to smooth out the movement of the line so it looks like it's actually swaying about.
So you hooked the fish and need to reel it in, at this point it's relatively simple. I mark the fish as hooked and have it move with the bobber. It also tries to run away, so if you let up on the line it'll bolt and take the bobber with it. If it gets too far away, it gets away so it's a battle of stamina management. I wanted to use the actual fish NPC the whole time with minimal modifications instead of swapping it out for a fishing model, because part of the gameplay is about how everything interacts with each other. So while it's on your line that fish is still interactable. Someone else could come up and spear it to steal it from you, or maybe a bigger fish will want a snack. Anyway, once it's reeled in you've got the fish! I added a little model viewer thing so you can look at your catch, and its length is recorded in your journal.
Now you know how fishing is done. It's one of those things that seems relatively simple and straight-forward but becomes a lot more complicated once it needs to be implemented for a game. See you next week!
Continue Reading in the Dev Forums >>
September 28 - SCIENCE!
Hello! This week has repairing, research, and reSoupAndWind.
The Badges screen is now the Research screen where you perform SCIENCE on various components from around the world at your alchemy bench to unlock new recipes. The tree branches let you invest in farming, entrepeneurship, building, and combat. You'll start in the stone age and progress through the iron age, elemental age, and then industrial age unlocking greater technology as you go.
You can now repair your items at the Forge and Loom. If any of your tools, weapons, or armor get low on durability, then a quick patch job with the right material and they're good as new. Literally.
It's gettin windy out. If it gets TOO windy you'll get a chill, so warm up with some soup! A delicious broth of cactus leaves and mushrooms will leave you feeling warm and toasty in the wind or even in the arctic. If you need more layers, then wear more clothes. The equipment screen now shows the defense and temperature bonus of everything you're wearing, so bundle up.
Continue Reading in the Dev Forums >>
Check out Rogue Legend 2 or Patreon for automatic rewards!
Shout outs: Stacey, Adam Fowler, Amanda Kettles, Angelo Anderson, Appreciate Witch of Life, AstroLass, bilbens baggo, Brian Nunziato, Bryan Sheairs, Brysen Packer, Bryson Waits, Burlyfighter, Caitlin W., chris wilson, Christopher Allbritton, CJMAXP, Connor, Dalton Elliott, Damon Carrington, Daniel Edwards, Darrya Keshvari, David Schraff, Dragons With Jetpacks, Elisa Martinez, eric sun, Ezzela1891, Federica Frezza, Gordon Alexander Fallon, Gundar Wez, Iofire, Irate The Pirate, Ivee Quinn, Jade Arrowood, Jake Lane, Jeremiah Walker, Jess, Joe Dalby, John Nazario, JollyGamer, Jonathan Lekse, Jordan Brazeal, Josh Braden, Joshua David Maddox, Justin Snyder, Kerry Melton, Kevin, KFB_Patreon, KingHavok1217, Kingyo Senpai, Kyle Clark, Lisa Tucker, Liz Fontain, Lizzie, Lou Bliss, Luke P, Mario Pizzamiglio, Mark L, Matt Price, Matt Yates, Max Hops, Maxwell Mayer, Michael Hamilton, Millergendraft, mtnman1979@aol.com, Mx Charlie, Mylon Schroder, Nahellion, Nathan, Nicholas Zamora, Nick Soucy, Phil Mehl, Phillip P Torchia, Pythor Sen, R., Rachel Anderson, Ray Bissonnette, Remora Jewel, Robert Rich, Robert Skadsem, Ryan Flagg, SallySparrow132, Sarah Holland, Serafina Moon, Shane Andrews, ShortyMcgibble, Sik Makoyi, Siren, Stefan Gottschalk's, Steve Rosenlund, Stuart, Syn21, That Video Editor Nic, thea musing, Trev909, Vedie V, Vincent Drone, Warren Clarida, Wesley Muncy, XMrMonkyx ., Zachary Burgess-Hicks, zachary gee, Zealot23, Zee Livezey
Their contribution stands as a beacon of hope for all adventurers!

