Generating an Ocean for the Player to Sail!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everyone thanks for joining me for another devlog for dauphin it's certainly been a while since you've heard from me so i appreciate your patience over the past few weeks but it hasn't been without good reason at the start of last month we packed up and said goodbye to our lovely little apartment in the city and moved into our very first home it's definitely bittersweet that old apartment was freezing cold in the winter and brutally hot in the summer and we found ourselves sharing some attic space with squirrels from time to time but it was the birthplace of dev duck and was just a really cozy space to both work from home work on personal projects and relax this devlog marks the start of a new chapter for me new home new office and even a few new friends in the aquarium and i couldn't be more excited of course one thing that hasn't changed in the last month is my to-do list for dauphin as you can imagine i've been pretty busy with the house but i did actually manage to make some changes to my sailboat artwork based on the great feedback from the comments of my last devlog and from my patrons you may recall that we finished up the last devlog by allowing the player to pilot the research vessel on the open ocean basically meaning you could accelerate and decelerate and also steer in all the directions the only problem is i only have artwork for four of those cardinal directions so it doesn't actually look very nice when the boat turns and this is what i kind of got stuck on in the last episode because i've got so much detail on the paneling of the boat it really was making it difficult for me not only to create the sprites you see here but even think about creating diagonal sprites to help make this transition between directions look a bit smoother a lot of y'all seem to agree with me in the comments that we did need those diagonal sprites to make turning the boat look a lot better so my compromise was going to be to try to go into my boat artwork here and modify it to remove at least some of the paneling on the side of the boat and maybe on the cabin here just to make this sprite easier to draw at those diagonal angles and ultimately remove some of those diagonal lines from all the paneling many many hours of staring at pixel art later this is our new research vessel and if you're looking at this thinking oh he tried to make this easier on himself by removing paneling from the sides of the boat and the cabin but he really just made it more difficult by adding sails you'd be exactly correct despite the net gain of zero trying to make this thing easier to draw i really feel that a sailboat is a better fit for dauphin i think it fits the theme better to be reliant on the wind rather than some kind of motor and i also just think it's really aesthetic and i even had some people on twitter suggest cool customizations like being able to change the color or the logo on your sale which i think is awesome so i ultimately ended up making this thing harder to draw in the eight directions that i wanted and just grinding through it and i'm really glad i did because i learned a whole lot about perspective here and it was honestly a major accomplishment for me to be able to complete these sprites so we'll go ahead and just jump through them real quick this is now the sprite for the docked research vessel with the sails folded up and port side actually on the left which i think is correct based on my very rudimentary understanding of boats now of course we'll step through to the east facing boat and then we'll start rotating counter-clockwise here with a sprite facing to the northeast the north northwest west southwest south and southeast so you can see we now have these kind of intermediate diagonal directions which i've drawn to the best of my ability i'm sure they still need tweaking but overall i'm super happy with how this looks with all that artwork wrapped up my next task will be to export it all from a sprite and import it into godot where i can hook it up with my existing systems for boarding and captaining the research vessel it's just going on eight o'clock here on wednesday morning i've just got an hour before work so i'll do my best and catch up once i have some progress all right back with a quick update here at 8 45 probably the last update of the morning before work and i have managed to replace all the artwork for the docked version of the research vessel which is what we're looking at here this was a little bit more tricky than i anticipated because i had to redraw all of these colliders that you see here and also i had to change some parameters for the transition to the interior of the research vessel but that's all worked out now we can go ahead and run the game and we appear on our island and you can see the docked sailboat here just off the sand i think this looks so cool i love the way it looks with these sails rolled up but anyway we can board this just as before you can see the player kind of passes underneath the sail not a perfect perspective right now but close enough i think and of course we can still enter the sail boats and head to our navigation table to pull up the c chart all right time to head off to work for the day great progress this morning though next step should be hooking up the rest of that eight directional artwork to the actual process of sailing itself and then the fun part designing the system that allows us to board the sailboat from an island choose a new location on the c chart and then enter the open ocean and sail towards that destination i'll catch up soon [Music] good morning everyone it is a cold and crisp friday morning over here just after 6 30. just grabbed a hot cup of coffee and i'm hoping to get about two hours of development time in before work this morning but before i start i want to give you guys a quick update [Music] the first thing to note is that i've gone ahead and plugged my new sprites into my sailing scene here so if we go ahead and get moving in the boat you can see as we turn a full 360 degrees that we actually use eight sprites instead of four now and i think i need to work on the positioning of these sprites just a little bit but overall i think this looks so much better and was definitely worth the effort of creating those extra sprites so i'm really happy with that as a side note if you're wondering how i'm actually changing the sprites of the boat as it's traveling i'm certainly not doing it manually that would be a little bit of a pain instead i'm taking advantage of the godot animation tree node and inside this animation tree i am using a blend space 2d what we're looking at here is basically just a graph with x and y axes and in my case the values within this graph represent a normalized direction in which the boat is traveling so for example if the boat is traveling directly to the east i'll pass in a vector with an x value of 1 and a y value of 0 to signify that we are moving to the right on that graph that value maps to this particular point over here on the right side and each of these points you see around the outside of the shape map to an individual animation so this rightmost point here actually maps to the animation where the boat is traveling east as you can see i have eight points around the edges of this shape to represent all eight of my animations or directions in which the boat can travel and to just give you a little demo here we can switch to this little mode here on the toolbar and drag around this crosshair and you can see that as i move around the graph the boat itself is actually performing the rotations that i'd expect it to as it's traveling in the different directions all right so after i finished up those animations i started putting some thoughts into the system for setting sail from an island and this is actually going to be really important this is like the foundational glue that's going to allow us to explore the world of dauphin i'll start out with my general idea for what this process could look like but i'd love to hear your feedback or just completely different ideas down in the comments so please let me know with that we'll go ahead and jump onto the boat here and enter the cabin and as you know we can interact with the table here to pull up our c chart at this point my thoughts are that the player can select an island that they've already been to a new island that they haven't explored yet or even just a random location on the map where they think there could be an island based on a clue they've found in the world or a conversation with an npc when the player sets a waypoint in this way my intent is to place some kind of arrow or indicator on the sailing scene to help the player guide the boat in the general direction of that waypoint but more on that later now i think it's important to note that i want interaction with this c chart to be completely optional if the player just wants to hop into the sailboat and aimlessly explore the open ocean i want them to be able to do that what that means is that we need a way to transition to that sailing scene without actually interacting with this piece of ui so if i dismiss that and we head back to the exterior of the boat you'll notice that next to our anchor here i now have this sort of green cleat thing that's attaching it to the boat my thought is that this will be a new interaction point that the player can interact with to actually transition to that sailing scene regardless of whether or not they've chosen a waypoint from the c chart that interaction with the anchor is what i'm gonna try to knock out this morning again i'd love to hear your thoughts about all this down in the comments in the meantime i'm going to grab some coffee and go heads down and catch up once i have some progress [Music] welcome back everyone to monday morning just after 7 a.m i know we've managed to fast forward ourselves through an entire weekend here but that's okay i was hoping to get one more update out before my parents came into town for a quick visit of the new home but unsurprisingly we just got totally tied up with projects and unpacking and all that stuff so not a lot of time for dev but that's all right i do have one small update i can show you before we jump back in this morning in my previous update last week i finally set out to create the in-game transition for the player from exploring the island to actually sailing the open ocean and i'm happy to say i managed to knock that out so if we go ahead and board the research vessel here and head over towards the anchor we'll have yet another interaction prompt and i'll probably change this to be something other than the little screwdriver here but for now if we press the interaction key we will see a similar dialog to what we saw a few dev logs back do we want to haul up the anchor and set sail if we choose yes we'll also see a similar animation to what we had before where it kind of zooms out from the player gives a bigger view of the island we're leaving and then it will perform a fading transition to the open ocean at which point you have control over the sailboat and you can start to sail the problem is once you're on the open ocean there's currently nowhere to sail and that's kind of a big problem for this game so for that we'll start by heading over to the whiteboard what i'm showing you here is not a very fleshed out idea but i still wanted to show you how i was thinking about approaching this problem and hopefully get some feedback from those of you in the comments who have solved for this before my basic dilemma is that i want to create a large world for the player to explore but i want that world to be easy for me to initially create and to expand and to modify if i build it all to scale in the game it's going to be really hard for me to go back and individually change the placement of individual islands and add new islands because it's just going to be a really big map so my thought for how to solve that is to create a key tile map that is a very very small scaled down version of the world that will ultimately be rendered for the player to explore each individual tile in this key tile map will represent kind of a single sector in the ocean and the type of tile that i choose to place in any individual square will represent what the player will encounter when they visit that sector of the ocean for example a very common type of tile will just be one that represents open ocean but i'll also have tiles that represent certain islands either handmade or randomly generated perhaps dive spots or encounters with sea life shipwrecks whatever type of content i want to add to the world for the player to explore i can create a type of tile that represents that to add to the key tile map once i have a prototype key tile map in place i'll have to create the world generator which is really just a big parser that takes the key tile map as an input and as an output creates the world which is going to be a scene with a much larger tile map that the engine will actually render for the player to explore there's going to be a couple interesting problems to solve here the first of which in my mind is loading because this is going to end up being a really big scene i don't think we want to or know if it'll even be possible to just dump the entire thing into memory for the player to explore instead what i think we'll want to do is lazily load chunks of that world as the player sails across it i am not quite sure how i'm going to do that yet but i'm very excited to find out all right i think i've rambled on enough here that's the basic idea i'd love to hear what you guys think down in the comments it is eight o'clock now i've got about an hour before work so i'm gonna get a refill of my coffee and jump straight into the key tile map [Music] hey folks it's not wednesday morning going on 7 am i have a lot of work i want to knock out this morning but over the past few days i have made considerable progress on the world generation system so i figured it was time for a quick update if we take a look back to my little road map on the whiteboard you'll recall that my first step in this process was to create the world key tile map and that's what we're looking at here and this is basically a grid that represents the entire world that will be rendered in dauphin now i didn't end up using a tile map here because i needed each of these individual cells or markers to be able to be scriptable and contain their own data and to my knowledge i could not do that with individual tiles in a tile map so really what we have here is just a scene that is a node containing a bunch of other node 2ds arranged in a grid right now i have each of these cells configured to represent a 1600 by 1600 pixel sector in the game and right now each of these cells is configurable to represent whatever data or scenes i want loaded into that particular sector right now this world key just represents a world that is all open ocean but we want to be able to quickly add islands to the world and change their position so to do that we can select a marker say up here in the top left corner and head over to the inspector where we can change the marker type from ocean to island and then import a scene to load and it's just going to be a resource path to the island that we've been working on over the past few devlogs as you'll see this square has turned green and because we have a scene to load filled out for it when the player actually visits that sector in the research vessel that island should load and be viewable by the player finally where this all gets glued together is the world scene which as you can see looks pretty empty with the exception of the research vessel and the world key which does have to be part of the scene tree so that my world generator script can actually look at it and decide how to parse it and lay out the world my world generator script here is only about 100 lines long and i'll probably go into more detail about it once i've cleaned it up a bit but for now the gist is that it asynchronously builds the sectors of the world based on the current sector that the player is exploring in the research vessel so if we go back to our 2d scene here and take a look at the key you can imagine that if the player is exploring this green sector here the world generator will only load that sector and the adjacent ones around the outside and if the player decides to move to the sector to the right these far left sectors that were previously loaded will be freed from memory and some new sectors to the right will be loaded so the only sectors that are ever in memory are the ones surrounding the player just to be a little bit kinder to your machine and your resources and as i mentioned before all this work is being done on a separate thread so that as you're sailing you never hit any weird break points or stutters or loading screens as the world around you is being dynamically built alright with all the rambling out of the way i think it's finally time for a demo so what i'm going to do is hit play scene here on the world scene which looks very empty in the editor but once i do hit play you'll see my asynchronous loading code in action as it goes all the way around the boat loading the sectors that surround it once everything's loaded up we can go ahead and use wasd to control the sailboat at which point i'll start heading towards the southeast which is where we laid out our first island and hopefully after a moment or so of sailing we'll find it and here we are right on time and as you can see it's basically the exact same island that we've been exploring as the player made a few changes to remove the camera that was part of that scene as well as the docked research vessel but apart from that i was able to just instance it right into this scene as you would any other which is just really cool you can even see all the crabs walking around there this is really awesome progress on the world generator but there is still so much work to do right now the world knows where each of the individual islands should be but the islands themselves don't know where they are in the world so when you disembark from an island to go sailing there's really no notion of where the research vessel should load into the world and similarly as you're sailing and you approach an island there's no way to dock the vessel and begin exploring so those are things i'm going to work on next and by next i'm afraid that'll mean the next devlog since we're just passing 17 minutes here as always i really hope you enjoyed the progress this week and i'm super thankful for your support of this series special shout out to my gourami supporters over on patreon cody fenikfu mega ombre vlad james and those who wish to remain anonymous thanks for sticking with me through this long devlog and keep your eyes peeled for another episode next week i'll see you then
Info
Channel: DevDuck
Views: 67,608
Rating: undefined out of 5
Keywords: indie game devlog, devlog, indie game dev, game dev, devduck, dauphin, godot gamedev, godot devlog, 2D game dev, 2d rpg, rpg devlog
Id: VPavrJxXRHE
Channel Id: undefined
Length: 17min 20sec (1040 seconds)
Published: Sat Mar 13 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.