Published in the development of the game: 2D physics engine for games with a platform - riding a platform
I have a number of questions regarding the use of the 2D physics engine in a platform game, but one of the main ones that I now face. I managed to integrate the Physics2D.Net engine somewhat into the scrolling game Development Kit 2 . I am very pleased with the performance and the realism of physics. However, I lost some of the things that made my original physics engine SGDK2 (oriented more specifically to gaming platforms) easier:
- Platform riding is now very difficult. This is my main question. It is not difficult to implement, but difficult to play. Assuming that I can even bring the player to the platform (which is difficult enough in itself), as soon as the platform moves, the player falls because there is not enough friction between the player and the platform or something else. Do I just need to set up things like friction, inertia, linear speed dampening, etc., to make it easier to ride the platform, or is there something fundamentally difficult to ride on the platform - is this a βrealβ world? I tried to reduce the force applied to the platform, which makes it move (so that it will increase the time for the rider in accordance with the speed of the platform), but then this is not enough to keep the rider at the top, and the platform plunges into the ground. I just use force to move the platform.
- What is the best way to stop the platform from working? I tried to set the Angular and Angular momentum to 0 on each frame, but this can lead to slight twitches that can cause something on the spring platform to airborne a bit long enough to fall off.
- Ground launch: how do most gaming platforms with realistic 2D physics implement the player? My player is currently a square, but often falls and spring into the air due to friction, hitting one of the corners. I assume that the player should be around and always upright. Is this standard practice or is there another way? If I use the circle, I expect it to be even harder to ride the platform! The player is hiding. I think of Little Big Planet, which also seemed to hold the player well on the ground. Should I just inflict too much speed attenuation on the player or something like that if I also want them to be grounded too?
- Since SGDK2 is a tile / IDE-based engine, I have a recording code that analyzes all terrain / tile shapes and turns them into physical bodies with infinite mass (merging them horizontally, but not vertically, where necessary, merging the two directions were too complicated for me to understand, because I could not understand how to track and imagine a hole in a toroidal formation). Is this a good way for a gaming platform to implement something for sprites to interact to represent solid ground? Is it better to turn each tile into a physical body (a few simple shapes, a lot of bodies and the inner surfaces between the plates) or merging them, as I do (fewer bodies, but more complex shapes)?
- I find it difficult to determine the optimal level of subdivision and the distance between the grids. I really do not understand that these concepts and documentation on Pysics2D.Net are rarely insignificant, as far as I can tell. Usually I divide by about 6 and using grid spacing about the same. My sprites and tiles are mostly 32x32 units (pixels), all square at the moment.
source share