A 2D multiplayer shooter game with magic and guns.
Josh
Check their projects out: Aushr, Spellfire Frontend, nocogl, dbgui
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
Finished a huge refactor of the entity component system, and started integrating sqlc. Lots of work, almost done with a fully working base implementation.
I needed a biome heatmap, basically a way to figure out what biomes surround each tile. I eventually settled on an efficient (multiple linear horizontal/vertical passes) gaussian blur algorithm that simply stores biome information rather than actually blurring the tiles. The attached image is just a visualization of the map with the blurred values. This way, I can avoid spawning entities near the border of their biomes so that they don't go where they aren't supposed to.
I designed a cactus as well, and wrote some code to save the generated biome map data to biomes.json
Spent so much time designing these 2 dead bush variants... alive bush and player for side-by-side size comparison.
Scaled up the generation to 1024x1024, and added a new biome dubbed deepwater. I now generate an island surrounded by deepwater, acting as a natural world border that has dangerous sea creatures that will kill players trying to cross over.
Successfully implemented smoothing by looking at each cell's neighbors and applying a majority rule pick.
Got terrain generation to look pretty close to what I want, very natural shape and biome distribution. The current algorithm is sort of like a cellular automata version of flood fill. I seed the grid with water and other terrain types initially, then void will copy adjacent water cells, and water cells will randomly copy adjacent terrain cells of any type. The next features I need to implement are a gaussian blur to blend biomes and rounding out the edges of the biomes with triangles.
Started implementing the terrain generation algorithm in Golang with ebitengine for visualization. I've decided to add cellular automata to the mix and see if I can get dynamically evolving terrain working, but tweaking the parameters is going to be quite painful.
Worked on a design for the player sprite (I couldn't get the eyes to look right for so long, still not sure if they look right QWQ), and also made a simple mage sprite.
Still working on biome generation, but switched from Voronoi diagrams which are polygon-based to a tile-based biome generation with a custom flood fill algorithm I cooked up that fills different regions with varying speeds. It's still not perfect, and I'm working on reimplementing a better version in Golang for the server.
Currently trying out a zoning method with Voronoi diagrams, smoothed out and distorted along the edges with perlin noise. It's still very rough but I think that with a few more iterations I can get something that looks good.
Drawing up some potential designs for terrain. I've settled on zoning for each biome, and the entities/structures inside each biome will be further generated via a perlin noise map. Still need to find and code a proper zoning implementation.
Trying to figure out designs for the game's background in Figma. Currently trying out grids, but they don't look too appealing to me.
The backend is fully working! Tested with a preliminary version of the frontend. However, due to code complications and bad architecture decisions, the frontend is currently undergoing a rewrite in Rust with the Bevy game engine. I've successfully implemented player movement, spawning bushes, shooting, and killing players in the Golang backend. I would've liked to include a video demo, but as the frontend was constantly too buggy, I never recorded one while debugging. I've included an image of a screenshot of the game (sort of) working. Hopefully the frontend rewrite in Rust will be less buggy QWQ
It's almost 2 AM and I'm tired as heck but I successfully implemented a working camera compete with zoom and added usernames to each player, along with some other debugging.
After many hours of sweat and pain, I've managed to implement a debug client in Python using Pyglet. The frontend will remain as TypeScript for Discord activities, but it'll be much faster to prototype and debug with a Python client. It's barebones and I've just gotten it to fully work (had to debug the backend server as well, NaN errors everywhere...) but it should significantly speed up my progress.
Massive updates to everything, world.go has a complete system for moving players, and everything is somewhat properly communicating with the frontend, but there are so many bugs to squash and the debugging session has been incredibly long... hopefully it'll be working soon...
After a huge amount of work (approaching 10h, so I decided to stop and make this devlog before finishing the home stretch), I've managed to implement an (almost) complete entity component system in Golang. The ECS uses dynamically created archetypes, with archetype signatures implemented with BigInts. The components stored within each archetype uses kelindar/column for maximum performance. I created a world class that fully integrates with the components, archetypes, and entities. I also started switching from json websocket messages to protobuf messages, which are much smaller and more optimized. All I have left to do is create a system that moves the players, and to complete the websocket communication and migration to protobuf, and I should be able to get a demo up and running. The attached screenshot is just a small bit of the full code written, I have already made a commit with the full changes.
Found kelindar/column which seems to be perfect for my ECS as a performant way to store component data. Set up packet structs and Unmarshalling.
Continued to work on making the game loop cooperate with the websocket server. I laid out the basic setup, with input / output channels that take in / put out player updates. These can be consumed concurrently by multiple goroutines, sort of like manual vectorization ig?
The first hour was spent working on testing different setups for implementing my custom Entity Component System. I eventually settled on a slightly modified project structure, renaming websockets.go to server/server.go and changed the way I initialized the gws server. After an insane amount of work, reading the lxzan/gws example code, testing different setups, and searching google, I successfully set up the websocket server part of the backend in a way that I'm happy with. I still have really good separation between different parts of the code, and everything communicates together well (hopefully, I haven't implemented the channels and different worker pools and whatnot yet).
Fully restructured project to conform with common golang project structures. Broke up main.go into spellfire.go, router.go and websockets.go, and put them into folders cmd and api. I honestly like how Golang projects are structured, it makes a lot of sense.
Switched to Golang (completely new to the language, so learning a LOT along the way). Created a main.go file that uses net/http and lxzan/gws. The websocket implementation at the moment is very simplistic and mostly for testing purposes. The majority of the time was spent coding and debugging the /api/token POST method, which goes through the Discord activity OAuth flow. There was a huge amount of time that wasn't tracked, as I spent many hours debugging cloudflare tunneling and getting it to work with Discord activities (the main issue was the tunnel not upgrading the connection to https, which ended up being caused by the domain being 4 levels deep backend.spellfire.hutao.rip, and cloudflare does not issue ssl certs for them). At the moment, the Discord OAuth flow is fully working alongside the frontend, but it was a rough migration to Golang as I have absolutely no clue how this language works, lol. I attached a screenshot of the main.go and discord.go files.
Reworked gun mechanics to have a bigger focus on crafting unique guns rather than following fixed blueprints. Players can now mix-and-match different modifications and use any materials they would like to craft their guns. Also did preliminary work on the api.md, drafting the initial structure and figuring out authentication/websocket message events. Spent the last 2 hours designing some basic art assets so we can start development. Attached are the designs for bushes, trees and rocks, made in figma.
Initial setup of backend framework code with socketify, still unsure about how best to work with game server backend (will figure out soon hopefully).
I updated guns.md with an list of guns that will be implemented, coming up with a comprehensive set of mechanics, stats, and modifiers for guns. The specific numbers for each weapons such as damage, fire rate, etc have not been inputted yet, as I need to code and playtest the game first to make sure that the numbers are sensible.
Set up the initial github repository and migrated the game design document to the repo. Attached image of the gdd in the google doc, committed the github version of the gdd already.