Author Topic: Settlement resources in multiplayer  (Read 1783 times)

Offline UnknownAX

  • Newbie
  • *
  • Posts: 4
Settlement resources in multiplayer
« on: January 09, 2012, 09:52:57 am »
Hi, I've recently started playing this game with a friend on multiplayer and was wondering how exactly do the settlement resources work in multiplayer? They don't seem to synch, but if we build something, it seems to take resources from both of us. If anyone could be so kind as to explain how this was designed, it would be greatly appreciated.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Settlement resources in multiplayer
« Reply #1 on: January 09, 2012, 10:24:25 am »
The resources belong to the settlement, not the player, and they should sync (several bugs were fixed with relation to that) but there may be more bugs.
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline KDR_11k

  • Hero Member Mark II
  • *****
  • Posts: 904
Re: Settlement resources in multiplayer
« Reply #2 on: January 10, 2012, 12:13:08 pm »
In other words, the inventory is shared between all players.

Offline UnknownAX

  • Newbie
  • *
  • Posts: 4
Re: Settlement resources in multiplayer
« Reply #3 on: January 10, 2012, 08:37:39 pm »
The resources belong to the settlement, not the player, and they should sync (several bugs were fixed with relation to that) but there may be more bugs.

Okay -- I can't seem to get them to synch without leaving and rejoining the server, and even then, the numbers don't much match up.

For instance, I just launched two clients, logged into my server on both with different usernames, then went into settlement management. The numbers were the same on each client. I began with 147 wood. Then, on Client #1, I gathered some wood. Client #2 didn't see these changes. On Client #1, I went to the settlement management, and was told we had 153 wood. Client #2 still sees 147. I logged off with Client #2, and logged back on, and Client #2 sees 150 wood. I then log off with Client #1, and log back on, and now Client #1 sees 150 wood.

Should I put this in a bug report, and maybe make a video demonstrating?

EDIT: Further experimentation leads me to conclude the following:

- For every tree harvested, only 1 wood is dropped, whereas the client believes it is 2 wood.
- The synchronization only happens for clients that are in the same chunk as the harvest.
- Even then, the clients are still being told they get twice as much resources as they are.
« Last Edit: January 10, 2012, 09:15:48 pm by UnknownAX »

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Settlement resources in multiplayer
« Reply #4 on: January 11, 2012, 09:37:26 am »
Thanks for the info, that will help me find the problems :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline UnknownAX

  • Newbie
  • *
  • Posts: 4
Re: Settlement resources in multiplayer
« Reply #5 on: January 11, 2012, 12:19:17 pm »
Thanks for the info, that will help me find the problems :)

Great -- glad I could be of help.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Settlement resources in multiplayer
« Reply #6 on: January 11, 2012, 12:58:44 pm »

Okay -- I can't seem to get them to synch without leaving and rejoining the server, and even then, the numbers don't much match up.

For instance, I just launched two clients, logged into my server on both with different usernames, then went into settlement management. The numbers were the same on each client. I began with 147 wood. Then, on Client #1, I gathered some wood. Client #2 didn't see these changes. On Client #1, I went to the settlement management, and was told we had 153 wood. Client #2 still sees 147. I logged off with Client #2, and logged back on, and Client #2 sees 150 wood. I then log off with Client #1, and log back on, and now Client #1 sees 150 wood.

Should I put this in a bug report, and maybe make a video demonstrating?

EDIT: Further experimentation leads me to conclude the following:

- For every tree harvested, only 1 wood is dropped, whereas the client believes it is 2 wood.
- The synchronization only happens for clients that are in the same chunk as the harvest.
- Even then, the clients are still being told they get twice as much resources as they are.
By gathering/harvesting, do you mean destroying a tree in side-view and walking over the logs that drop?  Or clicking on a tree in the top-down settlement view to salvage it?
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!

Offline Mánagarmr

  • Core Member Mark V
  • *****
  • Posts: 4,272
  • if (isInRange(target)) { kill(target); }
Re: Settlement resources in multiplayer
« Reply #7 on: January 12, 2012, 02:07:13 am »
Do remember that character inventory and settlement inventory are completely separate. You can transfer resources inbetween them, but if you "loot" something in adventure mode with your character, it does not display in the settlement interface until you physically transfer it.
Click here to get started with Mantis for Suggestions and Bug Reports.

Thank you for contributing to making the game better!

Offline UnknownAX

  • Newbie
  • *
  • Posts: 4
Re: Settlement resources in multiplayer
« Reply #8 on: January 12, 2012, 01:37:42 pm »

Okay -- I can't seem to get them to synch without leaving and rejoining the server, and even then, the numbers don't much match up.

For instance, I just launched two clients, logged into my server on both with different usernames, then went into settlement management. The numbers were the same on each client. I began with 147 wood. Then, on Client #1, I gathered some wood. Client #2 didn't see these changes. On Client #1, I went to the settlement management, and was told we had 153 wood. Client #2 still sees 147. I logged off with Client #2, and logged back on, and Client #2 sees 150 wood. I then log off with Client #1, and log back on, and now Client #1 sees 150 wood.

Should I put this in a bug report, and maybe make a video demonstrating?

EDIT: Further experimentation leads me to conclude the following:

- For every tree harvested, only 1 wood is dropped, whereas the client believes it is 2 wood.
- The synchronization only happens for clients that are in the same chunk as the harvest.
- Even then, the clients are still being told they get twice as much resources as they are.
By gathering/harvesting, do you mean destroying a tree in side-view and walking over the logs that drop?  Or clicking on a tree in the top-down settlement view to salvage it?

To clarify, I meant destroying a tree in side-view and walking over the logs that drop.

I did a bit more experimentation with it and found that effectively what seems to be happening is, the client is being told that, when a tree is destroyed, two logs are dropped. The client picks them up, and believes that they just gained two logs, when in fact, they've only gained one. I came to this conclusion because:

- If I destroy a tree, and then immediately pick up the logs, I gain two logs, the resource amount increments by 2, but if I disconnect & reconnect, the resource amount was really only incremented by 1
- If I destroy a tree, but do not pick up the logs, and instead disconnect & reconnect, THEN pick up the logs, the resource amount is incremented by 1, the proper amount.

My guess would be that the "a log got dropped here!" (what is sent when a tree is destroyed) packet is being sent twice instead of just once, whereas the "here's the map, here's the item entities on it" (what would be sent upon joining a chunk) is working as intended.

Offline keith.lamothe

  • Arcen Games Staff
  • Arcen Staff
  • Zenith Council Member Mark III
  • *****
  • Posts: 19,505
Re: Settlement resources in multiplayer
« Reply #9 on: January 12, 2012, 05:03:00 pm »
Ah, a double-spawning of the drop would make more sense than the other theories I'd investigated, thanks :)
Have ideas or bug reports for one of our games? Mantis for Suggestions and Bug Reports. Thanks for helping to make our games better!