How do I fix this lag?

Im remaking a roblox game called pm 6:06 with ray casting i found tutorials to get the engine working but its very laggy and i cant find out how to fix it. Does anybody know how?


This is the replit
https://replit.com/@adamisdum/PM-606-prototype?v=1

Try reducing the render distance to 20 or 30 to see if it improves performance.
You can do that by adjusting the distance in your main.py file

c = e.Constants(render_distance=50)

Try to reduce the number of rays too

def init(self, window_size=(1515, 793), rays=1000, fov=95, texture_resolution=256, render_distance=10):

Put something like 400 or 600. You may lost a bit of visual quality but I think that’s irrelevant for a robox game.

Maybe you can Use PyPy instead of CPython. There is a article here explaining why PyPy is better than CPython
What is PyPy? Faster Python without pain | InfoWorld.

1 Like

Alright thanks this helped some but I still cant find out how to use PyPy with it

I suggest reading their documentation before using it.

https://doc.pypy.org/en/latest/

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.