Activity

Snxhit_

Hello!

Installed love2d (Big props to the creator) for Neovim, because I didn’t have a LSP and shit for Love2D, works great.
Anyways, implemented:

  • Player: Can move around, shoots projectiles whenever the player clicks and holds
  • Projectiles: Smol triangular thingies that go vreem vroom
  • Enemy: Big red enemy that follows the player around

Enemies can be damaged but the player can’t.

Also made it so that the enemy spawn rate increases as time goes on, also capped it at 20.

Attachment
0
Snxhit_

Shipped this project!

Hours: 46.33
Cookies: 🍪 1185
Multiplier: 25.57 cookies/hr

What I made

I made Forlorn which is a MUD game engine!
MUDs are basically text based fully multiplayer games.

Features (Once again, stolen from README)

  • Flexible entity & item system using spawners for dynamic world population.
  • Detailed tutorial with a robust NPC system!
  • Clans system to allow players to improve the multiplayer experience.
  • Stat system for players and entities, including item buffs and modifiers.
  • Combat system with scaling, random factors, dodging mechanics, and looting and item drops.
  • Merchant entities for buying/selling items, simulating an in-game economy.
  • Room-based world navigation with cardinal directions and descriptive areas, like in classic MUDs!
  • Persistent player profiles, inventory, and stats.
  • Web client and terminal (Netcat/Ncat) support for gameplay.
  • Helpfile system for in-game tutorials, topics & command documentation.
  • PvP combat with coin looting and respawning.
  • Periodic world ticks for health regen, spawner management & combat.
  • Fully optional colors, beautiful unicodes for a modern terminal look and maximum compatibility!
  • Profile, and help cards for enhanced terminal readability!
  • Automatic database initialization and world setup on first run (Self-Hosting)

What was challenging

This time around,

  • It was hard to write clan logic sometimes due to the complexity and the scope
  • Coming up with proper sentences for NPC dialogues sobtv
  • Indexing randomly breaking due to the unsorted slices, maps
  • Fighting bugs that creeped into the code, didn’t drop proper errors.
    Regardless, it was still really fun!

What I learnt

Building this project taught me quite a lot:

Technical Skills

  • Golang: This was my first time using Go, and I loved it!
  • SQL: Although it was long overdue, I finally learnt SQL and DBMS from scratch!

Problem Solving

  • Managing time working on projects because this time it actually mattered.
  • Managing larger codebases than I’m used to.
  • Structuring servers like this with a lot of reusable logic (Learnt this the hard way.)
  • Although I tried my best to write good quality code, I still see a lot of design choices biting me. So, I also learned what NOT to do!
  • A lot about concurrency and using goroutines with Go!
  • Actually learning how to write READMEs and details.
  • Properly using a VCS!

Personal

  1. Working on something till I’m satisfied with it.
  2. Managing scope creep.
  3. Keeping track of work status instead of winging it and working on whatever, whenever.
  4. Building consistent and efficient work habits.

This was another fun ship! Thank you! <3

Snxhit_

Done with NPCs!

I am finally done polishing NPCs, they’re all pretty much cooked now. I’m not sure how easy their explanations are to understand but I’ll have an idea soon when I make people test them out. I can’t really tell because I’m the one that wrote the explanations… Ofcourse I understand myself.
Regardless, I added the remaining few missing things, fixed grammatical errors, et cetera.
I also worked on the web client a little bit. Mainly just improved the styling, added gaps wherever needed, et cetera. Now I’m gonna work on styling the background disable checkbox and then done!


I think we’re ready to ship for the second time!
Not much to explain or say… See ya’ll on the other side!


CIAO!

pic: polished gwaarhar dialogues

Attachment
1

Comments

Praco
Praco 3 days ago

YAYAAYAYYA

Snxhit_

Another Bug…

I was innocently working on improving NPC dialogues, and while testing, I picked up a few items… I used the inventory command and all was well. Then… I used examine 0, which should give me the information of the first item of the inventory… But instead… It showed the data for the 3rd item. Then I tried examine 0 again, this time, got a COMPLETELY different output!
Dread took me over… Another bug I didn’t know the cause of… Probably would take so long to debug.
After looking around and trying stuff for well over a little while, I got tired, and pulled out the big guns…
Copilot. Sad I had to rely on Copilot but, it fixed things so I won’t complain. Think it changed about 20-30 lines…
Regardless, indexing works properly in every command now.


NPC stuff

As the last item on my TODO list, I’ve been working on polishing NPC dialogues, and adding missing pieces of information to the conversations.
I would like to say I’m close to almost being done, but I’d rather not say something like that. I don’t think it’s gonna turn out to be true because it never does.
This process involves fixing delays, making sure enough time is given to the player for reading each sentence, fixing spelling mistakes and stuff cuz I was in a hurry whenever I wrote dialogues for some reason.


Web Client

Added a map button on the web client sideBar, this button opens the Forlorn map in full screen. Whenever the player clicks anywhere, the map then disappears.
Added fade in and out animation to the map overlay.
P.S.: Map button doesn’t appear in the top bar on mobile devices because the map can’t properly fit the screens of mobiles and hence would be unreadable, so instead I just don’t make it appear.
Added default alias hf -> help flavortown! Sets itself whenever no aliases are detected.


CIAO!!!

pic: map overlay

Attachment
1

Comments

Praco
Praco 3 days ago

second favourite devlog

Snxhit_

Map

Made a map like I mentioned in the previous devlog, the whole map is done (unless I missed something).
I also lapsed the entire process! Check it out here! That’s pretty much all I did. It was a pain in the ass to do but it was also very fun.
Working on making the rooms in the map bigger visually because they’re not even visible at the moment.
Not much to explain in this devlog, so…


CIAO!

pic: the map, probably won’t be visible properly since ft downscales images

Attachment
0
Snxhit_

V0.2.0 Is Here!

Published v0.2.0 which includes the new clans system, fully built, including the kick command that I was struggling with last devlog!
For reference, here is a list of commands that the clans system currently has:

  • clan info: Shows info ab your clan
  • clan top: Gives a list of all clans sorted by amount of players
  • clan join <name>: Lets you join a clan
  • clan say <msg>: Sends a message in clanchat
  • clan leave: Lets you leave the clan

Yes, I stole the list from the clan helpfile. Though, these are only the commands available to the normal players. This list doesn’t include administration (leader only) commands!


NPC Updates

Finished (Almost, there’s a lot of finishing touches left) working on Gungnir, the Tribal Chief’s script, added a new NPC named Arbara, the Librarian. He explains everything about the web client. He only talks to you if you’re on the web client.
Somehow, I missed quite a few important things while writing NPC dialogues. For instance, no NPC ever mentions the examine or use commands, which is weird, because they’re pretty damn important, lol.
Regardless, that won’t be too hard to fix.


VISUAL MAP!

Started work on a map of the entirety of ForlornMUD! This map will include every room, and will have connections to show entrances and exits. I’m using this website to make it!
I also found a commandline tool that instantly converts to a .png from a .json but it’s Windows only. Wine didn’t work with it for some reason. Here I am, manually creating a whole map. Well, atleast I can lapse it.


Alright then…

CIAO!

pic: barebones map, final product may look different

Attachment
0
Snxhit_

More tutorial stuff

Worked on more dialogues for the last NPC (for now), Gungnir, the Tribal Chief!
Got distracted by stuff I abandoned halfway while writing dialogues… But obviously always went back to it, lol. I also wrote the helpfile for clans, it lists out EVERYTHING about the clans system. Every command. Well there’s not a LOT but yes. The helpfile got pretty huge.


Apart from that, also worked on a kick command for clan leaders to allow kicking other players out of their clans. For some reason, I can’t get the logic working right because I’m just a little confused. There’s complications because when kicking the code has to check if the player being given the boot is online or not. If they are, then they get a notification, their in memory data has to be updated, if they’re not only the database has to update. But yeah. I’ll get it working eventually. I was just a little overwhelmed sobtv

