It is currently 26 Apr 2024, 04:03
   
Text Size

Portable versions without Java install

An original game by ubeefx

Moderators: ubeefx, CCGHQ Admins

Portable versions without Java install

Postby Cyril » 31 Aug 2022, 22:00

Hi ubeefx. Do your games require Java to run? I would like to try them out, but need to avoid installing Java on my systems for security reasons. Thanks!

EDIT: For instructions on running the games without a Java installation and for creating portable versions on removable drives see the post below: viewtopic.php?f=92&t=31427#p253445
Last edited by Cyril on 04 Sep 2022, 16:18, edited 2 times in total.
Cyril
 
Posts: 53
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 32 times

Re: Java

Postby ubeefx » 01 Sep 2022, 18:48

Hi Cyril, indeed the games require at least a Java 8 runtime.
They are provided as a JAR (Java ARchive) file.
This is basically a zip file containing all application data.

It is possible to download OpenJDK 18 as a zip file.
This can be extracted somewhere in a folder, for instance to d:\jdk18.
To run the games, from a command prompt, the following can then be done.
Code: Select all
d:\jdk18\bin\java -jar Dreamwalkers-9.5.jar
d:\jdk18\bin\java -jar MadWizard-3.5.jar
These are some example screens from running the game like this.
It should work on all platforms supported by OpenJDK and does not really require "installing" something.
game1.jpg
game2.jpg
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 35 times
Been thanked: 249 times

Re: Java

Postby Cyril » 01 Sep 2022, 21:44

Thanks for your reply, ubeefx. This is very, very encouraging.

So I could download OpenJDK 18 and your games to a removable drive, then create a batch file with the command you give and run the games portably using that? This would be perfect.
Cyril
 
Posts: 53
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 32 times

Re: Java

Postby ubeefx » 02 Sep 2022, 17:54

Indeed Cyril, that is possible. :)

In this example batch file there is a wizard folder on a removable drive e:
It contains MadWizard-3.5.jar, MadWizard.zip, the jdk18 folder and wizard.bat.
Code: Select all
@echo off
set JAVA_HOME=e:\wizard\jdk18
%JAVA_HOME%\bin\java -Duser.home=e:\wizard -jar MadWizard-3.5.jar
Notice that with the user.home option it is also possible to put the save folder on the removable drive.
MadWizard.zip is a zip file with all scans and tokens, this file can be made manually as explained in help.
Currently it is around 1.8 GB. In the options this file can be specified.
options.jpg
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 35 times
Been thanked: 249 times

Re: Java

Postby Cyril » 03 Sep 2022, 14:33

Thanks, ubeefx! I followed your instructions and got a portable version of Mad Wizard working, including the MadWizard.zip file. I like the AI - it certainly seems more strategic and a greater challenge than other programs I've played. Next I will download Dreamwalkers.

Presumably, I can update to later releases by downloading the new game .jar and modifying the .bat file? Do I need to set up a new MadWizard.zip each time, or does each new release recognise the zip files from previous versions?

Lastly, and sorry if this is ignorant, but does the gameplay in Mad Wizard consist of choosing a preconstructed or random deck and then fighting though a gauntlet of enemies? Are the enemies preconstructed too, or are they randomly-generated decks? I like this format as I enjoy adapting new strategies as I play, and the AI seems to pose a good challenge - I'm just checking I've got the right idea!

Thanks for making this game and for your help!
Cyril
 
Posts: 53
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 32 times

Re: Java

Postby ubeefx » 03 Sep 2022, 17:07

That is good to hear Cyril! =D>

For newer versions it will be sufficient to add the new jar and update the version in the batch file.
The game is able to use the zip file together with the scans folder for card images.
When downloading the new images, it will only download the images not present in the zip file and scans folder.
Dreamwalkers does not need to download images so that game is even easier to update.

You describe the Mad Wizard gameplay correctly.
Every deck theme is a random deck generator that follows a certain theme.
The AI uses exactly the same randomly generated decks as the player gets according to the AI player theme.

Enjoy! :)
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 35 times
Been thanked: 249 times

Re: Portable versions without Java install

Postby Cyril » 04 Sep 2022, 16:22

Thanks again! Incidentally, I didn't get any token images when downloading the images - but everything else works really well!

I have modified the first post and the thread title to help others searching for the same solutions.
Cyril
 
Posts: 53
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 32 times

Re: Portable versions without Java install

Postby ubeefx » 04 Sep 2022, 18:54

The game currently does not download token images. It does generic rendering for the tokens instead.
I have a collection of around 200 token images. It is not complete but a nice start. 8)
I provided a download link here and in the download links topic.

Download Tokens
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 35 times
Been thanked: 249 times

Re: Portable versions without Java install

Postby Cyril » 05 Sep 2022, 19:42

Thanks again, ubeefx - I appreciate your help.

I discovered something interesting in running Mad Wizard portably. I set up the game on a device where the removable drive was the E:\ drive. I then tried to play the game on another device where the removable drive is F:\ by default. Obviously, I had to write a new .bat file to get the game to run but, interestingly, the game still recognised the MadWizard.zip, even though it was set to E:\ in the options. This is a big advantage, as I can move from machine to machine very easily.

Incidentally, I'm not sure what the 'popup' and 'phase' options do in Mad Wizard. And is the AI at its hardest difficulty when the toggle button is light or dark?

I am very much enjoying this game; thanks for making it available to the community!
Cyril
 
Posts: 53
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 32 times

Re: Portable versions without Java install

Postby ubeefx » 06 Sep 2022, 18:00

What could also be the reason why this worked is that the card scans are available in the scans folder.
When the zip file is not present or does not contain the image, it will use the regular scans folder.

