Ahoy! Welcome aboard the development train!
As you all know flowlab is not a 3D engine, but we are able to create Wolfenstein 3D. I’m trying to create a simple engine that everyone is able to use. I could just use a ton a switches and Ray Casts to set custom FOVs but I had the idea of using a repeater so I’m sticking with it ,unless it fails. And it does work kinda, but it’s making the engine drop to 7 fps. I already set up 360 Ray Casts with my custom shadows thing I’m working on (it works at ~28 fps) and I don’t feel like setting up that many rays so If anyone finds a good way to optimize this that would be great.
(A draw function would be great for this Grazer, I believe tinkersmith suggested this before )
So here’s an explanation to how it works and what’s causing the fps to tank (Spoiler, it’s messages/expressions)
This is how it works, first I evenly space out the the objects that will display the wolfenstein effect, pretty simple, not more more than that.
Ok now on to the important part. First set the FOV, this will determine how many times the repeat will go off (The repeater activates a Ray Cast that many times each frame). As the repeater outputs it is increasing a Number behavior by 1, this will determine which section of the screen the ray cast will account for. Another thing the repeater does is increase another value, this determines the angle of the ray, from there it will cast the ray. 2 messages will be sent to the Display objects, Length and Which.
Length gives the height that the Display object will be, and Which tells which one needs to have its height increased.
What what’s causing the FPS drop is ~13ms of Mailboxes and ~12ms of Expressions. I have the FOV at 90, so that means each frame 180 mailboxes go off (2 in each display object) + 90 expressions (1 in each display object)
@JR01 if you had any ideas besides me setting up 90 seperate rays rays that would be nice
@Yoann I know you have your engine, but I think I remember you saying something about not using ray casts.
@ Anyone else with ideas