2 Problems with the game

Hi. I need some help with my game. I’m encountering 2 glitches with it and I really can’t solve for few days now.

  1. my cubes (red and blue) are acting weird when you push or even walk to the wall. It’s like something is colliding that makes them vibrate. (even you jump to the red box. 2 cubes vibrates).

  2. when you press TAB, the platform will change. however, if you check the platform in edit mode. It is not the position I designed when you play it. “IT CHANGES POSITION IN EDIT MODE”.

I hope you won’t find the blend file complicated. The duplicated shape inside the shape will act as the collider.

Controls:

WD = Move
Spacebar = Jump
R = Reset
Tab = Change Platform

Blend file: Demo.blend (557 KB)

AS ALWAYS, THANK YOU VERY MUCH!!

Go to your world settings. Under Physics > Physics Steps, set Substeps to something like 2 or 3. This will make your collision more accurate (at the cost of performance mind you) and reduce the ‘jiggling’ you see.

This is a side-effect of the physics engine. Collisions are approximated, so it’s impossible to get something 100% accurate. You can, however, make things more accurate.

(you may try turning down the margin of the collision bounds for your characters as well. Have your world objects with a margin of 0.04 and a margin of 0.06 for characters…this usually results in good reliable collision.

You are still using a collision sensor to detect if you’re standing on the floor. Use a radar pointing downward instead, with its distance just a little longer than half the heigh of your character (the radar is originating in the middle of the cube), so you get a little pad directly underneath you that detects floors. With a collision sensor, If you’re in mid-air hugging the wall, the game will think you are standing on the ground. If your in mid-jump and your head is touching the ceiling, the game thinks you are standing on the floor. Neither of these cases should be true.

Attached below is your bare-bones minimal viable product for a mario-style platformer. A and D to run, Space to jump. Green platforms are grass (normal friction), brown is mud (high friction), and light blue is ice (low friction).

As far as the issues with changing platforms with TAB, I wouldn’t even worry about that aspect now. Get your platforming mechanics down solid first, then start making your game do interesting things.

Attachments

bario_mothers.blend (558 KB)

Sounds like the platform is parented to something. try [alt]+[p] to clear parents. Either that, or it’s animated. you may need to unlink any animations from it and then put it in the proper position.

I tried making my floor a box collision. However, because this isn’t a perfect cube? What will be the perfect collision box (shape?) for this?

Also, I can’t perform double jump anymore with the same setup I had. Can’t figure out how to assign proprty to 0 with radar sensor.

Attachments

Demo.blend (576 KB)

The box collision type does not have to be a perfect cube. It only needs to be a perfect rectangle (a polyhedron with 6 faces and all 90 degree angles).
You also have to make sure your box’s origin is in the center of its geometry. Shift+ctrl+alt+c to bring up that menu (yep, that’s a real keyboard shortcut, lol)

You can build complex shapes, like stairs, by just using multiple boxes – one for each step.

As far as getting double jumping to work, let’s try to Rubber-Duck it:

-When the player jumps, he is normally ineligible to jump again until he hits the ground
+We want the player to get one extra jump while in mid-air (thus a double-jump)

-When you press the input to jump, this happens:
-We check if ‘on_floor’ == True, if so, we apply force upward
-The act of forcing the player into the air causes our radar to lose the floor, thus making on_floor = False (disabling jump)

-We can add a new sensor, which triggers when on_floor = False, and a new booleen property on the player called ‘jump2’
-In logic, jump2 should be false whenever on_floor is True, but True as soon as on_floor is False

-If jump2 is True, we should be able to jump regardless of the state of on_floor.
+However, if on_floor is False and jump2 is True, and we jump, it should switch off jump2 (thus preventing us from triple-quadruple jumping)
+If jump2 is True when on_floor becomes True, jump2 becomes False

Demo (1)_2x_jump.blend (570 KB)

(PS I may have messed up whatever logic was on your platforms on this file, trying to clean things up a little so I could understand what was going on)

@Nines - Wew! So many lines in the logic brick. It’s like I’m a police trying to detonate a bomb and if I disconnect the wrong line, everything will be messed up. lol.

How is your blend file has a perfect collision bounds? While I the collision of my platform doesn’t fit my platform why my radar can’t detect the platform.

Don’t be intimidated by the density of the noodles. Start by looking at the controllers – what sensors are noodling into it, and where is it going out to?
You can re-arrange the order of all the bricks too. Sometimes fiddling around with that can make your noodles more orderly, and minimize criss-crossing noodles.
Try re-building the rig I made on your own, in a fresh blend file (maybe in a new instance of blender, so you can have the example open next to it). Being able to make it yourself will teach you much, and make the thing seem much less scary once it’s been built. Be careful when trying to plug in things that other people make into your game. If you can’t understand it well enough to make it yourself, you could run into big problems down the road, when you have to alter/replace that alien piece of game, and you won’t know how.

Take it in stages. What’s the most basic thing it’s doing? Running left and right (that is straight S>C>A with no complications). Do that first. Next would be setting up the radar, and making sure it’s working the way it should. Next, jumping and its logic. Finally, double-jumping and its logic.

Mountains from mole-hills, my friend :slight_smile:

EDIT: I did put a couple XOR controllers in my rig. I would suggest reading up on XOR logic (as well as the other logic types), if you don’t get how they work. They are nifty, and fun to play with once you can wrap your head around them.

Yeah. I recreated it in my blend file. erased all the controller and analyze each line one by one. Because the file I am providing is the actual game file (yes, they are only blocks).

BTW. Another problem I encountered while testing it is when I held left or right while in the wall mid-air, my character doesn’t fall down. I thought it was because of friction or the collision sensor I had. But it seems not. Here’s the screenshot.