Inspiration
We had an engine for an ASCII-based single-player game with line of sight implemented from one of our team member's (Kevin's) past projects. From there, we wanted to make the program multiplayer through a client and server system. The ghosts were because it was Halloween.
What it does
The program consists of two parts, a server that runs and will accept and initialize connections from the collocate client as player characters, and a client that connects to a server and controls the player character they are assigned. Ghosts are generated in the world and will path towards the closest player. If the closest player has at least one person near them, the ghosts will instead path away from the closest player. Three's a crowd, and these ghosts are deathly afraid of crowds. There is no win condition, it's just a sandbox of an ASCII map of Missouri S&T!
How we built it
Kevin imported the rendering engine and the ASCII map of Missouri S&T that he created into our repository, and from there we worked on bringing it from single-player to multiplayer. We configured an apache server to route client connections to a local instance and vice versa. From there, we implemented collision prevention, wasd position updating, and occlusion layer application on the client side. On the server side, we implemented the behavior of non-player entities (ghosts) and updating player state (petrification, if set to true, tells client side that it shouldn't send position updates).
Challenges we ran into
The largest conceptual challenge was determining what tasks needed to done on what side (whether player position should be updated client-side or server-side, which side should implement what part of player state). A larger challenge was transforming xinput (linux ui) into curses to process inputs.
Accomplishments that we're proud of
We wrote a multiplayer game! It works! The game updates entity positions correctly in real-time, both player and ghost!
What we learned
We learned how client-side and server-code can interact and how a single process could be split between those two processes. And comments are incredibly important when it comes to helping people understand code they did not write. This can't be overstated, they are so important.
What's next for Pickle Haunt at Missouri S&T
We'd move the server-side code into a docker container and put that on Azure Container Services. Right now the client-side code only works when the server-side code is running on a personal server, but with Azure Container Services the server-side code can run for longer and more consistently.
Built With
- apache
- curses
- python
- websockets
Log in or sign up for Devpost to join the conversation.