Hey there, I just had this idea and it’s probably terrible, but it seems like it would sure help me.
I complain 24/7 about the problem with logic and physics tics being reliant on the frame-rate of the engine, and have an idea for a workaround: as the title proclaims, “logic-based physics”. Basically, my idea is to use python to create really simple, fake physics (similar to that of a side-scroller or Pokemon games) that can always work at the same speed no matter the frame-rate.
However the idea may be simple, I am having trouble understanding how to do it. Since bullet is entirely disabled, I can’t use rays, nor are there collision bounds or and form of collision for that matter.
Gravity is easy enough:
from bge import logic, render scene = logic.getCurrentScene() def tic(): fps = logic.getAverageFrameRate() fps = 1 if fps < 1 else fps logic.tic = 1 / fps def gravity(g): for o in scene.objects: if "g" in o == True: o.worldPosition.z -= g * logic.tic
But then how on earth would I be able to do collision? In pixel-based engines, you can check the pixel next to the object to see if it will “collide” with the next pixel, however that isn’t possible with 3D application as far as I am aware, and would require using camera rays, therefore eliminating the point of simplicity and also reducing performance significantly.
Anyone have any ideas?