Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Blood Lines Devlog #5

Introduction

Hi, it's been a while. 36 days, to be exact. I suppose I've never been good at keeping to schedules, huh? Well anyway, it's time to show my progress on Blood Lines.

Social Connections

When you log in, you're now greeted with a new account dashboard. You can access your account, manage your characters, and most importantly, connect your social accounts. Spicy.

More platforms are planned, but for now, you can connect your Discord account. Pressing the button prompts you to login in a new window with OAuth2. So what's the point of this feature?

  • Backup login if you forget your password.
  • Add players as friends in a more streamlined, secure way.
Add players as friends? Won't there be an in-game friend system?

In-game friends are great, until you want to use one of the many features a dedicated social platform provides. No one wants to lose their friends, right? Who knows, maybe you'll make a new friend or two.

Combat

At long last, I've finally made progress on fighting other players/enemies. Here's proof:

On the bottom left, you can see your abilities. Each ability (except weapon attacks) costs blood, which is that red bar on the right. And no! The big red cube isn't a special effect. It's called a hitbox (you probably recognise this), and fighting games use these to judge how far away an attack can hit. The above hitbox is pretty wild, but it's just a mock-up, so take it with a pinch of salt.

Technical Stuff

In the last devlog, I detailed how the game replicates objects between the client and server. It was kind of messy, which I noted. But in classic fashion, I ignored my own advice and thought about how much cooler it would be if I could knock out two birds with one stone. After a lot of trial & improvement, I've designed a much better solution.

Entities and Records haven't gone away. But this time, each Entity has its own Record. It looks like this:


The Record stores all of the Entity's information, and the Entity represents that information in the game world. The Record can be packed and sent over the internet, and it can also be serialised and written to the database. There's no duplicated information, because the Record is attached to the Entity. Neat, right?

After finding myself wilfully unimpressed with Godot's multiplayer nodes, I doubled down and made my own replication system. It's built with this entity-record structure in mind, and features a simpler approach to replication:

  • When the server spawns an entity, the replicator packs its record and sends it over the network to each client (player).
  • The client unpacks the record and recreates the entity.
  • The server sends a table of "property owners". Each record has a list of properties, and the server decides which should be owned by the server, and which should be owned by the player.
    • For example, the player's health is owned by the server, to mitigate exploits, but the position is owned by the player, so they can move around without lag.
  • The clients and server check each record property many times a second for changes. When a property changes, the property owner sends it to other peers on the network.

As for the database, that's had some work done too. If you're a gamer, you're probably used to low latency (<100ms). My original plan was to support a single server which has the database. I setup a server in New York, and in the USA, you're looking at 60ms of latency. Not bad, but on the other side of the world, it's not so fast:

USA60ms
Japan
160ms
Australia205ms
India
225ms


Doesn't sound that bad, but that's the amount of time it takes for data to travel from the client to the server. So if a player in India moves forward, it would take 450ms(!) for another Indian player to see it if they both have fast connections. In contrast, it would take just 120ms for two Americans.

For a small MMO like this, most players will be English and in America. But on the off chance someone from another country wants to play, I've designed the game to support multiple servers:

  • One server is designated as the "database" server, and exposes a password-protected API to access the database.
  • Other servers connect to the database server with the password.
  • Actions like creating characters must travel to the database server, but actions like moving your player will be much faster if the server is closer to your region.

Discord

You're always welcome to join our Discord Server!

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.