Regardless, MIGHT work on a map soon… Not sure.


CIAO!!!

pic: clan helpfile!

Attachment
0
Snxhit_

NPC Stuff

Worked on more NPC stuff, finished dialogues for Cedriah, the Economist, I’m working on Gungnir’s dialogues right now.
Also added confirmations to a few events:

  • Clan creation
  • Leader leaving the clan (auto-transfer of ownership)
  • Leader disbanding the clan

Apart from that, I also added clan tags to the profile command, the display name at the top now shows clan tags as well.
Also added new merchant in Cedriah’s room for demonstration purposes, added a new item, again for demonstration purposes. They’re both used in the tutorial.
Fixed a few room paths as well, a lot of them were broken. (Just the new ones in the academy.)

Something I’ve noticed though, the server has gotten a lot faster since I switched to WAL mode. Didn’t know this would happen or I would’ve done this from the start. It even starts faster!


CIAO!!!

Attachment
0
Snxhit_

More Polishing!

I’ve been working on a few different things.


Last night, I added confirmation prompts which take over the user’s command prompt and continually ask for confirmation (yes or no) till the user confirms or denies an action. Then, on the basis of the user’s response the action is executed or denied. Particularly proud of this because I didn’t think I’d be able to do this due to the way the prompting works, but hijacking the main.go part of the command logic did the job perfectly!
Any function/command can now call for confirmations using a function called AskConfirm(), and then use the values returned. Currently, custom prompts can be set so that each use case can have a different confirmation prompt.
I wanna add support for custom options apart from yes and no but that seems odd and not needed.


Then, I’ve been working on Cedriah, the Enchantress’ tutorial script. She explains currency, and merchants! There’s not really much to explain here because there’s not really any logic. After Cedriah, I will be working on Gungnir, the Tribal Chief, who is a new NPC (I don’t think he’s ever been revealed).
He explains the clans & social systems! (Messaging, clan creation, etc etc)


Fixed a certain bug with the clans system that caused a clan to be deleted if the leader handed over the position to another member? Don’t know how I missed a DELETE SQL query in the code, but yes.
uncanny-incredible
The bug is back as soon as I started talking about this… I should look into it.


CIAO!!

pic: confirmation system, non yes/no outputs retrigger the prompt, empty outputs paste the prompt symbol.

Attachment
0
Snxhit_

Polish Polish!

Not the nationality. I’m talking about polishing Forlorn. Because that’s what I’m doing right now! I’m sick so I didn’t feel like writing a devlog, now ya’ll get a 2.5 hour devlog, lol.


Web Client

I added a couple different things to the web client:

  • Added a topBar that displays either a warning or the title of the game depending on the screen size
  • The bar also holds a settings button for screen sizes that aren’t enough to fit the sidebar, so the sidebar is hidden and the settings can be accessed from the topbar’s setting button.
  • Top bar shows a warning about the game not working as intended on smaller screens.
  • Resized a few elements on smaller screens so that they don’t get clipped and look weird.
  • Basically finalized the web client apart from needing to perfect a few UI elements

Server

Made mainly QoL changes to the server, most were NPC and clan related.

Clan

  • Added a clan chat, whenever you send a message, it sends to your entire clan.
  • Messages sent by you (Private or clan) are now shown to you instead, unlike before when it’d just display Message sent!.
  • clan info now shows online players (WIP, broken rn)
  • Clan leaving and disbanding works properly.

NPC

  • Added opWaitDiffRoom & opSayDiffRoom, which are just opWait & opSay respectively but the former works if the player leaves the room. This enables “long distance” convo which is not always intended.
  • Conversation with an NPC stops if the player leaves the room.

CIAO!!!

Attachment
Attachment
0
Snxhit_

A bug

A random bug that crashes the ENTIRE server.


Explanation

At first, I saw a crash happening – no error message, just that the server is using a closed connection, which means a disconnected player which was caused by a bug, but I had no idea what was wrong.
Did a few things, tweaked a few lines, thought it’d be fixed, started working on the next item on my TODO list as usual.
But then, suddenly, while testing, it crashed when I tried to create a clan. Why? How? No idea.
Same thing once again, no error message.
Looked into it for 20 minutes. No idea what’s wrong. Panicking. What do I do?
Then I thought of Copilot. So I told the whole story to copilot.
Copilot thought for about 31 minutes 17 seconds. Checking every line, some, even twice for some reason. Then, after all that, it made a few changes, all less than 3 lines.


That’s it.

That’s the story of how I added Copilot to the AI usage of my project
And to be fair, I thought of increasing the timeout on the database just a couple hours ago. But then I forgot, which lead to my doom apparently. Well, I’m not dead. But you know what I mean.


Flashback

A few hours ago, I noticed that sometimes when I tried to log in, the server would see a database is locked (5) (SQLITE_BUSY) error message. I ignored it because I thought it’d be fine. Boy was I wrong.
Perhaps this is a side effect of spawners adding items and entities periodically… But then, it’s been a while since spawners were introduced.


Conclusion

Regardless, that was traumatizing. I was worried for my life (I’m scared of bugs).
Now, it looks like everything is working fine. I need to get back on the grind. Though, I’ve completely forgotten what I was doing before this devastating situation happened.

Ciao!

pic: summary of copilot’s changes, even tho only the first change was relevant.

Attachment
2

Comments

Snxhit_
Snxhit_ 8 days ago

Would write more, I feel very strongly about this. But I reached the word limit. No space even for emojis uncanny-incredible

Praco
Praco 8 days ago

THIS IS MY FAVOURITE DEVLOG

Snxhit_

Hello!

I’d misspelled the name of the database table that stores clans… I wrote clan in the code, and was wondering why a lot of clan related changes weren’t updating in the database… Spent like, 10 minutes (Could’ve been much worse), troubleshooting, only to realize I missed an ‘s’ in two places. isob
Regardless, clan tags now appear in look! Let me know if ya’ll have any color related suggestions because this looks pretty harsh lol


Ciao!

Attachment
0
Snxhit_

Halo

Worked on more clans stuff, added a few things:

  • All clans now have a “status” which is either open or close, if its open then anyone can freely join the clan and if its close then no one can join it. Owners can change this setting.
  • All clans now have a “tag” which is a 4 lettered abbrievation or anything else the clan leader wants. Tags are visible before player names if the players are in clans! (WIP).
  • Properly formatted clan top that displays ALL the clans from smallest to largest.
  • Added commands clan <open|close> (only works for owners) and clan tag <tag> (also for owners)!

That’s about all I did.
Currently, the clan info command is crashing for some reason, but I’m looking into it.


Ciao!

Attachment
0
Snxhit_

Fighting the Web Client

Last night, I was wrestling with the web client, or more specifically, xterm.js because it wouldn’t let me resize the font and then make the terminal fit it’s container properly. I tried stuff for a long time, but in the end, I gave up. I’ve decided the web client cannot support mobiles. Well, you can still use it with the desktop site option, it’ll work just fine. In the meantime, I’ll try to think of other ways to make it work.
I dreamt that the web client was trying to eat me scared


Other stuff

The work on the clans system has resumed! I did a few different things:

  • When using commands like fight or sayto that involve addressing a player, the actual command would become case sensitive which is not ideal. So, I fixed that
  • Added a clan top command that shows a leaderboard!
  • To achieve this, made a function that sorts the world.clans map into a slice.
  • Split up the clan subcommands into their respective command sizes.
  • Made the web client properly scaled on every device size, also made sure the main page has no clipping issues
  • Settings page is a WIP.

CIAO!!

Attachment
0
Snxhit_

I’m lost. What am I doing?

