[OPEN SOURCE] Multiplayer 3D RPG Using Colyseus

I have experience with Unity3D & Synty’s packages. It is really good quality and I personally use it for environment and map objects. But for characters it’s not suitable, because you can’t configure skin color etc because it is one mesh/material

Another problem is a license. You can’t use it for open source. (any paid packages from asset store AFAIK)

I suggest you to start with Quaternius because it’s easer to configure, it contains basic animations.

And after all, you need to handle Skeleton Animations performance issue. Because for online RPG you can easily concentrate 15-20 characters in one place and for CPU it will be a problem.

See this cool topic about VAT Baked Texture Animations with Animation Groups? - #8 by Alexander_Sosnovskiy

1 Like

@Alexander_Sosnovskiy of course you’re 100% right! I had not considered licensing… What a shame :frowning: I will fallback to quaternius.

I will look into VAT animations, that is exactly what I was looking for, it was bugging me having 100’s of animation group loaded when only 3 were needed. thanks for the suggestion.

@sebavan haha, let’s see who wins, even if I cannot really use them :slight_smile:

2 Likes

i messaged polyperfect about the license a while ago. unlike synty, they allow for usage in any scenario you could imagine, but said “you can use any way you like, as long as you keep assets safe” … which got me wondering: how can we keep assets safe and by safe i assume that means prevent from bulk download.

i was thinking: serving assets via gcp, with a limited time use key attached.

what do you all think? what’s the best way to fulfill this obligation to the asset provider? (happy to spin this off to a different thread also).

Kenny has a huge amount of free asset packs intended for use. They’re free to use however you want and IIRC there’s at least one fantasy pack

HTH!

Hi there,

Obviously, very busy IRL at the moment so not too much time to work on this, but I still managed to get a first draft of the inventory working, so monsters can drop loot, and player can pick up. all picked up items will show in the inventory.

I’m also trying to work on the character editor in preparation to be able to equip items, but it’s not easy. Anyway, I’m slowly getting the hang of it, just need to focus a little more on it.

4 Likes

That character looks fearsome. :fearful: It would just need a mightier sword. :crossed_swords: :crossed_swords: This one looks a bit small and also needs sharpening :grin:

2 Likes

Are you able to perform live armature remapping of the model within your equipment/inventory system? If so, did you write your own program for that?

I have similar needs so I chose rigged items + VAT + One skeleton for all NPC/player.

@mawa, I was drinking a coffee and I nearly choked while reading your message :slight_smile: You got to be careful when being funny like that, it’s dangerous ! :stuck_out_tongue:

Sorry, I didn’t mean to harm you :sweat_smile: May be drink first and read next?! :joy:

2 Likes

@webgrid Nope, items are all rigged currently, but If you ever figure out live armature remapping, let everyone know :slight_smile:

I’m am following @Alexander_Sosnovskiy advice and trying to use VAT animations & one skeleton (following some parts of this playground: Babylon.js Playground).

1 Like

Hi there,

It’s been a while, life & work is taking all my time.

A few updates none the less:

  1. Your inventory is now dynamic (but not saved to DB yet)
  2. Your abilities are now dynamic and not hard coded (but not saved to DB yet)
  3. Drop table updated to 5 different items (apple, pear, health potion, amulet, nothing), with the amulet being the hardest to get and the easiest being nothing :slight_smile:
  4. Added a Ability tab where you can learn and unlearn abilities (by default, you only have basic attack unlocked)
  5. Added a global tooltip that can be easily used to display additional information (inventory/abilities), still has small issues of placement, to be improved.
  6. You can open the inventory by pressing “I”
  7. I’ve reduced the overall Colyseus state, by using the provided filter() function,
    • All players receive position, level, health, mana and few other params of every other player.
    • All extra parameters get sent only to the player it belongs to (like abilities and inventory, as no one else needs to know about that).
    • All this allows to easily update any player on the server and only the relevant client will receive the relevant update.
    • Sounds obvious, but required a fair amount of refactoring to achieve.
    • (fyi, before this change, every player would receive all data from all players)

picking up items

learning/unleaning skills

2 Likes

Keep up the amazing work @oriongu :slight_smile: Always amazed by the progress you made knowing it all started with you pasting your password in the chat lol

and with this scene :slight_smile:

@sebavan Damn, I forgot that password leak :slight_smile: HAHA

Yeah, I indeed did set the bar very high from the start :slight_smile:

3 Likes

Hi there,

I’m trying to attach a sword to a bone of my character but it is acting a little weird? Is my logic flawed? The video shows what i mean very clearly.

// load player mesh
const result = this._loadedAssets["RACE_" + this._entity.race].instantiateModelsToScene();
const playerMesh = result.rootNodes[0];
this._animationGroups = result.animationGroups;
this._skeleton = result.skeletons[0];
   
/////////////////////////////
// equip weapon
if (this._entity.type === "player") {
  let bone = this._skeleton.bones[34];
  const weapon = this._loadedAssets["ITEM_sword_01"].instantiateModelsToScene();
  const weaponMesh = weapon.rootNodes[0];
  weaponMesh.setParent(bone);
}

/////////////////////////////////////////////////

As a bonus, had a funny bug earlier on :slight_smile:

He’s in big trouble

I use this one: Bones and Skeletons | Babylon.js Documentation

It seems like when you use setParent() the weapon takes the local vector of the bone or so? Would explain why the sword hovers around at 0,0,0?

1 Like

Mate, that’s exactly what I was looking for :slight_smile: Still a little offset but i’m sure I find a way to fix that. Thanks

Better, he looks so cool with a weapon. Not sure why I’m so happy, it’s just nice to see progress I guess (and possibilities…) :stuck_out_tongue:

4 Likes
  • Sorry, why can’t I run this project locally?

Hi @tianbadibatuasss, Welcome to the community.

There is no reason it should not work locally? We need more information to help you? Did you get an error?

If you do the below, it should work.

  1. yarn install,
  2. yarn server-dev
  3. yarn client-dev
  4. http://localhost:8080/