8000 Evoland hangs after splash screen / crashes · Issue #825 · lightspark/lightspark · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Evoland hangs after splash screen / crashes #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
6 of 23 tasks
Firlaev-Hans opened this issue Oct 9, 2021 · 55 comments
Open
6 of 23 tasks

Evoland hangs after splash screen / crashes #825

Firlaev-Hans opened this issue Oct 9, 2021 · 55 comments

Comments

@Firlaev-Hans
Copy link
Firlaev-Hans commented Oct 9, 2021

What is the purpose of your issue?

  • Site Support Request: Lightspark does not work correctly on a specific website.
  • Bug: Lightspark has the same problem across multiple websites or SWF files.
  • Feature request: a request for new features or support for new platforms, not sites or SWF files.
  • Question, Comment, or Suggestion
  • If none of the above apply, check this box.

If this issue is a bug report or site support request:

Evoland is a paid game on Steam, so I can't provide it here.

Provide the complete set of instructions required to reproduce the problem:

  1. Install Evoland (NOT Legendary edition) from Steam (Windows version and Linux version)
  2. open game.dat in Lightspark

What kind of failure is your issue?

  • Fault: You receive a black window instead of the flash content with a white text such as We're sorry, Lightspark encountered an as yet unsupported Flash file
  • Crash: The window disappears or your browser crashes with a message such as A tab has crashed
  • Broken: Lightspark shows something, but most of the file is not usable
  • Glitch: Lightspark shows something and most of the file is usable, but things are missing or wrong compared to official Flash.
  • Performance: Lightspark runs slow or uses lots of memory trying to play the file

Provide the Lightspark version

0.8.5-1226-ga75a5d8e

What operating system are you are running on?

  • Windows 7, 8 or 10
  • Windows XP, Vista or older
  • Linux: Arch Linux
  • Mac OS X: <specify version here, such as 10.8.1>
  • Other:

How are you are running Lightspark?

  • Browser plugin for Chrome or Chromium:
  • Browser plugin for Waterfox:
  • Browser plugin for other browser:
  • Lightspark executable on the command line

Which of these actions you have taken to help debug the problem?

  • I attached a screen shot of the problem to this issue
  • I have a backtrace listing and pasted it in the bottom section of this issue (hint: hitting Ctrl-C after a crash will copy it to the clipboard)
  • I have reproduced the problem using the Lightspark command line executable
  • I ran lightspark -l 4 on the command line and am attaching logs to this issue (hint: if they are too big, zip them)

Description of your issue

Evoland is an Adobe AIR based game on Steam. It's basically just an SWF file that can be played with flashplayer, even though the file extension is actually .dat. It has both a Windows and a Linux version (the Linux version is not advertised on the Steam page but exists), but the SWF files are not the same. The Windows version shows the developer logo, but once it fades out, the screen stays black and Lightspark just hangs and only prints INFO: FPS: XX Y to the terminal when I Alt+Tab. The Linux version crashes immediately.

For some reason I could not redirect the terminal output into a file so I have only the last 10k lines copied from the terminal
Nevermind. Here are the full logs:
With SWF from windows version: log_winswf.zip
With SWF from Linux version: log_linuxswf.zip

@eiglow
Copy link
Contributor
eiglow commented Oct 10, 2021

For me, on latest git master (a75a5d8), it segfaults. This is with the Linux version.

Here is a backtrace

@dbluelle
Copy link
Collaborator

I've committed a fix that should fix the crash, so please test it.

@Firlaev-Hans
Copy link
Author

I've committed a fix that should fix the crash, so please test it.

The behavior for the Windows version of the game hasn't changed, the Linux version no longer crashes but it doesn't work either:

NOT_IMPLEMENTED: no returntype given for [class flash.system::Worker](0x7f647800fca0 / 1 not constructed)  createMessageChannel
NOT_IMPLEMENTED: missing result type for builtin method:[ns:] createMessageChannel [class flash.system::Worker](0x7f647800fca0 / 1 not constructed) 
NOT_IMPLEMENTED: no returntype given for [class flash.system::Worker](0x7f647800fca0 / 1 not constructed)  getSharedProperty
NOT_IMPLEMENTED: missing result type for builtin method:[ns:] getSharedProperty [class flash.system::Worker](0x7f647800fca0 / 1 not constructed) 
NOT_IMPLEMENTED: no returntype given for [class flash.system::Worker](0x7f647800fca0 / 1 not constructed)  getSharedProperty
NOT_IMPLEMENTED: missing result type for builtin method:[ns:] getSharedProperty [class flash.system::Worker](0x7f647800fca0 / 1 not constructed) 
CALLS: isinstance [ns:flash.system] Worker
CALLS: isType on non classed object 0
NOT_IMPLEMENTED: LoaderInfo: childAllowsParent and parentAllowsChild always return true
NOT_IMPLEMENTED: WorkerDomain.createWorker: giveAppPrivileges is ignored
NOT_IMPLEMENTED: Worker.createMessageChannel not implemented
ERROR: coerce: type not found:[ns:flash.system] MessageChannel
INFO: throwing exception:1014 Error #1014: Class flash.system::MessageChannel could not be found.
    at hxd.snd::MusicWorker/start()
    at Class/init()
    at Class/main()
    at boot_ae42/init()
    at boot_ae42/start()
    at boot_ae42/()