Lost in my long, almost nonsensical to-do list at this point sobtv
Regardless, I’m almost done implementing limits, the hard part (adding them to the function that does batched inserts) is still remaining though. I also made the inventory command prettier, it now displays the total limit and the used limit!
The pickup command enforces limits now as well. There’s only two more functions I have to fix.
Training stamina also increases the limit as it should!
Ciao.

Attachment
0
Snxhit_

More formulas!

NPCs

I’m basically done writing the tutorial using NPCs!
So far, there’s four NPCs:

  • Xamien, the Guide
  • Gwaarhar, the Dwarf: Teaches combat
  • Bulgan, the Sturdy: Teaches about training stats
  • Cedriah, the Enchantress: Teaches about economy (WIP)
  • Gungnir, the Tribal Chief: Teaches about social aspects of the game (WIP, cuz clans system is not done)

More Stuff!

Apart from NPCs, I’ve also been working on adding a limit to the player inventory that scales with the stam stat! This gives the stam stat a purpose (Another use is coming soon), while also making sure the player can’t just hoard anything and everything. To achieve this, I added a field to the player table and to the character structure: invLimit.
It is calculated with the below formula:

  • 20 + 3 * (stam ^ 1.40)

This makes sure the limit scales progressively when you increase the stam stat! This MIGHT change later.


CIAO!

pic: a rather creative way to say work in progress sobtv

Attachment
1

Comments

Praco
Praco 9 days ago

LOLOL

Snxhit_

Hello!

Implemented a few different operations in the NPC scripts.
NPCs can now:

  • WaitForKill: Wait for you to kill a mob with a certain ID
  • WaitForReturn: Wait for you to return to their room before continuing a conversation
  • Alert: Send “alerts” that look like instructions instead of messages from the NPC themselves.

Explanation

I know I said I won’t implement a quest system just yet, but, this is basically a mini quest system. And when needed, I can see that it’ll be pretty easy to add more features to it.
Currently, the conversation continues even if the player leaves the room. Which is… Not supposed to happen…
So, I’m gonna now implement a way to inject WaitForReturns as soon as the player leaves the room, into the dialogue. Not sure if that’s EXACTLY what I’ll do, but the behavior I want to achieve is that.

CIAO!


Pic 1: Kill 1 small dummy quest
Pic 2: Gain 1 level quest

Attachment
Attachment
0
Snxhit_

Training Grounds!

Added a small 3x3 training grounds area connected to the 2nd NPCs room. Three different types of training dummies are spawned in this area. (Heavily inspired by either Carrion Fields or AardwolfMUD I don’t remember its been a while).
Now, I’m gonna work on enabling the NPCs to give the player quests, or something similar. Maybe not a full-fledged quest system just yet, I’m lazy, and also the clans system is still incomplete.
Also worked on a lot more dialogues for the 2nd NPC, which is where most of the time went.
Alright then, byebye!

Attachment
0
Snxhit_

Dialogues

Dialogues… A lot of them. Since the past 2 hours I’ve been writing dialogues for NPCs that are supposed to be the tutorial. I’ve completed about two NPCs. Implementing the scripting system was really rewarding. I’m gonna add another script operation that makes the user kill a mob. Probably a few others as well, I think I need them.
Doing this is pretty important to make the tutorial actually feel like a tutorial rather than just some NPC yapping.
Took me 2 hours to write ~130 lines of tutorial, which totals to around ~5 minutes of listening to NPCs in game.
Not much to explain in this devlog, I didn’t write any logic whatsoever.
Have a few screenshots, ciao!!

Attachment
Attachment
0
Snxhit_

NPCs!

I’ve implemented a pretty robust system for NPCs for purposes of a tutorial. NPCs are completely different from actual entities and merchants, and also, they only exist in memory, i.e. they’re only initialized every time the server starts. Rather than my usual approach, which is to give them a database table of their own. I wanted to make it simpler this time because, honestly, there’s not much of a point in using the database if they’re not gonna change anyway. It’s actually working better than I expected. Though, I did have to take ChatGPT’s help for a little bit of the logic.

Explanation:

Currently, there’s a “scripting” system in place. Which allows me to make a script that the NPC runs whenever it is talked to. For now, there’s a few operations the script can do:
opSay: Says something to the player,
opWait: Waits for a defined amount of time before the next operation,
opWaitCommand: Waits for the user to execute a certain command before the next operation.

And with this system, it’s pretty easy to modify it and add custom operations, which I might do in the future. For now, I’m gonna write a tutorial with this.
Along with these changes, I also added an academy to the map and the player starts out there instead of the Welcome Plaza room.
The academy will contain a lot of NPCs that’ll explain every element of the game.

Note: The spawn after death is still at Welcome Plaza because the academy is only intended as a tutorial.

CIAO!!!

Attachment
0
Snxhit_

Hola!

I’m done with working on the web client for a while, it’s time to move on to finishing the clans system in the game server! I did some polishing changes, and although I’m still not satisfied with a few things on the settings page, this is enough time given to the client. Most of the changes were hover effects, so I can’t really display them.
This marks v0.2.0 of the web client though!
Somehow, I didn’t close the dev server for 5 hours and 36 minutes sobtv
(I use python’s http.server cuz the client doesn’t use any frameworks)
CIAO!

Attachment
0
Snxhit_

Aliases!

Aliases have been successfully implemented, and they work perfectly!

What are aliases?

Aliases can be used to make longer commands shorter. Explanation:
In the settings of the web client, you can now add aliases and they each have two fields:

  • Command: the command that you want to alias (convert the value) to.
  • Value: the command that you want to alias (be converted).

For example:

  • Command: ss
  • Value: sayto Snxhit hey!
    And after hitting save, whenever you type into the input bar: ss, it’ll automatically convert to sayto Snxhit hey and also send the same command to the server, instead of ss!

Explanation

Basically, added an array stores in JSON the data of all aliases, that the user has added and then goes through this list whenever a command is executed (from the input bar ONLY), and then if a command that is aliased is found, then its replaced by the alias’s value!
Aliases are also stored in localStorage so they’ll persist between sessions! Though, loading them from localStorage on page load is yet to be implemented, I believe it’ll only take a few mins to do :D.

Ciao! happy

Attachment
0
Snxhit_

UI UI UI UI UI UI UI

Worked on the web client UI more, I think it’s really starting to take shape. There’s honestly still a few rough edges, but I’ll polish them as I go! Don’t have much to explain in this devlog, but take a look at the photo!
I am yet to implement the logic for adding aliases, but you can create a new alias section. I’ll now be working on the logic.

Attachment
0
Snxhit_

Hello!

Upon popular request, I’ve added an option in the settings to disable the background image because the colors don’t render properly for some people, which causes the background to hide a lot of the colors. It’s another QoL change, but I’m sure it’ll be helpful for some. I’ve also finished up the animation of switching between the settings and game page. The title of the website changes whenever you switch as well.
The settings is still under construction, and honestly, the styling is turning out pretty bad. I have no idea what I’m doing wrong or how to fix it, but I’ll think about that when everything else is in place. Next, I’m gonna work on adding aliases!
Here is the page, with and without the background enabled.
Ciao! agabye

Attachment
Attachment
0
Snxhit_

I’ve been working on a settings panel for a while, added a seperate panel that takes the whole screen and will display settings options. Also seperated the game’s layout and the panel so I can switch them and do animations. Right now, when you click the settings button, the game’s layout slides towards the right and the settings panel enters from the right. Honestly looks pretty cool. I don’t want to show it just yet because it’s still a little weird, so in the meantime, have this photo of the settings panel with two empty white buttons loll
Honestly, the background art looks so much better without a blur on the panels. I love it because it fits the theme of the game perfectly and blends very nicely with the UI… Drawn by a very nice person and a talented artist :)! Visit them here! Visit them. Not optional. cat-gun
Ciao :D

Attachment
1

Comments

Praco
Praco 10 days ago

i got shouted out by snxhit my life is complete🫡

Snxhit_

