• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Experimental WC3 loading performance booster

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I have created a small experimental Java program that tries to boost the load performance for WarCraft III.

It works by forcing your system to page in various WarCraft III data files into main memory. This causes there to be no hard page faults (reading from hard disk) when WarCraft III goes to load an asset. The speed benefit is only when loading an asset so it will not make WarCraft III run better. Also remember that WarCraft III will produce its own file cache meaning it will not grant better loading times for maps already played. What it does do is shorten initial loading times giving you performance similar to consecutive loading times.

WC3BOOST
Requires: Windows XP or better running Java 7
Program will not help people which do not have over 1 GB of free memory when playing WarCraft III. Automatically finds WarCraft III install path using system memory.

Why no Mac support?
I do not know how to find the data files for WarCraft III on Mac operating systems.

Simply run the program and then proceed to play WarCraft III or use World Editor. If you have console enabled it is best to leave the program running in the background to reduce the likely hood that the data file pages will get freed.

Results from a clean start (system just turned on).
WarCraft III The Frozen Throne boots a few seconds faster (still slower than consecutive boots but that is due to the game loading system libraries).
World Editor loads a map with a lot of art assets a few seconds quicker.
WarCraft III will load your favourite map a few seconds quicker (like you played it before).
When an art asset is created without being preloaded via script, fewer frames will get dropped.

Such tools as this could be very helpful when playing games like Diablo II where initial loading causes a lot of dropped frames and can endanger your character when teleporting due to your reduced ability to respond.
 

Attachments

  • WC3BOOST.zip
    7 KB · Views: 406
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
If you are using a windows operating system and WarCraft III is installed correctly (the registry contains correct keys) then it will work.

Nothing is needed to popup and it should have loaded all WarCraft III data files into memory.

I will work on a UI at a later stage, until then use a console if you want to read what happens.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
WarCraft III will load a lot faster (only really noticeable first time you start it since a system reboot). Most importantly maps will load a lot faster because all art assets are already in memory and just need to be loaded into the game.

The two areas where speed improvements are most noticeable are.
1. Loading a map in WorldEditor.
2. Starting a map session the loading phase will complete faster.

Data read by WarCraft III is naturally cached so you should not notice any improvement beyond getting the performance for loading a map a second time on the first time.
 
Level 12
Joined
Mar 13, 2012
Messages
1,121
Gives me the error
'Could not find the main class: loadenhancer.main.LoadEnhancer.
Program will exit.'

If it only gives some seconds of reduced time in loading World Editor test maps I wonder how many hours of my life could have been saved with that : )
 
Level 10
Joined
May 27, 2009
Messages
494
hmm

what does this thing do?
A force passing of data to the main memory instead of the paging file?
Sounds cool... but i think it may cause some little system instability with multi tasking... esp it runs under java o.o

Does it needs to run on every system startup?
Does it modify registry keys?
Is the memory flushed the same way windows flushes memory on shutdown or with the event of Windows that flushes memory?
How long the data will last? Until memory flush(shutdown) or forever?

or it just pushes the data into the memory?

o.o
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
A force passing of data to the main memory instead of the paging file?
It forces all the pages of the WarCraft III data files into main memory. Even if they are not referenced they will sit there until some other page eventually wipes them (which is unliklely to occur any time soon).

Sounds cool... but i think it may cause some little system instability with multi tasking... esp it runs under java o.o
Once the program has finished all the WarCraft III data files are left in memory as soft pages. They will get used if the files are required but will get cleaned if the system runs low on memory so there is no negative performance impact. The only possible negative performance would be if you have too little memory or are relying on the memory to cache some other data files in which case it will cause a lot of pages to be written out that can cause page faults in the future.

Does it needs to run on every system startup?
Once before each extensive use of WarCraft III. Even if you used it before and have not restarted your PC it is possible that the WarCraft III data file pages will get cleaned from memory and replaced with other files after enough time and use.

Does it modify registry keys?
It is meant to only read it. This is how I get the installation directory of WarCraft III to load the data files from. It uses the protected Windows class used by the Java API for interacting with the Windows registry so any problems with it modifying your registry is caused by your installation of Java and is likely a problem you should raise with the company that maintains Java.

Is the memory flushed the same way windows flushes memory on shutdown or with the event of Windows that flushes memory?
While the program is running the memory pages will not be low priority and will probably not get freed until low on system memory. When the program closes all files are treated like every other memory mapped file used by every normal I/O operation on Windows systems and will eventually have pages freed when low on system memory (although it will remain higher priority that less recently used files loaded into memory).

How long the data will last? Until memory flush(shutdown) or forever?
Until the page manager decides it needs the pages in memory for other purposes such as processes or different files. You can forcefully flush all such pages using developer tools but this does cause a massive number of hard page faults (degraded system performance until the working sets are rebuilt).

This program is hardly that cleaver. It just is more to make people aware of how operating systems cache file data as pages in memory which is why WarCraft III loads instantly the second time you start it but takes many seconds the first time.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I prefer C++ so it would be easier.
It is far from easier to make with C++. Most of the time I would have to spend making simple list structures to support the nescescary opperations. I do agree that it would be more efficient though as you can then use the memory mapped file objects directly and force it to load in each page (functionality that is abstracted away in Java).

Java always crashes like fatal errors.
I have never had that happen. The JRE you are using must be incorrectly set up or faulty.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Yes, all it does is force WarCraft III game files into memory. If you have a modern computer with 4-8 GB of memory this can dramatically reduce loading times as it will not have to read anything from disk while playing. If you have 256 or 512 MB of memory then this will not do anything next to take ages to run and cause a large number of hard page faults. The program will not do anything unusual to your memory as the data file pages will get unloaded as the system requires memory.

It does not load system libraries. Starting WarCraft III or WorldEdit for the first time will be slower than the second time even after running this program because it has to load the system libraries into memory. This is an area that has to be looked at but is also potentially problematic for portability.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Yes, all it does is force WarCraft III game files into memory. If you have a modern computer with 4-8 GB of memory this can dramatically reduce loading times as it will not have to read anything from disk while playing.

I am using DELL Inspiron laptop
Model: N5110
4 GB RAM
Java 6
intel Core i5
Windows 7
NVIDIA GeForce GT 525M

Does anything of the above don't match the requirements ?

I am getting this error:

126172-albums1967-picture57856.jpg
 
Level 4
Joined
Apr 30, 2012
Messages
59
Suggestion:
BTW bro you can update your work by just use C++ then archive your jar file in the exe.
Then when the exe is executed it will execute the jar file. Put also additional settings, etc.
Put also Icon to make it more professional and beautiful looking. :wink:
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
Well, I'm not happy if map loads in 5 seconds, since MOST of the time I do background stuff, like changing music, eating, drinking.. I'd rather wait few more seconds to load instead of hurry everytime a game is about to start...

There is a simpler solution ...
don't use it that way you can get the extra seconds :p :grin:

Anyway, I can't make it work and I don't know how to install java 7 the site informs me that it may have errors and is not ready to be installed on my machine
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Anyway, I can't make it work and I don't know how to install java 7 the site informs me that it may have errors and is not ready to be installed on my machine
What site? Java is installed via an executable you download.

BTW bro you can update your work by just use C++ then archive your jar file in the exe.
Then when the exe is executed it will execute the jar file. Put also additional settings, etc.
If I am going to use C/C++ I will rewrite the program in C/C++ since I would have direct access to the memory mapped file libraries and registry manipulation libraries so the program would be slightly more efficient.
 
Level 16
Joined
Mar 3, 2006
Messages
1,564
This tool has nothing to do with download... It makes loading assets faster as it caches them to memory instead of having to read them at map load time from disk (which is a hard fault).

I mean I didn't notice a change in the loading not downloading, perhaps it make it faster but when I looked at the loading bar I didn't notice there were a difference.
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
None of them didn't work.... It gave me a error.

I clicked all the files and ran them by Java but all of them gave me this error. See the picture... It says (In Japanese) It has problems in some of the lines.

EDIT:The file doesn't contain the "WC3BOOST2" file..... Please tell me how to use this.
 

Attachments

  • temp.jpg
    temp.jpg
    187.2 KB · Views: 104

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
The file doesn't contain the "WC3BOOST2" file..... Please tell me how to use this.
You need to run the archive file, it will automatically find the main class and execute the program if you meet the system requirements (you need Java 7).

If your registry is not configured correctly then....
Right click where the .jar file is located.
Choose "Open command window here...".
Then type "java -jar WC3BOOST2.jar" without the ".
A command line window will appear showing printing out various English text (which I used to test its operation).
If it says the command is invalid or not found then Java is not installed or Java is installed incorrectly.

Be aware that you need ample memory to load both WC3 and all the game files into memory at the same time. Otherwise this tool will mess up all file caches and degrade performance.

I am sorry about usability problems. It is far from perfect and is more an experimental process to see if the idea was worth perusing. I still need to try it with Diablo II where loading caused frame dropping when first entering areas (which sometimes resulted in nasty near death experiences).
 
Level 14
Joined
Jul 25, 2011
Messages
1,065
You need to run the archive file, it will automatically find the main class and execute the program if you meet the system requirements (you need Java 7).

If your registry is not configured correctly then....
Right click where the .jar file is located.
Choose "Open command window here...".
Then type "java -jar WC3BOOST2.jar" without the ".
A command line window will appear showing printing out various English text (which I used to test its operation).
If it says the command is invalid or not found then Java is not installed or Java is installed incorrectly.

Be aware that you need ample memory to load both WC3 and all the game files into memory at the same time. Otherwise this tool will mess up all file caches and degrade performance.

I am sorry about usability problems. It is far from perfect and is more an experimental process to see if the idea was worth perusing. I still need to try it with Diablo II where loading caused frame dropping when first entering areas (which sometimes resulted in nasty near death experiences).

Yes. I don't understand why but, I installed java 2 times and the java icon doesn't appear... When I google java it shows a lot of versions. Which one is correct?
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,467
Since it is not faster than recursive opening (taking from Windows 7 inactive memory), wouldn't the performance gain in fact be better by starting wc3, loading a map and its assets, then closing warcraft 3 and then it will run faster the second time? Having to load them to begin with defeats the benefit for me.

The idea is good, and can be quite useful for people who are stocked up on RAM and running Vista or XP. Howver, I think Windows 7 users and Mac OS X users with the system's superior RAM management (by using inactive RAM) have the best edge here from the start. Please correct me if I am missing something here.

SSD's still have the best overall benefit by annihilating load times for games and software. People who want more storage space without paying truckloads of $/€/£ can opt for a Hybrid drive which provides a massive amount of cache for the most frequently accessed files.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
All Windows 7 interactive memory does is load a lot of once off installers into memory on start-up for no apparent reason. None of my game data files are preloaded.

The idea was a program that is more convenient than having to play the map once (with poor load times). It is also more efficient at loading than the actual game because it requests data sequentially where as the game will load data in a fragmented way (due to how the MPQ archive is structured).
 
Status
Not open for further replies.
Top