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

Improve gravity #63

Open
jaythomas opened this issue Feb 28, 2022 · 5 comments
Open

Improve gravity #63

jaythomas opened this issue Feb 28, 2022 · 5 comments
Labels
type: enhancement New feature or request

Comments

@jaythomas
Copy link
Member

Tweak gravitate system so the goldilocks zone is wider. When getting near a planet it is easy to get too close and fall in or to be too far and not get any meaningful gravitational effects from it. Gravity is based on the inverse square. During the last meeting we discussed a linear gravity dropoff would give you a wider band around a planet that could slingshot your ship without providing too much or too little gravity.

@jaythomas jaythomas added the type: enhancement New feature or request label Feb 28, 2022
@Zxynine
Copy link

Zxynine commented Jun 21, 2022

The inverse square law is a phenomena created by the 3d nature of the universe, if you imagine sending rays out acting as light from the origin, the frustum of a camera would take the shape of a rectangular pyramid. If we have a pyramid with side lengths of 3 and a height of 1, the surface area of the base is just 3x3=9. Now if you imagine extending it outwards by a certain amount, the result would be a similar polyhedron, i.e. just a scaled version of the original. Because of that, all edges must be multiplied by the same scalar. So by doubling the height, you also double the length of the side. So while the height is now 2, the surface area of the base is (3 x 2) x (3 x 2)=36.
Now if we were to look at the same problem in 2d space, the equivalent is a triangle with a base of 3 and height of 1. Same rule applies, extending the triangle (increasing the height whilst leaving the angles the same) you just get a scaled triangle. So by doubling the height to 2 you have a base of 6. The problem is that since there is no third dimension, the area the light hits is a line (the base of the triangle). Therefore, under the constraints of a 2d reality, light intensity, sound drop-off, and in this case gravity are all linearly proportional to the change in distance as opposed to in three dimensions where it follows the inverse square law.
This is why a linear drop-off would feel more natural for this game. Because in a way it is.

@jaythomas
Copy link
Member Author

Thanks for the 3D analogy. We had a "how" and now we have a "why" too.

@Jon-Cavaliere
Copy link
Contributor

I think we should assign this issue to @Zxynine 🤣

@Zxynine
Copy link

Zxynine commented Jun 27, 2022

I think we should assign this issue to @Zxynine 🤣

I would advise against that unless you want C# code in your lua project lol. Ive never used lua before. Maybe Ill throw some python or javascript in there for good measure. Variety is the spice of life as they say.

@wyatt-herkamp
Copy link
Member

I think we should assign this issue to @Zxynine 🤣

I would advise against that unless you want C# code in your lua project lol. Ive never used lua before. Maybe Ill throw some python or javascript in there for good measure. Variety is the spice of life as they say.

If you know how to speak English you can write Lua

If you can program and speak English you are a expert lua dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants