 Hey there. Yeah, this is yet another video about the partnership between PigDev and Packet Publishing Yeah guys, I'm to release the book There will only be videos about there here in the channel because I need you to support me guys I have built to pay. I'm about to move to an apartment. So yeah, I have like this extra money guys. Please help But anyway in this video, we are going to talk about We are going to make a Q&A. So there are a lot of questions that people Repeatedly asked and some that are interested, but some They are not repeated and I decided to group them all together and reply at once here in this video So let's get started So let's start with the first and most asking question, which is is the book up to date with Godot 4.2? Yes, the book is up to date with Godot 4.2 And I think that it will be up to date with all Godot 4 releases because the Godot team don't usually doesn't usually make major changes in Feature releases. So they are feature releases and not major releases and that they use Use usually they don't make anything that break Compatibility so with the API, right? There there were some changes So there were some optimization fabulous and I made some cool optimizations and I think that was some Usability improvements as well, but nothing that that will prevent you from following the book So you can still follow the method present in the book and everything will work So I hope this ask this question So moving on to the next most asked question, which is does the book address dedicated servers? so as I said, I have few experience with Online multiplayer development in development, but the small research that I did From what I couldn't stand. Yes, the methods presented in the book definitely addresses that you could use servers because The very API itself takes the premise that there will be a client in the server So you can make just the server code Self-contained and you can run only the server side of the application on the dedicated service that you are host that you are Using to host your game So you can make like segregated applications one for the server one for the client and they can run Independently as long as you can make the communication between them So answering the question, does the book address dedicated server? Yes Okay, so this is a tricky one because I couldn't test it by myself and by the time that the person that actually started with this with this topic Was able to help me the book was already Was what was ready? So if there was something about that that was necessary to talk about I Couldn't actually make any major changes But the question is does the book address port forwarding? So port forwarding is a type of Redirect as far as I couldn't stand as I said, I don't have much experience with networking and stuff like this But port forwarding is like a kind of feature or tool that Internet providers and especially some more modern do that they will kind of like redirect some IPs so they have like a hub and they can redirect some IPs and mix them and so I think that this is made for security I don't know the thing is as far as you have because this is kind of like a mass king of IP addresses So as far as you have the direct IP address to the computer that you want to make a connection with You can basically just make a direct request to it So there is no problem with this kind of port forwarding as far as you have the IP address the direct IP address you can override the The local host in the instructions that we have in the book because in the book we are using local hosting But everything should work as it as intended as planned as far as you have the direct IP address for the computer that you are Using has as your hosting services as your hosting computer You'll be good. So answering the question. Does the book address port forwarding? No, but as far as you have the IP address of the server that you want to connect you'll be good So moving on to the next question is the approach server client base or peer-to-peer based So the approach that we use in the book is server client base So you have a client that connects to a server and a server that opens a port of connection for clients and But the Godot engine API network a high-level network API has a feature called mesh peer Something like that where there are many peers that behave in an horizontal relationship So there is no actual authority on the network as far as you can understand to be honest I don't understand very well this whole thing But answering the question is the approach server base of server client base or peer-to-peer based I would say that it's server client based So yet another very asked question is is there a PDF or online version of the book if you buy any of the copies of the book so the Kindle one and the physical one so the the paperback one At some point in the book I don't I don't know if it's at the cover side or at the end of the book There is a QR code for you so you can redeem a PDF version of the book So you can read it for personal use, but there is no official PDF version online yet and There is no online version as well as far as I as I know I don't know if the packet the packet publishing Online platform provides this kind of feature But I will put a link in the description so you guys can check this out. Maybe they have they have like a Reading platform that you can have access to all the books that they provide of course for a monthly fee Probably, I don't know if this is a business model that they follow But I know that this there is some platforms that provide this kind of server service So maybe they provide it as well So answering the question is there a PDF or online version not yet or not officially at least So another question that is very interesting to answer is does the book cover Transmitting user passwords securely No, this is not a topic that we cover in the book. This is this links more towards like network security and this kind of Thing that we are more concerned when we actually have some something in bigger scales So in the book we have like a fake database with uses press was so it's plain text Just for testing purposes, but yeah, of course if you have something that is meant for real life situations You will have some kind of cryptography behind this so maybe you will yeah use something like a HTTPS request for sending and receiving passwords or like other kind of sensitive data Another very interesting question asked is Is there any server side prediction to help prevent cheating for example if someone use cheat and engine to teleport 8,000 units on the X axis Could the server know that was impossible in the I think that in the Chapter 12 we talk about prediction interpolation and extrapolation and By by by this chapter we take the responsibility of calculating the player's Positioning and movement in general to the server. So the server is the actual responsible for stuff like this And it makes prediction based on the previous and next the the the previous and current position of the of the character so and it adjusts the the actual velocity of the of the Of the player's spaceship Because we are using the project made in chapter 9 from chapter 10 and and beyond so Answering the question. I think that probably with this after implementing the the knowledge present and the techniques presented in chapter 12. You are probably be able to make this kind of This kind of Prediction to prevent cheating. So answering the question Is a very shady question because I don't know how complex it will be to actually prevent actual cheating but Entering directly the question. Is there any server side prediction? Yes Prediction interpolation and extrapolation is all done on server side. I think that interpolation and extrapolation is made on the client side because They receive the new position that the server calculated and then they will make the interpolation and the extrapolation But the actual prediction is made on the server side. So the server is the one that actually provides The the data regarding the movement made by the player's character or in this case the player's spaceship So the next question is do you have a guide to setting up a server to run your good old game in it anywhere? Even if it's not yours would be useful to have. Yeah, definitely. So nowadays the very good documentation itself About the in net peer connection or in net peer only Has a Micro tutorial about how you can set up a server and connect your server So answering the question. Yeah, I will put the link in the description for the documentation. So you guys can see how easy it is Yeah, when you have documentation is very easy to understand the stuff So the next question is what do you consider to be the most difficult part of designing implementing online multiplayer games in Godot? so I think That the from my experience Which is basically writing this book the most difficult part was chapter 12 About like implementing prediction extrapolation and inter interpolation and also chapter 9 especially the part that was about like synchronizing the Server world to players world because there are a lot of stuff that you can miss in this in this replication because the synchronization because you never know What will be on this on the other side of the connection or what would not be on the other side? so for instance on the Server side, you can have like an obstacle that appears like let's say the player cast one of the players casted like a Skill that creates a wall nice wall for instance or or an earth wall and This wasn't replicated in the other players Instance of the game So the other players will be like just passed through And hit the other play if there is like a PvP for instance so you'll have to be very careful about Everything that we implement and how will this replicate in other players instance and also prediction and extrapolation and interpolation is very annoying as well because there is just a lot of things that you Have to calculate and it's not as easy as just like basic physics You'll have to calculate like the time between the collection and maybe is not Accurate as you think it would be because it takes the previous Time like the previous calculated like latency and it might be not the current latency and another thing is that if you Like you never know how will the player actually behave so you may calculate like okay So based on this velocity of the player We can make an extrapolation that it will be that the players spaceship or the play character We'll be at this position at this time in the next frame or in the next network thick and If they made some if they stop it walking or trusting Or so there is another technique which we don't don't go through in the book I think that is you take the the players input and you try to Create an average behavior for the player so I don't know if you already saw this kind of stuff like players trying to be a very random in the in the Play in the gameplay Online gameplay especially on like counter strike or this kind of first-person shooter multiplayer games I'll play tries to be like very random in there the movements, it's probably because if valve like if the Algorithm Realize that there is like a Pattern in the movement it will create a Next movement that is predictive for the other players as well And if they up if they need to update the like synchronize the players based on this algorithm The other play can like predict where it will be the next position and show the other player right there Whereas the player maybe it will not be there So yeah, there are a lot of stuff regarding interpolation prediction and extrapolation that Is very fine-tuning and very specific to each game Which I think that this would be one of the most aggressive topics when you want to actually develop an Nicerate action based online multiplayer game So the next question is I am new to good old. Well, welcome. I want to create to the MMORPG games Nice. Is it possible to do like this type of game massive multiplayer? And yeah, if yes, how what I need to learn. Well, the first thing is like by the book a read it Because One connection from using the growth API Supports like I think that up to four thousand Clients in a single server if the server has the infrastructure and actual hardware support this amount of of Clients But the the connection itself like the software itself Supports more than four thousand connections in the single in a single server and I want to create a to the so one of my mate one of my core Influences while making this whole book was regular online because I always wanted to make something like that So I didn't saw anything That would prevent us from making something like this. So we're playing this question Well, I think that is very viable to do So it's just a matter of like learning how to actually make a single player version of your 2d MMORPG and then you port it or your remake it as I Online would play a game. So I am new to go out first learn how to make Simple to the games then you move on to making any more RPGs because they are way more complex than you think What I need to learn. Yeah, learn the things that are in the book basically With that way, you'll be able to like extrapolate the knowledge and apply it to to your own game So the next question is what is the best cloud architecture for multiplayer games? Containers, maybe. I mean, how do you manage concurrent sessions? Thanks Tricky one, right? So to be honest, I I don't know Cloud architecture for multiplayer games. I have no idea. How would you make that? But regarding concurrent sessions if this is regarding like if the same player can log into the server and and Using the same email someone else could log in as well using the same user in the book we address this kind of situation where you basically just keep a Singleton with all the players that are currently logged in if the If another person tries to log in using a player's username It will be in this dictionary and you basically say, oh connection denied so Yeah, I think that the best option would be like to drop the current player and login with Using the the newest the new attempt to connect. I think that this will be better but to be honest, I didn't actually understand how for what this question actually addresses so Yeah, sorry about that. This is one of my limitations. I we don't work with cloud Architectures in the books. So I have no idea How would I reply to that? Oh, how would I implement this kind of thing in a multiplayer game? At least not now So the next question is how hard is making a client prediction system and will it be implemented on good old? Natively if is not there yet Well, I don't know if there is any plans to implement anything like that natively in good old currently there is none The prediction interpolation and extrapolation system is not that hard Especially if you use like the good old current available features for instance the twins Which by the way guys I'll put a link to the description for a request that I made on the good old Proposals that for a proposal that I made there Asking the guys to bring back guys to bring back the twin node. I The new the new system is it sucks. I mean there are some features that are very cool And but there is nothing like that prevent us from having this feature with the previous twin node Actually the current twin system behaves almost like if it was a node. So there is no reason for Not being an old And it's very annoying because anyway, I'll put a link to the description so you can go there up vote my request guys Please let's make this happen. I need to leverage My followers here. So let's do that. Let's massively Although I vote my my feature proposal to bring back the previous twin node but anyway Using that twin the new twin system, which is not a node, right? So it's just twin twin class So using the twin class, you can make Interpolations and extrapolations very easily and you can use some supportive classes like the in net Connection if I'm not the mistaking to gather some data necessary for making like prediction So for instance using the players current latency to calculate the actual Velocity of the player based on the previous and the current Updates about its position so you can calculate the actual Velocity of the player using this as the the base for calculations So answering the question. I don't know if there will something be implemented natively on good or regarding that That could be something like that in the multiplayer synchronizer It will be very very good to have this natively implemented, but since this is something that is very It's very ad hoc most games will need something Something very specific for each situation So I think that that won't that won't be something like this At least not very Usefully, so I think that this is the kind of stuff that you have to make by hand on your end so Manually answering the question how hard it is to make a prediction system It's not very hard as long as you know what you want to predict and the data that you will need to make this prediction And you can use like the twins to make interpolation an extra position And I don't know if there will be anything regarding that in the near future of good old engine So the next question is Interpolation I beg guys When I was writing the book one of the most shared retweeted and stuff like this Post that I made was exactly about interpolation and prediction and extrapolation So chapter 12 has this kind of knowledge guys We have prediction interpolation and extrapolation like compensation techniques and some introductory Paragraphs about what's lag what is latency? Why does the the stuff happens? Why do they matter and Everything like that. So interpolation I beg. Yes. I attended your request. We have interpolation chapters on the book So the next question is how can you go about hosting servers and managing players connections and data? If your game isn't on a platform likes team, this is a good question Well, usually you have a self-hosted platform, which is kind of the industry default to be honest And you can hire some services that will help you protect this kind of sensitive data and To also manage some players connections. So As I say previously The book goes all about like dedicated servers If you manage to use something like a platform like steam You'll probably have some kind of rest API that you can use to make requests back and forward from the servers And if this is the case we have a chapter 13 How you can make HTTP requests? So this will allow you to use these teams rest API to manage your service and the connection and the data and players data on steams service So answering the server, how can you go about hosting service and manage players connection? If your game isn't on the platform likes team You probably will have a hosting platform dedicated for this kind of stuff with probably something like a rest API So you can manage like posting new players on the database and gather all the data that you need from this database whenever your game request requested. So Basically, you'll have a dedicated server a dedicated service for this kind of Of connection to manage this kind of stuff So the next and final question is this a final? Let's see if there is someone new Yeah, so the final question is can you describe the how to beat pack using gd script? What what's that mean? Minimizing so the person goes about explaining the very question So answering the question what's that mean minimize the number of wasted zeros at the front of typing before writing to packets I Splitting into ints integers into nibbles and combining nibbles into bytes and integers This is very complex guys. I don't think that this is necessary at this point Well, no the book doesn't cover this kind of heavy optimization I don't think that that's necessary at least not in a high-level API if this happens probably it will happen on a lower side or at least on behind the scenes But the book goes about compressing data Probably Probably what happens is something similar to that. So I don't know how this happens. So we The method that we use in the book is the zealib Compression I think but Godot provides by default. I think that for compression methods Probably one of them will make this kind of weird stuff like Bit packing so I don't know if this is Accessible directly through gd script probably you can access the zealib compression to gd script I think that I saw something like that when I was researching compression data but on chapter 11 if I'm not mistaken we go into like Optimizing data request in which one of the features that we use to to minimize the the request size Is compressing data and I think that this that this person described It's some kind of compression method which if this is the case it's covered by the zealib behind the scenes So we don't have to do this manually But we can use the zealib to compress the data's request and implement data compression in our Network requests as well. So answering the question how can you describe the how to beat back using gd script you use the zealib How they they call like this This layer this high-level layer You don't have to do this manually. You can use another person's Implementation which in this case is the zealib provided by the gd script like good old API itself Well guys with that we ended up the Q&A. I hope you'll enjoy it a lot of Guys, we are surrounded by like people with all sorts of high High IQs here. The questions were all very good some were like as you saw some Some of them were like beyond my own knowledge So you guys there are some people that actually could write some books as well So because it's very scarce this kind of knowledge is very scarce. So I think that these people could also help us Get into their level into their development level Well, thank you so much for watching keep developing Pre-order the book guys. The book is amazing Why did you bought the book yet? Buy the book yet. I'll put the link in the description the link is in the screen as well So if you want to type it manually I'll put the link in the description and go there. Pre-order. We are currently having 5% discount into for early birds and Well, that's it. Thank you so much for watching keep developing and to the next time. See you there