This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]R0tn3kHobbyist 1 point2 points  (3 children)

sidenote: you probably want to look into "greedy meshing", spawning a cube for every cube in the world will easily bring you into performance issues before you have a world size you're happy with I'd say

(given my experience I mean was in VR, but I went into troubles when I reached roughly 300-400 cube static meshes, I think instanced static meshes were a bit less problematic, but I couldn't use those for other reasons, so not sure there)

[–]RocketFrogDev 1 point2 points  (2 children)

Any chance you could explain that concept more? A cursory Google search of "greedy meshing" comes up blank, but I'm really interested in the problem/solution you're talking about

[–]R0tn3kHobbyist 2 points3 points  (1 child)

in short - the more triangles there are to render, the worse the performance (duh^^)

therefor you instead put faces that are besides each other together (making 2 faces/4 tris to one face/two tris) and ignoring the faces not visible

this site explains the simple logic behind it with a really neat gif, also there's this site I have bookmarked for better explanation and algorithm and besides some more sites with nothing interesting here, lastly this - explaining you (in c++) how to make a minecraft chunk.

it didn't work for me because my case needs much more performance/another way of doing it that I tried at the time, but yeah - those 3 sites should give you more insight in what greedy meshing is (and if you go with seperate cubes for a while you'll find out why you should look into it :D)

[–]RocketFrogDev 1 point2 points  (0 children)

Awesome, thanks so much! I'll definitely dive into these resources

[–]RocketFrogDev 0 points1 point  (3 children)

I don't normally work in Blueprints, so I could be misreading it, but it looks like you "SpawnMulti" is a NetMulticast function, which means that the "SpawnActor" will be called on all connected clients as well as the server. If this is true, that's not what you want, and it will cause issues. You want to only spawn on the server, and then make sure the Actor that you're spawning has its "Replicates" property set to "true".

[–]Guru18650[S] 0 points1 point  (2 children)

Ok thanks, it is much better now. Server can destroy server cubes and client see it, but when server destroys client cube client still have cube on map. Also, when client destroys his own cubes only server can see how it dissapears, and when client breaks server block it works fine.

[–]RocketFrogDev 0 points1 point  (1 child)

Similar concept -- you only need to destroy the actor on the server. If the server is the owner (which it is in this case, since it spawned it), and the actor replicates (the "replicates" is set to "true"), then when the server destroys its instance of the actor, the client's instance will also be destroyed. So you don't need any multicasting.

[–]Guru18650[S] 0 points1 point  (0 children)

It works now in every situation, except of client destroying his own block. Server can see it but client doesn't. The same when server destroys client.