ERROR: Unhandled ActionScript exception in VM TypeError: Error #1014: Error #1014: Class flash.system::MessageChannel could not be found.
INFO: dynamic cast:TypeError
ERROR: Unhandled ActionScript exception in VM TypeError: Error #1014: Error #1014: Class flash.system::MessageChannel could not be found.
    at hxd.snd::MusicWorker/start()
    at Class/init()
    at Class/main()
    at boot_ae42/init()
    at boot_ae42/start()
    at boot_ae42/()

@huwdp
Copy link
Collaborator
huwdp commented Nov 7, 2021

Lightspark does not support MessageChannel as can be seen here (search for MessageChannel). Shumway stubbed it (https://github.com/mozilla/shumway/blob/master/src/flash/system/MessageChannel.ts).

@dbluelle
Copy link
Collaborator
dbluelle commented Nov 8, 2021

Yeah, implementing the MessageChannel class is difficault without any example swf that uses that class.

@huwdp
Copy link
Collaborator
huwdp commented Nov 8, 2021

I've created an example here using code from https://github.com/probertson/as3-workers-examples. It works on my machine using the official Flash player.

@dbluelle
Copy link
Collaborator
dbluelle commented Dec 2, 2021

I've implemented the MessageChannel class and the example works (except for the background color of the textfield, but that is a separate problem...)

@Firlaev-Hans
Copy link
Author

The game still doesn't work. The Windows version still hangs after the logo at a black screen, and the Linux version immediately shows a "yet unsupported Flash file" error with the following terminal output:

INFO: Lightspark version 0.8.5-1280-g24e2b00d Copyright 2009-2013 Alessandro Pignotti and others
INFO: RenderThread this=0x55d13edcd080
INFO: Creating input thread
INFO: Running in local-with-filesystem sandbox
INFO: zlib compressed SWF file: Version 26
INFO: FrameRate 60
INFO: Creating VM
INFO: Fragment shader compilation 
INFO: Vertex shader compilation 
INFO: start worker[object flash.system::Worker](0x7f59e89030d0 / 9)  0
ERROR: Stream exception in ParseThread basic_ios::clear: iostream error
INFO: throwing exception:1009 Error #1009: Cannot access a property or method of a null object reference.
    at haxe::Unserializer/()
    at Class/run()
    at Class/init()
    at Class/main()
    at boot_ae42/init()
    at boot_ae42/start()
    at boot_ae42/()

INFO: Window resized to 682x384
INFO: FPS: 19 24
ERROR: Unhandled ActionScript exception in VM Duplicate onCreate()
INFO: dynamic cast:String
INFO: AUDIO DEC: Audio sample rate 44100
INFO: AUDIO DEC: Audio channels 2
INFO: AUDIO DEC: Audio sample rate 44100
INFO: AUDIO DEC: Audio channels 2
INFO: AUDIO DEC: Initial timestamp 0
ERROR: Exception in reading SoundChannel: basic_ios::clear: iostream error
INFO: ~RenderThread this=0x55d13edcd080

(The windows output has the same exception and a bunch more audio warnings)

Here are the current full logs for both versions at log level 4:
Evoland_Windows+Linux_Lightspark_LogLevel4.zip

@dbluelle
Copy link
Collaborator
dbluelle commented Dec 2, 2021

I'm sorry but in this case I don't think I can do anything without the swf file...

@huwdp
Copy link
Collaborator
huwdp commented Dec 2, 2021

Thank you so much! :)

@eiglow
Copy link
Contributor
eiglow commented Dec 2, 2021

I have purchased the game on Steam.

@Firlaev-Hans Do I have permission to send the game files privately to @dbluelle? I will send it to @dbluelle's commit email, as a link to a google drive upload. Then when @dbluelle has downloaded it, I will delete it from google drive.

@Firlaev-Hans
Copy link
Author

Fine by me

I have purchased the game on Steam.

@Firlaev-Hans Do I have permission to send the game files privately to @dbluelle? I will send it to @dbluelle's commit email, as a link to a google drive upload. Then when @dbluelle has downloaded it, I will delete it from google drive.

@dbluelle
Copy link
Collaborator
dbluelle commented Dec 4, 2021

I've got the game files from @eiglow and committed some fixes for lightspark so that it basically works now.
The only thing still missing are the music and sound effects.

@Firlaev-Hans
Copy link
Author

I've got the game files from @eiglow and committed some fixes for lightspark so that it basically works now. The only thing still missing are the music and sound effects.

