[OPEN SOURCE] Multiplayer 3D RPG Using Colyseus

Hi all,

Please find below all long outstanding bugs I found in my project, I’m not necessarily looking for help in resolving these but thought it would be fun to share the struggle and it may help the debugging process by writing it down.

[BUG] AI death animation does not seem to be working correctly
No idea why this one suddenly started to happen, but when an AI dies, it goes straight to the end of the dead animation. This one shouldn’t be too hard to debug and tracking the animation state via few well places console.log() should be enough to find the issue.

EDIT: This is fixed, I was assuming all the models had exactly the same animationGroups keys (if that makes any sense).

[BUG] Camera is creating a lag effect as it follows the player
This one is a tricky one, as it feels like lag but I’m now 100% sure it is caused by the camera trying to catch up to the player, but I’m unclear on how to solve. For some reason it only seems to occur when running the demo online (not on my local). I’ve tried to parent the camera to the player, but that does not seem to work and camera does seem to stick. This is a funny one as I know the culprit but do not have a solution yet.

EDIT: I’ve improved the way the camera behaves, it now just follows (no tweening) the local player mesh.

[BUG] Some items appear flickers black randomly
That’s another long standing one, and I truly still have no idea why, I’ve tried to reproduce the error consistently with no success / or trying to recreate the issue on a playground. Only lead I have currently, is if I stop using the attachToBone() function for equipping meshes on Player/AI, the issue seems to disappears. The issue happens whether I use instances/clones/normal.

[BUG] Make sure movement works on mobiles and other browsers
My movement control apparently only works on chrome/windows, to investigate

Ahhhh, the joy of developing :slight_smile:

4 Likes

Hello everyone,

It’s been a while as I’ve been preparing for the next stage, squashing as many bugs as I could find and tidying as much as possible and I’m finally ready to attack next stage, which is interacting with NPC’s and ITEMS (like doors, etc…).

There is many ways to approach this, but I ended up doing something a little different: as you approach an interactable entity, a button will appear above it, clicking it will start the interaction. A dialog panel will then open and show the appropriate text and relevant buttons to continue;

I’m still quite far away of getting it fully fledge out, but I could not resist showing you guys the first draft of the system

Any comments welcome!

2 Likes

It sure does make the world feel more alive :slight_smile:

3 Likes

Yay! Just finished implementing 2 quest into the game using my latest quest/dialog system :muscle: All synced to database & network. It’s a little dirty/raw at the moment but I’ll do a full refactor pass to tidy it all up

A little hard to showcase, but here are a few photos :slight_smile:



4 Likes

Awesome !!!

1 Like

Thanks @sebavan

What’s the point of quests, if you cannot track them…? Well now you can :slight_smile:

Just realized, I should probably use an alternative word to “kill” (feels a little too strong), maybe “defeat”?

2 Likes

I think this depends on your target group (e.g. young children, pre-mature teens) and/or your overall game setting (sun-shiny green meadowy vs post-apocalyptic raider infested hell hole). Also, I do not know if “kill” is one of those evil worlds that advertisers do not like (if you plan on needing advertisers).

1 Like

Fair enough @Joe_Kerr I will not worry about that at this stage,

Just added trainer type screen so you can buy/learn abilities if requirements are met. It’s all controlled via a json structure so should be quite versatile.

Next, let’s do the vendor screen to buy and sell items, once that is done, game will be feature complete and game should have a full gameplay loop.

1 Like

Ok vendor for buying item is in place too.

Anyone has any idea what ux workflow to use to sell items?

  1. Could be done when vendor is open and double clicking on a item in the inventory for example
  2. Or when vendor is open, I could add an extra option called (sell item) in the drop down that show on item left click in inventory

Any ideas?

Not playing enough RPG to know what users would expect the most naturally. Maybe @PatrickRyan ?

1 Like

@oriongu, I think the UX for buying from a vendor is different from selling to a vendor. When buying, the player usually browses and can make a determination if they want to buy something based on the item and cost. So a simple point and click - possibly with an option to increase the number to buy - would normally suffice. Reducing the number of clicks is always the goal for the UI while still allowing for some flexibility and power for the user.

Selling is a completely different UX for an RPG, especially if the game’s economy centers around generating a resource from selling items. That means while users may only occasionally buy items - maybe consumables - they will be selling items often. I have seen multiple approaches to this and your approach will dictate where the player spends their time and how much down time is needed.

You mention a couple of options so we can look at considerations for each:

  1. If vendor is open, double clicking on an item in inventory will sell it. If the user only needs to sell one or two things, this can be quick as it’s a simple double click on the item. However, this can also be considered “hidden UI” as the double click is a form of shortcut. You would need text prompting the user to double click to sell which takes up UI space. You could also do a first run experience where the user gets a help prompt to teach them the double click, but if the user is away from the game for any amount of time, they may forget the interaction, so you may need some sort of backup for the prompt. It also has the challenge of a lot of clicks if the user is trying to sell many items from their inventory. It will also slow the user down to make sure they are selling the right items if the double click is the sale action with no confirmation. To increase user confidence, you might either need a sale confirmation (more clicks) or a buyback function to correct mistakes for selling things that the user did not want to.
  2. Putting the sell command in a drop down will also slow the user where they need to invoke the menu, move the cursor to highlight the sell action, and then click the button. Again, for selling an occasional item, this could be good in that the user has more time to make sure they are selling the right thing (though mistakes will still happen) and can’t mistakenly sell something through extra clicks. For selling a lot of items, however, this is still very slow as it is two clicks with an additional move of the cursor in many cases.

