Why Making Multiplayer Games SUCKS

Поділитися
Вставка
  • Опубліковано 6 вер 2021
  • I finally decided to tackle some of the more complex issues I was having with multiplayer, and this is how it went...
    Next devlog: • How I Fixed the Ocean ...
    Pirate game playlist: • Multiplayer Pirate Gam...
    ⎯⎯⎯⎯⎯⎯
    More about client prediction & reconciliation: www.gabrielgambetta.com/clien...
    Discord server: tomweiland.net/discord
    Support me on GitHub Sponsors: github.com/sponsors/tom-weiland
    Support me on Ko-fi: tomweiland.net/kofi
    GitHub: tomweiland.net/github
    Project's Trello board: trello.com/b/vJwk0iwS/pirate-...
    Website: tomweiland.net/
    ⎯⎯⎯⎯⎯⎯
    Gear & Software I Use
    Developing
    ⮞ Engine - Unity: store.unity.com/#plans-indivi...
    ⮞ Code Editor - Visual Studio: visualstudio.microsoft.com/vs/
    ⮞ 3D Modeling - Blender: www.blender.org/download/
    Recording & Streaming
    ⮞ Screen Recorder - OBS Studio: obsproject.com/
    ⮞ Camera - Panasonic G85: amzn.to/39P77GK
    ⮞ Microphone - Maono AU-PM422: amzn.to/2LsTIuG
    Computer Parts & Peripherals
    ⮞ Mouse - Logitech G604: amzn.to/3mqUSoy
    ⮞ CPU - AMD Ryzen 7 2700X: amzn.to/3pU06K9
    ⮞ GPU - GeForce GTX 1050 Ti: www.newegg.ca/p/N82E16814125915
    ⮞ Motherboard - ASUS Prime X470-Pro: amzn.to/3p20h5f
    ⮞ SSD - Gigabyte 240GB: amzn.to/39UPWDQ
    ⮞ HDD - WD Blue 1TB: amzn.to/2O37EMI
    ⮞ RAM - 8GB x2
    ⮞ Case - Fractal Design Meshify C: amzn.to/3q6FgHy
    ⮞ Power Supply - EVGA 750 GQ: amzn.to/2N3T3A0
    Other
    ⮞ YT Channel Management Tool - TubeBuddy: www.tubebuddy.com/tomweiland
    ⮞ Webhosting - Bluehost: www.bluehost.com/track/tomwei...
    I personally use all of the above products and services, so they are genuine recommendations. Some of these links are affiliate links, which means I get paid a small commission (at no extra cost to you) if you sign up or buy through them. Thanks for supporting the channel!
    ⎯⎯⎯⎯⎯⎯
    #LatencyIsTheEnemy #Devlog #PirateGame #GameDev #IndieDev #IndieGame #Multiplayer #Unity
    In this multiplayer devlog I finally decided to tackle some of the more complex problems I've been having with multiplayer. Latency is the enemy, and makes building multiplayer games 1000 times more painful and time consuming. While I've managed to get latency mitigation techniques like client prediction working on dry, non-moving land, it's a whole other story when you're standing on a moving boat, and this video is a summary of my experiences over the last 3 months.
    ⎯⎯⎯⎯⎯⎯
    The music used in this video is sourced from the UA-cam Audio Library and StreamBeats.
  • Розваги

