-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add Physics Tests project #473
Conversation
984f9a5
to
c7eb049
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm glad to see that you're working on physics, it really needs a lot of fixing. This is a first-pass review, I haven't looked into the project very much in depth yet.
3d/physics_tests/Test.gd
Outdated
timer.paused = false | ||
|
||
func is_timer_canceled() -> bool: | ||
return timer.paused | ||
|
||
func on_timer_done(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These scripts do not follow the GDScript style guide, there should be two lines between functions. Please read the whole style guide, there are some other issues that I can see: https://docs.godotengine.org/en/latest/getting_started/scripting/gdscript/gdscript_styleguide.html
3d/physics_tests/main.tscn
Outdated
"_edit_use_anchors_": false | ||
} | ||
|
||
[node name="Tests_Menu" type="MenuButton" parent="."] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node names should be PascalCase
with no underscore to match the convention of Godot's built-in names.
transform = Transform( 50, 0, 0, 0, 1, 0, 0, 0, 50, 0, 0, 0 ) | ||
shape = SubResource( 4 ) | ||
|
||
[node name="StaticBody_Head" type="StaticBody" parent="."] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The head and plane should be in their own scene, probably together.
3d/physics_tests/Test.gd
Outdated
class_name Test | ||
|
||
var timer : Timer | ||
var timer_started : bool = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akien-mga says he doesn't want static typing used in the demos, so for now the policy I've been using is "no static typing unless it significantly improves readability".
3d/physics_tests/README.md
Outdated
|
||
Language: GDScript | ||
|
||
Renderer: GLES 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since rendering doesn't affect physics, the project should probably be converted to GLES 2.
Thanks @aaronfranke for your review! I'll look into the GDScript style guide and fix the different things you pointed out. |
c7eb049
to
4aa7054
Compare
4aa7054
to
afd99e5
Compare
I've just pushed an update from the review:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! I can think of a few things to add, but it's great as-is.
Thanks! I'm interested to hear more details about the things you would like to add. I've got my own todo list for the next tests I want to implement, but I would gladly add more things if they can be useful. |
Mostly more complex scenarios, some are test cases for known existing physics bugs.
For the last point, here is a minimal script which showcases the problem. If placed on a StaticBody by itself with nothing else in the scene (no cameras or anything), for me it starts at over 300 FPS, gradually slows down to about 30 FPS, then once it's done adding colliders I get over 9000 FPS. If you change this to extends StaticBody
var amount = 1000
func _process(delta):
amount -= 1
if amount > 0:
var c = CollisionShape.new()
c.shape = BoxShape.new()
add_child(c) |
New project to provide a test framework for the 3D physics engines, based on part 1 of this proposal:
godotengine/godot-proposals#667
I'm planning to add more tests in the coming weeks, but I'm providing this first version in order to start getting feedback.