Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balls can be pushed through walls using the paddle #1

Open
NelloDev opened this issue Oct 18, 2019 · 14 comments
Open

Balls can be pushed through walls using the paddle #1

NelloDev opened this issue Oct 18, 2019 · 14 comments
Labels
bug Something isn't working

Comments

@NelloDev
Copy link

Issue description:
Balls can be pushed through walls https://streamable.com/ag0zy
Steps to reproduce:

  1. Push ball through wall
@Calinou Calinou added the bug Something isn't working label Oct 18, 2019
@Calinou
Copy link
Owner

Calinou commented Oct 18, 2019

This is not about walls being too small, but about RigidBodies (the paddle) being able to push other RigidBodies (balls) through StaticBodies (the TileMap).

I currently don't have time to look into fixing it though.

@Calinou Calinou changed the title Walls too small Balls can be pushed through walls using the paddle Oct 18, 2019
@NelloDev
Copy link
Author

I won't lie, I figured there was a technical reason for it happening but I couldn't pass up the name

@Calinou
Copy link
Owner

Calinou commented Oct 18, 2019

@NelloDev Thanks for opening the first issue here still 🙂

@sosasees
Copy link
Contributor

sosasees commented Jul 16, 2020

The obvious solution I see to this bug right now, is adding multiple smaller collision shapes inside the main collision shape, like this:
grafik

In this case, the negatives outweigh the positives:
positive: The Balls are less likely to clip through the wall
negative: It's very labor-intensive to set up the collisions by hand
negative: The Computer has so much more collisions to process, likely making the game walk at less than 10 Frames per Second.


I now have an idea for a possible better solution, but I'm not sure if it'd work.

  • Moving the Paddle's Collision Box to another layer that can't interact with the balls
  • Adding a Second Collision Box to the Paddle that's slightly smaller than the first one, but this one can interact with the balls

I'll make a Pull Request if it works, otherwise not.

Update: This did not work. Trying this method, the game runs slower but the bug remains.
I could not fix the bug, but at least we can rule out both of my suggestions on how it could be fixed.

@sosasees
Copy link
Contributor

sosasees commented Jul 24, 2020

The best games embrace technical limitations.
Maybe this game could be about pushing balls THROUGH walls?
This would be something awesome and new, which we haven't seen before.

Great developers use this a lot, Almost every time they find that a bug actually improves the game:

It's not a bug, it's a feature
- I don't know who invented this quote

@Calinou
Copy link
Owner

Calinou commented Jul 24, 2020

@sosasees I'm not sure about this. This could make sense in specific locations (e.g. with dedicated tiles), but not everywhere.

@sosasees
Copy link
Contributor

What about if you still could push them through everywhere, but don't want to because the ship would explode when you pushed them through certain tiles?

@Calinou
Copy link
Owner

Calinou commented Jul 29, 2020

@sosasees Maybe, but that sounds more like a frustrating gameplay mechanic rather than a challenging one.

@sosasees
Copy link
Contributor

I had in mind that the explodey tiles look different from the normal ones.

@sosasees
Copy link
Contributor

sosasees commented Jul 31, 2020

I have another possible solution:
Changing the paddle to only have collision for a split-second at a time whenever the player presses a button would still leave this glitch possible, but much harder to discover and perform.

@sosasees
Copy link
Contributor

I don't know exactly How we could do this,
but maybe we could add some sort of "collision priority" to the ball:
it'd work like
the ball preferring to go through the player instead of the walls when crushed.

I imagine that the ball would:

  • check if it touches the player And the ball
  • if true, it will actively pass through player collision but not wall collision (maybe by disabling its "Player" collision mask) until it notices that it no longer touches player collision, which is when it will touch the player again.

I also came up with an other way to solve this, that i'm much more confident about:

Redesign the player character to have 2 distinct collision zones, 1 outside 1 inside:

▒▒▒▒   ▒ touches walls
▒██▒   █ touches balls
▒██▒
▒▒▒▒

This way, you don't need any special programming to solve the issue.

This solution might require a slight level redesign,
since you'd have to make the player a bit bigger if you wanted to keep the "ball collision zone" the same size,
and if you kept the player the same size the "ball collision zone" would be smaller (too small for my preferences), which you'd have to now account for.
But the eleganct end result will be worth it.

@sosasees
Copy link
Contributor

sosasees commented Oct 3, 2021

@Calinou what do you think, are there any potentially good solutions for this bug in this thread?
if yes, which ones would that be?

@Calinou
Copy link
Owner

Calinou commented Oct 3, 2021

@Calinou what do you think, are there any potentially good solutions for this bug in this thread? if yes, which ones would that be?

I don't have time to look into it, but feel free to experiment and open a pull request if you manage to get something working 🙂

@sosasees
Copy link
Contributor

sosasees commented Oct 10, 2021

i have gotten an error when opening the project in my copy of
Godot v3.3.3.stable.official [b973f997f]:

┌────────────────────────────────────────────────────────────┐
│                          Warning!                        X │
│────────────────────────────────────────────────────────────│
│ Unable to load addon script from path:                     │
│ 'res://addons/smoothing/smoothing_plugin.gd'.              │
│ This might be due to a code error in that script.          |
| Disabling the addon at 'res://addons/smoothing/plugin.cfg' │
│ to prevent further errors.                                 |
│────────────────────────────────────────────────────────────│
│                    <OK>     <Copy Text>                    │
└────────────────────────────────────────────────────────────┘

the game seems unchanged by this error,
but i'm still concerned:
@Calinou ¿what are the hidden implications of this error, and how can i fix it?, because i don't want to unknowingly make a broken commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants