Animations and Multiplayer Architecture - Sapiens Devlog 45

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello everyone I met Dave in vs. sapiens as you can see this guy is going for a little jog this what I've been working on I've just sort of started on that over the last couple of days just just getting a few different variations in the way that they're moving I've got a snake animation and running and a sort of slow walk and yeah I'm only really really really just yeah it's going quite well and I'll go into exactly what I've done there so far yeah they've just done now because it's sort of run out of energy yeah I'll talk about that in a minute the first thing though that I wanted to talk about that I just wanted to revisit the holes that a multi-select thing you know there's been a lot of comments about it and I felt really that I needed to respond to what everyone's been saying so in the last YouTube video there were lots and lots of comments about this multi-select and face lots of people suggest making different suggestions about what they thought I could do to improve this or basically to replace it and honestly I'm not I'm not planning on replacing it I actually really like it I think it's really good but yeah it's really interesting is obviously because it was so varied it just shows that everyone's got their own idea of how they think that multi-select should work and yeah there was really no consensus at all there are a number of ideas that just went at all feasible for various reasons and you know most of them are things that I haven't talked about or that you couldn't have known but you know there's just interactions that wouldn't have worked but then they were also quite a few that was that suggested top-down interactions so you know show basically when you when you clicked on something to get him to multi select they it would zoom you up and show the cursor and then allow you to interact basically like any other top-down game now I definitely consider this I did give it quite a lot of thought before I started implementing this for you here and what it all came down to was my vision - turning this into a top-down game it's my belief that if I did implement multi select and a top-down view with the case of a visible like this that people would not be happy with that there wouldn't be enough yeah that would be too familiar to people who are used to playing top-down realtime strategy or city building and immediately you'd want to do a whole lot more you'd really want to be able to queue up actions for everything from that view you'd want to be able to tell people to be able to move places you'd want to be able to place building structures and basically do everything from above and I'm sorry but that's not what this game is about you know that was there was a fork in the road probably about three four years ago now where I decided to take the immersive first person camera route I'm far too far along development now to even consider going back to doing a top-down game even if I even if I wanted to which I very differently don't so anyway that's that's basically my reasoning for why I went the way I did with with the multi-select thing and I mean hopefully you agree and can kind of understand my reasoning but if not then there's always the chance for someone to make a mod it'd be pretty easy to make a mod that did do this top-down view with showing the cursor for multi-select so yeah I mean maybe maybe someone will do that and you can give it a go anyway okay so yeah so I've got a little sort of jog animation yeah I've been really sort of refining the code to try to allow me to create these animations about quicker and I've also been you know figuring out my workflow for creating animations because I've sort of you know I've made tentative efforts on it all but I'd only got so far so I thought I'd show you how I've gone about creating these new animations the first step is that I've recorded myself running and this is my office so this is me so I've recorded myself doing these actions and I can just use this as a reference so it doesn't have to be great it can be you know pretty pretty average quality running you know that doesn't really matter but it's just a reference so I can get some idea of where arms and legs and stuff go I basically just bought two really cheap little cameras webcams and I'm using OBS to record the the video footage at the same time so I can look at both both angles and figure out where everything is so I guess this is sort of like your cheapest studious motion capture that you could possibly imagine but it's you know working for me so I used that as a reference and I put that on one monitor and then on another monitor I've got blender so in blender I basically have one model file it's this is the the male animation model file I then sort of copy and paste these into the female and the child models and sort of modify them a little bit if they need tweaking any other basic kind of procedures for me to add new keyframes this this model file just contains a whole bunch of keyframes they're not actually animations as such the the animations are defined in a script so yeah I would add new keyframes for the new animation in this case there's eight new keyframes for the running animation and then in the scripts I need to add them and two here and then and then I can configure how they're actually combined what duration is between them I can configure that easing in between different keyframes and also add things like triggers that play sounds and stuff like that too so as far as actually rigging up each keyframe goes it's pretty standard sort of rigging stuff you know probably just copy and paste another keyframe from somewhere else that's sort of close and then I'll just that dragging stuff around sort of rotating around various axes and stuff to try to get the pose to match the keyframe that I'm looking at and the reference footage and then I'll load it up and see how terrible it looks and in fact my first attempt at a sneek was you know pretty pretty humorous but you know it looks bad to start with and then you sort of tweak things and slowly refine it and you get there I think my skills in this have already progressed massively in just in the last few days and what's basically going to happen is by the time I get to the end of this development I'll be much better and I'll be coming back and probably redoing all of these animations that I'm doing in these early stages I also did quite a little work on the kind of interpolation between the keyframes in the engine they walking before was a lot of people have actually commented that it was a bit a bit robotic looking and I mean you know it's it's not gonna be perfect I'm still learning how to animate and how to best sort of get the most out of my engine that I can and I've got limited resources you know it's just me and I can only really allow myself a few weeks to work on all the all the animations in the game so you know I'm competing with triple-a studios that have whole teams working for years there's you know there's only so much I can do but you know I'm gonna have to be happy with this I think that it fits with the game okay and yeah I'm quite happy with my workflow I think I should be able to create a number of different animations fairly quickly so these guys are on a food raid and they sort of running in I'm gonna make it so that they sort of spot other your sapiens and kind of start or start sneaking around if they're within a certain radius and stuff like that so I'll actually probably work on that really soon I also want to work on a number of the other animations and and just tidy everything up on you know relating to all their behaviors and animations and everything so I think I've probably got a good couple of weeks here of really just working on animations and behaviors so yeah that's what I'm gonna be working on next so it's been about a week since I recorded that last segment and I have not managed to get them sneaking when they were on food roads and I think that might actually wait a little bit longer now I'll go into more of that in a minute but I have done quite a lot and I've really focused a lot on the the end vidual kind of Sapien behaviors and their moods and things so I'll show you a bit of that and I also worked a bit on sort of network optimization so I'll talk a bit about that too so let's just create a new world and that will do and we'll just see what we end up with here the sapiens previously they had these traits assigned to them but they didn't actually mean anything whereas now I've actually done the work to to make these traits all have sort of some kind of effect so they will influence the skills they influence with em how hungry they gets how much sleep they need how old they are also influences their sleep needs and things so it's all just been fleshed out a whole lot more let me just find something not quite so snowy okay so this tribe looks kind of interesting we've got us at a variety of different personality traits so let's leave this tribe cool so let's I'll just queue up a few orders and things we'll get them getting some food maybe so yeah there now get tired and what tends to happen is they've got a lot of energy right at the start and then so they're all sort of running around off to kind of do things but then by the end of the day they'll be tired and those stats that are sitting around and having wrists and stuff let me just or queue up a bunch of orders and just get them sort of started so that we can start to see some some behaviors image okay so we're near the end of that first day and you'll see that a couple of them were actually sitting down now so yeah let's totally new they'll sit down when they want to rest and they've got a few different poses I think yeah I don't know that's sort of okay but some of the poses of you know a little bit of work but um the yeah that's all based on their needs so they've got a rest need and they've got a sleep need so rest is just if this sort of physically tired or mentally tired then they'll just going to have a sit down and have a break it's sort of a recreation need I suppose or as sleep is actually if they want to go to sleep and yeah they the combination of all of their needs will affect their happiness score over time and their icons are now colored I might actually change them to be a graphical representation of their mood too that was sort of voice my intent take the mood indicator above them like this and yeah so if they if their mood gets too bad feeling they'll start just moping around and refused to do any work and if they get the obviously if they get tired and then also to sit around and in wrists so that's that's nice now I thought I would do that stuff because when I started thinking about how they should behave towards each other it really seemed that I should actually get them to you know have some behaviors that are driven by their own needs and wants and personalities first that sort of made more sense so that's why I focused on that and yeah I think I think I will sort of go into their interactions with each other quite soon but again as I was talking about in the the last sort of segment of the video I would say that I probably wanted to get them sort of sneaking around when they come in on food raids and stuff but it doesn't really make sense to work on that before they even interact with each other so that's really what's missing right now is that they completely ignore each other you know and it feels like they're a bunch of individuals just doing their own thing so it's really important that I work on it soon so also I've been working on data compression for the multiplayer network state so I thought I should just explain how multiplayer works and sapience a little bit too because I think probably mostly you don't even know that it supports multiplayer there very much does now so the game is always running a server and and a client and multiplayer you've got a separate server on a different machine I've got an Ubuntu build of that as well as a Windows command line applications so you can run a separate server and have multiple clients connecting via a network but in single-player both of these just running on a single machine and in fact they're both running the same process and instead of using a network we've just got a thread safe queue that basically leaks lets the client and server communicate internally within the process so this is a really good design if we wanted to then add another client we could easily do so just create a network interface here and and then they can just communicate via that interface so this is basically a local area network connection they've just opened up and you can hear the multiple clients connecting so yeah it supports both local area network as well as sort of client server and of course just single player as well so this is a really good way to design a multiplayer game the previous game that I made was the Blockheads it was a single-player game to start with and then I tried to add multiplayer and after the fact and it was a lot of hard work and there were a lot of bugs all the way through and I actually made it very difficult to add new content in the later sort of stages of the games life so I would not recommend doing that if you want to support multiplayer desire that way right from the start and design it like this so that it's always split into a server and client because then when you're testing single-player you're testing 90% of what multiplayer is anyway you've still got that separation so anyway I spent about three days optimizing the the data that was sent across particularly to do with sapiens so so a sapien has a lot of state associated with it it has a name position it has potentially a path which can have multiple positions it has water sit his needs and once it has moods and has I don't know the list just keeps going on and on so the problem was that it was sitting through the entire state across to the client and of course you know that that state was getting bigger all the time it was really gonna use a lot of network bandwidth and it's unnecessary so the solution was to track changes of individual states items within this and so if I then if I change the position then it could mark that has changed and then when it goes to seeing the state through to the client it could just send that position or you know position and once if both of those changed and - and just not worry about sending all this other stuff that stayed the same now on the surface that same was extremely simple but the problem was that the server was just just changing the state whenever it felt like at various points throughout the code and there was just no way to track what what had changed without actually comparing this against the previous the previous state and you know that was an option I decided that the better solution was probably to actually track the changes as I changed them so that's what I did I added a you know changed state function actually no it was I had a tacit function and a remove function and so you could say sit pause X was it and then that would then say that this has changed and then we'd be able to just send that through so the real problem was I had to go through and find every single place where the sewer modified that state and replace it with a function and of course that can be it can be tricky especially when you've got nested state there were places where it was rearranging nested tables with another tables all sorts of stuff going on so I had to really tidy all of that up and yeah the only way that I could really make sure that I'd fixed it was to on the client verify the doubter updates with a full changed version of the state and yeah it took probably there were probably about thirty things that I'd missed or screwed up and I had to go through each one and when it printed out any room is saying that the states didn't match I had to find out why so yeah that was a bit of fun for three days there but you know it needed to be done it's been on my to-do list for a good couple of years and it's yeah good to have that done and I just thought you might be interested in a little bit of the more technical kind of side of how things work there and you know the process that I went through and yeah hopefully I don't have to look at any of that code again okay so it's the next morning and I just want to show you how I've started work on you know their interactions with each other again just like with their sort of individual behaviors of you know how this sitting and stuff in house that's driven by their own modes and needs and things I thought that their behaviors with each other should be driven by their individual kind of relationships with each other and so first I needed to come up with some kind of basic model for relationships so I sort of sat down and thought about that for a bit and I really you know it's interesting because it's like you know I don't have a psychology major maybe maybe someone watching this does and can help her a little bit but I really wanted a really nice simple model that was complex enough still to be able to give it some really nice sort of believable behaviors between them and what I've come up with so far is if I just click on one of these I have split it out into a bond and a mood so basically bond is sort of a long-term sort of attachment so all of the people within the tribe have a reasonable kind of bond score and then mood is more like a whether you like or dislike someone so yeah parents and kids are really tightly bond and in there they've got a nice bond with their other people in the tribe if they if they see someone that doesn't belong to their tribe then they'll have zero bond and in fact here's a couple over here I don't know if I don't know if they've seen them same look no they haven't seen again so if they do notice them then they should get a zero bond score which would cause them to then behave differently they don't know who they are they know nothing about them so they'll behave very cautiously towards each other yeah so that's the plan and also it means that if they don't if they don't if they're having an argument and they don't like each other they'll still fight for each other when it comes down to it because they have their bond so I thought that was nice splitting it out so also if I look at this there are two values for a bond and two for moods so the that's long term and short term in fact that's long term and that's short term so the short term will be influenced by how they interact and you know events that happen and then there will slowly influence the long term as well and I thought that that made sense they might have a little fight but overall they still like each other really so yeah I don't know we'll see how this goes I think it is kind of it's nice and simple and yet probably enough to really drive some interesting behaviors so we'll see but obviously I haven't started on the behaviors yet you know it's still early days and I decided instead of really going forward with it any further I would really like to add more content the problem is that all these things take a long time to test because you are sitting and watching their behaviors evolve over long periods of time and you know I don't want to just sit around waiting and watching only that I think that I can multitask a bit of the net and actually test some of the things that they can build and stuff too so yeah that's quite exciting because it means that basically next week I'm planning on starting work on adding some new content finally so some new some new tick some new structures you know I don't know exactly it maybe some maybe some animals and yeah just generally content okay so I think I might just wrap up the video there it's kind of a shame because this is quite a nice little tribe that I've got set up here but yeah things are going quite well and yeah I'm quite excited about all this new content that's just around the corner hopefully they so get distracted again right anyway we'll see you again and I get in a week or two and until then please don't forget to wishlist sapiens on Steam and we'll catch you next time Cheers [Music]
Info
Channel: Dave Frampton
Views: 28,049
Rating: undefined out of 5
Keywords:
Id: k_8ZELgA2qU
Channel Id: undefined
Length: 19min 51sec (1191 seconds)
Published: Fri Feb 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.