I worked on the input bar’s UI a little bit more, also worked on adding a settings panel. I’ve cooked up a few ideas:

  • Adding a toggle for the background image
  • Adding aliases (Will elaborate in later devlogs)

These are both web client specific ideas, because there’s not really much I can do with netcat players.
Apart from that, I also worked on adding colors to the clan system. Also, added a clan info command that shows a card (similar to the profile card) for the clan that you’re in!
This card includes a list of members in the clan as well!
There’s still quite a few bugs in the clan logic, but I’m gravitating towards working on the web client more. Dunno why but it’s just fun. Plus, it doesn’t make me have a million terminals open. I should probably use tmux. Anyway.
Ciao!

Attachment
Attachment
Attachment
0
Snxhit_

Input bar!

For a while, I’ve been working on a input bar, that has a input box and a button!
This allows the player to type commands into the input box itself and then submit by pressing enter or pressing the --> button (Same as typing in the terminal, except the button).
The reason I did this is:

  • Say there’s PlayerA and PlayerB.
  • PlayerA types the command “abcd” in their terminal’s input, but doesn’t press enter yet.
  • PlayerB does sayto PlayerA hi,
  • PlayerA gets the message, but their input gets wiped visually, and to the game, its still there.

PlayerA’s current line is cleared to display the message, and I can’t do it in a better way because of the game running over a TCP stream and the server not actually having full control over the player’s terminal. I tried to fix this in many different ways, spent almost 2 hours trying it out, but in the end, I failed. thisisfine.
So this is a better workaround, and also neater, prettier, more intuitive.

I know the input bar’s ending and the side bar’s ending doesn’t match but I don’t think I can do much about this because of the way xterm.js is initialized. Sometimes, it overflows, causing the input bar to be below the content, which makes the user need to scroll, so I intentionally made it shorter.

Attachment
0
Snxhit_

Currently working on the leaving logic, something I’ve stumbled upon is that for some reason, the name of the owner is stored in the field owner_id even though its supposed to store an integer? I’m very confused, how tw_sob?

Attachment
Attachment
0
Snxhit_

Clans!

I’ve been working on a clans system, I’ve managed to get the basics down, a table in the database for clans, they contain data about the clan itself, added a clan_id field to the player in the database as well. Right now, creating and joining a clan has been implemented and works. Basically done with the backend side of things, and now is time to use this.
Also added a loop that goes through the database players and populates a list of member ids in the clan data that is in memory.

Next up

I’m gonna work on the leaving/disbanding clan logic, maybe a few more administration related things for the owner, and most importantly, add a clan inventory, which I think will be a fun idea. Every member can take anything they want from the inventory, and from anywhere!
Here is a screenshot from the database!

Attachment
1

Comments

Praco
Praco 13 days ago

clans!!1!1!!

Snxhit_

Hola!

Over the past few days, I’ve made a LOT of little changes that added up to the 5 hours you see in this devlog. Didn’t think it’d take that long but I had quite a few bugs to fix every day. Regardless, managed that.
I few of the changes I can remember:

  • Added the ability to use multiple trains at once, which changed training syntax to: train <amnt> <stat>!
  • Added ability to reset stats via train reset.
  • Added the ability to lose multiple levels on death (only happens at level 35+)
  • Added sayto <player> command to directly communicate with other players!
  • Added user <player> command to look at another player’s profile! (Player must be online)
  • Fixed a lot of bugs revolving around players being unable to disconnect properly.

What’s next?

Currently, things on my radar are:

  • Pets: Yes, pets, because that’s what’s important :)
Attachment
0
Snxhit_

Hola!

I managed to implement actual sounds! Though, a lot of the logic was directed by ChatGPT cuz I couldn’t figure out what to do lol.
Anyways, the program can now play sounds, from the file that you give it!
Live reloading is also implemented, though it’s crashing and also a little buggy because of how text editors work.
I implemented a very small “toy” parser for now for testing purposes. It works, so that’s enough, lol.
Here is an example of a test track written in a .me (Mellow) file.

Explanation:

Each line plays the notes that it mentions in the duration that it mentions, forever!

Attachment
0
Snxhit_

Hello!

This is the first devlog on this project!
In the past hour, I basically set up the entire structure of the project, implemented ASTs, a parser (that doesn’t do anything rn), a runtime and a scheduler!
This project is a little different from actual programming languages because it requires an actual loop, running constantly and looking for updates on the code file, while also playing music after parsing the file!
So far, I’ve managed to get a structure working to create loops that execute after a set duration. I’m soon going to implement actually playing the sounds.
I haven’t yet made a GitHub repo for this either.
I do wonder… How am I supposed to devlog music?
Ciao!

Attachment
0
Snxhit_

Hello!

Just fixed a few bugs and things. Also added redirects to correct command usage when commands are used improperly. Tuned starter entity stats a little to make sure fights aren’t impossible anymore. Also added a health section in the profile command! Mainly QoL and a few bug fixes here and there.
This update will be V0.1.2.

Attachment
0
Snxhit_

Shipped this project!

Hours: 84.61
Cookies: 🍪 2471
Multiplier: 29.2 cookies/hr

What I made

I made Forlorn which is a MUD game engine!
MUDs are basically text based fully multiplayer games.

Features (Yes I stole this from the README)

  • Flexible entity & item system using spawners for dynamic world population.
  • Stat system for players and entities, including item buffs and modifiers.
  • Combat system with scaling, random factors, dodging mechanics, and looting and item drops.
  • Merchant entities for buying/selling items, simulating an in-game economy.
  • Room-based world navigation with cardinal directions and descriptive areas, like in classic MUDs!
  • Persistent player profiles, inventory, and stats.
  • Web client and terminal (Netcat/Ncat) support for gameplay.
  • Helpfile system for in-game tutorials, topics & command documentation.
  • PvP combat with coin looting and respawning.
  • Periodic world ticks for health regen, spawner management & combat.
  • Fully optional colors, beautiful unicodes for a modern terminal look and maximum compatibility!
  • Profile, and help cards for enhanced terminal readability!
  • Automatic database initialization and world setup on first run (Self-Hosting)

What was challenging

I fought quite a few challenges while on my way here.

  • Concurrency, different players accessing different things at the same time
  • Allowing web-based gameplay was challenging because I had to implement a “bridge” to translate WebSocket (from the web client) to TCP (for the game server), but I managed to do it!
  • Differentiating between client connections (If they’re using web, or coming from pure TCP) required a lot of tinkering and thinking.
  • Adding support for toggling colors and pretty unicodes to provide maximum compatibility took a lot of manual labor…
  • Implementing a combat system: Researching for optimal formulae to use was very fun but also challenging.
  • Staying consistent and working everyday.

Overall, there were a lot more challenges, but that doesn’t mean I didn’t enjoy them :)

What I learnt

Building this project taught me quite a lot:

Technical Skills

  • Golang: This was my first time using Go, and I loved it!
  • SQL: Although it was long overdue, I finally learnt SQL and DBMS from scratch!

Problem Solving

  • Managing time working on projects because this time it actually mattered.
  • Managing larger codebases than I’m used to.
  • Structuring servers like this with a lot of reusable logic (Learnt this the hard way.)
  • Although I tried my best to write good quality code, I still see a lot of design choices biting me. So, I also learned what NOT to do!
  • A lot about concurrency and using goroutines with Go!
  • Actually learning how to write READMEs and details.
  • Properly using a VCS!

Personal

  1. Working on something till I’m satisfied with it.
  2. Managing scope creep.
  3. Keeping track of work status instead of winging it and working on whatever, whenever.
  4. Building consistent and efficient work habits.

Overall this was really fun, I’ve never actually shipped something before, not to mention, put so much time into a singular project.
Thank you Hack Club and Flavortown :).
Ciao!

Snxhit_

Fixed yet another bug which would make the game crash upon the usage of the drop command.
Issue was undefined integer i being accessed…
I’m gonna do the final commit now.
Here is the web client.

