Making a multiplayer mod using Mirror

Discuss modding questions and implementation details.
User avatar
Y07A
Posts: 22
Joined: Wed Oct 28, 2020 4:09 pm

Re: Making a multiplayer mod using Mirror

Post by Y07A »

dartoxer wrote: Sat Nov 26, 2022 5:10 am Thank you for the update. I tested 0.5 and here are my observations.

- Dungeon monster types (rat, bear etc) are now shown correctly based on the host's level.
- Random spawns from resting/waiting are synced.

Dungeon issues:


Sometimes the player who enters first gets duplicated monsters as soon the other player also enters. The second player only sees one monster.

...
Ok, here is some interesting things, I haven't tested this version enough :D .

It should now work fine.
I re-uploaded the binaries files for the 0.5, I'm not making a new release because I only corrected these bugs.

Thanks for the feedback, let me know if you get any other bugs.

dartoxer
Posts: 5
Joined: Mon Aug 12, 2019 11:09 pm

Re: Making a multiplayer mod using Mirror

Post by dartoxer »

I tested the latest version. There are many improvements however there are still some issues.

- The dungeon monster duplication issue is fixed. 8-)
- For some reason after the client joins the game, most of the time the host can't see the client's player sprite (but the client can ALWAYS see the host). This can only be fixed if both players restart the game and they keep trying until the host can finally see the client. After that it works fine. This was an issue in the previous version too but I forgot to mention it in my last post.

As for the quest monsters, the TLDR version is that the player sprite issue somehow affects the quest monster spawn for the follower player. When the quest owner has no player sprite, the quest monsters don't spawn for the follower player.

Details:

Harpy / Bat quest:

- If both the quest owner and the follower have sprites, then the bat and harpy quests are perfectly synced. Both the spawn and the death. The follower can enter before AND after the monster spawned. The follower will always see the quest monster correctly and the death is in sync. Everything is perfect . Doesn't matter who is the host/client.

- If the quest owner (client) has no sprite, then the quest monster doesn't spawn for the follower (host).

- If the quest owner (host) has a sprite and the follower (client) doesn't, the quest monster still spawns for the follower and he can kill it and everything is in sync. Even though the owner can't see the follower.

Werewolf hunting quest:


- The spawn for the "werewolf in a dungeon" quest is still very random for the follower. Sometimes the quest monster spawns, but most of the time it does not. The whole host/client sprite thing doesn't matter here. However when it does spawn, the death is now in sync when the follower kills it. So it's an improvement.

User avatar
Corgi
Posts: 1
Joined: Wed Nov 30, 2022 6:27 pm

Re: Making a multiplayer mod using Mirror

Post by Corgi »

This is really cool.
Everyone everywhere in the Daggerfall Unity community wants multiplayer.
Have you been able to find assistance or support from others?

Also, questions about multiplayer:
1. Will there be PVP or dueling?
2. Trade?
3. How will players look in-game? Models? Will it show them riding horses?

User avatar
Y07A
Posts: 22
Joined: Wed Oct 28, 2020 4:09 pm

Re: Making a multiplayer mod using Mirror

Post by Y07A »

dartoxer wrote: Sun Nov 27, 2022 11:41 pm I tested the latest version. There are many improvements however there are still some issues.

...
Hey, finally figured out where the problem was from :shock: , for invisibles players and foes not syncing in interiors.

I made a new release on github the 0.6 https://github.com/EmptyBottleInc/DFU-T ... es/tag/0.6

There is still some issues: others players can float in the air or be under the ground where walking like 1 km due to floating origin, and other detailed on the release notes.

User avatar
Y07A
Posts: 22
Joined: Wed Oct 28, 2020 4:09 pm

Re: Making a multiplayer mod using Mirror

Post by Y07A »

Corgi wrote: Wed Nov 30, 2022 6:37 pm This is really cool.
Everyone everywhere in the Daggerfall Unity community wants multiplayer.
Have you been able to find assistance or support from others?

Also, questions about multiplayer:
1. Will there be PVP or dueling?
2. Trade?
3. How will players look in-game? Models? Will it show them riding horses?
Hey, thanks

