I am making a raycasting in defold. And i want to share it to community.
Be carefull, i can’t unload textures, so game will use more and more memory. I don’t recomend play more then few minutes
This is awesome! We need to figure out the issue you’re having with textures. I’m back at work on Tuesday unless someone else is able to assist before that.
Remove table with screen pixels.Use only buffer. Now it is about 16ms per frame in html.(only for drawing walls). I think i can do more optimizations. But now i will be working on other features.
Make a lot of things to increase performance. Now html version use 8-12ms per frame.
PC is x2-x3 faster then html.Not test in phones.But i beleive, it will be faster then html.
1)Move all raycasting code to C from lua
2)Refactor C code.
3)Make some optimizations
4)Use png for textures(lua tables with color integers,was used before)
Performance need be improved. For screen 640x480.I cast 640 rays. In laptop(i5-6300U) average time is 4 ms(html 8ms). Android(Galaxy s7) 20ms
Looks like the bottleneck is drawing vertical line of pixels. And i have no idea how it can be improved.
Also i need update texture every frame, it use about 1-2ms in pc, and can’t be improved.
Parallel execution can give big performance boost.I will add it sometimes later.