I can confirm that the game is now playable (the Linux version anyways, the Windows version still hangs). But besides the missing audio, the color palette is wrong:

What it looks like in Lightspark:
Evoland_Lightspark

What it's supposed to look like:
Evoland_Normal

Anyways, thanks for your work!

@huwdp
Copy link
Collaborator
huwdp commented Dec 4, 2021

This is cool!

@huwdp
Copy link
Collaborator
huwdp commented Dec 4, 2021

The colour difference is probably just a RGBA and BGRA issue where the red and blue get mixed up

@dbluelle
Copy link
Collaborator
dbluelle commented Dec 4, 2021

The colour difference is probably just a RGBA and BGRA issue where the red and blue get mixed up

Yeah, looks like it. The game uses Stage3D for rendering which is implemented but not much tested...

@Firlaev-Hans
Copy link
Author

I did some more testing:

  • Once you get to the part where you unlock monsters (about just one minute into the game) performance drops significantly (30FPS instead of 60). In general performance is suboptimal and one CPU core is always utilized 100% almost all the time, and RAM usage continuously climbs as you play
  • The overworld (maybe 3-5 minutes into the game) looks incorrect, as there is a white grid pattern, plus the textures are not supposed to be blurred / filtered:
    Evoland_worldmap
  • The game crashed when I tried to eat the weird magical seed inside the well in the village that is supposed to turn me into an adult. This part is approximately 10 minutes into the game so I didn't try it again because:
  • Save points don't work. The game will pretend that it was saved but once you restart the game or return to the main menu, "continue" is still greyed out. I assume Lightspark doesn't handle saving like this at all yet? Without saving it won't be fun to debug a game that takes 4 hours to complete.

@dbluelle
Copy link
Collaborator
dbluelle commented Dec 9, 2021

Regarding the savepoints:
By default Lightspark doesn't allow local storage, it has to be explicitly enabled in the settings menu (right mouse click->settings).
This is how Adobe handled that in the browser plugin.
Maybe we should always allow local storage when starting from command line or at least add a command line parameter to enable that.

@Firlaev-Hans
Copy link
Author

Regarding the savepoints: By default Lightspark doesn't allow local storage, it has to be explicitly enabled in the settings menu (right mouse click->settings).

Even with local storage enabled save points don't seem to work ("Continue" is still greyed out in the main menu).

On a different note, I just played until the part where the game previously crashed once again, this time it didn't crash when I ate the weird seed. However, I got another "unsupported Flash file" error when I wanted to sleep at the Inn in the village:

INFO: throwing exception:0 id:1069 Error #1069: Property createRectangleTexture not found on flash.display3D::Context3D and there is no default value.
    at h3d.impl::Stage3dDriver/allocTexture()
    at h3d.impl::MemoryManager/allocTexture()
    at h3d.mat::Texture/alloc()
    at h3d.mat::Texture/()
    at h2d::CachedBitmap/getTile()
    at h2d::CachedBitmap/sync()
    at h2d::Scene/sync()
    at h2d::Scene/sync()
    at h2d::Scene/render()
    at EvoScene/render()
    at h3d::Engine/render()
    at Game/update()
    at Class/doUpdate()
    at boot_ae42/()

INFO: dynamic cast:ReferenceError
ERROR: Unhandled ActionScript exception in VM ReferenceError: Error #1069: Error #1069: Property createRectangleTexture not found on flash.display3D::Context3D and there is no default value.
INFO: dynamic cast:ReferenceError
ERROR: Unhandled ActionScript exception in VM ReferenceError: Error #1069: Error #1069: Property createRectangleTexture not found on flash.display3D::Context3D and there is no default value.
    at h3d.impl::Stage3dDriver/allocTexture()
    at h3d.impl::MemoryManager/allocTexture()
    at h3d.mat::Texture/alloc()
    at h3d.mat::Texture/()
    at h2d::CachedBitmap/getTile()
    at h2d::CachedBitmap/sync()
    at h2d::Scene/sync()
    at h2d::Scene/sync()
    at h2d::Scene/render()
    at EvoScene/render()
    at h3d::Engine/render()
    at Game/update()
    at Class/doUpdate()
    at boot_ae42/()

@dbluelle
Copy link
Collaborator

Savepoints are now working (if you enable local storage in the settings)

@dbluelle
Copy link
Collaborator

The RGBA-BGRA issues should now be fixed, maybe also the other graphical issue and the "Property createRectangleTexture not found on flash.display3D::Context3D" error.

@Firlaev-Hans
Copy link
Author
Firlaev-Hans commented Dec 11, 2021

The RGBA-BGRA issues should now be fixed, maybe also the other graphical issue and the "Property createRectangleTexture not found on flash.display3D::Context3D" error.

Yes, all of those three issues are fixed.

