AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
Another small update has arrived:

UI
Changelog

- Added a tool to edit the nwjs' package.json file.
- Added the option to adjust the compression level.

CLI
Changelog:

- Added the command line argument --SetCompressionLevel to adjust the compression level (0 = Optimal, 1 = Fastest, 2 = NoCompression).
-Slight performance improvements thanks to .NET Core's tiered compilation.
 

Nekohime1989

Nekohime
Veteran
Joined
May 31, 2014
Messages
498
Reaction score
228
First Language
English
Primarily Uses
RMMZ
Does this work only with Javascript, or with other directories too?
Such as the overlay directory for orange overlay?
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
@Rachnera , this only works with Javascript files. Since plugin and script calls are stored on the Data folder, you'll need to obfuscate the JSON files or embed them to the Javascript files. For audio and image files, use the Deployment menu to encrypt them.
 

Fhntop

Villager
Member
Joined
May 4, 2017
Messages
28
Reaction score
25
First Language
Spanish
Primarily Uses
RMMV
Hey! This is pretty cool!
I've just found out about this so I'm a bit too late and made my own script for compiling but yours seems way more complete.
I saw on your video tutorial that you take the encryptionKey from System.json and edit the Decrypter object so as to hide it from prying eyes, which I find as a stroke of genius xD
I may be talking nonsense here but isn't it possible that someone edits index.html and adds their own script tag with their sneaky js and then access Decrypter._encryptionKey?
Thinking about this maybe it's best to change decryptArrayBuffer and hardcode the key there
Decrypter.decryptArrayBuffer = function(arrayBuffer) {
if (!arrayBuffer) return null;
var header = new Uint8Array(arrayBuffer, 0, this._headerlength);

var i;
var ref = this.SIGNATURE + this.VER + this.REMAIN;
var refBytes = new Uint8Array(16);
for (i = 0; i < this._headerlength; i++) {
refBytes = parseInt("0x" + ref.substr(i * 2, 2), 16);
}
for (i = 0; i < this._headerlength; i++) {
if (header !== refBytes) {
throw new Error("Header is wrong");
}
}

arrayBuffer = this.cutArrayHeader(arrayBuffer, Decrypter._headerlength);
var view = new DataView(arrayBuffer);



//this.readEncryptionkey();
var key = "encryption key here";



if (arrayBuffer) {
var byteArray = new Uint8Array(arrayBuffer);
for (i = 0; i < this._headerlength; i++) {


//byteArray = byteArray ^ parseInt(Decrypter._encryptionKey, 16);
byteArray = byteArray ^ parseInt(key, 16);


view.setUint8(i, byteArray);
}
}

return arrayBuffer;
};


Then again, I haven't tested if it's possible to gain access to the encryption key like this but I thought it was best to say it.
 

_Shadow_

Tech Magician Level:
Moderator
Joined
Mar 2, 2014
Messages
4,088
Reaction score
2,681
First Language
Greek
Primarily Uses
RMMZ
8870f7145aeff544c65f4e342f200dceda253c6b43aba735d8a34b505a4f131f.jpg

This is fantastic!
 

Tuomo L

Oldbie
Veteran
Joined
Aug 6, 2012
Messages
2,416
Reaction score
1,323
First Language
Finnish
Primarily Uses
RMMV
The new update broke it, my compiled games boot into a black screen and nothing happens. Tried both normal optimization and no compression and still black screen.
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
This is weird... I checked the latest version and it worked for me. Is the deployed project set up right? If you can, can you show me the dev console's output? You'll need to run the deployed game on the SDK version of nwjs.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,935
Reaction score
1,395
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi @AceOfAces_Mod !
I'm just trying your tool right now. Does this works with mobile deployments?
Also, whats the difference of the Compression level?
- Added the command line argument --SetCompressionLevel to adjust the compression level (0 = Optimal, 1 = Fastest, 2 = NoCompression).
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
Hey, @Eliaquim .

1. The tool doesn't work with games that are deployed to mobile. The compiler coming with nwjs SDK (which my tool wraps around) is designed to only work on Desktop.
2. The --SetCompression command line argument adjusts the compression applied to the archive when the game files are compressed (setting the --CompressProject argument as well, which creates an archive named package.nw). It follows .NET Standard's API setting. So:

