Maiu
|
|
« on: June 11, 2024, 10:29:42 PM » |
|
Hello Friends Edit: This is link to the game demo: https://maiu-online.com/I'm working on multiplayer browser RPG with similar gameplay to diablo/ mu online. I have few years of experience as a java business application programmer but I don't have any former experience with game development. This is my first game project and I was starting from nothing. Technologies which I picked to use are java on the server side, TS and babylonjs on the client side. I'm using websockets for network communication and spring for some http. I'm not using any dedicated game engine(only the graphic one), I will write everything by myself, try to make it work and later to optimize it. Root of the game is authoritative game engine, clients are responsible only for sending input, receiving state from the server and displaying it on the UI. So far I managed to implement few basic features I started work around December 2023, but after 2 months I had to make a break. Right now I'm back and want to make progress regularly. I started with rewriting and redesigning what I had before and I see nice progress, quality of the code is on the satisfying level and It's not too hard to add new things So far I managed to implement few things like: - simple zone - declared character classes - logging in/out game - player movement - syncing other players - area of interest with spatial hashing - simple combat with health, animations and sound syncing - and few more things Right now I'm working on syncing clock between server and client. And next on the plate is entity interpolation, player prediction and reconciliation. Actually I had this implemented in the previous code version so it shouldn't take too long. I'm sharing my progress on the YT channel. At the beginning in form of logs with speaking but I was spending too much time of video recording and editing so I switched to short video/text updates and maybe I will only talk in episodes with some more interesting things This is my last video with current state of the game: Hope You like it!
|
|
« Last Edit: September 05, 2024, 02:50:03 AM by Maiu »
|
Logged
|
|
|
|
Maiu
|
|
« Reply #1 on: June 13, 2024, 01:49:45 PM » |
|
Hey!
Last two days I was working on syncing server and client clocks and on top of it I implemented entity interpolation. On the video I'm presenting You situation when server network tick is set to 4 which means it sends messages to players each 250ms, which is simulating quite significant lags. Without interpolation movement is super shaky and after enabling it it looks very good taking into consideration 250 ms lags.
Next I'll work on client side prediction and reconciliation which will make similar difference but for the player.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #2 on: June 16, 2024, 11:32:53 AM » |
|
Hey Recently I was implementing entities interpolation and next on the plate was client side prediction, which is smoothing player movements and increase responsiveness (predicting player movement before response from the server is received). On the video I'm presenting effect of three algorithms: - player movement prediction - player movement reconciliation with the server response - player position extrapolation (between physics ticks 20/s)
I'm simulating latency by setting server network tick 4/s which effectively making server to send all messages each 250ms. It's not like in real world but i have some insights how it'd work. In general I think it work ok. It's minimizing lags effects quite significantly.
I thinking about adding to the entity interpolation similar mechanism which i have in player position reconciliation, which is not updating to position received from the server instantly but makes smooth transition across few simulation ticks (imagine elastic band). Perhaps adding it for all the entities will create too much overhead but adding it for enemy players would be nice. I'd increase experience significantly not only for players experiencing lags but others which interact with them.
Right now I'll be working on collisions mechanics and in parallel I'll add some monsters to perform some tests and maybe share some new posts. To make collisions work in a way I want I will need to create map editor with some custom coding which will calculate all the data for collisions checks and in future for veeeery cool :D rendering optimisation - some spoiler I'm thinking about creating one huge open world instead of smaller zones. Will see what will happen...
Hope You like it!
|
|
« Last Edit: June 16, 2024, 11:39:02 AM by Maiu »
|
Logged
|
|
|
|
Maiu
|
|
« Reply #3 on: June 17, 2024, 10:55:30 AM » |
|
Hello I'm working on POC (prove of concept) implementation of monsters system. I managed to achieve first milestone which is loading entities into engine. And finally i have occasion to show You how my hash grid area of interest is working. Engine is refreshing area of interest data each second and it sends info to the clients to show/remove entity. There're two visibility ranges. First is lower (eg 50 units) it describes distance below which entity should be visible and second visibility range (eg 100 units) is bigger and it's use to hide entities. This way I'm avoiding sending create/remove entity command when some entity is on the edge of visibility and potentially I'd have to show/hide and resend entity each spatial hash grid update.
Keep in mind that it's not working on radius but on bounding boxes (rectangles) and entities visibility is not symmetrical. This implementation is far more efficient and actually not having it symmetrical doesn't change anything. Eventually I'll setup it to comfortable range and players will no care about it.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #4 on: June 21, 2024, 02:14:28 PM » |
|
Hey, Currently I’m working on collisions detection. For now I’m using SAT 2D and later in future maybe I’ll change it to something different (maybe navmesh, will se…). To make creation of map and collisions data a little bit more automatic I prepared very simple map editor. Which prints in the output whole map config with collisions data etc… in json format. Collisions detection still have few bugs mostly related to the calculating collision response, when I’ll fix it I’ll share next video.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #5 on: June 23, 2024, 01:48:13 AM » |
|
Hello again, Since last post I added two new things to my game. First is global chat and the second is collision detection based on SAT 2D algorithm. Player is simple point and obstacles can have collision shapes of circle or rectangles with arbitrary orientation. Still there are some bugs mostly with calculating collisions response on the edges of the rectangles but it works quite good, for the first iteration it's enough. Still don't know how I will handle collisions/navigation in the future. I will need something simple with capabilities for integrating with path finding and line of sight algorithms. I need to do some research and think it through.
Next update will be probably about monster system. I want to add walking, chasing, attacking, death and spawning monsters.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #6 on: June 27, 2024, 12:40:04 PM » |
|
Hello, Finally I finished work on first prototype of monsters AI module. Monsters have several states: IDLE, PATROL, DEAD, FLEEING, COMBAT. Idle monsters are non active even when someone attack them. Patrolling ones are walking around and checking each 0.5s is they have someone to attack in a range if yes then they start chase target (combat state) and attack when in range. Dead are obvious and fleeing is triggered when monster is enough far away from the position where it switched into combat state. I also added death to the monsters after 120s they respawn. Implementation have some bugs and AI it's just bunch of ugly if's but It enables further development and testing. I will go back to this after some time and try to improve it.
From the technical point of view it's designed in a way that monsters service is independent from the main engine loop. It can be deployed on separate machine, I hope this will very significantly unload main engine in the future, I'll be able to afford very inefficient AI implementation without compromising game performance. Monsters are pretty much like players but are not connected by websocket's proxy but by internal api(redis pub-sub in future, right now I'm working on the mock for simplicity but have prepared redis and mocked implementation). Monsters service keep replicated state of the whole simulation and 'AI agent' is responsible for handling all monsters logic.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #7 on: July 06, 2024, 01:26:00 PM » |
|
Hello, This week I spent mostly on thinking about future gameplay. I did several tests and prototypes, I know much more then before and I gain some knowledge about limitations and problems which gameplay related stuff brings into the game. From the stuff that is visible I managed to improve targeting marking. I added new target mark under the mesh and outline around it. Recently I had some problems and most of the area of the meshes didn't triggered cursorOver/cursorPick events, it was occurring for random entities and i didn't manage to replicate it in the babylonjs playground. To not spend to much time on this problem which might be related to the mesh itself I fixed it with a hack. Each entity has assigned cylinder which is user for picking and it works quite good I made first steps into abilities. Since now each class has 2 abilities, which are fetched from the server with all related data: icons, descriptions, animations names etc... Also there's tooltip with spell description - again i didn't manage to make tooltip showing next to the icon so i picked ad hoc solution and it's displayed in the middle of the screen. The last thing which I added are tabs in the settings panel. Last 3 days i spent on rewriting player controller system , adding key bindings and handling user inputs with some more structured way. I broke movement and combat and for now it's not working :p. I hope this version(4th or 5th one) which I'm working on will be final and soon I'll be able to continue working on the abilities.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #8 on: July 07, 2024, 02:49:47 PM » |
|
Hello, Short update from today's progress. I added settings tab for managing sound and combat system gained global countdown feature:
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #9 on: July 19, 2024, 02:19:51 PM » |
|
Hello, For the whole week I was working on the combat system. Goal was to create nice generic combat system but it end up with spaghetti code glues duck tape Code is super ugly but next milestone for the game is done. Each of the characters have several abilities with different mechanics: aoe, aoe over time, projectile, projectile with the effects etc. I added basic visual effects just to present spell effect and affected area. Also added casting and in some cases spell effect sounds. Despite super ugly code and not finished design I'm really happy from the effects. First time while testing I had slight feeling that I'm actually playing game. Further work related to the combat I'm putting into 'improvements backlog' and I'll revisit it in the future. Next on the board is to fix few discovered bugs and probably I'll start working on bags and drop items.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #10 on: July 25, 2024, 01:28:57 PM » |
|
Hello, I'm working on inventory system. So far i implemented few things: - inventory UI, displaying slot items and currency (dust) - monsters drops items or dust (gold) - player can pickup item from the ground - not picked up items disappear after 30s
still TODO: - dropping items on the ground - drag and drop for inventory items for dropping/replacing in inventory slots
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #11 on: July 28, 2024, 04:39:37 AM » |
|
Hello, I finished work on inventory system, this is the list of supported features, which I added while working on it: - monsters have a chance to drop items/currency - dropped items with name labels are displayed on the ground - inventory UI with currency and items slots - players can pickup items/currency from the ground. Picked items are displayed in the inventory - not picked up items are removed after 30s - items can be moved between inventory slots - all picked up items are immediately persisted. In case of server crash they wont be lost. Saves are performed asynchronously and are not affecting engine loop. Players are seeing persisted inventory state.
UI changes are written in MVI pattern. I really like it and i think it suits well for online game. I will rewrite other UI parts to this pattern.
Also while recording this video i found one bug. Dropped item removing counter is not cleared after item pickup. So if player will drop it again within 30s, item will disappear earlier.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #12 on: August 02, 2024, 07:03:55 AM » |
|
Hello Adventurers, I introduced vendor NPC in to the game. Since now it's possible to buy items from the vendor or sell them. The only available currency is 'dust' (gold) but in future it might change. This is only prove of concept implementation but it has working the most basic features.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #13 on: August 03, 2024, 11:02:27 PM » |
|
Hello Adventurers, I was working on the experience and level support. For now experience gained by killed monster is fixed (+42 exp). Max level is 10. Soon I'll add very simple quests and player stats.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #14 on: August 06, 2024, 02:13:04 AM » |
|
Hello Adventurers, After adding levels I added player statistics: -strength -agility -vitality -energy For each level character receives 5pkt to spend. Strength, agility, energy have impact on the ability dmg (depends on the ability type). Knight gains from strength, archer from agility and wizard from energy. 4th stat vitality adds 2pts of HP for each point spent. You can see distinction between base and effective stats. Base are simply stats added from the spend level points. Effective in the future will be base + armor bonuses etc. All combat stats/hp are calculated from the effective stats.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #15 on: August 16, 2024, 01:11:02 AM » |
|
Hello Adventurers, This week I spend on designing items model and implementing equipment (also affects character stats). There're few game items rarity types: POOR - grey COMMON - white UNCOMMON - green RARE - blue EPIC - purple LEGENDARY - orange Items can have bonus stats and weapon bonus dmg (shields bonus armor). Options in the dropped items are generated randomly. Maximum is to have 2 bonus stats and weapon bonus. So far there's no equipment visual effect and no weapon type validation in the skills
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #16 on: August 19, 2024, 07:25:54 AM » |
|
Hello Adventurers!
I have completed basic form of item upgrade system. Items can be upgraded using jewels:
Jewel of quality (upgrading from 0 to +6, 100% chance) Jewel of perfection (upgrading from +0 to +9, 75% chance)
Items can be upgraded in the inventory or equipment. All changes of the statistics are updated automatically. Dropped items have upgrade option in the name label. Allowed for upgrade are armors and weapons
Upgrading items changes:
weapon attack and attack/defense bonus for weapons and shields defense for armors
Additional: Aside working on items I added quest progress tracker and authorization by cookie (previously token in the session storage) and there’s a possibility to pick name for the character. And fixed/made some minor bugs and improvements.
Quest tracker:
Upgrade system:
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #17 on: August 21, 2024, 06:18:07 AM » |
|
Hey Adventurers! Death arrived into realm of Maiu. All other prerequisites (possibility to regenerate hp, reasonable strong monsters etc.) were done so it was time when death finally makes sense. Before that I added neutral zone in the spawn place in order to not die instantly if some monsters comes by. After tests with friends I also disabled pvp because it was annoying when can attack attack and kill player by mistake. I will come back to it after some time. One lonely npc doesn't have health component which makes it immune for damage.
I took idea from one of the open source projects and used black&white post processor to display death screen.
On the server side for the players commands I added notion of isAllowedByDeadEntity (disabled by default) and I'm filtering all incomming commands against entity state.
The one thing I struggled was teleporting player to the spawn place. Update of position is straightforward but I had one not covered case in the player movement prediction algorithm which effectively was blocking updating position until clicking some movement control in the client. At the beginning I tried to fix it with some hack but I failed and finally i found the problematic place and simple if with two line of code fix the problem. Still missing some validation on the UI but I'll add it after bigger refactor which I'm planning to do.
What's next?
I'm working on rewriting AI system and I want to fix some issues which makes monsters group in corners of the map. I want them to always stay in own area not matter how long server is running. Next I will try to fix issue with client side prediction. Sometimes there's a small jump back of player after stopping player movement. And i want to finish vat animations for monsters.
|
|
|
Logged
|
|
|
|
Maiu
|
|
« Reply #18 on: September 01, 2024, 02:17:12 PM » |
|
Hey Adventurers! Time has come to share my project with the outside world and share demo of the game. I was testing it for some time and it's quite stable. There're a lot of things to improve/implements but I think i fixes all the most annoying things. Right now I have viable minimum of the mmo game. There're some quests from npc, npc shop, 4 types of monsters, some level progress and gear progress etc... If You're interested please check it out and I'll be grateful for feedback. https://maiu-online.com/
|
|
|
Logged
|
|
|
|
vitalash
|
|
« Reply #19 on: September 01, 2024, 06:08:11 PM » |
|
Cool I think if you pick up dust, it adds it as if it's a string concatenation, which seems like a javascript problem. Or maybe I actually started with 10,000 dust and didn't notice? This was after killing a ninja that I picked up 10. I think if you spam click up an item, you get many of them. I got one gloves drop, and one perfect jewel drop(!!!) and I spam clicked them and have like 5 in my inventory I beat the ninjas quest!
|
|
|
Logged
|
|
|
|
|