Browserfying the Quake 3 engine

2020/03/15 - games

Working on the Quake 3 engine has been amazing. Changes that seem like it should break, just keep on chugging away. I've made some various improvements over the original script.

console output

The graphics are all PNG/JPG with 50% quality. Tuning up the in game quality makes a mid-definition game load fast and look great.

quality graphics

quality graphics 2

More mod support. The original author of QuakeJS released with the capabilities for Vanilla Quake 3, CPMA, and Fortress 2 (a team fortress clone with roles). One of the first people to reach out to me from my activity on Github asked for the Defrag mod. The original conversion script was failing because one of the levels had a weird character in the name.

Defrag mod

I've added Open Arena, Q3 Rally, and Team Arena to that list. The conversion script makes a graph of every asset. It converts the assets and repacks them in a way that separates the menu/game and level content, so that they are only downloaded when needed, instead of filling up your phone or browser with a bunch of unused files.

Q3Rally

q3tourney5

Mobile support is handled with two little onscreen joysticks that can be assigned to look or actions like jump and crouch. Another cool change, editing the mouse position directly because of a touch screen. The problem was, other games are already compiled, and they receive signals for mouse movement such as +/-1 pixel, but the actual position of the mouse is locked to the center of the screen. With touch screen this has to be changed, but I can't change other people's compiled games, so I have to hack the mouse position in memory.

Touch screen

Touch screen defrag

Disassembly

Networking is improved. People reached out asking for Open RTC, it is a communication protocol built on top of Web Sockets. Since HTTP connections are still required, Quake 3 already has support for SOCKS5, I decided to roll my own Web Socket to SOCKS5 server. Searching for SOCKS server implementations I found one that works on NodeJS, and the first request was to support Web Socket connections. This is one improvement over QuakeJS.

Working networking

I have already received some feedback, missing graphics, input lag, freezing on resize, etc. I finally acquired the skill and understanding enough to realize it would be entirely possible to lazy load all graphics over the network. I.e attach the game to low quality assets, and as the player enters the game, slowly update to high quality graphics when the network has settled. WebM and WebP with something like Google AMP would be perfect for this sort of use case. I am enjoying the mode of "breaking it to fix it better".

Lazy load

Lazy load 2

I realized after talking to some community members that it is time for me to put this toy down for a while and play somewhere else. Usually by the time I get my hands on something, it's already turned to shit. There are a lot of players and communities based around forks on the original game, I don't see much indication that these people want to work together. They actually choose to fork and not work together on purpose. I've found a lot of evidence there are content creators who feel they got ripped off. There are a lot of administrators who retaliate with their ego and reject or ban community members on a whim. There is a lot of separation and angst between communities. Different goals, rejection, trolling, and hate unrelated to trolls, seems to be commonplace in the gaming world.