Raycaster Game with Networking II

SOURCE

Rendering Updates

After a lot of debugging, I finally got the 2D renderer working.

../images/video-game-4-2023-02-21_17.17.13.webm

After that, the 3D renderer was straightforward to implement. The length of each ray corresponds to one vertical column of the screen. I just have to scale and center the rays.

../images/video-game-3-2023-02-21_15.03.11.webm

Finally, I have to counter a fish eye effect. Rays towards the edge of the player's vision tend to be longer than rays towards the center. This makes things at the edge of the vision seem farther away. I can fix this by scaling.

../images/video-game-4-2023-02-28_00.50.50.webm

The fish eye effect is gone. Actually, I may be over-scaling. The edges seem to get a little bigger.

Miscellaneous

Besides the renderer, I added a heart beat feature to the server. If a user doesn't send an input message, including an empty input message, for a long enough time, the server disconnects the user and removes them from the game.