Attachment
0
Snxhit_

It is done!

After a month… almost 90 hours of work… It’s done! I’m ready to ship!
Spent an hour fixing a bug I found which was quite interesting and scary.
It allowed you to buy items from merchants that weren’t in the same room as you. There was more to it but I’ll abstract the details.
Scary considering the fact that I was about to ship and found such an insane bug at the last second, lol.
Oh, and the web client is mobile compatible too!
For the last devlog before shipping, ya’ll get a peak at my TODO list. Yes, I keep every list item. It’s become really long, lol.

Attachment
1

Comments

Praco
Praco 29 days ago

YAY!!!!

Snxhit_

Hello!

I have finished working on the websocket bridge, the glue that holds the TCP server and the web client together. I fixed up all of the major problems, and now the web client works perfectly fine! I also then worked on the UI of the web client and I still am in the process of polishing it!
I made several GitHub commits after the v0.1.0 commit because well, there was a lot to be fixed. and I couldn’t work on my VPS without synchronizing code via GitHub so that my VPS could access it as well.
Regardless, I’m 99% certain I won’t have to make changes to the server again, and everything should be ready for shipping with a few more hours of work!
Here is a peak at the current look of the web client :)
Ciao!

Attachment
1

Comments

Praco
Praco 29 days ago

so cooll!!!!!

Snxhit_

It is done!

I’ve pushed the v0.0.7 commit to GitHub, after spending another hour-ish writing 10 more helpfiles, describing each and every command.
I’ve also finished up with the README file, and now that I’m done with working on the main project, it’s time to move on and wrap up the web client and the websocket bridge! Ciao, I’ll be back soon.

Attachment
1

Comments

Praco
Praco 29 days ago

wonder which awesome cool human made the art :PPPP

Snxhit_

I’ve finished writing helpfiles. I’m tired. Coding through the night is fun, though.
Regardless, here is one of the ~10 helpfiles I wrote.
I’m now gonna also commit version 0.0.8, finally!
And also go to sleep…
Spent so long on helpfiles because I want it to be easy to understand how the game works.

Attachment
0
Snxhit_

Hello!

So I may have gotten a little carried away while implementing a map… And, well, made whatever monstrosity you can see attached below. Honestly, I don’t even know if this is coherent anymore. But hey, I’m pretty proud of it!
My only regret is not mapping it out. Because now that its like 55 rooms big, I have no idea how to map it, like, at all! Well, at least you guys will have a lot to explore!

  • I’m also done with the README.md for GitHub repository!
  • I also added some QoL changes to the helpfiles!

And, I’m too tired of working on the map for now. I’ll finish writing the helpfiles and then commit v0.0.8!
Ciao!

Attachment
0
Snxhit_

Nevermind. I’ve learnt the hard way that having multiple goroutines reading and writing to the same map object creates a big clusterfu- mess. I kept having random crashes and I had no idea why, till I discovered go run -race ., shortly after which I realized that the batched writing caused huge race conditions which ultimately crashed the server! Regardless, I reverted back to the laggy version. I’m messing around a little bit more again, so hoping I get something right. Byebye.

Attachment
0
Snxhit_

Done! I fixed the lag when you defeat an entity and it drops a lot of items. I achieved this by adding another function that writes the database updates batched instead of writing one by one in a loop. Then, I made that work on a seperate goroutine so that the updates are seen immediately. Below is the fix!
I’m gonna move to writing helpfiles now! Ciao!

Attachment
0
Snxhit_

Heya peeps! Since the last devlog, I’ve been working on the stuff left over from past Snxhit ignoring edge cases and safeguards…

  • On disconnect, most changes weren’t saved to the database. Now they are.
  • On login, the character was just generated from magic numbers instead of using values from the database, and I fixed that too.

While doing this, a nasty nasty bug popped up that basically broke the entire game, and it was a runtime error, which is even worse, because I had no idea where it came from. Regardless, I fixed it after a lot of toiling. Then,

  • I added aliases to commands, for example, the profile can now be accessed by using either the profile command as usual, or pf to make life better. Another example you can pick up items by: pickup, pick, or take!
  • Fixed another issue where the game would crash if item names were too long for the profile command’s length. Now, they just truncate. Same thing for helpfile keywords.

There’s a lot more, but I’m gonna get back to it.
Currently I’m trying to fix the fact that the entire game pauses when data is written to the database. Which is… Not ideal. Byebye! Cya soon o/

Attachment
Attachment
0
Snxhit_

Turns out, I’m not actually done. A lot of stuff I neglected before keeping popping up in my mind, I have to start fixing it. Once again, I’d like to believe that I’m almost done, and I really hope I actually am this time. Over the past 3 hours I wrote a README, doesn’t really include much information just yet, but I’m working on it. I also added a “training” system to increase your stats!
Whenever you level up, you gain 5 trains. Then, you can use the train command to increase any of your stats by one, and consume one train. So, basically every level, you get to increase your total stats by 5.
This way, there’s actually a point to leveling up, lol.

  • Please note, PvP doesn’t give exp to prevent abuse.

I also added a field called EXPUPDATES to the web client side of things! This’ll reflect exp based changes on the UI!
Generally just working on small changes here and there, so I’ll finish up and then post another update.
I still have to work on the web client itself, also the bridge because there are quite a few bugs and unfinished features on both.
CIAO!

Attachment
Attachment
0
Snxhit_

Hello! I’ve finished fully implementing spawners, they work to spawn items and entities as well! Now, I’m basically done with everything related to the actual engine, and only polishing things here and there, looking into a few bugs that popped up, and cleaning up the debug statements is all there is left to do! Apart from that, I still need to work on writing the helpfiles though, which will take a while.
I fixed a bug with the use command triggering on every consumable (if there are multiple in inventory), made helpfiles indexable by their IDs, and finally fixed the bugs causing spawners to break!
I also added a marker against the names of each entity & player that you can look at to indicate if they’re in combat. If they are, then you cannot interact with them. Previously, you could fight entities that were already in combat which caused weird race conditions.
The image attached indicates that player Snxhit and the 2nd Green Slime entity are in combat, which is what, C, the marker denotes!
Byebye!

Attachment
0
Snxhit_

The item drops are successfully implemented and working! I’m on the verge of finishing the implementation of spawners.

Spawners

Spawners just spawn an entity or an item in a room every x ticks, where x is the duration set in the spawner’s data. A maximum amount of spawns can also be set. An example in simple english to clarify further:
A spawner in room with the ID 2, spawns an entity with the templateID 1, every 8 ticks*, for a maximum of 3 entities.
Then, after reaching it’s maximum, the spawner sits idle. If one of the entities it spawns were to die, then it’ll go back to work and replace that entity in its respective duration.
* 1 tick = 3 seconds (for now)
Also, players cannot interact with, or even see spawners, they’re just mechanisms to automatically populate the world.

Item drops

Every entity template has a DropTable which may or may not contain DropEntry(s). Every element of the DropTable (i.e. Every DropEntry), defines:

  • templateID of the item to be dropped
  • chance of the item dropping
  • min quantity of the item to be dropped
  • max quantity of the item to be dropped

The chance is a number between 0-100, which is used to determine if the item drops. The lower the value, the lower the chance of the item dropping.
If there’s multiple DropEntrys, then every entry is rolled separately (since every entry obviously has different items).

Ciao! :D
Due to a bug in the spawner system, the game accidentally spawned 550+ slimes in under 5 minutes of me writing this devlog… (pic 2)

Attachment
Attachment
0
Snxhit_

Currently I’m working on implementing item drops from entities! The core already existed, I added drop tables to entity templates a while ago, but then I completely forgot about it, so I’m picking up the pieces right now.
Apart from that, I also implemented consumables! Currently, only consumables that heal you exist, but I plan to add more as I get more ideas :D.
Suggestions would be appreciated, ciao!