Yes I get some decent help by people who are testing and giving feedback :) .

For your questions,
There isn't PVP but I'm planning to add it later.
You can share items by dropping them at the ground.
Players look exactly the same as humanoid foes, as 8 directions sprites, and I'm planning to add horses sprites too.

dartoxer
Posts: 5
Joined: Mon Aug 12, 2019 11:09 pm

Re: Making a multiplayer mod using Mirror

Post by dartoxer »

Hello!

Thank you for the new version.

- The sprite issue is fixed.
- Now quests that spawn monsters inside a house/tavern work. We tested it with the usual harpy and bat quests. We also tested another quest that spawns a monster in a tavern and that works too :).

- However, unfortunately the dungeon spawn quest still doesn't work for the follower :/. In this version the monster doesn't spawn for the follower at all. We tried entering and re-entering the dungeon 20-30 times and it didn't spawn for the follower at all. In 0.5 it sometimes spawned.

I uploaded two save files (quest owner and follower) so you can easily test it yourself. We use the Smaller Dungeons option in Daggerfall Unity (menu ---> Advanced ---> Smaller Dungeons). Please enable it before loading the save files.

Save27 = follower
Save29 = quest owner

Save files link.

Both save files are outside the dungeon entrace. The quest monster (bear) is very close inside. Go inside ---> go down the stairs ---> turn left ---> first door on the left side. It always spawns in the same room.

l3lessed
Posts: 1358
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: Making a multiplayer mod using Mirror

Post by l3lessed »

This is great and what I've been waiting for. With DF massive size, it is perfect for a online play.

This is mod compatible too? I'm curious because ambidexterity mod would really add a whole new dynamic to the combat online, especially the PvP side is in.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Y07A
Posts: 22
Joined: Wed Oct 28, 2020 4:09 pm

Re: Making a multiplayer mod using Mirror

Post by Y07A »

dartoxer wrote: Thu Dec 01, 2022 12:58 am Hello!

Thank you for the new version.

- The sprite issue is fixed.
- Now quests that spawn monsters inside a house/tavern work. We tested it with the usual harpy and bat quests. We also tested another quest that spawns a monster in a tavern and that works too :).

- However, unfortunately the dungeon spawn quest still doesn't work for the follower :/. In this version the monster doesn't

...
Effectively, quest monsters in dungeons were not sync, I just corrected it and re-upoladed files on the last release (0.6).

By the way, I figured out that the best way to get everything working good, is to host/join a lobby while being outside.

Thank you for finding this issue :)

User avatar
Y07A
Posts: 22
Joined: Wed Oct 28, 2020 4:09 pm

Re: Making a multiplayer mod using Mirror

Post by Y07A »

l3lessed wrote: Thu Dec 01, 2022 6:37 pm This is great and what I've been waiting for. With DF massive size, it is perfect for a online play.

This is mod compatible too? I'm curious because ambidexterity mod would really add a whole new dynamic to the combat online, especially the PvP side is in.
Hey, welcome :D

This is mod compatible, as long as they don't rewriting some game scripts. I already tested mods that change visuals and it works without issues.

I don't know how I will make the PVP code,
but I think as long as the way the player deals damage in ambidexterity mod stays the same as the basic one, this should work :D .

dartoxer
Posts: 5
Joined: Mon Aug 12, 2019 11:09 pm

Re: Making a multiplayer mod using Mirror

Post by dartoxer »

Y07A wrote: Thu Dec 01, 2022 9:53 pm Effectively, quest monsters in dungeons were not sync, I just corrected it and re-upoladed files on the last release (0.6).

By the way, I figured out that the best way to get everything working good, is to host/join a lobby while being outside.

Thank you for finding this issue :)
Quest monsters now spawn correctly in dungeons :)! There is only one bug with them. If the quest monster spawns before the follower is inside the dungeon, the quest monster movement/death is not synced.

If the follower is already inside the dungeon when the quest monster spawns, then everything works perfectly.

Another thing: Arrows are not showing up for the other player in the trade barrel.

Post Reply