The sound+music is still completely absent, and performance is sub-optimal (seemingly due to being single-threaded?). Some loading times / transitions are kind of long too. And there are also some (not easily reproducible) crashes here and there but with save points working that's not such a big deal. The beginning of the game is completely playable now.

HOWEVER: The biggest problem is the continuously climbing memory usage. There must be some memory leak, because after just a few minutes of playing I had to kill Lightspark as it was using over 11GiB (out of my 16 gigs) of memory.

AND: After playing for about 20-30 minutes, there's a boss fight after which game is supposed to become 3D. (If it wasn't obvious, this game shows the development of RPGs so it gets more technically advanced as you play)
As I sort of suspected, this does not appear to work in Lightspark, as the window froze when the 2D to 3D transition was supposed to occur. Or maybe it would have worked after waiting some more, but due to the memory leak I could not afford to wait that long.

Here's a save state of just before that point.
You'll have to extract it to the respective folder in ~/.cache/lightspark/data (on Linux anyways). To get to the 3D transition, you will still have to walk to the right and up and then fight the boss in a turn based battle (initiated by walking up to the crystal and pressing space)

@dbluelle
Copy link
Collaborator

I suspect that the sound issue is somewhat connected to the memory usage.
In this game the sound is computed in a background worker thread which run's all the time, even if no sound is played (it generates silent samples in that case). I have to investigate further...

@dbluelle
Copy link
Collaborator
dbluelle commented Dec 30, 2021

Ok, I've fixed some stuff, so this is the current state:

  • The sound now works to some extend, but it's not perfect yet.
  • The switch to 3d works, but there is a graphical glitch in the 3d world (the main character has no face...).
  • performance should be better, but not as good as Adobe
  • local storage is now stored in the same format as adobe does, so savegames from Adobe can be used in lightspark and vice versa. Unfortunately this means *.sol files from older lightspark versions don't work anymore. I've attached the savegame from above in the new format: savegame.zip

@Firlaev-Hans
Copy link
Author

Ok, I've fixed some stuff, so this is the current state:

* The sound now works to some extend, but it's not perfect yet.

* The switch to 3d works, but there is a graphical glitch in the 3d world (the main character has no face...).

* performance should be better, but not as good as Adobe