- Optimal is compressing the archive as best as possible, but it takes the longest to decompress.
- Fastest compresses the archive quickly but the space savings are smaller. Although it's faster to decompress than the optimal compression.
- No Compression doesn't apply compression to the archive at all. It's like you've never compressed it. This provides the fastest decompression but the archive will be just as big as the project before compressing it to an archive.

Now, which compression you'll choose which is up to you. If nwjs sees the package.nw, it will decompress it to a temporary folder before starting the game (on Windows, at least), which will cause some delay at startup. The more compression is applied, the more time it takes to start the game up.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,935
Reaction score
1,395
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hey, @Eliaquim .

1. The tool doesn't work with games that are deployed to mobile. The compiler coming with nwjs SDK (which my tool wraps around) is designed to only work on Desktop.
2. The --SetCompression command line argument adjusts the compression applied to the archive when the game files are compressed (setting the --CompressProject argument as well, which creates an archive named package.nw). It follows .NET Standard's API setting. So:

- Optimal is compressing the archive as best as possible, but it takes the longest to decompress.
- Fastest compresses the archive quickly but the space savings are smaller. Although it's faster to decompress than the optimal compression.
- No Compression doesn't apply compression to the archive at all. It's like you've never compressed it. This provides the fastest decompression but the archive will be just as big as the project before compressing it to an archive.

Now, which compression you'll choose which is up to you. If nwjs sees the package.nw, it will decompress it to a temporary folder before starting the game (on Windows, at least), which will cause some delay at startup. The more compression is applied, the more time it takes to start the game up.
Thank you for your answer!
I managed to make it work. However, I have a problem. When I try to test any game by the rpg maker mv editor it shows me this warning:
LLAs7QI.png


"An error has occurred in your profile

Your profile can not be used because it is from a newer version of NW.js. Some resources may not be available. Specify another profile directory or use a newer version of NW.js."

Even so, I can make it work. But there are two errors ocurring:
1 - The image has a small black bar on the sides. Really small.
2 - This plugin no longer works. It enabled me to add some lights on the map inside the editor, now it does not open anymore.
https://forums.rpgmakerweb.com/index.php?threads/lighting-and-time-editor-continued.86409/

I had already had this problem when I upgraded nwjs following this post:

https://forums.rpgmakerweb.com/inde...upgrade-nwjs-and-chromium-67-68-64bits.96908/

But, to fix the problem, i have to format my computer.
I though that the changes will be only applied to the project itself, but applied to all =/
I don't want you to solve the problems, because i figure it out that i only have to rollback to the older version of nwjs.
How can i do that?
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
"An error has occurred in your profile

Your profile can not be used because it is from a newer version of NW.js. Some resources may not be available. Specify another profile directory or use a newer version of NW.js."

Did you happen to run the game (deployed or not) with a newer version of nwjs? That's the most likely scenario. nwjs profiles aren't backward compatible with older versions. It's an easy fix: Windows Key + R -> type %localappdata% -> Click OK. -> Delete the folder named after the "name" variable in the game's package.json file.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,935
Reaction score
1,395
First Language
Portuguese - Br
Primarily Uses
RMMZ
Yes, i run the game with the newer version of nwjs that i download here to use with yout tool:
https://nwjs.io
When I saw the black bars, I suspected that it was the same problem that had happened to me before. So to confirm I opened other projects and the warning appeared.

I manage to do what you say "Windows Key + R -> type %localappdata%"
But i don't understando the other part you say abut the "name". Here what happens when i click OK after the command %localappdata%:
plwYhat.png
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
kG4x9qm.png

