I decided I needed to move the server code from a standalone console app into a separate instance of unity.
It would be way too difficult to detect collisions and implement NPC pathfinding otherwise. It has the added benefit
that I can see player movement in realtime. This also goes hand in hand with implementing server autoritative
movement. That is, even if an object does not exist in the client view, that does not mean it is not there,
and vise-versa. Even if a player sees an object, if it does not exist in the server view of the world; It does not exist.
The server is the authority on what is or is not there. I had to make sure that the client version of the world and the
server version of the world are the exact same. Pretty simple, I just copied the list of game objects that made up the world
and copied them from the server project folder into the appropriate place in the client project folder.
I also decided to try to let the server handle calculating speed as well as movement for the player, as opposed to having it calculated on the client side, and then telling the server the values. This goes back to building the project as server autoritative movement. But in doing this, I somehow made the playable character insanely slow. This was a pretty simple fix, but I decided it would also be a good time to implement running. Simply hold the "Left Shift" key to run. But I created a self inflicted bug that caused the player to quickly approach light-speed.
What was supposed to happen is, every frame, the game will tell the server that we are holding the shift key (obviously only if we are). The server will check every frame to see if we are holding the shift key for that frame, if so; set the move speed to moveSpeed = 10. Otherwise, set the moveSpeed to 5. But what had happened was I had doubled the move speed for every frame the user was holding the shift key. (moveSpeed *= 2;). This meant we were doubling the player speed every single frame. If the moveSpeed started at 5, after 30 frames (1 second) we were at a move speed of 5,368,709,120. I don't know what the ratio of in-game units to real world units are, but that has to be quickly approaching the speed of light.
Future updates will include upgrades to the game, new game ideas, and absolutely upgrades to this website. This is some 1999 looking website bullshit.
Planned future game updates include:
- Obviously adding shooting. An zombie FPS game doesn't make sense without the ability to shoot zombies.
- The ability to choose between a variety of different weapons: guns, knives, grenades.
- Probably some form of triggerable traps that could affect both zombies and players. Zombies will be more likely to trigger them because they are zombies and they are dumb.
- Better player models. Everything is just capsules and cubes right now. I am terrible at 3D modeling, but there isn't a whole lot that I can't get better at with practice. #positivity
- Models for weapons
- Bullet path rendering. I had this on the first iteration of this game, but didn't impliment it when I rebuilt everything from scratch because it wasn't a priority, but I like how it looked. I'll have to figure out how to implement it server side and render it client side.
- Add a gallery of screenshots to every blog post showcasing the progress.
- Probably add a page for memes that I think are dope. lol