since monday i’ve added npcs, monsters, combat, inventory and equipment system, and a leveling and experience system
everything is done through updating game state in postgres and using @zero__ms to broadcast updates to the clients
the tilemaps are loaded in chunks through a zero query so it only loads chunks near the user, and those are static
the game loop checks entity intent every tick and updates the database depending on the current game state, and clients get the updated game state through zero queries
user actions such as moving, dragging inventory irems, attacking, equipping/unequiping are all done through zero mutators.
the server is a @bunjavascript server in the background running its own zero client and a loop to to manage the game logic and push updates to the db
@heyvishal_@PlanetScale@zero__ms@threejs The assets are from https://t.co/nykL9TnXKF, the sprite is from the Time Elements collection and the tileset is from The Mana Seed collection
Saw @PlanetScale’s demo of video calls through Postgres and thought: could Postgres handle a simple online game too?
So this weekend I started building a prototype using @zero__ms and @threejs
@providerproto@PlanetScale@zero__ms@threejs Of course if it’s just a data layer it’s common sense Postgres would be able to handle it. It just never occurred to me that you could use Postgres as the game state itself, and use the WAL to broadcast game updates until I saw Planetscale’s video call demo.
@Heav2point0’s description is pretty accurate, it does have the data duplicated to sqlite, however the data in the game loop is actually saved directly to the postgres database and zero listens to the WAL to update its own data and broadcast the updated data to clients.
also worth noting that while planetscale and zero are not related, zero can work with planetscale postgres offering
@spacetime_db@PlanetScale@zero__ms@threejs I actually want to try doing this with SpacetimeDB, but I had more friction trying to do things like load maps or make a map editor that worked well last time I tried SpacetimeDB. I want to explore it more though
Authoritative game server using Postgres as state, and Zero to broadcast updates to clients.
Includes chunking, so we only load players and map chunks near the player, and a tilemap editor that lets you build open world scenes with autotiles, collision, and proper y sorting.
This looks awesome!
How's the performance looking for Opencode Desktop? I used it a lot last week and it lagged a lot when switching between projects and in long sessions.
I really like the desktop experience over the TUI. If the performance was better I would use it for pretty much everything haha
tauri uses less memory than electron but it’s not the actual bottleneck in terms of performance
i’ve tried a lot of these apps and tbh conductor is one of the least performant
t3 code is the only one i’ve tried that hasn’t lagged for my work with long threads and switching projects
@NicholasKissel@vishyfishy2@NathanFlurry I've been looking at Rivet for awhile and I think it's super cool!
Do you guys have any example for something like (durable) workflows? I saw an example in the documentation, but it doesn't seem like it's durable, unless I'm missing something