On the game's folder, there's a file named package.json. Open that file and look for a variable like the one on the photo above. The folder should be named like this (or if you added / on the variable, it will have the first section.

Looking at the image you uploaded, deleting the "KADOKAWA" folder should do it.
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,935
Reaction score
1,395
First Language
Portuguese - Br
Primarily Uses
RMMZ
This is my package.json
Bfh4Hod.png


I'm not understanding about this "variable". I did not find anything in package.json.
I do not know the name of this folder that I should delete.

I also delete the KADOKAWA folder, but the problem persisted = /

[EDIT] I type process.versions in the F8 and look what is showing:
ReYSmwb.png

[EDIT: Solved it.] - Manage to solve the problem with this post:
https://forums.rpgmakerweb.com/inde...urred-during-playtest-game-play-nw-js.103824/
 
Last edited:

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
I've released a new update for the tool (it will arrive on the Microsoft Store soon).

Core
  • Updated Newtonsoft.Json to 12.0.2.
UI
Changelog
  • Fixed a bug where the settings wouldn't be re-enabled after a failure.
  • Fixed a bug where the JSON editor would fill the icon location in the HTML file location text box instead of the icon location text box.
  • Improved the presentation of the output text.
CLI
Changelog
  • Improved the presentation of the text.
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
Hello everyone!

I released a new version of the tool (both of the UI and command-line version). Both of them will see performance improvements.

Changelog:
Common
- Ported over to .NET Core 3.
- Compiled with Ahead-Of-Time compilation.

UI
- Improved High DPI support.

CLI
- Added Greek Translation.
- Sight text cleanup.
- Reduced space consumption (except the UI version, due to crashes caused by the PublishTrimmed option).
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
Another update to the tool. This has some extra fixes and improvements.

Common
  • Technical improvements.
  • New compression system.
  • Slight to moderate performance improvements.
UI
  • Improved error messages.
  • The taskbar will now show progress.
  • Slight tweaks.
CLI
  • The CLI will throw a warning if the –PackageApp flag is active and the –ReleaseMode flag isn’t included.
  • Added the –CompressionSafeMode flag to use the old system.
 

HintonR

Veteran
Veteran
Joined
Mar 2, 2016
Messages
197
Reaction score
26
First Language
English
Primarily Uses
RMMV
Hi there.

Question about NWJS and upgrading. I'm currently working on a project I started in 1.5.1 and cannot upgrade due to compatibility issues with some plugins. Will it be okay if I just copy/paste a newer version of NWJS -- or will that break my current project.

Also, for clarification -- when I deployed a cooked project using this -- It is not clear to me about the can only run on that version and that platform. Meaning only people with the same specs of my computer as of deployment will able to run the game or... what did you mean about that (I understand non-cross-platform) but Windows to Windows, for example -- I run Windows 10. So it will not run on other Windows versions?

Thanks
 

AceOfAces_Mod

Engineering to infinity!
Veteran
Joined
Sep 7, 2014
Messages
1,730
Reaction score
1,204
First Language
Greek
Primarily Uses
RMMV
@HintonR ,
For the upgrade question, you can use a newer version of nwjs. The only reason to worry about compatibility issues is if you are using NodeJS scripts. If you are only using MV plugins, it shouldn't be a problem.

For the Windows compatibility question, it will work in older versions of Windows.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,125
Reaction score
10,657
First Language
Czech
Primarily Uses
RMMV
If you update nwjs on MV 1.5.1, the playtest button won't work though and you will need to playtest manually every time.
 

Latest Threads

Latest Posts

Latest Profile Posts

Time to add the support for import/export default RMXP maps. Maybe there will be customized tileset support later. In theory, I can reimplement the entire RMXP inside this RMXP-made game to make more RMXP games. :kaojoy:RMXPFORMATSUPPORT.jpg
Gonna make a story driven game someday in RPG Maker about this diseased character in my head. Will keep you posted, although I was warned by the authorities that posting too much would be considered 'spamming' so I WON'T SPAM. It'll be before I go in anyways. It's gonna be messed up but it won't be explicitly pornographic so don't worry, I'll give all the content warnings. :barf::barf::barf:
If you're a RM plugin developer, and you're reading this...

Thank you. You're awesome. Even if I haven't used your plugin, your work is appreciated.
Ami
tomorrow is the finale of my Endurance

Forum statistics

Threads
111,265
Messages
1,059,711
Members
144,554
Latest member
Neopren23
Top