We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
Analysis Summary
Worth Noting
Positive elements
- This video provides a realistic, unvarnished look at the trial-and-error process of implementing WebSockets and state synchronization in a JavaScript/TypeScript environment.
Influence Dimensions
How are these scored?About this analysis
Knowing about these techniques makes them visible, not powerless. The ones that work best on you are the ones that match beliefs you already hold.
This analysis is a tool for your own thinking — what you do with it is up to you.
Related content covering similar topics.
RELAXING CODING WITH VIM (duck simulator dev log 3)
nycrat
GAME DEV WITH VIM IS THE BEST (duck simulator dev log 4)
nycrat
Are Good Coding Practices Overrated??? | Leetcode With Vim
nycrat
Transcript
[Music] that's beautiful this I have an update which is for the client to send to the server now we and then it should work and you see we get all the states for the Ducks [Music] chat server so right now what I have of the I have some example code I'm not I'm hold on quote stealing it but I'm repurposing it so it's not chat server it will be game server obviously whiches OB be game server and let's see session dat let's say result let's say Pub uh what are we going to update it with let's just do a number so let's just say position cuse why not or for update for G typ results equals nothing def handle this [Music] stuff and we don't have to anything here and this is good so let update let lobes equals to Z l. keys. CCT honestly I might just do this [Applause] [Music] [Music] uh Lobby I'll to uh if you look in the client there's a stream Handler for the thing so this handles whenever we get a message from the client so what the ping pong of the text now if it's SL list we list lobbies um sure sure so let's just send list arm so what we'll see from is we'll get a message [Music] how this lobbies map [Music] uhor map oh [Music] myor lobby lobby Plus [Music] collect which is a string equals this if. data [Music] thought it's any [Music] let's just just just make it a string us it's a command or let's say this is response from command so if uh [Music] Swit split split by new line if do server um update all position [Music] Z to actor self res whatever that is on context so another day another day to work on this okay so I have a few things update I sort of okay so I sort of kind of thought of what I need to happen I need an update and then an update sync is I have an update which is for the client to send to the server and then I have an update sync which is for the server to send to all the clients you get me you oh my I forgot okay yeah so Lobby [Music] name and it's an update [Music] I send an interval or set to roll let's say 10 milliseconds sure oh I don't I don't have to do [Music] that connecting St all right so we probably open [Music] and here boom it's a bunch of updates so let's say update and H how do we implement this with the game we can we get the game the game updates as well so we can get game dots doc do position. X and we can send an update here I send an update with the position of our do here you can see okay let good and all uh we have to make sure we format this [Music] right uh two fixed does it [Music] [Music] still yeah just send it to 10 I know doesn't matter anyways so that's was me for now else let x and z equals to V 1 dot split split ones [Music] at the space [Music] dot dot unwrap updates syn interval and then I forgot how oh it's a it's a a what this act context the actor the context at H let's just do this and they can't do [Music] that uh import have to import something it's okay and you see the server damn so the server can run this as well I guess that's the plan from now on ah I don't know and I have to clean up this code as well later I mean that was a given that was a given so data let's just say 4 let i = z one I is less than data do length I ++ if [Music] data let ials con info equals is this splice [Music] or split let's SPL on space yeah this is assuming names can have space let's just assume I for now oh no it's a no it's chill H ID equals z h xal h zal info to that's what I deserve if ID equals um [Music] you are otherwise I go to a game instead of having [Music] duck ducks ducks this start [Music] zero so four let I zero I self do uh actually for dock four con St Ducks put this in here oh I don't have this I don't have this turned on whatever camera is going to follow the first stock okay um follow the first do cu the first St is always [Music] you box zero cuzz this is the duck that you're playing as handle input yeah this yeah same thing is the duck you're playing as duck zero maror yeah count this okay else if data zero say join in [Music] [Music] [Music] do parse in um prob [Music] do do positionx [Music] X actually part FL [Music] please work game do. add Duck game Ducks game Ducks length minus one [Music] it works hold up hold [Music] up what we also need is to just send a join and everyone else so that's [Music] [Music] [Music] [Music] okay my yeah this was the thing I was afraid of is how about [Music] [Music] updates yeah so what happens is is let's say we update it real [Music] fast I mean that's pretty good that's pretty good this is this is beautiful this is [Music] beautiful wow wow wow
Video description
DEV LOG EP 2, Duck Simulator. BACK AGAIN, this time we implement multiplayer :) IF YOU HAVE ANY IDEAS FOR THE GAME, PLEASE COMMENT ! Game ► https://nycrat.github.io/duck-simulator Repo ► https://github.com/NycRat/duck-simulator Twitter ► https://twitter.com/VimSalesman Github ► https://github.com/NycRat My Config ► https://github.com/NycRat/dotfiles/tree/main/dot_config/nvim