Multiplayer World War Z

0 views
Skip to first unread message

Zina Perko

unread,
Aug 3, 2024, 11:43:53 AM8/3/24
to dicsochandnost

I have written a function that runs and checks the distance from origin, and does
UGameplayStatics::SetWorldOriginLocation(this, CurrentLocation);
When you are a certain distance away from the origin.

With my current setup i have the entire level loaded on the server (this is fine for the time being), and the clients are shifting the origin using the function i mentioned. (Checks distance from Origin, and rebases if above a certain size)

Floats have a limited amount of digits. Increasing the map size, will decrease the precision as the comma shifts to the right to accomplish greater numbers. Rebasing will help you to keep those floats small and precise enough. It can be used in multiplayer, just like jonimake posted above, you have to take care of the relative coordinates.

As this distance increases, so does the error.
For example, at 40074.28 Km (real earth size) this error is about 2Km. Any coordinate value calculated at this distance can be 2Km off in your absolute world position.
Things like teleportation and ai can often resolve to the wrong location. The magnitude of this depends on the specific calculations involved.

The decision of which of our 3 choices (or other choices depending on your requirements) is going to be based on the number of intended players, the size of your map, and the capacity of your dedicated server network.

When writing your code to handle coordinate translations, you often need to scale this to the actual size of your landscape tiles (total distance +/- X and Y) not to the limiting distance of the engine. The exception being a tiled landscape set to the actual limiting value, in which case the numbers are the same.

There are a couple of issues that arise with world composition in multiplayer. If the server and client are on tile 1, and the server walks far enough away to unload tile 1, the client will fall through the tile, as well as a few other issues. My team and I are going to be using a dedicated server, so tiled landscapes work perfectly for us, as dedicated servers load all distance dependent tiles at once, and keep them loaded.

thanks for your comment, help me with something please, if I have a map like arma 3, with the measures are 16 km x 16 km (256 km square), and I have different places at a great distance where players may appear, this would work with world compositing? and how many players can have? I will use three lods per model, like houses, cars, etc. let me know your thoughts my friend and if this can be possible, Thanks regards!!!

thanks for your comment, help me with something please, if I have a map like arma 3, with the measures are 16 km x 16 km (256 km square), and I have different places at a great distance where players may appear, this would work with world compositing?

You can use 100 LODs if you wanted. up to you, no reason to stop at just 3. If you need more, make more! I am using 10 LODS and distance factors in the grass alone, so, feel free to use what works best for you and your project.

I wouldn't suggest uploading the whole map as that could be around 100 MB, while I belief that when playing only a small part of the 100 MB is really affected. What you need is a binary version control system, try looking into Boar or come up with something like RDiff-Backup which might be easier to automate over the command line.

I have used a combination of the answers below to make this game even more awesome. First I setup a Dedicated server as mentioned by OrigamiRobot. This was super simple and meets my requirements perfectly. I don't mind leaving my computer on all the time with this running. To do this I also had to do a couple of other things unique to my situation:

Looking at the other answers, Kissaki provided me with the folders I needed, and I used flying sheep's answer aboutsymlinks along with Tom Wijsman's suggestion of using DropBox to share my player folder. I use the dedicated server to hold onto the world, but putting my player folder in dropbox allows me to play as the same character regardless of which of my machines I am using.

I'm making a new multiplayer server and I can't figure out how to adjust some of the world config options. Most of them can be changed after the server is created using commands, then I can delete the world and let it regenerate with the new settings. However, some of the options available for single-player worlds don't appear to have associated commands, or at least they're not in the wiki. Is there a way to do this, either with commands or by modifying the files?

Yes, I'm familiar with that part of the wiki and already use those commands, but the specific ones I'm asking about are the ones that don't have commands. Does anyone know if it's possible to simply copy a settings file from a single-player world onto a server? Will that work? Has anyone done it? Or do the devs possibly have other world config commands that aren't documented in the wiki?

The ones that don't have commands usually don't for a reason--those settings are applied upon world generation and can't be retroactively changed without regenerating the world. Copying the config file would likely either do nothing, crash the world, or the game would demand a regeneration, the former two of which I find much more likely.

It may do nothing if those particular settings are only applied on world gen, which I find the most likely. If you paste them on an already-generated world, it doesn't have a chance to apply the settings, as the world is already generated.

It may crash your game because some config settings may be actively used in-game, and changing them might create some obvious complications/disconnect between the world itself and what the config tells it to do, and might result in disaster.

The last outcome would be the server demanding a regenerated world, which would only happen if the devs have already thought about this issue and put something in place, which at most would regenerate your world and be no different than copying in a different world file. It is very difficult to "repair" a world to a new config because of having to replace things, avoid overlap, and potentially modifying existing generation, all of which may cause problems in the long run. It is simply not worth the effort to implement function that fixes all those issues.

The last last outcome (and the least likely imo) would be that the config simply wouldn't care about the aforementioned issues and simply paste over your existing world with changed settings, which would not create your desired world. For instance, if you changed ore deposit rates, it would paste new ore deposit rates over the old ones, resulting in both new and old deposit rates combined--much more than you originally intended.

What would work is generating a new world with your desired settings and replacing all of the world files in your server with those. Such would make sure the config is applied on generation and that nothing is missed, and that all potential conflict issues are avoided. If your main desire is to keep a certain world you like, the best I can recommend is generating a new world (with your desired settings) but the same seed. It may or may not work depending on how the world generation system is set up, but it'd be your best shot.

I wasn't trying to apply them to an already-generated world, I was trying to adjust the worldgen parameters on the server then generate a new world. I wound up just generating the world in single-player using the usual options and then uploading the single-player world save to the server, which seems to have worked. It would be great if there were a way to set these parameters on a server in a config file before starting the server, which generates the world, but there seems to be no way to do that.

(Also, regarding changing worldgen parameters after the world is generated, it doesn't necessarily cause any problems. You can already adjust plenty of worldgen options after creating the world which only affect newly-generated chunks. If I can adjust the copper/tin surface ore generation rates after worldgen, there's no reason I shouldn't be able to change overall oregen rates. Ungenerated chunks just generate with the new settings. It makes a hard line between the old and new chunks, but it doesn't harm the world or the server.)

Glad to know it worked. I forgot config settings might affect ungenerated chunks, which you seem to have figured out for me. Unfortunately, servers are somewhat tough to change worldgen on (especially with third-party hosting), which hopefully should change once they get around to improving multiplayer.

Hi dude did you have tried these commands in your server? Its seems they do what you need. Its work in our server, but some only will work in the new generated chunks i think. i saw you solve the problem but for sure this extra info here will help other people looking for solve the same issue.

DCS server-admins: please adhere to a common sense gaming industry policy as most server admins throughout the industry do. (After all there's enough hostility on the internet already which really doesn't help anyone. Thanks.)

Yup, getting the same problem after the last update... on v 1.5 and 2.0 I am only getting half a dozen servers on each multiplayer page; before it went off the screen and had to scroll down. I presume ED know about this multiplayer bug?

c80f0f1006
Reply all
Reply to author
Forward
0 new messages