Hi there, I’m making a 2D game with 4K artwork. I was trying to figure out PPU and came up with this. I was hoping someone might be able to vet what I’ve done here to make sure I’m not making a crazy decision.
This is a 2D point and click adventure game
The camera sits at around 30 degrees from the floor (this is me eye balling the background artwork). Based on the tilted perspective foreshortening table here, that means I probably need to multiply units per room by 2.
My main character is exactly 2 units tall (over 6 feet tall)
1 unit == 1 meter in my game
If I have a room that needs to be 4 x 6.8 Meters, then taking into account the 30 degree camera, that becomes 8 x 13.6 units (16:9). That being the case, I need 480 PPU
Does that make sense or have I gone off the rails.
If your character is 2 units tall, than how tall is the sprite? Say its 512 pixels, 512 / 2 is 256 so you would want 256 PPU. If its 64 than you want 32 PPU.
I am assuming you are doing a 2D game with a 3D perspective, seeing as you are “tilting” the camera, this should have no bearing on PPU.
If your characters are a certain size all the other objects in the game should be proportioned to that by the artist. My artist makes a scene in Photoshop with the characters and the items he is working on so he can give them all the right proportions. A house is pretty big but a shovel or a gun is small.
Say a wall is 3 meters tall @ 256 PPU the wall needs to be 768 high. If you are working with art that varies in size(a house that is 768 high and a gun that is 512), you will need to adjust the PPU for each one to match with the rest of the game, this is not desirable and only slows down development.
Consistency is very important, but you probably already know that seeing as you are trying to get the PPU right.
So the game is 100% 2D, no 3D at all. The camera tilt is an approximation of what the perspective looks like based on the artist’s renderings. I used that estimation and the lookup table i mentioned to figure out how much I should multiply the desired unit count by.
It seems like PPU should be a function of screen size, which in my case is 4K. Is that not correct?
Not at all, unity has world units x,y,z, these units don’t have a measure and its up to you what 1 unit amounts to in your game.
PPU simply defines how many pixels are in a unit.
It seems you are concerned with screen size so you will have to decide: how wide do you want your screen be in unity world units? In the end this too is a moot point because it can change depending on your camera’s zoom.
In the end PPU is quite arbitrary and the only important consideration is that you should use the same on all assets, but even if you dont you can just scale their transform down or up so they match and it will be the same, so even that is not necessary.
There’s only one consideration that you should have that is important: since units are floats it is advised that you don’t make your sprites too large in world space that your world needs to be wider than -9999 to 9999 world units, beyond 10k you will start to have floating point imprecisions and your movement calculations would start to potentially have unpredictable results. Just something to keep in mind.