Now level changes and area changes are separated. Entity deletions are
properly tracked on level change or area change. Late entity
synchronization is now triggered on any area change.
The old implementation was hacky and often returned desynchronized
results. This implementation gives a seed to each sync object, and
synchronizes that seed. Also allows for a seed to be saved temporarily
based on position and recycled for multiple calls.
The precision of ray casting was too low previously, causing the
collision checks to skip right past a wall sometimes. There was also
nothing to prevent the camera from getting too close to a wall
horizontally or vertically.
Since the second-player code was the first code I wrote, it was implemented
poorly. At that point, I didn't know the code base at all and the way it was
written would prevent anyone from ever adding to those parts.
The rewrite allows me to use the default geo.inc.c file for Mario, and removes
all of the geo2.inc.c files. I no longer do a bunch of bit shifting to figure
out which player is being drawn in the rendering code.
I'm also now able to remove tons of duplicate code that exists just for the
remote player. The main player code is generic enough to support both indices.
A side-effect of the rewrite is I was able to remove many assumptions in the
code where two-players is assumed, but many other parts of the code still
assume two players.
This is a fairly major change that, if all goes well, will be completely
unnoticed by the player. However, I do expect new bugs to pop up in strange
places. Time will tell.
Due to my compile & launch scripts, I was silently ignoring warnings
this whole time. I've fixed my process, and gone back to fixed all of
the warnings I could (even outside of my code).
Created functions to trivially translate an ID to a Behavior and vice
versa. Sent ID over packets instead of Behavior pointer. This should
allow Linux and Windows to play together.
Added Luigi model.
Renamed all previous references to 'Luigi' to 'Mario2' since player 1
isn't always mario, and player 2 isn't always luigi.
Now server is always mario and client is always Luigi.
Luigi model credits:
Original model by Cjes, converted by AloXado320, textures added/fixed by
SunlitSpace542.