Attachment
0
Snxhit_

I’m in pain. That was hard. Regardless, I’ve added color to everything!
Now, I’m gonna start working on the last two features (hopefully) before shipping! Though, there’s still a lot to do, writing readmes, writing helpfiles, cleaning up the code, et cetera. But hopefully I’ll ship today!
Below are some more sneak peaks of the look!
CIAO!

Attachment
Attachment
Attachment
0
Snxhit_

This is proving to be quite time consuming and laborious. I just got done adding color to the combat system. Hopefully the rest will be easier. Not much to talk about in this devlog, but I also improved the formatting of combat logs. Below is a snippet for PvE combat. PvP looks similar too. Byebye!

Attachment
0
Snxhit_

After quite a while of procrastinating this, I’ve finally started working on adding colors to the game and polishing the game along with it. Colors, like the pretty unicodes, are also toggle-able, and I’ve added a field to the player that tracks if they have colors enabled. Again, the terminal emulator running on the web client supports colors, and as such, they’ll be enabled by default.
For now, I’m only using the basic 8-bit color set to provide maximum compatibility across all devices, and with the way I’ve written the helper function for colors, it’s also possible to add toggles for different color sets, but that’s for in the future.
I’ve added colors to a lot of commands, currently working on improving the combat formatting, and adding colors. After that, I’ll finish with the basic commands and move on to adding color to the profile card and helpfiles!
For now, this is a teaser preview. Next devlog, I’ll showcase more :)
Ciiiiiiaaaaaaaoooooooo!!

Attachment
0
Snxhit_

Heya. It’s been a while. I got distracted once again, and ended up changing the OS I use. Currently unwell, but the grind never stops. I’m a little hazy about what I did before because it’s been a few days, but, I refined the combat exp system more, and I also added an option to toggle the usage of pretty unicodes to make the tables displayed throughout the game look better.
Basically just added a function called glyphs that returns the appropriate character to be used on basis of a bool set in the connection’s structure.
Players that use the web client will have this enabled by default because the terminal emulator that the client uses supports unicode characters.
Below is what my workspace currently looks like, along with screenshots of the profile command.
We’re getting closer and closer to finally shipping. Ciao!

Attachment
Attachment
Attachment
0
Snxhit_

Over the past two hours of work, I’ve added an experience and leveling system, and added formulae to calculate “power” which takes into account the player’s & the entity’s strength stat, along with the entity’s base defense stat. Then, a ratio is calculated and then this ratio is multiplied by the entity’s base experience stat. Then, there is also the level difference multiplier. Another multiplier to the base experience, which is determined by the difference between levels of the combatants. Below are the formulae:

  • pPower = player.strength
  • ePower = entity.strength + entity.baseDefense
  • powerRatio = ePower / (ePower + pPower)

Then, powerRatio is multiplied to entity.baseExperience to either reduce or increase it depending on the values, and finally,

  • finalValue = entity.baseExperience * powerRatio * calcLevelDiffMultiplier(lvlDiff)

The function calcLevelDiffMultiplier() simply returns value on the basis of level difference.

Then, finally, I modified the profile command card to add more items to it, like coins, leveling data like current level, exp, and also a progress bar for the current level!

Attachment
Attachment
0
Snxhit_

Currently, I’m adding support for addressing entities, items with their names instead of always having to use their number in the room itself. But, this, for now, will only work for the first element in the room in case the item you’re trying to access has duplicates.
So now, there’s two ways to address something:

  • <command> int

Where int is the index of the element IN THE ROOM, or

  • <command> keyword

Where keyword is one of the words (if the name has multiple words) from the name, it can be any word. For now, it even allows keywords like “the” if they are in the name.
But if there’s two items with the same keyword in their name, the one that comes first will be accessed.
Later, I plan to add a system that looks something like this:

  • <command> int.keyword

Here, keyword, like before, is one of the words from the name, and int is the index of the duplicate you wish to select.

Ciao! Here’s a weird bug.

Attachment
0
Snxhit_

Fixed the client identification. The server can now differentiate between WebSocket clients (the website) and pure TCP clients! This is a great improvement because the TCP stream doesn’t see unintelligible data spam anymore.
After that, like I promised last to last devlog, I started working on help and have fully implemented it. Having a help command is absolutely ESSENTIAL to every text based game simply because of the sheer amount of commands and other information in these games.
Although Forlorn isn’t quite large enough yet, I intend for it to be as scalable as possible.
Currently, the helpfiles are loaded directly into memory as go structs and stored in variables. Which is fine for now, but I want to load the helpfiles into memory from JSON files, which will make it more customizable, and easier to expand.
The logic itself of querying and parsing input was pretty easy, the designing everything into tables was what took a lot of time.
Please excuse the lack of actual information in the help command of move, I wrote that in a hurry, for testing purposes. CIAO!

Attachment
0
Snxhit_

Currently, I’m working on a system to identify the client that the user is on. Basically done, but it doesn’t seem to be working so I’ve been bug fixing for the past hour. If this works then the game will work just fine with NetCat once again, and it’ll be playable on the terminal itself. A rather short devlog because I didn’t get much done. I’ve also started working on helpfiles which are, well, files, that you can view in game with the help command. They show you information about whatever game-specific thing you want to learn about. Until next time, cya!

Attachment
0
Snxhit_

Done with working the web client UI for now. Pretty satisfied with the functionality I’ve managed to implement so far. The directions with gray names represent that rooms lie in those directions and you can move there. The health bars display remaining hp and total hp for you and your opponent if and when you are in combat. I think its time to move to working on the game server, this is enough time spent on the UI.
I know the UI still looks weird and bland, but my focus isn’t making it look pretty for now. That said, if you have any suggestions, please drop them down below :D
It’s 4 am and I’m dizzy, but this is fun. Ciao!

Attachment
0
Snxhit_

Ah, I’m back to juggling three different projects with 4 terminal tabs (I should probably use tmux) between my main device and VPS. Honestly don’t mind, it’s worth it. I managed to implement the exits part I showed in the last devlog. Preview is given below. Currently working on adding more elements show more data like the user’s hp, coins… The combat data (if the player is in combat) like the enemy’s hp, name, et cetera. I also improved the terminal itself. It now resizes to fit it’s parent.
I will also be adding a help <option> command sometime soon, in preparation of the ship. This command will list information about any keyword you come across and want to learn about. Be it a command, an entity, an area. Ciao.
The “compass” updates every time you move.

Attachment
0
Snxhit_

Hola peeps! I’m writing after a lot of time as I’ve been busy and unable to code a lot. Only managed to squeeze in 2 hours of work. Well, in that time, I struggled to the data handling system I talked about in the previous devlog. I went through TROUBLE when testing via my VPS because I don’t push to GitHub often enough. I had to keep manually copying every file after changes, then build and test. That took up a lot of unlogged dev time. Well regardless, I’m done with that, the bridge is in a working-ish condition right now. There were a few bugs I fixed using the bufio library’s Scanner. Well, I’m currently working on the web client. Below is the current state.
Also the explanation I promised in the last devlog:
The main server prints a line that begins with STATE followed by current user data. This line is then picked up and processed by the bridge, and passed to the web client with the data in the line. The client then:

  • Deletes this line so that the user doesn’t see garbage,
  • Updates the UI to reflect current game state. (WIP)

Right now, only the directional data is implemented to be passed through the bridge to the client, and is printed to the console, but it works. So, I can now expand on it and allow for more stuff to move around. I’m also working on the UI update function after parsing the direction data.

I find it really cool that I’m able to do this. Although, this does make it so that every player connected via NetCat or something similar, pure TCP will see garbage spam.
But, who would prefer nc to a website? Ciao. Hope ya’ll enjoyed this! New banner soon :D

Attachment
Attachment
0
Snxhit_

