Anuken / Mindustry-Suggestions

Repository for Mindustry suggestions and feedback
130 stars 58 forks source link

Add the ability to sync the data if memcells with the wproc `sync` instruction #4706

Closed SkyeTheFoxyFox closed 11 months ago

SkyeTheFoxyFox commented 1 year ago

Describe the content or mechanics you are proposing.

Either an option to sync memcells with wproc sync or anything similar instruction to sync a memcell. If desired you could also just have it sync one index, to reduce the overall amount of syncing

Describe how you think this content will improve the game. If you're proposing new content, mention how it may add more gameplay options or how it will fill a new niche.

sync works great if you have data you're only updating once per code loop. But whenever you're looping over data (such as a fetch loop for all players), it becomes a huge pain to keep the variables synced, as it sometimes syncs data from the same variable at a different point in the execution. Being able to sync memcells would allow the user to store data for all the players, and keep it synced easily.

Before making this issue, check the boxes below to confirm that you have acknowledged them.

Optimal-performer-38 commented 1 year ago

(This is irrelevant to the post lol im self advertising sowwy but heck yeah I agree with syncing memcells instead of individual values inside) https://www.reddit.com/r/Mindustry/comments/16ogqar/a_slightly_better_version_that_can_store_about/

SkyeTheFoxyFox commented 1 year ago

the problem is desyncing

Optimal-performer-38 commented 1 year ago

the problem is desyncing

What is desyncing? And what is it supposed to do

Varxalaxiacis commented 1 year ago

the problem is desyncing

What is desyncing? And what is it supposed to do

Varxalaxiacis commented 1 year ago

dsync : basicly client 1 and 2 precive or got data diffrently like player 1: supposed to have data(a) but got data(b) player 2: however got data(a)

SkyeTheFoxyFox commented 1 year ago

No, desync is where the client and server have a different value for the same variable or cell index. This is because mindustry doesn't actively sync data between the server and clients to save on network usage. This leads to problems with world logic that intends to work in multiplayer, as they can end up doing different things for different people. to combat this we got the sync instruction, it will sync a variable when ran, however, due to the nature of it, it struggles to sync data if the variable has to change multiple times during a code loop, such as when you're looping over stuff.

Optimal-performer-38 commented 1 year ago

Awsus. Silly me. I misunderstood. I am going to pack my stuff and leave this thread to keep some dignity.

github-actions[bot] commented 11 months ago

This suggestion is now stale, and will be automatically closed.