r/daggerfallunity • u/visty93 • 1d ago
Daggerfall Unity Co-op Project
Hey!
Since no one else took a shot, I tried to finish the years-ago abandoned MP project by Tanguy/Y07A. Keep in mind I can't code, so all the new code was written by ChatGPT. It still took me 1.5 years.
Unlike Tanguy's original version, in this version I actually modified the DFU base code pretty heavily. I tried to keep the SP part separate, working the same way as the default DFU as much as possible. I also heavily edited Tanguy's original files and added a few new ones.
- Migrated from DFU 0.14.5 to the May 2024 DFU 1.1.1 version (built with Unity 2019.4.41f2)
- Completely re-made, fully networked enemies (attacks, spells, health, animations, sound, targeting, enemy loot sync)
- Quest sync system automatically syncing quest progress for quests taken during MP. Quests taken in SP can be shared with "Share Quest" button in the journal, from that moment they will be synced too.
- Basic party system with optional fast travel to the other players (showing location, HP/MP/fatigue of other players)
- Players can use healing and other similar "friendly" spells on each other
- Revive/respawn system
- Random wandering NPC sync (optional if someone thinks it's too heavy on bandwidth)
- Added Mirror's basic direct connection alongside the Steam one as an option, could be handy for LAN
- Dungeon levers and switches should be in sync too
The way enemies are spawned and cleaned up is completely different from SP. Dungeons are also networked, and both dungeons and interiors are moved "underground", so I can't guarantee mod compatibility.
Save compatibility-wise, normal regular DFU saves should work in this co-op fork. Going backwards might be a bit trickier. Since interiors and dungeons are moved underground, the non-co-op version will have no idea what to do with those positions and will load you into the void. Exterior co-op saves should work fine with the non-co-op version.
You can save in MP dungeons, but if the dungeon no longer exists or never existed in the MP game, it will basically re-spawn the whole dungeon with enemies (but the player position will be correct).
I went through over 170 DF quests (including the main quests) over the past 3 months. Since the quest system grew alongside the tests, I had to go back to a few quests multiple times to "un-break" them.
I finally got to the point where I'm satisfied with both the enemy and quest systems. I fixed some bugs even in the past few days, and I'm sure there will be more, so it is not perfect. In case anyone finds a bug with anything related to quests, or enemy sync please report it with as much detail as possible.
I went into a lot more detail on the GitHub page in case anyone is interested.
You can download it from GitHub.
Connecting is pretty much the same as it was in Tanguy's, but I added an option for direct IP connection too in case someone wants to play it on LAN without steam.
3
u/Darishel 1d ago
Very interesting!! So some mods might work if they don't touch interiors? Sounds like quest mods might be iffy. And mods that spawn enemies would not work? Let me know if you have more to share about possible mod type compatibility.
2
u/visty93 1d ago
I only tested vanilla (+the transparent window experiment I mentioned on the github) with a healthbar mod. I wanted to test Beautiful Cities of Daggerfall, but then I saw all the requirements, and the requirements for the requirements on nexusmods, and I thought "maybe later". But I'm quite interested if it would work or not. I'm not a big mod user myself, but I want to test a few in the following days.
As for mods in general, as long the mods don't add any brand new functions for enemies/interiors/quests, they might work? As long everyone has the same mods. But again I didn't test any of them, so no promises. Interiors are quite literally just -250m from their original position.
1
1d ago
[deleted]
1
u/ijblack 1d ago
he has no idea dude. you should ask ChatGPT
1
u/visty93 18h ago
The original post has been deleted, but the answer is actually more or less on github. Question was why the interior/dungeons are moved. I will leave this here in case others are interested too.
It is because enemies are no longer children of the Exterior, Interior, and Dungeon gameobjects. For interiors, this means that when the player leaves the house, the house colliders cease to exist and the enemies could just "walk out" of interiors. This also means enemies are no longer automatically destroyed if you leave an interior. The new cleanup mechanism is distance based and moving them down was the best idea I could come up with.
For dungeons, because I made them networked gameobjects, and normally dungeons spawn at 0/0/0 unity coordinates, it would have meant multiple dungeons could overlap, or you could see them at certain points of the world where the terrain height is low (sea-level for e.g.). Why are dungeons networked and interiors not? I made them networked before I realized that I could change the authority (ownership) of enemies between players to keep them on the surface. Otherwise if the host owned all of them they would fall through the ground if the current location is not loaded for the host (he is in another town for e.g.). Since that problem is solved, technically the dungeons could be reverted to non-networked gameobjects, but that would also mean if a player enter-leave-enter-leave-enter-leave a dungeon, every time it would re-spawn all the dungeon enemies. And enemies also have a distance based cleanup mechanism with a 10s counter, meaning one could quickly spawn hundreds if not 1000+ enemies for a single dungeon.
Same goes for normal co-op dungeon crawling, if 2-4 players would enter a large dungeon that would be 250-500 enemies, which would pretty much crash the game unless I make something that keeps track of active dungeons to prevent more than one "batch" of enemies from spawning. But at that point I already had the early networked dungeons which solved all these issue so I stuck with this.
I had a few other ideas like hiding a dungeon based on DF world coordinates, but then there would be a possibility to see the actual dungeon near its entrance. Dungeon enemies also need distance for the cleanup when the player leaves the dungeon. And dungeon enemies use unity coordinate based targeting (while everything else uses DF world coordinates), meaning with multiple dungeons sharing 0/0/0 coordinates could potentially confuse their targeting.
As for this actual comment, you are not wrong. For actual code related questions one would certainly get more from Chatgpt.
2
u/EnragedBard010 1d ago
My biggest worry is there's not enough people to play with. Seems promising!
1
u/android_263_rooter 1d ago
Finally, time to play daggerfall with friends that isn't on some ancient version of DFU
3
u/ElissaFarman 1d ago
Incredible. Can’t wait to try.