It’s been a while. I’ve been a little busy, but I worked on stuff here and there. Two new projects have joined the ForlornMUD group. I made a web client for Forlorn. It only works with the server I’ve hosted, but, I will also provide instructions to host your very own ForlornMUD server instance when the project ships. The second project I worked on was a “bridge” between the Forlorn server and the websocket handling the web client. Let me elaborate.
The server itself talks over TCP or Transmission Control Protocol. But, browsers don’t understand pure TCP, and because of that, I had to make a bridge that translates the TCP to stuff websockets would understand. Blah blah. Then I spent an hour debugging because it didn’t work. Just the usual.
Well, both projects are currently live on GitHub, can’t guarantee uptime for the server for now though. Upon shipping, it’ll be up for at least 15 days.
The bridge works properly, I don’t think it’ll see a lot of changes, its barely ~80 lines of code. But the web client on the other hand is still very rudimentary and has a LOT of room for improvement.
Next on the to-do list:

  • Improve style of the web client
  • Make the server hand out data for clients to use
  • Add markers that display game data visually

I know this doesn’t mean anything currently, I don’t know how to explain, but I’ll be back with an explanation and example soon :D. Ciao!!
Sneak at the web client’s current state. As you can see, there’s not much yet, but the game works fully.

Attachment
0
Snxhit_

I have been working on, among other things, on a rather… Unimportant feature. Behold, the profile command. Displays a pretty “card” that lists all your stats and equipment slots. I want to add more fields like coins, hp, etc, but for now, this is enough time spent doing this. The username centers itself too. Holy waste of time. Atleast it looks nice. Well, I’m gonna move on to doing more important and urgent stuff. Ciao.

Attachment
1

Comments

Praco
Praco about 1 month ago

PRETTAY

Snxhit_

I think I’ve got it. In the previous devlog, I explained the dodgeChance mechanics, and after an hour of work I’ve added a finalDamage variable that calculates the total damage after taking into account:

  • Both combatants’ base damage (including items on equipped slots)
  • Both combatants’ strength stat
  • Both combatants’ base defenses (again, including items on equipped slots)
    The formula for finalDamage is as follows:
    (own.rawdamage * (100 / (100 + opponent.basedef)) * randfactor
    Where randfactor is randFloat * 0.3 + 0.85 such that the range of randfactor is always [0.85, 1.15].
    Why a random factor, you may ask? Well, what’s a game that doesn’t include bowing down to the great RNGesus?
    As you can see from the screenshot, there’s still formatting errors on the initiator’s side for some reason. Working on that right now. Ciao :D
Attachment
1

Comments

Praco
Praco about 2 months ago

LETSGOOOOO

Snxhit_

Took me an entire hour, but I’ve figured it out. The perfect formula to calculate dodge chance. Yes, it took me an hour to experiment around. I made up a few different formulae, most didn’t even work but, after balancing stuff and looking around, I found the one that works perfectly! Behold:
playerDodgeChance = (player.agility / player.agility + enemy.agility) * maxDodge)
Here, maxDodge is a constant that keeps the agility clamped between 0 and itself. maxDodge must be between 0 and 100. If the agilities of each combatant are equal, then the dodge chance of both becomes maxDodge / 2. This keeps combat fair, while also giving both combatants a chance to dodge which avoids one-sided battles.
Here is one that did NOT work. Now if you’ll excuse me, I have a defense system to implement.

Attachment
1

Comments

Snxhit_
Snxhit_ about 2 months ago

I swear to god, stop making my screenshots unreadable, flavortown.

Snxhit_

Added a base damage and base defense stat to all items, and to all entity templates as well. Okay so the current idea goes like this: Player characters rely on their on stats str, dex, agi, stam, int, for combat and other events. Although the five of these are in the game currently, they are subject to change later since the game is still developing. Regardless, characters also have the ability to equip items which provide base damage and base defense to the player and some but not all items also have stat buffs that increase one or more stats. On the other hand, entities, by themselves have base damage and base defenses, and they cannot use items. They also have their own stats.
Right now, what I’m envisioning is: More the agility, the more you land hits and dodge the opponents’ hits, more the strength, the harder you hit. Currently, dex, stam, and int are irrelevant to combat.
I’m in the process of devising formulae for if the attacks land, and if so, how many times. Gonna get back to brainstorming. Ciao.

Attachment
0
Snxhit_

Deleted the files that were on the repo since ~2023, added some basic stuff, and then tried designing a little bit. I’m not very good at designing stuff so it looks weird. Well, here’s what the website looks like right now. Byebye.
(The bar at the top has a blur filter on it but since I took the screenshot with Firefox’s screenshot tool the filter isn’t visible)

Attachment
1

Comments

Praco
Praco about 2 months ago

Cool picture :)

Snxhit_

Short devlog because yes. Getting start on the actual combat system like I mentioned before, currently researching combat systems. I have no idea how to calculate damage. Mainly because there’s no actual base attack or base defense system in place. I just added a base damage to all items. But I’m still a little confused about how to go about this. Welp, gonna get back to researching and refactoring, byebye!
What the hell is that?

Attachment
0
Snxhit_

Entities, just like items, are now derived from templates! The templates store name, stats, other data like maximum hp, et cetera. and the entities point to the templates, and store state data like current hp, location, et cetera. This wasn’t exactly hard, having been through this before, it didn’t take a lot of effort, it did take time though. The most troublesome part is fixing bugs in the database schema and logic. Added three new tables. Rooms are now also stored in the database. Entities now also have drop tables, but the logic for those is not yet implemented. Next up is implementing said logic and using the stats of entities in battle. Ciao!
Here is what my workspace looks like, because I don’t know what else to use.

Attachment
2

Comments

Snxhit_
Snxhit_ about 2 months ago

Curse flavortown for compressing my screenshots.

Praco
Praco about 2 months ago

Curse flavortown for compressing Snxhit’s screenshots.

Snxhit_

Heya beeches! I’m back after getting side tracked for an entire day, by the shiny world of self hosting… Well, regardless, I’m back now, and I just tidied the code more, fixed MORE edge cases, moved rooms to the database, and items now stack as well! Productivity 100. It’s only been an hour though. I keep being unable to find time to add colors… Well, its okay. For now, I’ll go with giving mobs stats so not every fight is the same. With that though, the revamp of the fighting system would have to follow, because right now, only the player’s stats are taken into consideration. So yeah, I have a LOT of work to do. I’ve been thinking about making some kind of a tool to customize the game for everyone. Perhaps a website that directly modifies the database to add whatever custom shit you want? We’ll see. For now, I need to go bang my head against the wall while refactoring 50% of the logic.

Attachment
0
Snxhit_

Tidied up the code a little, still working on it, working on the formatting, handling edge cases, all of the stuff I neglected before I’m working on right now. It’s coming together nicely, I’m also gonna start adding color.

Attachment
0
Snxhit_

Someone should’ve told me sooner that all I had to do was put all the files in the same package to make Go recognize them as one… Clever and convenient, I love Go. No imports required is very nice. Well regardless, this short devlog is just to show you guys the image attached.
My exam papers look twice as red.

Attachment
1

Comments

Snxhit_
Snxhit_ about 2 months ago

The photo I uploaded was NOT this low quality.

Snxhit_

Merchants, done! Added buy <id> <merchantname> and sell <id> <merchantname> commands! Next up, it’s time to restructure stuff, polish the game, add color maybe? I don’t know if I should focus on aesthetics first or fix the code management. Don’t get me wrong, there’s still a lot to be done. The game itself is FAR from done. I just feel like this would be a good change of pace. I have some thinking to do, goodbye!

Attachment
0
Snxhit_

Hello! Finally managed to get merchants working. Unbeknownst to the past me when I wrote the last devlog, there were quite a few problems with the merchants logic. But its okay because well, I fixed them all! Added a list <merchantname> command that lists the stock and details of the merchant (Still working on the buy and sell commands). Below is a peak. A rather short devlog because I’m in a hurry. Ciao!! Oh and, v0.0.6 soon!

