SrRapero720 / waterframes

Mod which let you see pictures in-game amen
24 stars 13 forks source link

Video loading cause freeze #110

Closed sorae42 closed 2 months ago

sorae42 commented 3 months ago

When a video is being loaded, the game will freeze for a few seconds until the video is completely loaded. This is annoying when walking/flying across someone's house, or going in and out an area with the TV.

This seems to be that the video loading is done on the main thread, causing game freeze to be happening.

This also cause Elytra fly to stop moving towards the direction I was flying to.

Fabric 1.20.1. No errors in log.

SrRapero720 commented 2 months ago

this issue is mosly related to watermedia. If you're using mac, the issue might be that, watermedia turns off async media loading on mac to "prevent" other memory reading bugs (doesn't work). I will rollback that change, yet again some mac users must have crashes loading media

for other operative systems... must... no(? VLCJ is not very optimized on memory managment, is on my todo list fix that but nothing that i can address right now...

closed as no planned due to a bague report.

sorae42 commented 2 months ago

I don't really mind when it freezes with entering once and leave after. But it gets insanely annoying when I'm building something nearly and have to step out-step in the TV loading radius.

I think one way to temporary solve this is to implement an area range that keep the video loaded until the player has gone out of that radius.

It could go like this:

  1. If a player enter a 16 blocks radius of a TV, video began loading.
  2. Player left the 16 blocks radius, however there will be an additional range (e.g. 8 blocks) that keep the video loaded until the player also got out of that range. That means it only takes 16 blocks radius to load the video, but 24 blocks range before the video is unloaded.

This will make the issue less annoying since I don't have to load a video everytime I go in and out an area (literally freezing), making the experience less frustrating this way.