- Fundamental's of NodeJS.
- Basic understanding of eventloop.
- Basics of ES6.
- Working of REST api's.
- How to play CHESS game.
Backend Developer [NodeJS and Python] @ TechJini
- Few words about what a game backend is supposed to do.
- Existing languages and implementations.
- What, why, when sockets?
- Sockets vs REST api's
- Intro to the websocket libraries
- Reason to choose library
We will try to take, chess as a case study, and explain the rest with a code base biased to chess.
- An image of simple architecture
- Explaining the components
- What is game state.
- What are the components of game state.
- Games are basically a state in memory, which changes wrt to the input from the user.
- This is similar to the turning machine designed by
Alan Turing
. - Architecture and game state is compared to a Turing Machine
- Code to connect to socket client
- Code to send and receive data from client and server
- Explain the relevance of rooms
- How to create and subscribe to rooms
- Defining methods for each actions
- Starting the game
- Game moves
- Handling conflicts, like when a player makes a move he is not supposed to make.
- Winner declaration, and resetting the game board.
- Writing the entire game might be time consuming, thus some parts could be reused by some libraries.
- Implementing concept of rooms
- Doing move validations
- Vertical scaling and Horizontal scaling.
- Socket scaling using broker.
- Game-state scaling using cache servers.
- Message queues.
- Reverse proxy using nginx.
- Image of architecture involving the above components
- Node is not designed for game backend.
- Handling computations on event loop.
- Importance of doing CPU intensive tasks using golang/rust.
- Need of timers.
- Forget es5 approach.
- es6 / typescript will be lifesavers.
- Security with tokens
- Rather than writing from scratch, you could use frameworks.[But don't expect a long term support]
- Do profiling to find out time consuming functions.
- For production use game engines.
- Conclusion of JS and Game development.
- Q&A.