Attachment
0
Snxhit_

Okay. Done. Refactored the entire item behavior. All items now inherit their data from templates, and they themselves only store their location. This was weird. A lot of statements are abnormally long, just to simply fetch the name of an item. The spaghetti is getting worse. I swear I’ll make it prettier before shipping, though. Again, like always, there’s still bugs remaining, I’m going after them right now. Ooh, and, merchants are (almost) implemented. Below is a sneak peak! Cya :D

Attachment
0
Snxhit_

I was trying to implement shops (merchants), and while doing so, I realized I should probably refactor the entirety of item behavior (I’m in pain.)… This is something I’ve been wanting to do for a while: Item templates. Basically, before, every item was unique, every item could have its own stats (although that can still be achieved, just with a little more pain), name, et cetera. But now, each item is created from a predefined preset. This allows the process of adding new items and spawning items in general to be easier. In the future I’ll add customisability to the template itself while making a new item so that unique items or items with varying stats can be created as well. This just felt like a wise design choice… Though, having to refactor half the database schema and the entirety of the codebase is… Not… Healthy… Please help. I’m gonna return to hell. Talk to you guys after I’m out of it.
I don’t even know where to begin. Send help.

Attachment
0
Snxhit_

Added a stats system! Players have stats now and they directly effect the course of battles. Equippable items now provide boosts to stats as well. The system itself is pretty robust so its easy to add new items, and make them provide any kind of buff. We’re almost at 900 lines of code, I’m tired of squinting. I like the pain. Uhhh, this update added a new database table too, there’s still a few bugs I’m working on fixing. I don’t know what else to say, so byebye!

Attachment
Attachment
0
Snxhit_

Hola. Added types to items, to make them equippable, consumable, et cetera. Items can now be equipped, consumables, and other types coming soon! In other news, I added coins which you can get from killing mobs, and also killing and looting other players (assuming the player in question has coins). With equippable items and coins added, shops/merchants aren’t far away. Every player now also has maxHp, which is pretty basic functionality. As more and more of the core systems are cemented down, I’ll start to add the more basic and concrete stuff. I don’t know why I wrote that in building terms but you get the idea. Three new commands: equip <item>, unequip <slot>, equipped, where the first two are obvious, and equipped allows you to view a list of all slots, with their equipped items. This marks TWENTY hours working on this project, in a span of just FOUR days! Though, now that I think about it, an average of five hours per day is not all that. Welp, back to tinkering I go. Ciao peeps!

Attachment
Attachment
0
Snxhit_

Fixed the bug shortly after posting the last devlog. Got lucky and spotted the problem! Well anyways, after that, I worked on improving the formatting of logs of combat. Looks more organized now. Also pushed v0.0.5, it’s a pretty huge update. Fixing the bug was exhausting, was stuck for half a day. Well, this was a rather uneventful hour and a half, byebye!

Attachment
0
Snxhit_

Bug. Big bug. Since the last devlog, there’s a situation where when PvP combat is initiated, only the player that initiated deals damage. Which is, obviously… Not how PvP works… And, I can’t figure out how to fix it. Going insane. I’m gonna beat my coffee mug. Domestic violence? Uhhh, I’m gonna do my best and well, f*ck around and find out, till I fix it. Ciao.

Attachment
0
Snxhit_

Entity combat system implemented! You can now fight mobs around rooms! With every new feature, the scope feels like its getting bigger and bigger. Well, I’m not complaining. Anyway, I’m also done with a PKing system. Yes, you can fight other players! Isn’t that cool. There’s still bugs in the PKing, the server keeps crashing, but I’m on it. Welp, anyways, the combat is resolved every world tick (around 5 seconds for now). Still dreading splitting the code into modules for more readability… I’m… Lazy. This was a rather short update, because I didn’t exactly do much… Ciao?
As you can see the formatting is a bit messed up, but it’ll be better soon, trust.

Attachment
0
Snxhit_

Currently working on a tick based combat system. I got just a tiny bit sidetracked and ended up implementing multiplayer stuff. There’s a command called look that allows you to look around in the room you’re in. It allows you to see the exits, entities, items on the ground. And if there’s another player in the same room, you can see them too. If they leave, you’re notified because you perceive them leaving, similarly, if someone comes into the room that you’re in, you’re notified. Added entities into database storage to save all the mobs. Picking up and dropping items now works properly as well. The codebase hit 500 lines! Not a lot but that’s not just 500 lines of code, it’s 500 lines of spaghetti code. Now that takes talent.
I also found a cool TUI based sqlite database viewer called squall-sql. Welp, until next time. Cya!
Sorry for the uncensored 2021 brainrot on the third slide.

Attachment
Attachment
Attachment
0
Snxhit_

The tick system is implemented. Had to learn about mutexes because like I mentioned in the previous devlog, one data structure kept being accessed by multiple things at the same time, causing races. Mutexes prevent exactly that. Now, I’m restructuring the data a little better. Previously, the items were owned by rooms, even if the player was supposed to have them. The items were part of a room, and the player could only see them in the inventory if it was in the room. Which is weird. Obviously not how inventory works. Now the world owns the items, and the rooms, players only share the item IDs. I’m a little worried about the optimization, but eh, I’m sure it’ll be better than Cyberpunk 2077 on launch day… Right? Well, I’m gonna get back to squinting. Ciao.
I’m gonna require more powerful glasses after this because my workspace looks like this currently. This is painful.

Attachment
0
Snxhit_

Currently fighting concurrency. The “server side tick” system is causing a sh1t ton of race conditions. Two things updating at once, and its weird. Looking into it, and I’m tired. The codebase is expanding, considering splitting it into files for better management. Time for another coffee. Cooking is fun. Be whimsy. Ciao.
P.S.: I promise I’ll write a proper devlog when I ship, if I don’t, sue me. On second thought, maybe not. Please don’t sue me.

Attachment
0
Snxhit_

Since the core systems are done, we’re progressing pretty fast. Just added movement, a location system for players, items AND entities! The player can move around and explore. The player can also pick up items that are in the same room as the player, they are then attached to the player.
This is an example with only two rooms, short descriptions, and random names. Rooms, items, entities, etc will be highly customizable, but for now, I need a proper working prototype.
PS: Colors will come after I have a base game, I just got distracted and added color to the room names
Next up, combat, server based tick system, and whatnot. Stay tuned, ciao!

Attachment
0
Snxhit_

v0.0.3 IS HERE!
I conquered SQL. That was fun, looking forward to more. Even if just a little, I learnt how to use SQL, which is a win to me. Also added actual authentication, with the database. Next, its time to move on to actually implementing the game, the world system, movement, interaction with the world, et cetera. Cya!
Special mention: My coffee cup.

Attachment
Attachment
Attachment
0
Snxhit_

Second devlog, for the past hour, I fixed a few bugs here and there, and then have been fighting SQL since then. Hear me out, I’ve never used MySQL, why? I don’t f*cking know. I always knew jumping straight to Supabase and Firebase would come back to bite me in the ass one day. Well here it is.
Okay jokes aside, I’m not actually struggling, that was an exaggeration. I have been learning SQL and learning how to use it with Go. Sweet ol’ state persistence, amiright? I’ve made progress. Perhaps, V0.0.3 soon! Cya peeps!
Again, another random image because I have no idea what to use.

Attachment
0
Snxhit_

First devlog on this project, I worked on the login and registering system, which is still absolutely very crude. There’s no authentication, but that’s coming up. The system feels decent, it can handle any amount of players at the same time. I spent most of this time looking into edge cases (found & fixed a funny bug: user interrupts their game and the ENTIRE server crashes). Next on the chopping block is probably a database. Ciao.
Have the photo of the bug because I don’t know what else to put there.

Attachment
1

Comments

Snxhit_
Snxhit_ about 2 months ago

Yappity yap yap