* local storage is now stored in the same format as adobe does, so savegames from Adobe can be used in lightspark and vice versa. Unfortunately this means *.sol files from older lightspark versions don't work anymore. I've attached the savegame from above in the new format: [savegame.zip](https://github.com/lightspark/lightspark/files/7793965/savegame.zip)

For some reason that isn't the current state for me. With the latest commits I currently get "Unsupported Flash file" again on launch:

INFO: throwing exception:0 id:1009 Error #1009: Cannot access a property or method of a null object reference.
    at haxe.xml::Fast/()
    at Class/parse()
    at Class/load()
    at Class/init()
    at Class/main()
    at boot_ae42/init()
    at boot_ae42/start()
    at boot_ae42/()

ERROR: Unhandled ActionScript exception in VM TypeError: Error #1009: Error #1009: Cannot access a property or method of a null object reference.
INFO: dynamic cast:TypeError
ERROR: Unhandled ActionScript exception in VM TypeError: Error #1009: Error #1009: Cannot access a property or method of a null object reference.
    at haxe.xml::Fast/()
    at Class/parse()
    at Class/load()
    at Class/init()
    at Class/main()
    at boot_ae42/init()
    at boot_ae42/start()
    at boot_ae42/()

INFO: ~RenderThread this=0x558d8c321d00

@dbluelle
Copy link
Collaborator
dbluelle commented Jan 1, 2022

I couldn't reproduce the exception in a reliable way, but I've committed something that should fix this.
Also there are more fixes for sound handling and local storage is now always enabled when using the standalone executable.

@Firlaev-Hans
Copy link
Author
Firlaev-Hans commented Jan 1, 2022

Yup, thanks! The game now runs again and, up to the 3D part, works quite well! However there were still some slight issues which I have compiled in a little video (forgive the horrible bitrate, I wanted to keep the file size small)

LightsparkEvoland.mp4
  • The color issue came back temporarily after loading a save game
  • The music often starts playing / changing with a delay, but most other sounds play fine and at the correct time now
  • The transition between the world map and the... normal world looks a bit weird
  • The screen randomly flickers white sometimes
  • Some transitions (like entering houses) lag for a second but it's tolerable. Performance and loading times in general are way better than they used to be and totally fine to me
  • As you already noted many 3D models render incorrectly (Z-Buffer glitches / surfaces get rendered in front of other surfaces when they should be rendered behind them)
  • When I opened the chest with the heart just after the 3D transition, the game froze, well, at least the graphics did. I could still hear me swinging the sword when pressing space. This is consistently reproducible for me.
  • Lightspark still got up to around 2.5 GiB of memory usage after playing from the beginning to the 3D part in one go. A bit on the high side, but definitely better than before.

@dbluelle
Copy link
Collaborator
dbluelle commented Jan 2, 2022

I've fixed the game freezing after opening the chest with the heart.

@Firlaev-Hans
Copy link
Author

Another crash (stack overflow) when opening the chest on the world map that, I think, would make the map 3D:

ERROR: Unhandled ActionScript exception in VM Error: Error #1023: Error #1023: Stack overflow occurred.
INFO: dynamic cast:Error
ERROR: Unhandled ActionScript exception in VM Error: Error #1023: Error #1023: Stack overflow occurred.
    at world::D3Over3D/draw()
    at Game/initWorld()
    at Game/unlock()
    at ent::Chest/onCollide()
    at ent::Hero/collide()
    at ent::Hero/collide()
    at ent::
9E88
Hero/collideBox()
    at ent::Hero/move()
    at Game/updateLogic()
    at Game/update()
    at Class/doUpdate()
    at boot_ae42/()

Savegame
follow the path to the left, go south to enter the world map, walk to the chest

@dbluelle
Copy link
Collaborator
dbluelle commented Jan 5, 2022

I've fixed the stack overflow crash.
I'm still trying to figure out the glitches when rendering the 3d models...

@Firlaev-Hans
Copy link
Author
Firlaev-Hans commented Jan 5, 2022

I'm happy to report that, graphical/sound glitches and occasional hangs / crashes aside, the game now appears to be fully completable! I say "appears to be" because I haven't actually beaten the final boss yet, because it turns out that beating him while almost everything is invisible is a little hard... Let's say, the Z-Buffer glitch that we previously encountered isn't the only 3D rendering issue.
EDIT: I now managed to defeat the final boss and watch the credits sequence, so now I can definitively say that the game can be completed in Lightspark even if the graphical glitches make some parts harder than they ought to be.

So here are some more issues, each with screenshots and savegames:
Lightspark_Battle_Black
What it should look like:
Evoland_3DBattle
In turn-based battles on the 3D Overworld, the ground isn't rendered / is completely black. Maybe this is also simply caused by the Z-Buffer issues that you're looking into right now, but it doesn't really look like it to me. Also, the background is affected by another RGBA-BGRA issue.
What's even more annoying, is that the audio pops a lot during the battle.
Here's a savegame. Leave Aogai City by going down, then in the Overworld walk around on the grass until a battle starts.

This Diablo-esque part is almost unrecognizable:

Lightspark_EvolandDiablo_2
It looks like the floor texture is stretched and has an RGBA-BGRA issue again, while the rock texture is just black.
EDIT: This behavior has changed now: No color issues, and the rock wall texture is now rendered (but stretched), instead it's now the floor that is entirely black. but blood stains on the ground are black.
What it should look like:
EvolandDiablo
Also the performance drops quite a bit while fighting lots of monsters at once here, and during the boss fight, the audio popping returns.
Savegame - Go south east until you encounter a chest, opening it summons the boss.

The first encounter with the final boss suffers from black or missing objects:

Lightspark_Evoland_Final1
At least in this case it doesn't really have an impact on gameplay, since this is a turn based battle.
Savegame - You will have to go far to the east over the bridge to the tower, and you may or may not get annoying random encounter battles in between...

During real the final boss fight it's even worse, and does impact gameplay

Lightspark_Evoland_Final2
You can't see the stage at all and sometimes the boss is completely black too. This fight isn't a turn based battle, you have to see where you're going, so that's a problem. The first phase of the boss is sort of manageable but I didn't manage to defeat the boss this way.
Savegame - Simply walk to the mana tree (but don't enter the air ship)

But on a different note, I'd like to praise the recent performance improvements! I got the game to run in Lightspark on a RockPro64, an ARM based computer barely more powerful than a Raspberry Pi 4, and even after unlocking HD textures the game still ran semi-smoothly! (didn't test the obviously more demanding Diablo part yet though)
Thanks for your hard work, @dbluelle ;)

@dbluelle
Copy link
Collaborator

I've managed to get the windows version of the swf file running (at least on Linux ;) ) with the following limitations:

  • has to be run with --air.
  • it tries to start a native process "GetAch.exe", which does not yet work. The neccessary AIR classes "flash.desktop.NativeProcess" and "flash.desktop.NativeProcessStartupInfo" are only implemented as stubs but don't do anything.
  • unfortunately the save games are not compatible to the linux version, so I couldn't yet check if the 3d stuff has the same glitches in both version (It would be nice to know that to further debug the glitches...).

@Firlaev-Hans
Copy link
Author

