Wed May 13, 2020 6:05 am
Thu May 28, 2020 11:27 pm
edward-san wrote:Interesting. How does this approach cope with multiplayer mode, where clients may have different loaded mods for various purposes, like graphics and etc.?
m8f wrote:This is an alternative to cross-mod communication via EventHandler.SendNetworkEvent. If the data that is passed between mods affects the game, mod authors have to use EventHandler.SendNetworkEvent.
Graf Zahl wrote:So in other words: This completely bypasses the network barrier?
You wouldn't expect modders to cluelessly use this and make their mods incompatible with multiplayer and demo recording?
Sorry, but we set it up this way so that modders won't accidentally create such mods - of course nobody will ever stop them from deliberately screwing things up - but I don't think it's a good idea to provide ready-made solutions to do such things.
Graf Zahl wrote:If it can cross the network barrier it will completely circumvent all the protections we added to the engine to ensure that modders won't accidentally create mods that break demos and multiplayer, so yes, it should be restricted to one side of it.
m8f wrote:Honestly, I don't see how this introduces a new problem.
S1. Players involved in a netgame can load different sets of mods. Suppose that Player1 has a mod that Player2 doesn't have. Then if this mod changes the game, players will desync. I just checked this, it works like this. There is no protection from this situation besides "out of sync with..." message.
S2. If players have the same service-client combination, then service and client will behave the same, both service-client pairs working on their own side of network barrier. They don't "bypass the network barrier".
S3. If players have different service-client combinations:
S3.1. servers cannot cause different changes in the game because they are data-scoped. Even if they could, see S3.2.
S3.2. clients may behave differently depending on the supplied data from server (or lack of such information). This is an issue, of course, but it's the same issue that is described in S1, which already happens without Services.
If I'm wrong, please correct me. I feel that I don't understand something here. If you have time, please explain. I also will be glad if I'm pointed to a source where I can read on the subject.
Fri May 29, 2020 3:24 am
Sun May 31, 2020 2:03 am
Mon Aug 03, 2020 1:40 pm
Sat Oct 31, 2020 10:51 am
Sat Oct 31, 2020 12:44 pm
class MaxEnemyHealthService : Service
override string get(string enemyClassName)
int newMaxHealth = calculateNewEnemyHealth(enemyClassName);
string result = string.format("%d", newMaxHealth);
ServiceIterator i = ServiceIterator.find("MaxEnemyHealthService");
// use default maximum monster health
while (s = i.Next())
string maxHealthData = s.get(monster.getClassName());
int maxHealth = maxHealthData.toInt();
// do something with maxHealth.
Sat Oct 31, 2020 4:12 pm
M8F wrote:Yes, your mod could add a Service that would return proper spawn health for a class. Target Spy then could add code that checks for Service existence and asks it for health value.
Sat Oct 31, 2020 4:39 pm
Sat Oct 31, 2020 4:59 pm
Sat Oct 31, 2020 5:01 pm
Sat Oct 31, 2020 5:05 pm
Class D4MaxHealthGetter : MaxHealthGetter
Sat Oct 31, 2020 5:11 pm
Sun Nov 01, 2020 4:08 am
Sun Nov 01, 2020 1:22 pm