[1.192.021] In-game scripts using sprites don't work in MP

Whiplash141 shared this bug 11 months ago
In Progress

In Single Player or local MP as a host in-game scripted screens display properly:

GXZsA3y


In a Dedicated Server or local MP as a client, in-game scripted screens using sprites look like this:

SNjDKGt


Steps to reproduce:

1. Start a single player game (with in-game scripts enabled)

2. Spawn in the ship attached to this post. The LCDs on the bridge will display properly like the first image.

3. Start a Dedicated Server game (with in-game scripts enabled)

4. Spawn in the ship attached to this post. The LCDs will display the bright default blue background instead.

Best Answer
photo

Adding an empty MySprite() at the beginning of your draw frame periodically will force the game to send all the sprites. It caches them in an array so if you send the same sprites, it will ignore duplicates. Adding one at the front shifts the indicies and makes it draw again.


The issue seems to be with sprite streaming to clients. This often arises when entering sync range. For whatever reason, the client does not get all the sprites, and since the server only sends unique sprites, if one fails to reach the client, it never will unless you force it to be sent again.

Comments (8)

photo
1

Have been playing on a PVP server, half of the time the lcds had this problem

photo
1

so i play on Local MP, im alone atm..does this mean as soon someone joins it, the LCDs will become blue?

photo
2

Hello, Engineer!


Thank you for your feedback! Your topic has been added between considered issues.


Please keep voting for the issue as it will help us to identify the most serious bugs.


We really appreciate your patience.


Kind Regards

Keen Software House: QA Department

photo
1

very funny @KEEN! THEY DONT WORK!!!

photo
4

I was able to reproduce the issue and reported it. I hope we will manage to fix this son, We will update the thread once we have more information.


Thank you, Whiplash.

photo
1

WHIP! ARE YOU A DEV????

photo
4

FYI this is still broken as of 1.192.101 despite the change log listing it as fixed.

Examples:

d3911219d38ff45da61309511ca9302c299f5f8dd48169a491467b1db26ef82f

photo
1

The issue is still present. Is Keen working on it? Or is there a workaround?

photo
1

yup i can confirm, all lcd script using sprites are not working because of this... please fix thing... again...

photo
1

i hope they fix this soon

photo
photo
4

Hi,

i may confirm this in the latest release now. I just finished a LCD script to display oxygen pressure and want to share some interesting points.

It seems to definitely occur as soon as IMyTextSurface.ScriptBackgroundColor or IMyTextSurface.ScriptForegroundColor gets changed by the script.

Workaround: Never touch those 2 values, instead draw a 100% covering SimpleSquare with the desired color in background first.


It also seems to occur in other situations, i just got the behaviour after a server restart.

Workaround: Implement a INIT sequence, setting all your sprites for at least 1 tick to a different color (or maybe change another sprite property). Changed sprites seem to get updated properly. Don't forget to set all sprites back to normal color after initialization.


With these 2 workarounds i feel able to bypass most of all problems... not nice but functional.

photo
2

Here some more infos i got meanwhile:

It also happens as soon as i leave the rendering distance of the script.

Each time i come back from asteroid mining, it's bugged.


What actually happens is, all static sprites which haven't been changed are invisible only dynamically updated sprites in size or color will be displayed.

photo
2

Adding an empty MySprite() at the beginning of your draw frame periodically will force the game to send all the sprites. It caches them in an array so if you send the same sprites, it will ignore duplicates. Adding one at the front shifts the indicies and makes it draw again.


The issue seems to be with sprite streaming to clients. This often arises when entering sync range. For whatever reason, the client does not get all the sprites, and since the server only sends unique sprites, if one fails to reach the client, it never will unless you force it to be sent again.

photo
1

still a thing 11 month after it was posted

photo