Skip to content
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

MoM 1.7.0 - broken import on Android #964

Closed
scrubbless opened this issue Dec 1, 2018 · 13 comments
Closed

MoM 1.7.0 - broken import on Android #964

scrubbless opened this issue Dec 1, 2018 · 13 comments
Labels
Milestone

Comments

@scrubbless
Copy link
Collaborator

scrubbless commented Dec 1, 2018

Description of Problem or Question

The latest version of the official app has broken the import function of Valkyrie.

I just ran the reimport on my Valkyrie and after "importing" it goes back as if the important was not run.
screenshot_20181201-133244_valkyrie

Valkyrie Version

2.2

@BenRQ BenRQ changed the title MoM 1.7.0 - broken important MoM 1.7.0 - broken import Dec 1, 2018
@BenRQ
Copy link
Collaborator

BenRQ commented Dec 1, 2018

Strange, it works for me in 2.2 and 2.1.3

I have v1.7.0 (740) on steam.

@BenRQ
Copy link
Collaborator

BenRQ commented Dec 1, 2018

Can you please share the logs of Valkyrie ? : %USERPROFILE%\AppData\LocalLow\NA\Valkyrie

@scrubbless
Copy link
Collaborator Author

scrubbless commented Dec 1, 2018

Android 1.7.0 (821), I've not tested windows yet.

@BenRQ BenRQ changed the title MoM 1.7.0 - broken import MoM 1.7.0 - broken import on Android Dec 1, 2018
@BenRQ BenRQ added the bug label Dec 1, 2018
@NicolaZee
Copy link

NicolaZee commented Dec 2, 2018

Well done on fixing the bug so quick and a big thanks from me! :)

@scrubbless
Copy link
Collaborator Author

Yeh thanks BenRQ

@OPettz
Copy link

OPettz commented Dec 2, 2018

I can confirm that I also have the same importing issue on my Fire 7 - of course using the android file

@BenRQ
Copy link
Collaborator

BenRQ commented Dec 4, 2018

I've been investigating the issue on Android import, but no success so far.
The log of the issue is:
12-04 21:45:15.365 22016-22402/com.bruce.valkyrie I/Unity: Import caused EndOfStreamException: Failed to read past end of stream. at System.IO.BinaryReader.FillBuffer (Int32 numBytes) [0x0005b] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/BinaryReader.cs:119 at System.IO.BinaryReader.ReadSingle () [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.IO/BinaryReader.cs:506 at Unity_Studio.EndianStream.ReadSingle () [0x0002d] in C:\Users\Drizzt\Documents\GitHub\valkyrie_bruce_dev\libraries\FFGAppImport\AssetImport\Unity_Studio\EndianStream.cs:134 at Unity_Studio.unityFont..ctor (Unity_Studio.AssetPreloadData preloadData, Boolean readSwitch) [0x000f5] in C:\Users\Drizzt\Documents\GitHub\valkyrie_bruce_dev\libraries\FFGAppImport\AssetImport\Unity_Studio\Font.cs:67 at FFGAppImport.FetchContent.ExportFont (Unity_Studio.AssetPreloadData asset) [0x00039] in C:\Users\Drizzt\Documents\GitHub\valkyrie_bruce_dev\libraries\FFGAppImport\AssetImport\FetchContent.cs:529 at FFGAppImport.FetchContent.ImportAssetPreloadDa

So it seems the issue is with the Unity package extraction.
Unity assets explorer also has a problem with this file:
image

But I don't have any issue on Windows, even though it's the same code doing the extraction ...

I'm still working on it but don't know how much time it will take.

@scrubbless
Copy link
Collaborator Author

scrubbless commented Dec 5, 2018

No worries @BenRQ , thanks for your effort so far.

@redwolf2, @LordPyrex , @NPBruce - Is this something you may be able to assist with?

@LordPyrex
Copy link
Collaborator

I wish I could. I'm not much of a coder. Back in the day I was doing wikis to assist with people jumping in to using Valkyrie. I can help with any new how-tos we might need.

@BenRQ
Copy link
Collaborator

BenRQ commented Dec 5, 2018

I have confirmed my first assumption, something is wrong with the package extractor on Unity.

In \libraries\FFGAppImport\AssetImport\Unity_Studio\Font.cs:61
m_CharacterRects_size is read from the file :

On Windows 10 the value is 0
On Android it's ‭0x3F800000‬

Maybe something related to size of object, compiler or endianness ...
I'm still investigating.

BenRQ added a commit that referenced this issue Dec 5, 2018
 - deactivate font import
 - add some logs
 - fix test app compilation for Import library
BenRQ added a commit that referenced this issue Dec 5, 2018
 - deactivate font import
 - add some logs
 - fix test app compilation for Import library
BenRQ added a commit that referenced this issue Dec 5, 2018
@BenRQ
Copy link
Collaborator

BenRQ commented Dec 6, 2018

I have disabled the font export, and now the import is working just fine.

But unfortunately, the sprite placement is different on Android.
This is a very bad news as it means we need to update the sprite system to support a different placement mechanism between android and windows.
And of course we need to do the placement of sprites again.

Here is the old (first) and new token placement on the texture file for Android.

Old DDS texture (please don't mind my beautiful paint writing)
image

New PVR texture on Android for MoM 1.7.0
image

@redwolf2
Copy link
Collaborator

redwolf2 commented Dec 6, 2018

The tokens have this image format ATM:

[TokenYellowWoman]
image="{import}/img/SpriteAtlasTexture-ATLAS_FEATURES_CORE (Group 0)-2048x1024-fmt12"
image2="{import}/img/SpriteAtlasTexture-ATLAS_FEATURES_CORE (Group 0)-2048x1024-fmt47"
x=130
y=520
height=130
width=130

We could introduce x2 and y2 in order to overwrite that parameter on the second resolved image if it is used.

[TokenYellowWoman]
image="{import}/img/SpriteAtlasTexture-ATLAS_FEATURES_CORE (Group 0)-2048x1024-fmt12"
image2="{import}/img/SpriteAtlasTexture-ATLAS_FEATURES_CORE (Group 0)-2048x1024-fmt47"
x=130
x2=758
y=520
y2=130
height=130
width=130

The better alternative would be to use ini files like translation files and auto resolve for a platform. For example tokens.ini and tokens.ANDROID.ini.

If this continues, I could also create tokens in a similar design if necessary.

BenRQ added a commit that referenced this issue Dec 7, 2018
 - Bring new placement support on Android in tokens.ini
 - Fix Zebulon Whateley token on Windows
 - unload bundle after import to free memory and allow reimport
@BenRQ
Copy link
Collaborator

BenRQ commented Dec 7, 2018

Version 2.1.5 is available with import and tile fix

@BenRQ BenRQ closed this as completed Dec 7, 2018
BenRQ added a commit that referenced this issue Dec 7, 2018
 - Bring new placement support on Android in tokens.ini
 - Fix Zebulon Whateley token on Windows
 - unload bundle after import to free memory and allow reimport
@redwolf2 redwolf2 added this to the 2.1.5 milestone Dec 7, 2018
BenRQ added a commit that referenced this issue Feb 20, 2019
 - deactivate font import
 - add some logs
 - fix test app compilation for Import library
BenRQ added a commit that referenced this issue Feb 20, 2019
 - Bring new placement support on Android in tokens.ini
 - Fix Zebulon Whateley token on Windows
 - unload bundle after import to free memory and allow reimport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants