Block physics technical question:

P

Pink Kitty

Guest
Heya @zanzistar!

I have a technical question for you, or whoever on the team is the expert! :p

In terms of CPU load, which takes the more load:

a huge 25x25x1 plate, or
25x25 single blocks as a plate, or
a huge pile of 125 loose blocks?

And can you explain it a little please?
 
  • Like
Reactions: zanzistar

streak1

Well-Known Member
Aug 30, 2015
2,291
2,139
570
23
steamcommunity.com
Definitely the latter.

For the first two, as far as the physics are concerned, you can consider them to be the same thing. Since the blocks are all joined together and cannot move in relation to each other, they are essentially one object. One object means one set of physics values you have to keep track of.

That said, a 25x25 tech takes more CPU than a 25x25 plate. A thing made of a bunch of little things is more intensive than one big thing. 125 blocks uses more individual textures than one big block, so it takes more to render them. And then you have other things like the damage they have taken, what block they are and what they do, any effects or animations they might have, etc. None of this has anything to do with physics, though.

With the big pile of loose blocks, that would take a ton more cpu than the other two. That is because you have 125 individual sets of physics values that you have to keep track of, as opposed to 1 set for the other two. That is why the game tends to lag when you have a lot of loose blocks in your world, as the game has to constantly update all of these values. The same problems of a 25x25 tech are also part of this, so it just adds up into one big load for the game and the computer to handle.


None of this is to say that I have any experience with code, but much of this can be assumed from plain logic. If there is a thing in the game, it has to be handled by the game, otherwise it doesn't exist. There are optimizations you can do to make all of this easier to handle, but the same rule still stands: the more complicated something is, the more things that the game has to keep track of. The big pile of blocks is the most complicated.
 
P

Pink Kitty

Guest
but much of this can be assumed from plain logic.
No, it can't!

That's why i'm asking the devs.
Speculation is all very well, but 'logic' is often misleading when it comes to code.

It could well be that a whole bunch of things like pathfinding don't get calculated for loose blocks, thus rubble is 'cheap' CPU-wise.
Or not.

Which is why i need someone who know for certain to weigh in. :)

Regardless, one thing i would like for base building is a wide flat plate for making decks/walls.
8x8x1 maybe?
 

Gameslinx

Well-Known Member
Oct 19, 2015
1,081
1,120
525
18
A cab, stranded in deep space
The blocks on their own are their own entities entitles their own "blockstates". This means that each block, from 1 to 125, are all called different thinges, probably "GSO_Block_1" to "GSO_Block_125". The large plate made out of 1 blocks will be the second most intensive, as there are still physics for every block, but they kind of act as one, but joined together. This means the attach points don't need physics anymore until they are broken off. Finally, the large plate will be exactly the same to a GSO 1 block in terms of Graphics and Physics rendering. The only difference is that it's bigger than all the over blocks. The large plate will only have 1 set of physics nodes acting on it
 
P

Pink Kitty

Guest
The blocks on their own are their own entities entitles their own "blockstates". This means that each block, from 1 to 125, are all called different thinges, probably "GSO_Block_1" to "GSO_Block_125". The large plate made out of 1 blocks will be the second most intensive, as there are still physics for every block, but they kind of act as one, but joined together. This means the attach points don't need physics anymore until they are broken off. Finally, the large plate will be exactly the same to a GSO 1 block in terms of Graphics and Physics rendering. The only difference is that it's bigger than all the over blocks. The large plate will only have 1 set of physics nodes acting on it
Thankyou for your opinion!

What i'm looking for is facts. :)

I can speculate myself, but what i want is an answer from someone who knows for certain so that i can calculate some things!
 

zanzistar

PAYLOAD STUDIOS
Aug 13, 2014
1,010
1,688
525
34
London
Hey @tomo_cjt can answer this definitively, I'm not the most technical person on the team.

My understanding is that the pile of blocks is the most expensive, as they are each individual physics objects which can collide with things and move about on their own.

The first two I believe would be reasonably equal as they both count as a single rigid body is physics terms. In terms of rendering I would expect that the plane made of multiple blocks would be more expensive (more faces = more expensive), but I'd guess the difference is not important enough to be a real drain. It's the physics which is most expensive.
 
  • Like
Reactions: cupid_the_conqueror

tomo_cjt

Well-Known Member
Aug 14, 2014
401
362
475
Hey guys,

Kris is correct, the first two are more or less the same (it depends on what the blocks are and what updates etc they have).

Physics wise, a single block is going to be more efficient that lots of little ones, but they you lose gameplay possibilities with them breaking up etc. Same goes for rendering (however the larger block could cause more overdraw).

As for the pile of blocks, yeah they're more expensive but it depends what they're doing and how good your machine is. For example, mine isn't amazing and this isn't particularly nasty:

 
  • Like
Reactions: cupid_the_conqueror

cupid_the_conqueror

Well-Known Member
Sep 20, 2014
241
142
445
24
yea, one thing I learned from coding in highschool. Keeping track of lots of little objects quickly and effectively is quite the pain. Gotta give Props the real programmers out there, I would shoot myself If i had to write code for a living! :p ^
 

SwagBagel

Well-Known Member
Oct 3, 2015
79
15
46
Definitely the latter.

For the first two, as far as the physics are concerned, you can consider them to be the same thing. Since the blocks are all joined together and cannot move in relation to each other, they are essentially one object. One object means one set of physics values you have to keep track of.

That said, a 25x25 tech takes more CPU than a 25x25 plate. A thing made of a bunch of little things is more intensive than one big thing. 125 blocks uses more individual textures than one big block, so it takes more to render them. And then you have other things like the damage they have taken, what block they are and what they do, any effects or animations they might have, etc. None of this has anything to do with physics, though.

With the big pile of loose blocks, that would take a ton more cpu than the other two. That is because you have 125 individual sets of physics values that you have to keep track of, as opposed to 1 set for the other two. That is why the game tends to lag when you have a lot of loose blocks in your world, as the game has to constantly update all of these values. The same problems of a 25x25 tech are also part of this, so it just adds up into one big load for the game and the computer to handle.


None of this is to say that I have any experience with code, but much of this can be assumed from plain logic. If there is a thing in the game, it has to be handled by the game, otherwise it doesn't exist. There are optimizations you can do to make all of this easier to handle, but the same rule still stands: the more complicated something is, the more things that the game has to keep track of. The big pile of blocks is the most complicated.
THANK YOU so much, I finally have figured out why my world lags so much, I don't clean up when I blow stuff up