I replayed the beginning of the game with the windows SWF and found surprisingly many differences to the Linux version so far:

  • Some of the Linux versions minor bugs such as the music delays, the delays / lags when entering buildings, opening certain chests etc., the rough looking "Mode 7 Overworld" to village transition and probably others are NOT present using the Windows version
  • The font used in the main menu and some other places looks... weird. It's supposed to look the same as in the Linux version but it actually looks kind of jagged
  • When you load the savegame called "256colorsavebug" (see the bottom of this post) and you go to the left to and
    unlock 256 colors, then return to the main menu (with Esc or by getting killed, but don't restart lightspark) and reload the savegame (where the game was still in 16 colors), some tiles are completely black
    LightsparkEvolandWindowsBlackTiles
  • chests on the 2d world map are blurred / filtered (load "leavingPapunika", go to the far right and up to leave the village, then you'll see one)
    LightsparkEvolandWindowsBlurryChest
  • When you load "InnSave", enter the inn, talk to the innkeeper and choose to sleep, suddenly only the bottom left of the screen will continue to be updated while the rest shows the last frame and flickers until you restart Lightspark
  • The 3D transition crashes Lightspark. "pre3dboss" is once again a savegame just before the boss fight leading to the 3D transition. Here's a -l 4 log.
  • Another thing I just noticed when I loaded up that savegame in the actual windows version in Wine, is the fog in the cave. It should look like this:
    Evoland_Cave_Fog
    But in Lightspark it looks like this, not terrible but not quite right either:
    LightsparkEvolandWindowsCaveFog
    Interestingly, the Linux version of the game doesn't have this fog at all (and I don't mean in Lightspark, it just doesn't have it even in the original version)

Here are the mentioned savegames: sharedObjects.tar.gz

@dbluelle
Copy link
Collaborator

Yeah, the versions are handling the resources (images, fonts and sounds) differently.
The windows version uses standard flash resources for all this, but the linux version has some kind of "virtual filesystem" added, so that all resources are just some binary tags in the swf.
Also the windows version is heavily obfuscated, so it's really hard to look through the actionscript code...
That's why I like to have a comparison of the 3d stuff, to exclude that this "virtual filesystem" code triggers any bugs on lightspark.

@dbluelle
Copy link
Collaborator
dbluelle commented Jan 16, 2022

The crash when transitioning to 3d is now fixed. The 3d models of the player, the monsters and the boxes look "interesting"...
Edit:
I've fixed the textures on the 3d models, so they now look more or less the same as in the linux version. That means the "virtual filesystem" is working correctly and is not the reason for the broken 3d models.

@Firlaev-Hans
Copy link
Author
Firlaev-Hans commented Jan 16, 2022

Sweet, the 3D crash seems to have been the only thing blocking a full playthrough this time. Although I get an error message when trying to quit the game from the main menu:

INFO: throwing exception:0 id:1069 Error #1069: Property exit not found on flash.desktop::NativeApplication and there is no default value.
    at Class/GLWA()
    at Class/k7()
    at Object/()
    at YL::WN//9XQD()
    at Class/R1uz()

ERROR: trying to call an object as a function:Null on [object global](0x7f60ec6ca770 / 1) 
INFO: throwing exception:0 id:1006 Error #1006: Object is not a function.
    at Class/k7()
    at Object/()
    at YL::WN//9XQD()
    at Class/R1uz()

ERROR: Unhandled ActionScript exception in VM TypeError: Error #1006: Error #1006: Object is not a function.
INFO: dynamic cast:TypeError
ERROR: Unhandled ActionScript exception in VM TypeError: Error #1006: Error #1006: Object is not a function.
    at Class/k7()
    at Object/()
    at YL::WN//9XQD()
    at Class/R1uz()

Also there are memory leaks again. It seems like, whenever a 3D scenery is loaded memory usage increases, like, it doesn't remove the previously loaded data from memory or whatever. You can see this while walking between the different screens in Aogai village, or every time you switch from 2D to 3D with a crystal in the sacred grove.

The graphical issues are interesting:

  • The depth buffer glitch from the Linux version is also present here (surfaces being rendered in the wrong order)
  • Skeletal animations of entities don't work at all (e.g. walking animations)
  • some textures in the 3D world are garbled, notably that of the main character, chests, savepoints, fire and some other entities Nevermind you just fixed that
  • Completely black textures or issues with red and blue being swapped are not present in the windows version, so e. g. 3D fights look correct (the background anyways, the characters are all transparent and garbled, also the sound popping is once again present here)
    LightsparkEvolandWindows3DFight
    and also the pre-final boss stage is properly textured
  • In the Diablo part, performance issues are still there when fighting many enemies, and there's more audio popping during the boss fight. The ground and rock textures are still stretched (1st screenshot), and sometimes in the beginning the whole terrain is all over the place (2nd screenshot) so you can't see where you're going:
    LightsparkEvolandWindowsDiablo3
    LightsparkEvolandWindowsDiablo2
  • The bug from my previous comment where some ground textures in the 2D world suddenly became black came back in other places, like in the sacred grove towards the end, and during the end credits
  • Some objects are not rendered at all, like the stage of the final boss fight (just like in the Linux version), or wizards in the mines of Noria (you can only see their shadows)
    LightsparkEvolandWindowsFinalBoss
    Note: The final boss' eyes are supposed to be red like in this screenshot. In the screenshot of the Linux version in a previous comment they were purple, which was likely another issue with red/blue, but it's now also fixed and it's red in both versions of the game.

Here's a new archive of 18 savegames of various stages of the game: sharedObjects.tar.gz

@Firlaev-Hans
Copy link
Author
Firlaev-Hans commented Jan 17, 2022

That means the "virtual filesystem" is working correctly and is not the reason for the broken 3d models.

I'm not sure it's the 3D models that are themselves broken or loaded incorrectly. I think it's the 3D depth buffer / Z-order that is broken.
The overall shape of the 3D objects looks pretty much correct after all, but, for example, when the main character is looking at the camera, instead of his face you see basically the inside of the back of his head as it is drawn on top of the face even though the face should be drawn on top (if that makes sense), and in the "Mines of Noria" the lava is often drawn on top of the floor that is raised above the lava.
I've seen this phenomenon before in some other old game (not in Lightspark), which is why I (believe that I) immediately recognized it.
Depth Buffer
Original game:
EvolandNoriaNormal
I don't know a whole lot about 3D graphics so sorry for rambling on about it without really knowing what I'm talking about but I just figured I might as well share this idea in case you hadn't thought of it ;)

I'm curious about one thing though: Are there any other 3D flash games that work in Lightspark yet, and do they have similar problems? I don't know that many flash games overall and "3d adobe flash game" is not a very expedient search term, but it would be interesting to see if Lightspark's depth buffer (assuming I'm right about this) is universally broken / glitchy.

@dbluelle
Copy link
Collaborator

I think you are right about the z-buffer stuff. I'm currently using apitrace to get a deeper understanding of what's going on in the OpenGL part and the shaders.
I've not found many flash files that use the 3d stuff.
Evoland uses the haxe engine (see https://haxe.org/ ), so maybe there are other games that use this engine and are available as swf or AIR files.
Also searching for "Stage3D" flash games may get some results...

@eiglow
Copy link
Contributor
eiglow commented Jan 19, 2022

I think one game which uses Stage3D is Running Fred, although at the moment it doesn't work.

@dbluelle
Copy link
Collaborator

Yeah, Running Fred seems to use the Unity engine, so maybe there are more flash games based on the Unity engine.
I've fixed Running Fred so that it doesn't crash anymore, but it still has graphical glitches and runs very, very, very... slow.

@dbluelle
Copy link
Collaborator

I think I've fixed the z-buffer issues with the latest commit :)
I haven't tested all your savegames, but at least on my test savegame everything is rendered correctly!

@Firlaev-Hans
Copy link
Author

Indeed, and it also fixed the stretched ground textures in both Evoland 1 and Evoland 2!
There are some remaining graphical glitches, e. g. in the Linux version there are some black textures (e. g. during the final boss fight), wizards in the Noria mines are invisible in the Windows version, and probably a bunch more (e. g. frequent screen flashes). But at least it's mostly rendered correctly, I'd argue the Evoland 1 is now fully enjoyable in Lightspark... except:
There seems to have been a regression causing a crash during the final boss fight as well as during turn-based battles on the 3D world map (both in the Windows and the Linux version) so the game is no longer completable right now. I attached a gdb backtrace of the crash during a 3D battle in the Linux version:
linux3dfightcrash_backtrace.txt

@dbluelle
Copy link
Collaborator

I've fixed the crashes (at least on my savegame...) and the black textures should now be gone, too.

@Firlaev-Hans
Copy link
Author

Great, those issues are indeed fixed now! However, while I have yet to do another playthrough I have done some more testing with my existing savegames and besides some minor already known issues that are remaining, there seem to have been more regressions.
(Testing done with Windows version, archive of savegames is here):

  • When you sleep at the Inn in Papunika Village (papunikaInnsave), the screen flickers indefinitely with the exception of the lower left corner. This reminds me a lot of the issue in Evoland 2 where opening the inventory or a name text input field will cause similar flickering.
  • At the beginning of the 3D part (post3dtransition) when you unlock pixelated textures, everything goes black except for the player, enemies and bushes will go black. Same thing goes for the overworld right after that part once you unlock the 3D overworld, for switching timelines in the sacred grove, and for the end credits.
  • Sometimes the " unlocked!" messages are bugged, making the text fields display the previous message

And then there are some remaining previously reported issues, notably these:

  • Painful audio popping during 3D turn based battles on the overworld, as well as during busy battles and the boss fight in the Diablo section
  • Slightly broken / aliased font rendering in windows version
  • In the Windows version in the mines of Noria, wizards are invisible (only their shadows can be seen), and so are hearts dropped by enemies or destroyed pots (if you load the provided Noria savegame and go to the far right and break the pot, you'll see it)
  • Various smaller graphical glitches which are minor enough that I don't feel like listing them all as they're barely worth looking into

Anyways, if you could figure out at least the black world regression, Papunika Inn flicker glitch, sound popping and perhaps the invisible wizards, I'd consider this game good enough that the issue can be closed. As I said, there are various tiny glitches left but fixing them all could take ages and probably isn't worth it.

@dbluelle
Copy link
Collaborator
dbluelle commented Jul 17, 2022

I've fixed some of the issues:

  • the black textures don't appear anymore
  • the text rendering is now smoother and the "unlocked" messages shouldn't display the previous message anymore.
  • several audio issues in other games were fixed, maybe these fix the audio popping here, too (not tested).

The Papunika Inn flicker glitch seems to be related to playing in fullscreen. When switching to windowed (ctrl+f) everything is rendered as it should be.
Unfortunately the wizards and hearts int the mines of Noria are visible in the linux version (The actionscript code of the windows version is heavily obfuscated, so that's very hard to debug).

@Firlaev-Hans
Copy link
Author

The audio popping is still there. The other two glitches are gone, including the "black world regression".
However, when in fullscreen, the game suddenly shrinks into the bottom left corner to a size equvalent to what the windowed size would be, when you unlock the 3D world, 3D textures or generally anything that changes the current scene significantly.
It's not quite like the Papunika flicker glitch, because here, the game actually properly resizes to the smaller size, rather than only rendering a small part of the image, and toggling fullscreen mode fixes it.

I can confirm that the Papunika flicker glitch doesn't happen when you exit full screen mode beforehand and use the Inn with the default window size. But it triggers if you resize the window (either before or after sleeping) as well, not just in fullscreen mode.
(As a side note, the inventory flickering in Evoland 2 is unrelated to the window size, I just tested it, so it's different from this)

Additionally, with the Mesa RadeonSI OpenGL driver, now the whole image "jitters" both in the main menu and in-game, which then goes away after a while but may come back briefly when e. g. using the sword. This wasn't the case two or three days ago when I did some testing. Using Zink (Mesa's OpenGL on Vulkan driver) or the proprietary AMD GL drivers, this issue is not present.

@dbluelle
Copy link
Collaborator

How can I to reproduce the audio popping error?

@Firlaev-Hans
Copy link
Author

How can I to reproduce the audio popping error?

Either in the boss fight of the diablo part, or in 3D turn-based battles.
The fastest way would be loading one of the Aogai savegames, leaving the city and walking around the overworld map to trigger a turn-based battle.

@dbluelle
Copy link
Collaborator
dbluelle commented Jul 20, 2022

I've fixed the Papunika flicker glitch!
I couldn't reproduce the audio issue, to me the turn based battle in Aogai save game sounds the same in lightspark as well as when running the game via wine.
Does the issue also occur when playing the linux version of the game?
Can you check if the "popping" sounds originate from the music or from the sound effects during the battle (by setting music/sound to off in the options) ?

@Firlaev-Hans
Copy link
Author
Firlaev-Hans commented Jul 20, 2022

The sound popping appears to be music related, as it doesn't happen with music at 0 (but sounds enabled), but it does with sound at 0 (and music enabled). Both in the Linux and Windows version.
Btw while testing I happened to go back to the main menu in-game with Esc, and I got this:
LightsparkEvolandReturnMainMenu

@Firlaev-Hans
Copy link
Author

I have now confirmed that Evoland (Windows version) is once again 100% playable in Lightspark! I did another playthrough and this time I backed up savegames of every single point in the game and actually ordered them chronologically for once: evoSave.tar.gz

Besides the audio popping and the invisible wizards I also noticed memory leaks when loading new scenery just like in Evoland 2. Very noticeable when switching back and forth between 2D and 3D with the blue crystals in the sacred grove, or when navigating Aogai. Also there was a huge memory leak in the diablo part but I'm not sure if it is the same or not.

Besides that, there are only small graphical glitches, e. g. some textures being filtered when they shouldn't be, black outlines around textures with alpha, and some black lines between the individual "tiles" in the 3D world. All of those are very noticable in the 12_3DpixelTextures save game. I do not consider fixing these particularly important though. The memory leaks are the biggest issue.

I haven't done much more testing in the Linux version, though I noticed that all music is still delayed by ~1sec in that version. But I think people are much more likely to play the Windows version anyways considering the Linux version is hidden on Steam and not on GOG at all.

@dbluelle
Copy link
Collaborator

The wizards and the hearts are now rendered correctly.
I could reproduce the audio popping but have not yet found out why it occurs...

@Firlaev-Hans
Copy link
Author

I could reproduce the audio popping but have not yet found out why it occurs...

My guess would be that there's something weird with the specific music files in question: battle_hd.mp3 for the 3D battles, and hs3.mp3 for busy Diablo battles and the Diablo boss fight, since the popping only always occurs when these specific tracks play.

@dbluelle
Copy link
Collaborator

I think I've fixed the sound issue, at least on my machine the popping has stopped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0