КОМЕНТАРІ • 1,4 тис.

  • @nocultist7050
    @nocultist7050 2 роки тому +1781

    That's why I chose to do LAN multiplayer. That way, if a cheater is stealing your fun you can just go to him and punch him in the face.

    • @tomweiland
      @tomweiland  2 роки тому +169

      😂

    • @Bunny99s
      @Bunny99s 10 місяців тому +15

      Like that: 1EJXTh4HMAE
      It's a classic clip that was actually shared in LAN parties quite often. I think I still have it somewhere on a HDD. Yes, the time before UA-cam was a thing

    • @richardwelsh7901
      @richardwelsh7901 10 місяців тому +5

      ​@Bunny99s I remember learning why you shouldn't set your drive on a subwoofer. Also to make backups

    • @mikeyg831
      @mikeyg831 10 місяців тому +1

      ​@@richardwelsh7901 will it get wiped?

    • @thomaseubank1503
      @thomaseubank1503 10 місяців тому +2

      Smart Man!

  • @plank2490
    @plank2490 2 роки тому +2342

    "It doesn't work and I don't know why "
    "Now it works and I don't know why"
    -every programmer's cycle in a nutshell

    • @tomweiland
      @tomweiland  2 роки тому +214

      The former is frustrating and the latter is fear-inducing 😂

    • @postcode-x
      @postcode-x 2 роки тому +2

      DELETE THIS

    • @baconguy9961
      @baconguy9961 2 роки тому +14

      to relatable to be said out-loud

    • @TheTrifel
      @TheTrifel Рік тому +2

      This is my last 3 months in a nutshell 😆
      And I'm only through the building system and inventory and connecting ui 😆

    • @thehalflifeguy368
      @thehalflifeguy368 Рік тому

      @@tomweiland i was following a tutorial and it had 35 errors
      here is the tutorial i followed: ua-cam.com/video/oyvt7RacVoo/v-deo.html
      here is the code:
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class PlayerMovement : MonoBehaviour
      {
      public bool CanMove = true;
      public CharacterController PlayerController;
      [Header("Camera")]
      [SerializeField] private Camera playerCamera;
      public float MouseSensivity = 5f;
      public float XRotation = 0f;
      [Header("Walking Params")]
      public float WalkSpeed = 4f;

      private void Awake()
      {
      Curser.lockState = CurserLockMode.Locked;
      }
      public void Update()
      {
      Move();
      HandelCamera();
      }
      private void Move()
      {
      if (!CanMove)
      return;
      Vector3 moveDirection = transform.right * Input.GetAxisRaw("Horizontal") + transform.forward * Input.GetAxisRaw("Vertical");
      PlayerController.move(moveDirection * WalkSpeed * Time.deltaTime);
      }
      public void HandelCamera
      {
      XRotation -= Input.GetAxis("Mouse Y") * MouseSensivity;
      XRotation = Mathf.Clamp(XRotation, -90f, 90f);
      playerCamera.transform.localRotation = Quaternion.Euler(XRotation, 0f, 0f);
      float YRotation = Input.GetAxis("Mouse X") * MouseSensivity;
      transform.Rotate(new Vector3(0f, YRotation, 0f));
      }
      }

  • @PatriotZest
    @PatriotZest 2 роки тому +1768

    "Give a man a software he will enjoy it, teach him to code he'll never enjoy in his lifetime'
    -Suz Tzu art of coding

    • @tomweiland
      @tomweiland  2 роки тому +151

      Probably gonna go die of a truth overdose, brb.

    • @Evoleo
      @Evoleo 2 роки тому +116

      Give a man a game and he will be happy for a night. Teach him how to make games and he will never be happy ever again

    • @caronfernandes4625
      @caronfernandes4625 2 роки тому +4

      If this is the case games would stop existing

    • @alex.g7317
      @alex.g7317 Рік тому +3

      @@caronfernandes4625 exactly. That’s why games don’t exist.

    • @l.3626
      @l.3626 2 місяці тому

      That's why I never learned it from school, it was just not fun

  • @MrLasse6001
    @MrLasse6001 2 роки тому +616

    Players unfortunately don’t now about all these complications…

    • @tomweiland
      @tomweiland  2 роки тому +141

      Yeah for sure. So much work goes into the (mostly) seamless multiplayer experiences we all play nowadays, and I think most people take it for granted how ingenious the systems that make it possible really are. Working with multiplayer stuff for the last ~4 years has really changed how I view games :P

    • @representer4039
      @representer4039 2 роки тому +9

      @@tomweiland True

    • @038alpha
      @038alpha 2 роки тому +54

      They b like : where content

    • @tomweiland
      @tomweiland  2 роки тому +19

      @@038alpha precisely 😅

    • @ArcaneWorlds
      @ArcaneWorlds 2 роки тому +3

      IF ONLY THEY KNEW !!! 😭😭😂😂

  • @Neverjam
    @Neverjam 2 роки тому +133

    Thank you so much for making this. Ever since release its my go to video when players ask "Why don't you just add online"

  • @that_kaii
    @that_kaii 2 роки тому +216

    "What better way to fix a bug than working around it?"
    -Every Programmer Ever

    • @tomweiland
      @tomweiland  2 роки тому +18

      Exactly :P

    • @cahydra
      @cahydra 2 роки тому +2

      Yeah because that won't possibly go horribly wrong after a month into the thick of it😂😭

    • @andresiglesias6952
      @andresiglesias6952 Рік тому +12

      Making it a feature.

    • @chucklesdeclown8819
      @chucklesdeclown8819 3 місяці тому +2

      It's not a bug, it's a feature

  • @jasonwilliams8730
    @jasonwilliams8730 2 роки тому +350

    I fricken love this channel! Anyone that can do networking is a god.

    • @tomweiland
      @tomweiland  2 роки тому +56

      Haha I'm glad you like it! Despite what this video seems to suggest, I do think that anyone that's interested enough can certainly learn at least the basics of networking :)

    • @Quique-sz4uj
      @Quique-sz4uj 2 роки тому +5

      @@tomweiland Completly true! 4 Months back i knew literally nothing and your tutorials helped me a lot! Im not using it for games tho

    • @Wonrofccsreal
      @Wonrofccsreal 2 роки тому +1

      I agree

    • @ezpz4646
      @ezpz4646 2 роки тому +1

      Even if it's photon?

    • @bide7603
      @bide7603 2 роки тому +5

      Networking is nowhere near as complicated as game design imo

  • @PuppetDev
    @PuppetDev 2 роки тому +304

    This is very relatable. Great video.
    Whenever I tell people about how annoying it is, I don't feel like they comprehend the full extent of it. Even this video didnt fully give it justice.
    It's feels like you are slowly driven mad by some eldritch god. Stuff stops making sense but it kinda does, sometimes... You start to understand why online games seem so limited sometimes.
    Make sure to take care of your mental health. Take breaks and do other stuff that gives you joy and purpose in life.

    • @tomweiland
      @tomweiland  2 роки тому +38

      For sure. This stuff can really bend your brain around...
      And yeah, mental health is something to be aware of when dealing with this madness. Although honestly 90% of the last 3 months that I "spent working" on this were actually spent either enjoying the summer or procrastinating tackling this problem 😅

    •  2 роки тому +4

      It's like quantum physics. But with better excuses.

    • @soylentgreenb
      @soylentgreenb 10 місяців тому +7

      Latency is worse than you think. Your processor has the speed of a 486 if you disable its caches. It is essentially playing a multiplayer game with itself since RAM is so hideously slow and instructions are pipelined over multiple clocks. Memory has kept up on bandwidth by taking many memory cells that operate slowly and multiplexing their output into something with a high clock frequency; but latency is scarcely better than 1998 because the individual cells are still slow. Even if latency of RAM was 1 clock instead of hundreds of clocks your CPU is pipelined; this means every instruction is chopped up into many stages and microops which can execute in parallel or out of order. Multiple instructions that use the same resources can be in flight at once as long as they are in different stages or in a different execution unit. To get around the latency problem the CPU is executing instructions out of order; as long as they don't depend on a prior result; and for every branch (think while-loop, if statement or for-loop) it is predicting if that branch will be taken or not and executing instructions on that basis. If ever it is wrong it needs to undo hundreds of instructions and their effects on several levels of cache as well as RAM which all have different latencies. And it gets worse; for legacy reasons the CPU has few registers and it is getting around this by renaming registers on the fly and having more physical registers than it has software addressable registers. So if you put the result of a calculation in EAX and store its value to RAM, then write something else to EAX and use that to do another computation; your CPU is aliasing EAX to different physical registers and trying to execute those things in parallel. Now there are also multiple cores which are using the same cache (L3 and RAM) in parallel and there are multiple levels of cache that have to be kept synchronized and the bigger they are, the slower they are.
      And this is hardware; so this either works perfectly on the first try when you release it to the consumer or you are down billions of dollars if you release a defective product that has to be recalled. High performance processors are pure nightmare fuel.

    • @OramiIT
      @OramiIT 4 місяці тому

      It happens delete the glitchy function and rewrite from scratch spent two days trying to debug nuked the code and redid it all of a sudden it works.

    • @PuppetDev
      @PuppetDev 4 місяці тому

      Oh Jesus, my notifications reminded me of this cringe comment I made 2 years ago. I learned a ton since then. It can definitely help if keep things simple and rely on existing systems and tools to sync stuff. But even with a lot more experience, my comment still holds truth. Always remember to code defensively! Also log errors and important events.

  • @calitts4708
    @calitts4708 2 роки тому +44

    The best thing is swapping a semicolon for a Greek question mark in a friend's code

    • @tomweiland
      @tomweiland  2 роки тому +26

      That is _evil..._

    • @Theraot
      @Theraot 2 роки тому +6

      @@tomweiland Look at mimic by reinderien. But don't touch it, or it may plunge your soul into darkness.

    • @Warp_Speed_Studios
      @Warp_Speed_Studios Місяць тому

      You my good man, are the devil's right hand man.

    • @LLDJ_
      @LLDJ_ Місяць тому +1

      ; ;

  • @krammehl
    @krammehl 2 роки тому +388

    Hey, I ran into similar issues while developing pantropy. We had the player move on ground and flying/moving bases here are my tips:
    1. DO NOT use a rigidbody to move your player. Physics movements are never equal on server and client. Use a CharacterController instead. The characterController.move function is always accurate and the player will move an equal distance on server and client.
    2. Don't use the characterController for ground collisions. Use a raycast and keep the player a given distance away from the ground. Move the player downwards if the ray doesn't hit anything.
    3. Set the player's transform as a child of a moving object (like your boats) on server and client when he enters it. You will not have any weird physics glitches thanks to the "groundray".
    Hope these helped, this wroked for me flawlessly.

    • @tomweiland
      @tomweiland  2 роки тому +95

      1. The problems I've been dealing with aren't related to a lack of physics determinism. You can actually make Unity's physics deterministic on the same machine by enabling the "enhanced determinism" option in the physics setting, and I've really only been developing & testing with both client and server on my computer. I also want to be able to easily apply forces to players, and I don't like how the CharacterController is basically a black box-no idea of/control over what goes on under the hood.
      2. Again, not really a fan of CharacterController in general.
      3. Making the player a child of the boat would give largely the same result that I ended up with at the end of this video. When getting on and off boats it would still jitter, and I kind of prefer my solution because I really didn't want the player to be a child of the boat.
      Thanks for taking the time to make suggestions though :)

    • @mattlegge8538
      @mattlegge8538 2 роки тому +5

      This is great advice thank you, I will be using this!

    • @mattlegge8538
      @mattlegge8538 2 роки тому +19

      I did actually come back for this advice, and I did use it. In standard cases, this would be a perfectly fine solution. Unfortunately, my case turned out not to be standard.. of course.

    • @spronkthesprinter273
      @spronkthesprinter273 2 роки тому +13

      As a UA-cam commenter with absolutely zero game coding experience, this seems fairly good 👍, thank me later and yes I know my opinion is highly sought after

    • @bedtimestories1065
      @bedtimestories1065 2 роки тому +5

      Try using a downward SphereCast and/or CapsuleCast over a single Raycast. While that solution seems to work for you, there are many scenarios where it can break. A great example are slopes. Granted, if you use the CharacterController component, slopes are automatic. But if you make your own kinematic character controller, you need to detect slopes on your own. Using something like CapsuleCast provides fantastic results. But I'm not gonna lie, creating a kinematic controller is probably the hardest thing I've ever done is game dev. It still doesn't even work tbh. There is SO much math involved. At least I learned a ton lol.

  • @iMinx
    @iMinx 2 роки тому +70

    I tried making a multiplayer fps and gave up because of these things. It's really hard to conceptualize what this sort of entails until after it starts bending you over.

    • @tomweiland
      @tomweiland  2 роки тому +10

      😂

    • @cattysplat
      @cattysplat 10 місяців тому +6

      > Spend forever making functioning multiplayer game/modes.
      > Half the playerbase only plays singleplayer.
      Social anxiety, the hardest challenge of all.

  • @toastbrot97
    @toastbrot97 2 роки тому +131

    Switching from a physics based system to a simple parenting system when stepping onto the ship is actually genius. I had a stupid grin on my phase when i saw that part in the video cause i was also like "wait, how does one fix this actually?". And then my brain was like: "ah of course, why did i not think of that!" :D

    • @tomweiland
      @tomweiland  2 роки тому +23

      It's an okay solution, but it has its issues. The jitter when getting on and off the boat being one, but I also foresee it complicating things when I get around to dealing with lag compensation. I'm strongly considering just predicting the ship's movement as well-that'd avoid the problem in it's entirety and is probably a simpler, easier to maintain solution 🤔

    • @toastbrot97
      @toastbrot97 2 роки тому +2

      @@tomweiland Yea i guess that makes sens. But it's still a novel solution to safe on resources imo!

    • @gzxmx94
      @gzxmx94 10 місяців тому +3

      @@tomweiland Why not incorporate some allowed error margin for the client calculation on the server and be like "ah yes this sounds within the realm of possibilities, hereby I declare you not a cheater and I accept this update"

    • @lock6562
      @lock6562 10 місяців тому +2

      @@gzxmx94 I mean that would still allow for speed hacks and whatnot they would just be slower

    • @pj-wille
      @pj-wille 10 місяців тому +5

      @@lock6562 Most likely, but as long as you give them a sort of "Vector3D positional_errors_accrued" variable that slowly returned to (0,0,0), you could see if someone gets too many errors in quick succession is probably cheating. With that, people would only be able to hack in a very small advantage at best since the rate of their advantage is limited to not accede the resetting speed of the positional_errors_accrued or it's max value.

  • @Skeffles
    @Skeffles 2 роки тому +40

    Brilliant to see you've got this going! Client prediction was a major reason why I gave up last time I tried networking.

    • @tomweiland
      @tomweiland  2 роки тому +13

      It's definitely not a fun problem to be solving, and of course I had to make it even more complex for myself by having moving boats in my game 😂

    • @Skeffles
      @Skeffles 2 роки тому +7

      @@tomweiland The boats sound like they make it significantly harder. I believe sea of thieves switches players to local coordinates for the ship. Do you think that is similar to your duplicate ship approach?

  • @PixelWealthh
    @PixelWealthh 2 роки тому +51

    I just made my first game in unity, and honestly the coding part seems kinda intimidating but i'm somehow enjoying the learning process.

    • @tomweiland
      @tomweiland  2 роки тому +14

      Congrats! It can definitely be intimidating at the beginning, but I'd say it's definitely worth it :)

    • @juju8470
      @juju8470 2 роки тому +2

      Do you guys recommend unity or unreal engine? I’m completely new and I want to get into game development.

    • @tomweiland
      @tomweiland  2 роки тому +6

      I personally use Unity and like it a lot, but I haven't used Unreal Engine so I'm probably at least a little bit biased.
      I think the most important difference is the programming languages they use-Unity uses C# which I _love,_ while Unreal uses C++ which is apparently one of the hardest programming languages to learn. You can use blueprints in Unreal instead of C++ which is like visual scripting, but I've never really been a fan of that. Both engines can be used to do a lot of the same things, but I'll probably always recommend Unity because it uses C#.

    • @wargamerproducions
      @wargamerproducions 2 роки тому +6

      @@juju8470 I've worked in Unity and Unreal and as Tom says coding in C# is really nice and C++ usually is a slower and more tedious process and yes its difficult to get into. Unreal has a lot of build in systems similar to unitys monobehaviour but its so massive and that can be really hard to get into, so lots of trail and error early on. Blueprints is actually also pretty enjoyable to work with until you have to make massive system for your game, it can get rough to keep track of the code. Unreal also offers a lot of shortcuts and more dedicated support for artists, and level designers to get going. Unreal also has a more integrated multiplayer systems, haven't touched it myself but compared to unity its very much an engine feature.
      Imo I've had less issues working in unreal on a engine error level, and the experience has been smoother working in unreal but Im still much more comfortable with unity.

    • @steven3314
      @steven3314 2 роки тому +1

      @@tomweiland Be aware of using Unity networking library to develop multiplayer games, they change the API every several years mainly because not many people use it. I think it's totally not necessary, they just have to improve the API not abandon it! Unreal use the stratege and it works just fine.

  • @icoso
    @icoso 2 роки тому +14

    Great video, Tom! Really enjoyed this one, and I love how you're so concise and clear with everything you say! Awesome work :D

    • @tomweiland
      @tomweiland  2 роки тому +3

      Really glad you enjoyed it :D

    • @sphericalsphere21
      @sphericalsphere21 Рік тому +1

      ayoooooo
      icoso spotted in the wild?
      nice :D
      hope you're doing good man

  • @xzippyzachx
    @xzippyzachx 2 роки тому +10

    That cliff hanger tho! I was on the edge o' me cap'n seat. Great video like always matey :p

    • @tomweiland
      @tomweiland  2 роки тому +5

      I can't tell if the pirate speak is improving or getting worse every time 😂

  • @RialuCaos
    @RialuCaos 2 роки тому +56

    These problems are why I probably wouldn't recommend a multiplayer game for a first project (unless it's local multiplayer). It's a real headache to figure out the proper way for networking in games, and when you're also doing everything else for the first time, it becomes a whole lot to handle.

    • @tomweiland
      @tomweiland  2 роки тому +2

      Yep, 100% agree.

    • @HomeSliceGame
      @HomeSliceGame 11 місяців тому +1

      Agree! it's always good to learn the basics and then go for the multiplayer aspect after

    • @StupidDanimations
      @StupidDanimations 10 місяців тому

      I wouldn't even recommend local, as it makes playtesting way more of a pain.

  • @soundtrackreimagined1854
    @soundtrackreimagined1854 2 роки тому +19

    The most honest insight I have seen into what it’s like to develop a game

  • @KasperJuul87
    @KasperJuul87 2 роки тому +2

    I really appreciate learning from your experiences. Thank you so much for sharing your progress.

    • @tomweiland
      @tomweiland  2 роки тому

      I'm happy to! Thank _you_ for watching :D

  • @Steveplays28
    @Steveplays28 2 роки тому +3

    I feel your pain Tom, good luck with fixing the issues!
    Your game looks sick :D

  • @RugbugRedfern
    @RugbugRedfern 2 роки тому +60

    I love how it just ends xD
    haven't had to deal with server authority before, looks like a lot of fun ;) enjoy your next few weeks fixing more bugs!

    • @tomweiland
      @tomweiland  2 роки тому +17

      "Fun". Yes, that...

    • @thekingdev5305
      @thekingdev5305 2 роки тому +3

      Fun, so fun still exists

    • @kodi0223
      @kodi0223 Рік тому

      Fancy to see you here, I asked you about how you networked redmatch 2 in steam comments a while ago. Been a rough learning for me but fun nonetheless. Seeing this video just adds a layer of terror to the ordeal but it will be done...

    • @RugbugRedfern
      @RugbugRedfern Рік тому

      @@kodi0223 xD Glad you're having fun!

    • @RugbugRedfern
      @RugbugRedfern Рік тому

      @Limeify lol thats great

  • @erickpassos
    @erickpassos 2 роки тому +67

    This is a great video. Very good and clean explanation of an otherwise very complex topic.
    A few things from my several years experience:
    - there's no need to "compare" for misprediction... just overwrite with server data and resimulate forward (maybe this is what you do already) with the local input buffer...
    - for moving boats, and all moving platforms in that sense, it gets trickier because you could place the boat in predicted timing as well (if you also predict/rollback physics, which you can do), but this would create a problem for proxies (view of other players) as they are generally on interpolated time.
    One thing that may work for proxies is to predict just their gravity and move-with-platform part... But in either case or solution you will loose one thing, which is the capability of doing accurate lag compensation... but that is another story...:)

    • @tomweiland
      @tomweiland  2 роки тому +11

      Thanks for watching :)
      You're right about not needing to compare positions-I don't actually do that in my code, but since I didn't want to get into the whole rewinding-and-resimulating part I figured that'd be the easiest way to explain what happens from there in a single sentence.
      I definitely thought about predicting the boat movement as well, but that would've then meant also predicting the waves, and it sets the precedent of having to predict anything that moves which the player might end up standing on. Then again I suppose I've set a similar precedent in the sense that if I want to avoid jittering on other moving objects, they're going to need "proxies" as well...

  • @redcloud319
    @redcloud319 2 роки тому +1

    just found you because of this video and got sucked into the rest of your videos watching your progressing of your game. Gave me inspiration man!

    • @tomweiland
      @tomweiland  2 роки тому

      That's awesome! Glad to hear you've enjoyed the videos :)

  • @yourday1363
    @yourday1363 2 роки тому +1

    just amazing man , love this channel , ur multiplayer series was amazing , i loved it , ty so much

    • @tomweiland
      @tomweiland  2 роки тому

      Thanks for the kind words, glad you're enjoying the channel!

  • @sinksinkswim
    @sinksinkswim 2 роки тому +3

    Godspeed my friend, that's why I'm sticking to single player for the foreseeable future! Also the music that kicks in at 0:30 made me think That Chapter and I was worried someone was going to end up dead by the end of the video

  • @hazytp7150
    @hazytp7150 2 роки тому +8

    0:16 Yeah its such a good feeling when you rewrite all of that code but in a different way beause you thought your other way is stupid and didn't work BUT! then you see that you didn't type () or added an extra space
    Great video btw Hope we can see more videos soon. Love the progress so far Good luck!

    • @tomweiland
      @tomweiland  2 роки тому +2

      Yeah it's always nice when issues are quick one word fix...except when you spent 3 days trying to _find_ the issue in the first place :P
      Glad you enjoyed the video-I'd definitely prefer not to go another 3 months before the next one, so hopefully soon!

  • @TheCorrupt1on
    @TheCorrupt1on 2 роки тому +11

    You are doing great work man. The fact that you have gotten this far this quickly already puts you light years a head of others in the industry. To top it all off you are teaching yourself all this. That puts you even farther. I can't wait to see any tutorials that you (hopefully) put out for the new netcode.

    • @tomweiland
      @tomweiland  2 роки тому +5

      Thanks for the kind words, that means a lot to hear :)

  • @aarondcmedia9585
    @aarondcmedia9585 Рік тому

    Thanks for the link to the articles. Very helpful.

  • @EAurora
    @EAurora 2 роки тому +10

    can't tell if i'm inspired to make a game or heavily deterred
    love the videos!

    • @tomweiland
      @tomweiland  2 роки тому +2

      Glad you enjoyed it! I can at least see the light at the end of the tunnel now, so maybe take it as inspirational with strong warnings about what you're getting yourself into? :P

  • @ezoray
    @ezoray 2 роки тому +8

    It's interesting to hear your experiences with implementing multiplayer. I'm writing a multiplayer game myself in Unity but it's simultaneous turns on a grid-based map so I'm not feeling the pain of realtime play, I'm sure I'll discover my own pains as I progress though. Anyway, I always liked this quote from Michael Abrash's Black Book on reducing player latency in Quake - Reduced latency also often makes for more frustrating play. It’s actually not hard to reduce the latency perceived by the player, but many of the approaches that reduce latency introduce the potential for paradoxes that can be quite distracting and annoying. For example, a player may see a rocket go by, and think they’ve dodged it, only to find themselves exploding a second later as the difference of opinion between his simulation and the other simulation is resolved to his detriment.

    • @tomweiland
      @tomweiland  2 роки тому +3

      Yeah, hiding latency introduces a whole other set of problems to deal with...can't wait!
      It's very wise of you to work on a game that doesn't require realtime play 😂

    • @ezoray
      @ezoray 2 роки тому +1

      @@tomweiland Yeah, well actually no, I should have edited that. It is realtime but not realtime realtime. As in the players move in realtime simultaneously during their turn but they're restricted to a grid so I don't have to worry about little annoyances like physics and collisions. I've probably got it easy compared to you but there's still plenty to think about. It is at the same time both a 'fun' challenge and an interesting learning experience.

  • @simonbauer83
    @simonbauer83 2 роки тому +1

    Hey Tom! Has been a while since I dropped in to watch a video by yours.
    It changed, in a good way. You made me chuckle and it was informative.
    Keep up the work, mate!

    • @tomweiland
      @tomweiland  2 роки тому

      Glad to hear you like what has changed :D

  • @IronFreee
    @IronFreee 2 роки тому

    Sorry for enjoying watching your struggles on UA-cam :D Keep trying, it will eventually succeed (if it doesn't drive you mad).
    Remembers me when my friend and I had had to use an obscure front framework and the correct data wasn't showing, it took us 3 weeks of heavy sweating and nightmares to discover it was expecting some weird null instentiatiation with no data to work...

    • @tomweiland
      @tomweiland  2 роки тому +1

      "3 weeks of heavy sweating and nightmares" should be part of programmers' job descriptions 😅

  • @Commander_Wolf32
    @Commander_Wolf32 2 роки тому +6

    Great thumbnail :)
    Lol only just started watching and it’s already great

  • @christopherwalka6338
    @christopherwalka6338 2 роки тому +4

    This was a really good video Tom. Great video editing as well. You can see the effort you put in. Good luck with the continued efforts and we all look forward to more updates in the future!

    • @tomweiland
      @tomweiland  2 роки тому +1

      Thanks, really glad you enjoyed it! I definitely think this was my best video, despite being about a topic that can easily be very boring.

  • @TonsOfHunStudios
    @TonsOfHunStudios 2 роки тому

    Sounds like fun :D Sorry you went through these issues but this was very informative! It starting to sound like the Marvel Multiverse with all the client and server prediction stuff haha. Glad you got a lot of the latency/jitters fixed, at least with a single player in!

    • @tomweiland
      @tomweiland  2 роки тому +2

      Welcome to the Unnamed Pirateverse 😂

  • @ermilburn02
    @ermilburn02 2 роки тому +2

    Nice video, keep trying with the multiplayer, you'll get there eventually.

    • @tomweiland
      @tomweiland  2 роки тому +1

      Yep, I can at least see the light at the end of the tunnel now, so I'm hoping things will start getting less frustrating 😅

  • @pojomcbooty
    @pojomcbooty Рік тому +6

    Thanks for being so honest with this! I've been taking miro notes like a crazy person for the last few days learning about Unity netcode + thinking that I could just mash together these two:
    1. Hurricane VR
    2. Multiplayer netcode tutorials from Dilmer Valecillos
    - despite having some unity projects behind me, I think this is a CRAZY idea and I might have to scrap it all :-)

    • @tomweiland
      @tomweiland  Рік тому +2

      I have no experience with VR dev and I haven't heard of that guy or his tutorials so I can't really comment on that specifically, but yeah, multiplayer stuff is hard :P

    • @pojomcbooty
      @pojomcbooty Рік тому

      @@tomweiland yip. Very :-)

  • @bluewingtitan
    @bluewingtitan 2 роки тому +11

    I am soo happy I kept it ad 2d without physics and to something where single milliseconds don't matter that much. I really am feeling with you though, network-code is the worst to debug. Especially if you went insane like me and introduced multi-threading in the process, please just end my eternal suffering.

    • @tomweiland
      @tomweiland  2 роки тому +4

      Multi-threading is asking for trouble 😂

  • @enderduck4253
    @enderduck4253 2 роки тому

    Great video! Despite being much shorter, it was definitely your best!

    • @tomweiland
      @tomweiland  2 роки тому

      I agree! Analytics seem to be reflecting that too, it's doing twice as well as my videos usually do in the first 12 hours :)

    • @enderduck4253
      @enderduck4253 2 роки тому

      @@tomweiland glad to hear that! I hope to see more like this.

  • @Dominik-K
    @Dominik-K 8 місяців тому

    Great video and I've actually been confronted with this issue today too...
    My solution is very game specific, but it works out pretty well

    • @tomweiland
      @tomweiland  8 місяців тому

      Nice, glad you enjoyed it :)

  • @gnt542
    @gnt542 2 роки тому +5

    Yo, you finally got into the same problems I have been working on for the past 3 months. I was almost getting angry seeing you not having to deal with any of those. 😂

    • @tomweiland
      @tomweiland  2 роки тому +4

      Why try solving problems when you can just _avoid_ them instead 😅

    • @gnt542
      @gnt542 2 роки тому +6

      @@tomweiland Jittering is not a bug, it's a feature. It defines the status of chaos of the world making the player feel the uncertainty and instability of life. Latency also is important, it teaches the player to wait and have patience or to take initiative and get a better connection.

    • @tomweiland
      @tomweiland  2 роки тому +5

      Ah yes...patience. Precisely what the gaming community is known for...

  • @Tornadoally
    @Tornadoally 2 роки тому +3

    Wow! Amazing video. From the beginning to the end I was engaged and entertained. The only thing that could've improved this video was your jawline.

  • @xxyoboigxx
    @xxyoboigxx 10 місяців тому +1

    As a person who's just jumped into the ship of game development, I've decided that I want to make a multiplayer game at some point. So, I will absorb all of the videos that you have with issues and explanations/solutions to these issues. I've subscribed waiting for for the next video lol

    • @tomweiland
      @tomweiland  10 місяців тому

      I'm hoping to upload a new one in the next few weeks 🤞
      Good luck with your game dev journey!

  • @Orinslayer
    @Orinslayer 2 роки тому +1

    Oh my god that is the most hacked together solution I've seen in a long time. I love it!

  • @xmimagma4630
    @xmimagma4630 2 роки тому +65

    "They" is every single non-programmer ever.

    • @tomweiland
      @tomweiland  2 роки тому +7

      You may have a point 🤔

  • @TheBcoolGuy
    @TheBcoolGuy 2 роки тому +9

    Man, I am glad I'm only doing singleplayer.

    • @tomweiland
      @tomweiland  2 роки тому +1

      I think if/when I eventually finish this game, I will build a singleplayer game next. Or at least a multiplayer game that doesn't require hiding latency to ensure a good gameplay experience. Maybe a top down RTS or something 😂

    • @Efim141
      @Efim141 2 роки тому +1

      Or you can try building coop games where the client-side authority is usually enough

  • @murnoth
    @murnoth Рік тому

    Thanks for the heads up. I find struggle in every corner so I'm not surprised

  • @castlecodersltd
    @castlecodersltd Рік тому

    Great video, thanks for sharing. Funny as well, which helps 😃

  • @headhunter531
    @headhunter531 8 місяців тому +8

    Don't lie. DO NOT lie. No one said coding would be fun 😂

  • @boredduck231
    @boredduck231 2 роки тому +7

    The pain which every gamer and program feels
    rip my guy

    • @tomweiland
      @tomweiland  2 роки тому +2

      It's been a looong 3 months 😂

  • @KamranWali
    @KamranWali 2 роки тому

    Awesome video! Yeah multiplayer is a real though one. I personally have not tried multiplayer in Unity3D but tried it in JME3 with SpiderMonkey. But it looks like you are almost perfecting it. Keep it up! :)

    • @tomweiland
      @tomweiland  2 роки тому +1

      Haha yeah it's definitely a bit crazy once you get into the deep end :P

  • @abdelkaderomrani6049
    @abdelkaderomrani6049 2 роки тому

    Ran into this few months back and its hell , i hope you make a detailed video about prediction for just the player movements

    • @tomweiland
      @tomweiland  2 роки тому

      Yeah, I'm considering _maybe_ covering it in a tutorial at some point in the future 🤔

  • @Taki7o7
    @Taki7o7 2 роки тому +3

    Making multiplayer games with Unity is just a pain, it's so simple if you're aware of networking basics in Unreal ^^

  • @icefire5555
    @icefire5555 2 роки тому +4

    The irony that UE4 does movement prediction for you with very little effort. You just tell the server and client to move. And it solves the rest.

    • @tomweiland
      @tomweiland  2 роки тому +1

      I mean that's nice I guess...but totally useless in my case. A generic prediction solution would have the exact same issues on boats that I'm having, so I would end up needing to heavily modify it (at which point it'd probably just be easier to write my own). I'm also using Unity and don't plan on switching-I like C# and don't feel like learning C++ right now, and blueprints are quite unappealing to me.
      It's also worth noting that Unreal's netcode out of the box is really only good for small arena shooters with less than like 20 players (my game is not one of those). Epic themselves had to make modifications to get Fortnite to be able to handle 100 players on the same map.

    • @Hunsenbargen
      @Hunsenbargen 2 роки тому

      @@tomweiland Yeah that's true, the MMORPG Ashes of Creation is being made on UE4 and they had to make their own proprietary networking to make UE4 capable of supporting a massive concentration of people (the Massive on MMO :P)

    • @soylentgreenb
      @soylentgreenb 10 місяців тому

      @@Hunsenbargen I would think this is mostly about reducing fidelity. Players that are far away don't need 60 updates per second or even 30. Even 1 update per second will go very far as long as they are running in a somewhat straight line or turning smoothly. You therefor only need to send frequent updates if they are doing something unexpected. As the number of players increases the naive solution is an O(N^2) problem.

    • @mightyt73
      @mightyt73 10 місяців тому

      I was going to say. A lot of these issues (not all) are solved in UE out of the box. I actually found it very easy to set up a multiplayer replicated movement model.

  • @indieprogress7170
    @indieprogress7170 2 роки тому +1

    Hahaha I haven't even tried multiplayer yet, but I feel your pain. It's always some small error that you spend most of your time trying to fix.. Nice video!

    • @tomweiland
      @tomweiland  2 роки тому +1

      Yeah, the small things always cause the biggest problems...glad you enjoyed the video :)

  • @LuckyLucasLife3L
    @LuckyLucasLife3L 2 роки тому

    You're really good with analogies!

  • @RobLang
    @RobLang 2 роки тому +3

    I did laugh with you at a couple of points. Streaming gaming services can't come fast enough. Your description is excellent, I think it was wise too stop before you got into estimating latency and forward calculating at the server. "Time streams" was a great phrase.
    Still enjoying your vids, sorry it's being such a pain.

    • @tomweiland
      @tomweiland  2 роки тому +2

      Glad my humor hasn't been stripped of me along with my sanity 😂
      I'll figure it out eventually, I have the bulk of the pain out of the way now, so I at least see the light at the end of the tunnel :)
      I'm hoping I explained things well enough with enough visual aids to keep people interested even if they're not familiar with programming and multiplayer.

    • @RobLang
      @RobLang 2 роки тому

      @@tomweiland you explained it well enough for me to not build my own!!! 😂

    • @tomweiland
      @tomweiland  2 роки тому

      LOL
      Your wisdom clearly exceeds mine.

  • @user-yn5te8vj5j
    @user-yn5te8vj5j Рік тому

    Good thing channels like this exist that talks about painful topics, having a beer beside you does wonders 🤣

  • @ArcaneWorlds
    @ArcaneWorlds 2 роки тому

    Funny, we made the exact same decision recently !! We’re going to onboard a networking specialist in our second release probably ! Nice content !

    • @tomweiland
      @tomweiland  2 роки тому

      Wait, the exact same decision as what?

    • @ArcaneWorlds
      @ArcaneWorlds 2 роки тому

      @@tomweiland sorry was a late night message ☕️ I meant we’ve started to look into client predictions as we are building a multiplayer element to our game - turns out to be a bigger can of worms than we expected 😖😂

    • @tomweiland
      @tomweiland  2 роки тому

      I mean client prediction itself is still _relatively_ okay. The problems really come in when you need it to work on another moving object like a boat...

    • @ArcaneWorlds
      @ArcaneWorlds 2 роки тому

      @@tomweiland yes we don’t have that issue so much.. for now….

  • @TPD_Dev
    @TPD_Dev 2 роки тому +3

    "Take 2 days to fix the error"
    Me trying to upload my game to google play from past 2 days
    1. Keystore
    2.some random arc64
    3.150mb limit
    4. api
    time taken 1- week

  •  2 роки тому +11

    Oh if only the players knew what we go through to make the multiplayer experience at least on the "acceptable level".. #PrayForNetDevs

    • @tomweiland
      @tomweiland  2 роки тому +2

      True. I think we are under-appreciated :P

  • @kfestofil3249
    @kfestofil3249 Рік тому

    Bro, I feel you so much rn, I am literally stuck at client prediction in my own game right now xd

  • @madferretgamedev
    @madferretgamedev 2 роки тому

    Awesome video Tom!

  • @Ari-ez1vj
    @Ari-ez1vj 2 роки тому

    I had a very similar experience working on a multiplayer FPS i never ended up finishing. I avoided the issue with player-movement by using a character controller, however, I was having lots of issues with rigid-body projectiles. It was such a pain in the head I ended up scrapping most of them.

    • @tomweiland
      @tomweiland  2 роки тому

      Hmm, you must have had a different problem then, because using the CharacterController instead of a rigidbody controller wouldn't change anything. I'd still have the exact same issues...

  • @ChristopherCricketWallace
    @ChristopherCricketWallace 2 роки тому

    thanks for the article links!

    • @tomweiland
      @tomweiland  2 роки тому

      No problem, I hope they're helpful :)

  • @CodemasterJamal
    @CodemasterJamal 2 роки тому

    Glad to see you're back.

    • @tomweiland
      @tomweiland  2 роки тому +1

      Yeah...only took 3 months :P

    • @CodemasterJamal
      @CodemasterJamal 2 роки тому

      @@tomweiland progress is progress, my dude.

  • @xDDBF
    @xDDBF 2 роки тому

    wow the end got me dying lmfao, my everyday struggle and im not even as good as you.. It's a pain.

    • @tomweiland
      @tomweiland  2 роки тому +1

      Welcome to multiplayer game dev 😂

    • @xDDBF
      @xDDBF 2 роки тому

      ​@@tomweiland hahaha, you're the man tho, i really appreciate your work, i can watch your tutorials to understand a bit more about how things are done. Keep it up! :)

  • @WwZa7
    @WwZa7 14 днів тому

    This is actually a great explanation why standing on a vehicle in any multiplayer game like Battlefield series was always normally fine, but when it was moving, things would go spasmatic and probably end in phasing through the vehicle or dying for no reason.

    • @tomweiland
      @tomweiland  5 днів тому

      Makes sense-as long as it's not moving, you don't experience the effects of objects from different "time streams" interacting. Once it moves though, 💩 hits the fan :P

  • @jonahhenriksson
    @jonahhenriksson 2 роки тому +1

    Best choice I made when creating my multiplayer game was switching over to Unreal. I've used Unity for years, learning all the ins and outs, but it lacks the tools for multiplayer development. Unreal has a ton of great features for multiplayer like profiling, viewing net corrections (aka where you f'ed up), controlling multiple players and simulating latency and packet loss. The cons are that it can be tough to find documentation on stuff and there are some videos out there that give bad advice (such as using blueprints for multiplayer; DON'T use blueprints for player movement, C++ is the correct way). Luckily, there are great videos out there that give awesome advice on how to do it properly.

    • @tomweiland
      @tomweiland  2 роки тому

      Unfortunately I love C# and don't really want to spend a ton of time learning C++ just so I can use Unreal's multiplayer. Also, while I haven't used Unreal's netcode myself, I've talked to others who've said it's really not as great as most people make it out to be. Either way though, I'm not sure their out-of-the-box solution would take care of the problem I had here, so it's very possible I'd just end up having to solve the same issue, just this time using a language and engine that I'm not at all familiar with.

  • @hereandnow3156
    @hereandnow3156 5 місяців тому

    I don't really understand how the solution of the second boat not moving works but that's cool as hell that it does.

  • @weylinstoeppelmann9858
    @weylinstoeppelmann9858 10 місяців тому

    I think player movement can be handled locally, but if the player moves beyond the sphere of allowable mismatch and for too often, it can be verified more and more by the server.
    I used something like a "suspicion" tracking variable, where someone speed hacking or teleporting quickly finds their movement entirely server-authenticated.
    So it trusts the client initially, but the trust can be lost for a time.
    Multiplayer coding is absolute hell, just getting a game to finally accept connections was a whole endeavor...

    • @tomweiland
      @tomweiland  10 місяців тому +1

      The problem is that checking speed or distance traveled doesn't account for things like collisions, and those metrics really say very little about whether the movement is "acceptable". A system like that wouldn't catch someone who's walking through a wall, or someone who slows their gravity down so they fall slowly, and making the system capable of detecting those things essentially requires simulating all of the movement logic on the server.
      At that point, it's arguably easier and less work to just give the server full authority, and by doing so you'll also avoid dooming yourself to playing the cat & mouse game of hackers finding ways to exploit/evade your detection systems and you having to react. At the end of the day it just comes down to what tradeoffs you want to make-I prefer giving cheaters as little chance as possible to gain an advantage :P

  • @luccabollani377
    @luccabollani377 2 роки тому

    Keep on it Tom. Eventually you'll figure it out 👍

    • @tomweiland
      @tomweiland  2 роки тому +1

      Yeah I've got the bulk of the problem behind me now so things are looking up a bit :P

  • @infinitenex8165
    @infinitenex8165 2 роки тому

    The first 30 seconds resonate with me so much

    • @tomweiland
      @tomweiland  2 роки тому

      Haha I figured many people would be able to relate :P

  • @mbamboogames8843
    @mbamboogames8843 10 місяців тому

    I had the same problem when I created my first multiplayer game too, but I found out that letting the player move only after getting the move message from the server worked better than trying to predict the player’s future position on both the server and the client at the same time. The process was: player presses W -> sends it to server -> server check if the move is valid and instantly sends back command to tell client to move the character.
    The latency can be forgiven because most of the time it happens in less than one frame. That way, I can focus on reducing the message size instead of trying to correct the player position, which is a dead end.

    • @tomweiland
      @tomweiland  10 місяців тому +1

      Waiting for a response from the server before moving quickly leads to an experience that is sufficiently unresponsive for it to feel awful. A 50ms round-trip time is plenty for the delay to be noticeable, and I'd argue that it's unreasonable to expect most players to have less than that, especially when you factor in the added delay from your tick rate (lower tick rates mean bigger gaps between ticks, which effectively increases the time it takes for the server to respond) and from slightly buffering positions so you can interpolate them and have the movement look smooth.
      Players with powerful rigs and high refresh rate monitors will also be more likely to notice delays than players whose monitors max out at 60hz.
      _"The latency can be forgiven because most of the time it happens in less than one frame."_
      This is just not true in my experience, unless you're testing with the server and client on the same network. At 60hz you have a frame time of ~16ms, and the vast majority of your players will almost certainly not have a round trip time that's less than that. Someone with a 144hz monitor will have a frame time of just ~7ms, so even if they somehow had a mere 25ms round trip time on their connection, at least 4 frames would pass before they see the result of a key press.

  • @willmcdonnell287
    @willmcdonnell287 2 роки тому

    very helpful heads up. thank you

  • @larsliamvilhelm
    @larsliamvilhelm 2 роки тому +2

    This video is a whole mood

    • @tomweiland
      @tomweiland  2 роки тому

      That's exactly what I was aiming for when making it :P

  • @ROBdk97
    @ROBdk97 2 роки тому

    I really feel you.... Had the same issues in the past.

    • @tomweiland
      @tomweiland  2 роки тому +1

      I can't wait until I can also talk about this stuff in past tense 😂

  • @SambusLive
    @SambusLive 2 роки тому +2

    You probably want to keep your control over the server, but if you ever decided to switch to Photon, it has an option for extrapolation to enable Photon's server to predict where a player's transform may be in its Photon Transform View Classic documentation. I'm unsure of how well this will work for your game, but in case you weren't aware of this option, thy has presented it.

    • @tomweiland
      @tomweiland  2 роки тому

      Wait, it predicts the location of _other_ players? That's normally a major no-go in first person shooter games...

    • @SambusLive
      @SambusLive 2 роки тому

      @@tomweiland I see, I've never needed to use the option myself, so thanks for letting me know

  • @samochreno
    @samochreno 2 роки тому +1

    Hey bro I don't know if you read your comments, but if you do, could you please tell me how you store your mesh colors/roughness in vertex data and then use it in a shader without breaking batching? I think you mentioned it somewhere but I cant seem to find it, it would help a lot, thanks

    • @tomweiland
      @tomweiland  2 роки тому +1

      Well in addition to a position, UV, normal, etc. each vertex also has a color, so I just set that. I believe you can do that from within Blender (or whatever other modeling software you use), but I do it from within Unity: docs.unity3d.com/ScriptReference/Mesh-colors.html
      Since I don't need the alpha component, that's where I'm storing the smoothness.
      I didn't do anything special to avoid "breaking batching", but I'm actually not sure what makes you think that any of this would break it...

  • @martyboi5609
    @martyboi5609 2 роки тому +1

    I feel your pain, and I haven't even started making my game multilayer

    • @tomweiland
      @tomweiland  2 роки тому +1

      Oof.

    • @HomeSliceGame
      @HomeSliceGame 11 місяців тому

      I started, but hoping my game doesn't have anything complicated to run into these issues! lol

  • @CreativeOven
    @CreativeOven Рік тому

    Nice video looking forward for more videos.

  • @wiktorm.3613
    @wiktorm.3613 2 роки тому +1

    Thumbnail is awesome xD

  • @timothygooding9544
    @timothygooding9544 2 роки тому

    the second boat idea is actually amazing
    any chance for a rundown if it ends up working? I'm making a vehicle based game too but I'm staying out of multiplayer stuff for now lol

    • @tomweiland
      @tomweiland  2 роки тому

      It seems to be working relatively well so far, although I haven't cleaned any of that stuff up yet so it's still rough around the edges. Does your "vehicle based" game actually involve players being separate, independently moving objects while inside/on board said vehicles? Because if not, you can avoid all of this 😅
      The same thing applies if you're not particularly concerned about cheaters. Make the movement client-side and you can save yourself a _lot_ of pain :P

    • @timothygooding9544
      @timothygooding9544 2 роки тому

      @@tomweiland Its basically a star citizen rip-off that has quickly turned into a VR version of that same thing, using movement from Lone Echo and eventually the cockpits of VTOL VR.
      I know to stay away from getting serious about multiplayer for a while, (the base game as it is will take forever) but the plan is to have ship interiors that you move around in.
      Farthest I can think of realistically going is local asynchronous, where the PC player and VR player use the same computer, so any server stuff would hopefully be relatively basic in comparison to actual multiplayer games.

  • @Dark_Slayer3000
    @Dark_Slayer3000 Рік тому +1

    5:09 Little tip for recording long texts where you run out of breath:
    take little stops inbetween to breathe and cut it out in editing so you have a more chill recording experience :)

    • @tomweiland
      @tomweiland  Рік тому +1

      Thanks, but it was honestly just a joke :P

    • @Dark_Slayer3000
      @Dark_Slayer3000 Рік тому +1

      @@tomweiland considering how often I need to cut down my audio, I honestly related too much to see the joke 🤣

  • @renji-hjk
    @renji-hjk 2 роки тому

    i am big fan of games that can use multiplayer criatively like clash royale that transfer a simple card info and the position in the field and even if you lag the server do the recalculations and sincronizes the players, it moves so simple info but works so well for a vs mobile game that is awesome

    • @tomweiland
      @tomweiland  2 роки тому

      I mean when you only need to deal with card spawn positions, that makes life a whole lot easier 😅

  • @blue_birb
    @blue_birb 9 днів тому

    You can fix the jump when going on and off boats with a sigmoid function to interpolate between the positions

    • @tomweiland
      @tomweiland  5 днів тому

      Yes, interpolation would be able to hide most of the jitter in most circumstances.

  • @Thomason1005
    @Thomason1005 9 днів тому

    interesting idea with syncing the player position relative to the boat, but you could skip the floating boat, just synch a parent id + relative position over the network!

    • @tomweiland
      @tomweiland  5 днів тому

      The problem with that is that it doesn't account for the discrepancies/delay in the boat's rotation, which would still lead to jittering/mispredictions an various situations. That's part of the reason why I went to the trouble of adding a "proxy" boat-it doesn't need to rotate so it just avoids that issue entirely.

  • @tazyohivesg-player8674
    @tazyohivesg-player8674 2 роки тому

    That last part gave me goose bumps, and not the good ones...

  • @nitricswight
    @nitricswight 2 роки тому

    Hey Tom. I was wondering if you recommend using unity's multiplayer api, MLAPI or just doing the networking from scratch. Thanks :)

    • @tomweiland
      @tomweiland  2 роки тому

      If by "Unity's multiplayer API" you mean the networking solution they developed for DOTS, I haven't checked up on that in a looong time. MLAPI is still under development as far as I know.
      What solution you use really depends on what you want. I like having lots of control and knowing what's going on under the hood, which is partially why I wrote my own low level solution. Check it out if you're interested (I haven't made any tutorials on how to use it yet though): github.com/tom-weiland/RiptideNetworking
      MLAPI will do more for you out of the box, but that generally comes at the cost of control, and potentially performance. Mirror is the same, except it's even higher level, and I personally really disliked using that because it felt like I had no control :P

  • @mihnwq9211
    @mihnwq9211 11 місяців тому

    wondering, can't you move the player instantly by letting the calculator do the movement, still send the data to the server and when it's done coming back, you can do something like |newPosition - lastPosition| and determine the cheater by the rate of change?

    • @tomweiland
      @tomweiland  11 місяців тому

      This is basically what happens for prediction/reconciliation, except the part about checking the rate of change. Checking the rate of change (or a discrepancy in calculated values) on the client and using it to ban the player or something is pointless as a cheater could tamper with those calculations on his end.
      Because the server is the source of truth, the positions the client calculates are irrelevant anyways (from a preventing-cheating-perspective) and any tampering with the movement calculations will not affect any other players. A cheater could walk through walls or fly or move really fast on his end _only_ and maybe look at things which a normal player shouldn't be able to, but there is quite literally nothing that can be done to prevent that.

  • @voodookittoys7606
    @voodookittoys7606 2 роки тому

    Hey Tom Weiland i wanted to ask if you could make a toutorial on how you made the water my water just dosn't look as good as yours. I love your videos keep going.

    • @tomweiland
      @tomweiland  2 роки тому

      I'm not sure if I'll do that-the water is kind of my "secret sauce", so if I do ever make a tutorial on it, it'll probably be way in the future.

    • @voodookittoys7606
      @voodookittoys7606 2 роки тому

      @@tomweiland ok i can undestand if you dont want to show how you made your water but if you will then im looking forward to the toutorial

  • @Nervniyak
    @Nervniyak 2 роки тому +1

    Love the duct tape solution you came up with :D How exactly do you calculate movement on proxy?

    • @tomweiland
      @tomweiland  2 роки тому

      Pretty much the same way it's calculated anywhere else. I just teleport the object that has the collider and movement code on it down onto the proxy and then let things run as usual.

    • @Nervniyak
      @Nervniyak 2 роки тому

      @@tomweiland so on server you have N players and M ships and they will all be simulated on 1 proxy? I believe this solution will be hard to maintain because of player and projectile collisions. Wonder how they did parented movement in Rust game.

    • @tomweiland
      @tomweiland  2 роки тому

      Currently I have player collisions disabled, and projectile collisions would still be calculated in the "real" world. I'll definitely need multiple proxies though, because eventually there will be different ship types/builds so the colliders will need to be different.

  • @rmt3589
    @rmt3589 Рік тому +1

    Congrats!

    • @tomweiland
      @tomweiland  Рік тому +1

      For what exactly?

    • @rmt3589
      @rmt3589 Рік тому +1

      @@tomweiland Working hard, and getting these difficult things done.
      Not everyone does that, and I see you going strong. Good job!

  • @angadbasandrai4814
    @angadbasandrai4814 2 роки тому

    Great! But when is the real devlog coming Tom?

    • @tomweiland
      @tomweiland  2 роки тому

      Define "real" 🤔
      I'd definitely like to _not_ take another 3 months before the next video...

    • @angadbasandrai4814
      @angadbasandrai4814 2 роки тому

      I mean the devlog where you have something new to show?

    • @tomweiland
      @tomweiland  2 роки тому +1

      Uh well I suppose whenever I have something new to show lol

    • @angadbasandrai4814
      @angadbasandrai4814 2 роки тому

      @@tomweiland LOL

  • @HATL201
    @HATL201 2 роки тому

    Nice video! This is unrelated, but can you please tell me what water shader you're using? It looks good!

    • @tomweiland
      @tomweiland  2 роки тому +1

      I wrote the shader myself, I'm glad you think it looks good :)

    • @HATL201
      @HATL201 2 роки тому

      @@tomweiland it's awesome looking mate! Hope you do a tutorial on it 👍

  • @at930pmgames
    @at930pmgames 2 роки тому +1

    Feel so related to this. Im making a multiplayer 2d car game and im using photon pun 2.
    I move the player with rigidbody but even if its smooth synch because photon has their own synch system, sometimes the wheels goes crazy, they also have rigidbodies. So im struggling on what to do 😅
    Also the events in the scene that have to be synched for all players, like when the player activates a trap, or simulate bunch of rocks going down the hill to crash players.

    • @tomweiland
      @tomweiland  2 роки тому

      Not sure if you were looking for advice for your problem, but since I'm not really familiar with Photon I don't think I'll be able to help much 😅

    • @at930pmgames
      @at930pmgames 2 роки тому

      @@tomweiland lol im not looking for advice, was just commenting as i felt related with your video.

  • @Thesupperals
    @Thesupperals Рік тому

    Before you got to the part where you wanted to get back to the practical side of things 4:13, I immediately thought "why not use a decimal data type and clamp the position to the nearest median? The difference is negligible." Also, to fix your new problem, it starts off with how you tackle the problem. First off, depending on your set up, the water becomes the parent and the objects such as ships and the terrain to walk on become the children of the sea. When the boat sails out to the sea and hits a certain local distance in the water, the land itself moves away from the boat and the water instead; This has the server calculate the position of the static land (and local position of the player), not the boat.

    • @tomweiland
      @tomweiland  Рік тому

      _"I immediately thought 'why not use a decimal data type and clamp the position to the nearest median? The difference is negligible.'"_
      What exactly would this accomplish/solve?
      _"When the boat sails out to the sea and hits a certain local distance in the water, the land itself moves away from the boat and the water instead; This has the server calculate the position of the static land (and local position of the player), not the boat."_
      Are you suggesting that I make the boat stationary and move the land and water around it in order to make it _look_ like the boat is the one moving? That sounds _at least_ as complicated as the solution I ended up with, and it has many more problems. What should happen if one player is standing on a boat and another is on land? What should happen if there are 2 boats? Which one should everything move in relation to?

  • @sylvan4042
    @sylvan4042 2 роки тому +1

    Just curious, are you writing the network code yourself or using a premade network solution like Mirror, Photon, or whatever Unity has nowadays?

    • @christopherwalka6338
      @christopherwalka6338 2 роки тому

      He's writing it all himself I believe.

    • @tomweiland
      @tomweiland  2 роки тому +2

      I'm using this, which is an RUDP solution I built from scratch: github.com/tom-weiland/RiptideNetworking

  • @Povai
    @Povai 2 роки тому

    I feel your pain man, and what I tried to do was much more primitive :D

  • @martiusr2404
    @martiusr2404 10 місяців тому

    So vast majority of described issues are occuring in case of real-time games? For example in turn-based strategy with classic turns (so no simultanous turns) multiplayer is "less susceptible" on those issues?

    • @tomweiland
      @tomweiland  10 місяців тому

      Yes, a turn-based strategy game (even with simultaneous turns) could probably get away without any sort of prediction/latency mitigation techniques because there just isn't anything happening which is super time sensitive.