The popup and phase delay settings are both in milliseconds.
Popup determines how long it takes before the popup card image will appear when hovering over cards.
Phase determines how much time there is between phase changes.

There are four possible combinations of settings for the AI.
  • MiniMax or Vegas (when the dice toggle button is selected and shown in dark).
  • Low or High (when the head toggle button is selected and shown in dark).
Glad you enjoy the game! :D
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 35 times
Been thanked: 249 times

Re: Portable versions without Java install

Postby Cyril » 06 Sep 2022, 20:58

Thanks as always! I will look forward to future updates!
Cyril
 
Posts: 53
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 32 times

Re: Portable versions without Java install

Postby Cyril » 23 Oct 2022, 19:16

Hi ubeefx! I having difficulty getting MadWizard 4 to run with my portable setup.

Following your advice, under my old setup I had Open JDK and the MadWizard jar files in a file called 'wizard' on a portable drive. The batch file to run the program was therefore
Code: Select all
@echo off
set JAVA_HOME=e:\wizard\jdk18
%JAVA_HOME%\bin\java -Duser.home=e:\wizard -jar MadWizard-3.9.jar
I downloaded the MadWizard 4 zip from Github and extracted the file. This created a folder called 'madwizard-main'. I moved this folder to the top level on the drive, and added open JDK to the folder. My new batch file was therefore
Code: Select all
@echo off
set JAVA_HOME=e:\madwizard-main\jdk18
%JAVA_HOME%\bin\java -Duser.home=e:\madwizard-main -jar MadWizard4.jar
However, this did not work (i.e. the program did not run) and I am unsure why.

I am also a bit concerned about how to update to new versions going forward. The beauty of the old system was that when you released a new version, I downloaded it to my wizard folder, amended the batch file to the new version number and could immediately continue with my old campaigns and settings in the new version. It was wonderfully easy! I am not sure how to do this with the Gitub release (where should my existing saves, scans, config files go for instance? Would I have to manually copy them to any new madwizard-main download?)

You'll have realised that I am not programmer so these may be stupid questions. I also appreciate your generosity in opening the project up so that other people can mod it easily. But I wondered if you still planned to release the single .jar file updates as before, mainly for simple people like me whose main interest is in playing MadWizard and Dreamwalkers?!
Cyril
 
Posts: 53
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 32 times

Re: Portable versions without Java install

Postby Aswan jaguar » 24 Oct 2022, 05:28

Cyril wrote:Code: Select all
@echo off
set JAVA_HOME=e:\madwizard-main\jdk18
%JAVA_HOME%\bin\java -Duser.home=e:\madwizard-main -jar MadWizard4.jar
The issue might be that you are missing a - after MadWizard so MadWizard-4.jar
---
Trying to squash some bugs and playtesting.
User avatar
Aswan jaguar
Super Tester Elite
 
Posts: 8078
Joined: 13 May 2010, 12:17
Has thanked: 730 times
Been thanked: 458 times

Re: Portable versions without Java install

Postby Cyril » 24 Oct 2022, 11:47

Thanks, Aswan Jaguar. The .jar file is correctly named - i.e. it is MadWizard4.jar in the latest release. However, your message made me look at the problem again and I made some progress.

The new batch file is correct, but what I didn't realise it that it has to be within the folder containing the .jar file and the Open JDK folder - in this case the madwizard-main folder. A .bat file with the following code will then launch Mad Wizard 4. This could be a beginner's mistake!

Code: Select all
@echo off
set JAVA_HOME=e:\madwizard-main\jdk18
%JAVA_HOME%\bin\java -Duser.home=e:\madwizard-main -jar MadWizard4.jar



I got the game to run, but obviously without images, my previous campaigns and settings.
To correct this, I then copied my old MadWizard folder (containing decks, scans, saves and tokens folders and the config file) into the new madwizard-main folder in order to continue with previous campaigns and settings.

All of this makes upgrading to new versions a little more complex because the user needs to put the OpenJDK and MadWizard folders into any newly-downloaded madwizard-main folder manually- I would be interested to know if there is an easier way!
Cyril
 
Posts: 53
Joined: 06 Jun 2022, 15:00
Has thanked: 33 times
Been thanked: 32 times

Re: Portable versions without Java install

Postby ubeefx » 24 Oct 2022, 18:24

Glad to hear you got it working Cyril. :)

Putting Mad Wizard on GitHub makes the project more accessible and the modding possibilities make it more interesting for users.
I do not plan to do the same for Dreamwalkers or Magarena 2.0.
Also the previous jar releases of Mad Wizard are still available.

I created a tag for this release : Mad Wizard Tags
It is possible to download a zip file for a tag. This can be considered as the release.

This setup is actually more flexible than you think.
The MadWizard4.jar is the jar file to execute.
The only requirement is that the plugins.cfg is in the same folder as where you run MadWizard4.jar.
In plugins.cfg there is a folder setting, default is . or current path.
This can be however any other folder reference, like folder=c:/games/madwizard-main
The Java runtime can be in any folder, the one you reference with JAVA_HOME.
Normally Mad Wizard 4 uses the same home folder as Mad Wizard 3 in the users folder.
With the user.home setting this can be changed and again it can be located anywhere.
It is indeed best to put your batch file in the same folder as the jar.
However it is possible to first change directory in the batch file too.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 35 times
Been thanked: 249 times

Next

Return to Dreamwalkers

Who is online

Users browsing this forum: No registered users and 25 guests


Who is online

In total there are 25 users online :: 0 registered, 0 hidden and 25 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 25 guests

Login Form