Both of these options also put all the downtime in selling items into the same part of the experience. The user needs to find a vendor, open their inventory, and then start deciding what to sell and doing comparisons to make sure they are keeping the best items. This can make visiting a vendor a bigger commitment causing downtime in the game. It can also be perceived as a negative because once inventory fills up, you are required to find a vendor and spend time emptying the inventory, taking them out of the exciting game loop (unless the entire game loop centers around buying and selling).

One of the methods I’ve seen - which I prefer in RPGs - is to break up that decision making process in selling or keeping gear into small tasks that can be done as you are playing the game. This is a marking system to mark items picked up as favorites (so they can’t mistakenly sell it), junk (to be sold), or leave unmarked. Then once you get to a vendor, you have an option to sell junk. This reduces time at the vendor and breaks up the decision-making process into small, distinct chunks, often when the items are picked up. It’s a matter of simply doing a comparison of what is picked up to what the player is using or saving and setting the state of the item. Often this is a dropdown so the player can invoke the menu and scroll to a tag to assign to the item. This acts like the “sell” button in the menu in number 2 above, but the actions are not back-to-back in most cases. If users can break up the decision process along the path in the game loop, they can simply not spend much time at a vendor.

Not everyone will make use of this type of system or do it inconsistently. So, there should still be a way to mark multiple items for sale. One could still mark items as junk at the vendor, but it would be fewer clicks to also give the option of selling multiple items. Maybe pressing a button to get into multi-select mode, then single clicking each item to include in the sale. Then a complete sale button. This would allow the user to select/deselect items before completing the sale as they change their minds. But basically, if you can offer your users a way to be able to break up the decision-making process for selling or keeping items picked up so that it is not required to be done all at once, you can reduce down time for your users.

Granted, these options will work better for some game loops than others, so it will need to be determined how much down time your players need to clear inventories or generate currency. But I think the best approach is to mockup how many clicks and/or input device manipulations are needed to clear inventory and look for ways to reduce the number of actions as much as possible while not making users afraid to lose items through mistaken sales. And if you can break up that down time into other parts of the game loop through a marking system, you can make the user feel like they can get back into the game sooner.

Hope this helps!

5 Likes

Hi @PatrickRyan

Thanks for taking the time for such a detailled post, there is a lots of good ideas in there that I will most certainly implement as the game progresses.

1) SELLING MODE
Following your suggestions, I was thinking of proceeding this way for the selling part:

When you’re on the vendor buying screen:

  • adding a button somewhere called “sell”
  • when you click on it the cursor changes to show you are in “selling mode” (clicking it again wil cancel “selling mode”, and/or closing the screen will do the same).
  • when in “selling mode”, hovering an item in the inventory will a trigger a tooltip that will show details including sell price and if you click left, we can proceed to the sell.

This seems simple enough as you could quickly sell items if you wanted, and it only has the minor drawback of needing to click a button before being allowed to sell.

What do you think?

2) BUYING QUANTITIES
I will also implement the ability to buy more than one an item as you suggested and this can be solved by adding a input (default is 1) to the left of the buy button

2 Likes

@oriongu those sound like excellent features!

2 Likes

Just me as a gamer speaking (personal opinion): When doing inventory (in the widest sense), it is a good opportunity to eat cookies or drink my coffee with the non-mouse hand. How am I supposed to do that if I have to type in stuff :smiley:

Two alternatives I can think of:

  • The Guild / Europa 1400: I think it was generally drag&drop. But when you wanted to increase the quantity, you needed to click-hold a few milliseconds, after which a vertical slider appeared within the inventory image. You could then slide up and down to adjust the draggable quantity.

  • Open XCom: They have up/down buttons. Single click: 1 quantity. Mouse wheel over button: 10 quantity. Right click: max quantity (context sensitive ofc). Note: mouse wheel is extremely fast and suitable for very large quantities.

2 Likes

You’re right, it was a bad guy idea (cookies first! :slight_smile: ) @Joe_Kerr I tried it and it felt very clunky.

So I changed it to this, which is much easier to use and feels more natural.

1 Like

Damn, that’s a busy year :slight_smile:

That’s 2.5 commits a day :stuck_out_tongue:

Looks like my project is nearing it’s 1 year birthday :slight_smile:

5 Likes

Ok selling items has been added as discussed previously :slight_smile:

EDIT: Looks like the video is not showing the cursor changes, when in selling mode, the cursor does change to a different one to highlight the fact we are in selling mode. sell

3 Likes

Happy early birthday! :cake: :birthday: :partying_face:

1 Like

Hi,

It’s time to squash the last remaining obvious bug I have… drum rolls… random black items.

I’ve managed to drill it down to this:

  • it only happens once I attached a cloned/instanced item to a entity/player bone using attachToBone(boneId, playerMesh)
  • it does not happen if I spawn items on the ground using (this._game.loadedAssets["ROOT_ITEM" + entity.key].clone(entity.sessionId)

In order to help debug this, online demo has the inspector activated: https://t5c.onrender.com (launch it with SHIFT + CTRL + ALT + I)

2 Likes

Oh dear, sorry, I wanted to give a try with the Inspector and all. But there is way too much stuff going on. Is is really hard to actually pick one of the black swords in the Inspector. That is getting really unproductive and frustrating. And then in the end: all we get is Inspector access. We cannot mess e.g. with uv coords or normals. We cannot console.trace calls, add debugger stops and step through (at least idk how). Also, you probably already have checked all that anyway.

Also, then, I do not know what I did, but the swords started flickering between black and intended color. Why? How? I think there is way too much complexity in that scene. If possible, can you make a scene with 1 charater model, 1 sword and 1 clone of it. Then start adding stuff one-by-one until the glitch occurs? (Or backward, remove until it disappears)

Yeah, I wish I could be more helpful. Just keep at it. Don’t let the bug win :muscle:

1 Like