gamedev / gamedev-jbgame
JBGame: Development Blog
This is the update log for JBGame, my second multiplayer game and the reason I wrote JBend. After the first Java game stalled at its login screen, I decided the game needed a real backend underneath it first, so most of these updates are about the backend. The early entries were written on my old site, kanetempleton.space; I've copied them here as they were, to-do lists included.
2026: the game is finished enough to play and hosted on this site. Play it here, or read Update 4 below for what changed.
Update 0: JBend
This update pack establishes the backend environment for running the game servers, website, and engine. Since these updates deal with the entire backend, there will likely be items on the to-do list for a while.
To-Do
General
- change password support
- email sending
- login session expiration
- logout support
- add more failsafes for HTTP server
- secure password management
- encrypted server communication
- secure session cookie management
- login page reflects your current login status
Connections
- connection logs
- enforced communication protocol
- more POST security
- stress tests for web server
- stress tests for database querying
Security
- encryption
- prevent cross-site request forgery
- more POST security
Done
- add callback support for server database queries
- ... lots more ...
Update 1: Live Website and Servers
The primary goal of this update pack is to host all backend components on my VPS and host a live website.
To-do
- recruit someone for css
- add css
Done
- redirect main .space index page to game web server (5-19)
- create development blog pages for game (5-19)
- status message improvements on registration page (5-19)
- test login and registration functionality from VPS (5-19)
- add favicon.ico to web pages folder to avoid 404 errors (5-19)
- test VPS connections to web server, websocket server, and TCP server (5-19)
- change server database manager to connect to VPS database instead of localhost (5-19)
- set up VPS MySQL database + user for the website and game (5-19)
- install java + jdk on VPS machine (5-19)
- upload JBend to VPS (5-19)
- transfer VPS space primary domain name to kanetempleton.space (5-12)
- register new domain name kanetempleton.space (5-12)
- purchase VPS space for kanetempleton.com (5-12)
Update 2: System Foundations
This update consists mostly of technical improvements to strengthen the core backend that the game engine runs on. (5-29-2019)
Web
- users who are banned during their login session will be logged out the next time they make a web request
- support for reading cookies from front-end web pages
- changed game page to only allow websocket connections for users who are logged in
- changed login page to reflect your current login status; displays your username and "log out" button
Admin
- created admin ban and unban commands; targets a specific username or IP address
- added "kick all" support to kick command
- created ping command to issue a ping to all TCP and WebSocket connections
- added more details to the connection display command
- added admin web portal for executing certain server console commands
- created admin kick command
Security
- passwords are now salted before being stored in database so that they are never visible in plaintext
- support to store/retrieve IV and other message data from CBC crypto methods
- touched up RSA encryption methods
- passwords are now encrypted before being transmitted when registering or logging in
- added RSA encryption to server
- tried adding ElGamal encryption to server; gave up
- added symmetric CBC encryption methods to server
- performed more DoS stress tests after implementing connection control mechanisms; web queries slowed down but no servers crashed
- performed stress tests for DoS attacks from single IP; TCP and WebSocket crashed immediately, HTTP was fine
Connection Management
- saving/loading/checking of banned IPs and usernames; banned IPs are unable to make connections
- increased the max connections per second threshold of HTTP server to avoid denying web requests from legitimate users
- connection manager keeps track of number of connection attempts an IP has made; if this number exceeds a threshold within a short amount of time, the IP will be temporarily banned from making connections
- added connection manager to servers which keeps track of data for specific IPs
- added a thread to occasionally check the "health" of the database connections; sends queries every 30 mins, then resets the database connection if the query does not successfully complete
- fixed a bug where a server reaching the maximum amount of connections would crash when attempting to register another connection
- created ping pong system for server to kick inactive connections; server requests a specific response from clients, if connection sends wrong response or doesn't reply in time, it is disconnected from the server
- changed server behavior for registering connections so that connections on the HTTP server are only registered when they are sending a packet of data containing an HTTP request; this fixed another issue with extra connections getting stuck in the server
- fixed an issue in the HTTP server which did not always drop connections after sending an HTTP response, causing connections to sometimes get stuck in the server
- added server support to kick a specific connection ID
- touched up connection registration code which always registered incoming connections as websocket connections awaiting a handshake
Login System
- added some bruteforce password protection: five incorrect password attempts for any username will temporarily prevent login attempts for that name
- prevent registration of multiple users with the same email address
- added email requirements: must contain @ sign, minimum/maximum character requirements
- added username requirements: minimum of 1 character, max of 14 characters, only letters and numbers
- added password requirements: minimum of 6 characters, max of 20 characters, only printable chars, and no @ sign
- deleted all user accounts so that the password encryption scheme can be properly used moving forward
Engine Improvements
- console thread and database manager thread start before any server threads; prevents some nullpointer bugs
- added launcher support for starting threads in a specific order
- toggle option for displaying text of outgoing network messages
- store console output to text file logs
Update 3: Game World
The goal of this update is to create a primitive game engine.
To-do
- player login session
- player account creation
- map data
- player input listeners
- sprite rendering for webclient
- identical downloadable client
Done
- basic interface to load/update player coordinates via websocket connection
Update 4: Finished and Hosted (2026)
Update 3 ended with a to-do list that was most of a game. This update ports JBGame to JBend 2.0 and finishes enough of it to be worth playing, then puts it on this site. The art is the original; the rest of the client was rewritten.
Done
- port to JBend 2.0: the whole server, its WebSocket endpoint and its game loop are described in one config file [11-28-2026]
- players see each other: other players' positions are sent to everyone within nine tiles, as they move [11-28-2026]
- map data: the world is a 250x350 tile island, generated from the tile coordinates when the database has no hand-made section, so the same place always looks the same [11-28-2026]
- the map streams to the client in 50x50 sections as you walk toward them [11-28-2026]
- movement checks the terrain: no walking on water [11-28-2026]
- chat, with a rate limit and a length limit [11-28-2026]
- guest play, so you can try it without an account [11-28-2026]
- player login session and player account creation, using JBend's accounts: a browser already logged in on the site joins without typing a password [11-28-2026]
- player positions are saved to the database and restored at the next login [11-28-2026]
- player input listeners: arrow keys and WASD, or click (or tap) a tile and the server finds a path there around the water [11-28-2026]
- phones: tap to walk, tap to type, and a layout where the map fills the screen with the info panel floating over it [11-28-2026]
- sprite rendering for the web client, with smooth movement between tiles [11-28-2026]
- one lock around the game world, so the network, database and game threads never trip over each other [11-28-2026]
Still To-Do
- identical downloadable client
- NPCs - spawns, dialogue, movement
- Items - inventory, ground items
- Equipment
- Combat