Posted: 14th Nov 2021 23:25
I have finally tried WadPacker on one of my games and I have successfully added all of the assets to a Wad file. I have modified my code to use the WadPacker file and the game runs as a Windows executable and as a APK file on Android. When I output as HTML5 and upload to itch.io I just get a black screen. Has anyone successfully used WadPacker on a HTML5 game? If so any suggestions on what I may be doing wrong?
Posted: 15th Nov 2021 0:10
Do you need asset protection for HTML5, I thought the server blocked access to the files?

also, do memblocks work on the web,

maybe chuck in a check for the file to see if its being found
+ Code Snippet
if GetFileExitst(wad)
 message("Way, file exists")
else
 message("What file?")
endif


and then add more messages along the way to see where its failing, like a breadcrumb trail

Edit: also, did you export with dynamic memory selected?
Posted: 15th Nov 2021 0:25
I'm not sure if protection is needed for HTML5 myself but now I have changed my code to work with WadPacker any HTML5 output will have the WadPacker changes in it. I did have dynamic memory selected when I output the HTML5 program. I have also tried Vishnu Studios and have packaged one of my games and uploaded it to itch.io so that it can be downloaded. I assume by doing this that the assets are now protected? After downloading my game from itch.io Windows warns against running it so I assume that this is because the file isn't signed. Encryption/packing is all new to me so I just want to make sure that my assets are secure.
Posted: 15th Nov 2021 0:49
but now I have changed my code to work with WadPacker


OK, heres the thing, although multiplatform code bases will run on all platforms there are edge cases where you need to be platform specific, use GetDeviceType() (I think) and check what platform the game is running on ... this is the nature of multiplatform coding I'm afraid it cant be avoided

When planning to target multiple platforms from a single code base you need to plan ahead and/or edit the project to keep all platforms happy, my guess is html is not liking the memblock commands in wadpacker, I could be wrong though so don't take that as gospel, look the functions up the help file tells you what works on what platform.

as for the signing, I thought TGC signed the exe?


Edit: The code once, publish everywhere mantra is a fallacy!
Posted: 15th Nov 2021 1:14
I don't think it will take too much work to get it working again on html5. I already use getdevicebasename for specific platforms. I think Vishnu Studio changes the exe file and it doesn't appear to be signed.

Update: now working on html5 again
Posted: 15th Nov 2021 2:16
Cool, glad you got it sorted, also something to bear in mind for your next projects.
Posted: 15th Nov 2021 3:15
anything that we should watch for when using this for html or otherwise?

i tested the vishnu packer today for the first time. the interface is a little clunky but i had a windows project packed on first try and in under 5 mins from launch.
Posted: 15th Nov 2021 3:37
Well I cant find anything in the help about memblocks not working in HTML5 so maybe its a path issue, html wants lower case path names, right? (or is that the droid?)

read/write path issue maybe?

Dont know, but it has been seen where one single upper case letter in a file path can break an entire project.
Posted: 15th Nov 2021 7:24
Android definitely needs lowercase as I ran into that issue on my first project. The only thing I found with WadPacker was that on every image I had to assign an index of 0 to all images, sounds etc as anything above this resulted in an array out of bounds.

+ Code Snippet
Wad_LoadImage(0,"imageone") //works
Wad_LoadImage(1,"imageone") //doesn't work