Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by DFortun81 · Apr 12, 2015 at 07:39 PM · webglhtml5

Incompatibility between Seven Zip and WebGL

I'm attempting to use SevenZip for compression in a Unity 5 game that I'm working on. It works fantastically so far, however, when I attempt to compile the game for WebGL (HTML5), I keep getting a Data Error Exception when it runs. Initially, I thought there might be something wrong with the data file itself, so I made a really small project and reviewed the contents of the file, the arrangement of the bytes, and so on. This review proved that the file itself was not at fault.

When Unity creates a WebGL build, it converts just about everything into JavaScript ASM. I suspect that there might be something in the code that the converter was not expected or wrote in the wrong logical order. I will eventually figure out what's wrong and how to fix it, but I would absolutely love it if I could get some additional heads looking into this issue.

Attached is the sample project in question. If you run the project in the Unity editor (you may have to load the Test scene first) and look at the console output, there are results of the test as they are expected. They should all pass. If you compile the project to WebGL and then run that build in a browser, then you'll see the Data Error Exception print out when the bytes are supposed to be decompressed. (directly after the debug and right before the tests)

LZMA Compression Sample - Unity 5 Project

Alternatively, if I uncheck the box on the Main Camera object that says "Test Compressed Resource File", the uncompressed version of the file works without issue under all cases. The problem must lie with the SevenZip decoder and its compatibility with Unity's JavaScript ASM.

NOTE: I'm using LogError so that the console output can be seen in the HTML 5 build without having to dig for it.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by DFortun81 · Apr 19, 2015 at 02:35 AM

Despite there being no response on the subject, I have solved the issue for myself. The Seven Zip library had initialization for non-static members in the decoding classes declared outside of the constructor. This behaviour is NOT detected by the JavaScript ASM cross-compiler and was the cause of my problem.

Do NOT practice local variable initialization outside of a class method or constructor - This may be valid behaviour in C# , but the cross-compiler will simply ignore it.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Schubkraft · Apr 21, 2015 at 12:03 PM

I tried your linked project and it works without any errors compiled for WebGL with 5.0.1p1

If it still errors for you please file a bug report and attach the repro project.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DFortun81 · Apr 21, 2015 at 11:44 PM 0
Share

Perhaps the JavaScript cross-compiler was updated in 5.0.1p1, since it did not work in 5.0.0. I just downloaded the project and it also works fine with no modifications. Hmm.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

19 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Setting up my website/server to host WebGL 0 Answers

in webgl , how to change #canvas property? 0 Answers

Unity WebGL not playing in Chrome 1 Answer

Does Unity have any plan to support Wechat Mini Games platform? 0 Answers

How to Make WebGl Export Work in All Browsers? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges