In my personal opinion, if you don’t plan having anti cheats to speed hacking or teleportation then just do it on the client because exploiters could just teleport instead, if you do plan having an anti cheat it’d be best to do it on the server in sacrifice for the delay. What would you recommend for future ‘attack moves’ that may be in my game? Should I do hit detection for melee attacks on the server or the client? The bullet should definitely be done on the client. The bullet should spawn on the clients and if you figure out the delay you can spawn the bullet further away (to be in sync) with the server hitbox. Since I don’t really bother with syncing the server and clients much I’m not sure how I would approach that, but if you manage to somehow obtain a way to get the delay time to get to the client or is able to almost sync the clients and servers then this would be quite simple.Īssuming you’ve figured out how to synchronize the server and clients, the actual hit box should be a progressive raycast using os.clock() for precision, with this no matter how much exploiters tinker with the bullet it wouldn’t matter since the server is handling it. Visuals should be always be on the client, the main issue isn’t exploiting rather it should be syncing all the clients together. What would you recommend doing in this case? Doing this on the Server seems to make the bullet look a little laggy, but doing this strictly on the client could lead to lag/hacking issues too. The goal is for the bullet to travel as a beam along 2 attachments up to 100 studs at a rate of 50 studs/second, taking raycasts as it goes and dealing damage to the first player it contacts. I’d like for the bullet to travel smoothly, but I’d also like for the bullet impact/speed to be consistent across all clients. There is never a 100% perfect solution, because of the nature of the internet and the delay between machines, but you can get pretty close.Ĭurrently however, I’m working on a bullet. You can look up “multiplayer gun interpolation” to see how other games handle this problem. Then you can either have the server determine who if anybody takes damage, or have the client determine who takes damage, then just have the server determine whether or not the shot was possible and made sense.Server tells clients to show the bullet for all other clients based on those initial conditions. Client tells server I want to fire a bullet in this direction. What you’ll have to think about is how you want to have the server validate the bullet firing and make sure nobody is cheating. There are several different methods you can implement, depending on whichever one you think is best for your game.įor most methods, you wanna have separate code that controls the visuals of the bullet for all of the clients vs code that controls the hit detection on the server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |