Home Creators Posts Import Register Favorites Logout

Content

Hi everyone

Development of the mod continues. In this post I'll be discussing even more discoveries and interesting fixes for the development of the enemy synchronisation aspect of the mod.

Enemy synchronisation

I've gone on about this a lot in my previous posts, but I'd argue it's a pretty important mechanic to get right in the co-op mod considering if enemies are in different places doing different things for different people in the same world it leads to a very frustrating online gameplay experience.

Of interest for me this week was the following game networking packets:

NetP2pPacketAiFlag

NetP2pPacketAiData

NetP2pPacketAiGroup

As the name suggests, these are networking packets that communicate different entities AI states. Usually these contain an enemy location param ID, followed back the data to be applied to that enemy.

This works in the base game, because you only ever have 1 multiplayer map loaded in at any time. The issue is that in seamless, you can have multiple maps loaded and this leads to the enemy location param ID NOT being unique.

For example, enemy location param ID 100 could be present in two maps relating to two different enemies, but with the data available in the vanilla game there's no real way of differentiating the two.

To fix this, I had to re-write the networking protocol for these packets to create a new, unique enemy ID from merging the high bits of the map ID with the lower bits of the enemy location param ID. This allows for accurate application of the data to the correct entity.

This was most apparent with one of the main story bosses which activated only after a period of time:

In the game's event script, "EventConditionChr_CompareLogicEzStateFlag" is a virtual function checking some parts of the enemy AI state. The condition for this particular boss is that it has emerged from the ground - once this happens the boss becomes active and the music and boss health bar appears

For the host, the logic state is set correctly, but it was not networked correctly, meaning that the guest players never receive the AI flag update for the boss, causing it to never activate.

This was only a minor bug, but it allowed me to debug that there was at least 3 enemy state synchronisation packets which were not working at all.

The result of fixing all 3 of these packets means enemy sync is working flawlessly (from my experience anyways). The little hitches before - such as enemies occasionally splitting off on different clients - seem to be fixed

I'm extremely proud about this, because it was one of my main sticking points when I was first considering whether I should or shouldn't make this mod.

EnemyDeadCounter

A mechanic unique to Dark Souls II is the enemy dead counter. This makes it so that enemies will only re-spawn a pre-defined number of times before no longer re-appearing when resting at a bonfire.

With the addition of this mechanic, they also removed event flags defining whether an enemy would respawn or not.

In previous games. An event flag would be set in your save file when a boss or non-respawnable enemy would be defeated, meaning when a respawnable action occured (area reaload, bonfire rest) then the enemy would not come back.

In Dark Souls II they moved this condition to the EnemyDeadCounter. Bosses and certain unique enemies just have a "respawn_count" parameter defined as 0, meaning they will not respawn.

There is no networking for this in the base game, aside from an initialiser value on connecting, because it is never expected that players could do a respawnable action whilst in a session. In addition to this, phantoms are limited to 1 area's worth of enemy information, whereas the host can access all 42 areas at once.

I rewrote this class early on in development, but forgot to add networking functionality to update this value when new enemies are defeated, leading to bugs like inactive bosses respawning for the remote player only.

Once I'd found the responsible function, it was fairly straightforward to add my own networking to update the counter, and now it is working as intended with non-respawnable bosses not respawning for guest players.

What I'm working on right now:

People seem to like seeing a list of what I'm currently working on, so here is an updated list from last post.

Done:

Creating a system where some area-specific flags are not saved correctly to the guest world

Right now, if you are a guest and you kill a boss in the hosts' world. When you go back to your own world the boss will still be there, but in a dead state (meaning the fog wall won't be there, and the boss will be technically dead but just standing there idle.

It was not actually a problem relating to guest event flags as I first thought, but the EnemyDeadCounter which I described in this post.

Fixing 'The Abyss'

The Abyss is a purely single-player only area in the game accessed via a covenant. It's currently semi-functional, however the boss of this area can only be accessed by the host

The abyss should now function in multiplayer, meaning now every single map should work in a session.

Fixing the 'duplicate player' bug

Occasionally, a rare race condition can happen if you warp at the same time as the host, causing the host to spawn twice. This will inevitably crash the next time you hit a load screen. I know what causes it I just need to get around to fixing it.

I have re-written the way that player data synchronisation works, so now instead of the host sending all player data to the connecting player, each player is responsible for sending their own information.

To be done:

Creating a system where items are not instanced correctly

At the moment a guest player can pick up an item in the host world and it will regenerate when they re-spawn.

This is unfortunately very annoying to do because, unlike the other souls games, ItemLot pickups are not associated with event flags. They are directly attached to the object that they spawn from themselves, meaning I have to access unloaded object data during a session

Fixing bonfire warps

Currently, if one player sits at a bonfire whilst another player is just starting the warp animation, it will softlock the player warping. Meaning they have to restart. I know what causes it I just need to get around to fixing it.

Thank you for your patience, and a huge thank you to all of my supporters <3

Files

Comments

Hexxx

nice.

LilForno

Cant wait for the mod to drop, great job!

Nick

Keeeeeen

TheUnrizzed

I don't think it's an exaggeration to say that you're one of the greatest modders of all time. Especially given the nature of the mods you're making, and the respective games you're wrangling to make them for.

Klaudiusz Kąkolewski

great work! had much fun doing 100% achievements in DS, DS3 and ER with my friend, and I cant wait to do the same with DS2!

TheChesireMouse

I'm not sure what half of what you said means but it sure sounds impressive! Thank you for the work.

Sage

Absolutely incredible keep up the great work!

Josué Rodríguez

This is incredible, thank you so much for the update Yui. My friends and I have played ER, DS1 and DS3 with Seamless and we really think your work is wonderful; the experience was very enjoyable and fun. I really appreciate that you share updates from the mod with us; it's fun and interesting to see the programming process behind it. I'm really looking forward to play DS2 with seamless with my friends and I know it's a somewhat tedious task, but I can say with certainty that the wait will be worth it, as always.

Danny Alvarez

Can't wait. Going through my favorite souls game with my partner will be amazing!

HuffsPaintThinner

I appreciate the effort you put in for this mod to happen. I couldn't be happier to see this in development. Take as much time as you need. We will be here waiting for it. Thank you.

Ryn Fox

You are easily one of the most impressive developers I've ever seen. To not only reverse engineer these things but to also rewrite them in smart ways that cleanly integrate with the other existing code takes skill and good judgement. I'm so grateful that you're putting your talents towards reviving one of my most beloved games. Thank you again for all of your hard work!

Bumra

Getting DS2 Seamless to work like other soulslikes seems like a lot of work. Looks like you've got this, cheering from the sidelines \o/

jenzfc

I had to subscribe and support your talent with monetization. I truly cannot wait for this to be out. Myself and my husband beat DS3 and ER in seamless coop several times, and we are eager to do the same with DSR and DS2.

jenzfc

How did you do it in DS? We tried and we don’t see the same enemies, enemy killing and bosses don’t sync up.

jenzfc

You didn’t have problem with DS? We tried it and enemies don’t sync up.

Meme Daddy

This is probably a comment you'd be tired of reading by this point, but assuming you have everything in the TBD section done, would it become viable for testing as mentioned in the prior post? I know you said once you have a build more or less sorted out the cadance would be pretty close to the mod releasing. Also it's always interesting to read what challenges you are undertaking with the mod and I always enjoy learning how you fix them. I know the mod has come a long, long way since before

Sauce Hut

Another great update, keep up the great work!

Bob Whyland

Today we are one day closer to DS2 seamless co-op 🙏

ryley carroll

i know this is about darksouls2 but im having an absolute horrible time with darksouls 1 seamless. doors are closeing and than i cant open them unless disbanding. one person got respawned at the start of the game and got stuck there because of the black night killing them. another player will get stuck with someone else's camera when dying in a boss and then rejoining. constant crashing.

Yui

I've never heard any of those issues before, make sure you're all using un-modded versions of the game for the best experience (even some visual mods like re-remastered will break since they change enemy counts) . Avoid starting co-op in the Undead Asylum and wait until you get to Firelink Shrine before starting co-op. Turn off invasions. I did multiple playthroughs of Dark Souls Remastered seamless with my friends and had none of the issues listed. If all else fails join the Dark Souls seamless co-op discord for help debugging issues with your game

ryley carroll

We did all these. I will say that we have 6 players in total. We were in the depths when one player died and randomly ended up in the asylum on respawn.

Bob Whyland

You may have had incompatible versions of the mod. I've done a dozen playthroughs and have not had this issue

SteelBoi

first time commenting but i'm in awe just how amazing you are at this. hell if i attempted this the code would step out my monitor with a haymaker. Simply impressive and I would wait a worlds wait longer knowing you are doing superb work.

Fabian Tobar

La puta cabra 🙏🏻🙏🏻🛐

Soiju

love the updates!! is there a way to play an earlier access branch of it somehow?