first "development" build, please try

Here’s a link to the first of what I’d like to call our “development”
series of builds, indicated by SVN version number:

nomic.net/~uckelman/tmp/vass … vn2708.zip

In this build, you’ll find implementations of:

  • RFE #1637163: make VASSAL faster, more responsive
  • RFE #1566177: Implement JAI tiled images to reduce memory usage
  • RFE #1565958: Zooming to larger than 100%

Specifically, it should now be possible to load much larger modules
now than before, due to memory-sensitive caching and writing large
images to disk.

Additionally, you’ll find the following known issues:

  • Requires Java 1.6+ because I haven’t added the SwingWorker.jar yet.
  • Much diagnostic stuff spewed to the terminal.
  • Occasional weird behavior when loading Board images: Whenever the
    first Board image gets in the queue ahead of the button images,
    repaint performance is bad and I haven’t been able to figure out why
    yet.
  • Memory-mapped temp files might not be cleaned up if VASSAL crashes.
  • Large modules will require quite a bit of disk space at runtime. If
    you needed 1GB of heap to run a module using the 3.0.x series, then
    there’s a good chance that you’ll be able to run the module with only
    512MB of heap (or less) now, but with 1GB of disk space used by temp
    files while VASSAL is running. I don’t work miracles, the storage has
    to come from somewhere…
  • It’s almost certainly the case that you’ll be able to find bugs I
    haven’t spotted yet. Let me know what you find so we can move toward
    a “testing” release.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Hi Joel,

I am unable to run this on my XP system. If I run the VASSAL.bat. I get

‘Could not find the main class’.

I have been trying to run it manually, without success yet.

Regards,
Brent.

Thus spake “Swampwallaby”:

Have you looked at contents of the batch file? I modified it slightly
from the default (becuase I didn’t include docs.jar in my rush to get
this packaged up), but I’m not certain that what I did is appropriate
for a Windows system.

What happens when you try to run it manually?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Swampwallaby”:

I sat down at a Windows machine just now, and I see what the problem is:
Apparently it doesn’t work to set the classpath as 'lib/’ in Windows.
Oddly, it does seem to work if I set the classpath to lib/Vengine.jar;lib/
.
I don’t get it—maybe you can shed some light on this?

That change is all I needed to get this build to start—but you’re going
to encounter an ArrayIndexOutOfBoundsException right away anyhow if the
‘new user’ screen comes up for you. I hadn’t seen this before, as it’s
never shown on my system.

I’m writing this as I go—I’ve fixed the Exception—it was happening
because I missed merging 2569:2570 from trunk.

Here’s a newer build, which should fix both problems:

nomic.net/~uckelman/tmp/vass … vn2715.zip


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Hi Joel,

Tried to run this on one of the older versions of my CC behemoth.
Start up screen - super fast :slight_smile:
but after that it crashed and burned because of the about screen and predefined setups

– OS Windows 2003
– Java version 1.6.0_01
– VASSAL version 3.1.0-svn2714
[VASSAL.build.module.documentation.AboutScreen: null]
java.lang.NoClassDefFoundError: org/netbeans/spi/wizard/WizardBranchController
at VASSAL.build.GameModule.getWizardSupport(GameModule.java:158)
at VASSAL.build.module.documentation.AboutScreen.setAttribute(AboutScreen.java:208)
at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:57)
at VASSAL.build.Builder.create(Builder.java:107)
at VASSAL.build.Builder.build(Builder.java:63)
at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:69)
at VASSAL.build.module.Documentation.build(Documentation.java:73)
at VASSAL.build.Builder.create(Builder.java:107)
at VASSAL.build.Builder.build(Builder.java:63)
at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:69)
at VASSAL.launch.BasicModule.build(BasicModule.java:104)
at VASSAL.launch.BasicModule.build(BasicModule.java:72)
at VASSAL.build.GameModule.init(GameModule.java:680)
at VASSAL.launch.LoadModuleAction.loadModule(LoadModuleAction.java:53)
at VASSAL.launch.LoadModuleAction.performAction(LoadModuleAction.java:46)
at VASSAL.launch.GameModuleAction.actionPerformed(GameModuleAction.java:57)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
[VASSAL.build.module.PredefinedSetup: null]
java.lang.NoClassDefFoundError: org/netbeans/spi/wizard/WizardBranchController
at VASSAL.build.GameModule.getWizardSupport(GameModule.java:158)
at VASSAL.build.module.PredefinedSetup.addTo(PredefinedSetup.java:194)
at VASSAL.build.Builder.build(Builder.java:65)
at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:69)
at VASSAL.build.Builder.create(Builder.java:107)
at VASSAL.build.Builder.build(Builder.java:63)
at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:69)
at VASSAL.launch.BasicModule.build(BasicModule.java:104)
at VASSAL.launch.BasicModule.build(BasicModule.java:72)
at VASSAL.build.GameModule.init(GameModule.java:680)
at VASSAL.launch.LoadModuleAction.loadModule(LoadModuleAction.java:53)
at VASSAL.launch.LoadModuleAction.performAction(LoadModuleAction.java:46)
at VASSAL.launch.GameModuleAction.actionPerformed(GameModuleAction.java:57)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Took out the pre defs and still hit the tarmac (this time just about screen error)

– VASSAL version 3.1.0-svn2714
[VASSAL.build.module.documentation.AboutScreen: null]
java.lang.NoClassDefFoundError: org/netbeans/spi/wizard/WizardBranchController
at VASSAL.build.GameModule.getWizardSupport(GameModule.java:158)
at VASSAL.build.module.documentation.AboutScreen.setAttribute(AboutScreen.java:208)
at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:57)
at VASSAL.build.Builder.create(Builder.java:107)
at VASSAL.build.Builder.build(Builder.java:63)
at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:69)
at VASSAL.build.module.Documentation.build(Documentation.java:73)
at VASSAL.build.Builder.create(Builder.java:107)
at VASSAL.build.Builder.build(Builder.java:63)
at VASSAL.build.AbstractBuildable.build(AbstractBuildable.java:69)
at VASSAL.launch.BasicModule.build(BasicModule.java:104)
at VASSAL.launch.BasicModule.build(BasicModule.java:72)
at VASSAL.build.GameModule.init(GameModule.java:680)
at VASSAL.launch.LoadModuleAction.loadModule(LoadModuleAction.java:53)
at VASSAL.launch.LoadModuleAction.performAction(LoadModuleAction.java:46)
at VASSAL.launch.GameModuleAction.actionPerformed(GameModuleAction.java:57)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
– Combat Commander version 1.80
java.lang.NoClassDefFoundError: org/netbeans/spi/wizard/WizardBranchController
at VASSAL.build.GameModule.getWizardSupport(GameModule.java:158)
at VASSAL.launch.ConsoleControls$3.run(ConsoleControls.java:85)
at VASSAL.launch.GameModuleAction.runActions(GameModuleAction.java:86)
at VASSAL.launch.GameModuleAction.actionPerformed(GameModuleAction.java:59)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source

Tim

Thus spake “Tim M”:

Are you running it from the included batch file? If so, the problem is
most likely that I still don’t have the wildcard syntax correct for
indicating the classpath. I haven’t used Windows actively in a decade,
so my Windows batch file skills are not what they once were.

What I have in VASSAL.bat is:

start javaw -client -Xmx512M -cp lib/Vengine.jar;lib/* VASSAL.launch.Main

My understanding of the classpath is that that the ‘lib/Vengine.jar’
part should be unnecessary—this should work with ‘lib/’ only. (It
does work on Linux, but you need to quote 'lib/
’ in order to prevent
shell expansion of the ‘*’.)

If you replace the argument to -cp with this mess:

lib/BrowserLauncher2-10.jar;lib/Vengine.jar;lib/batik-awt-util.jar;lib/batik-bridge.jar;lib/batik-css.jar;lib/batik-dom.jar;lib/batik-ext.jar;lib/batik-extension.jar;lib/batik-gui-util.jar;lib/batik-gvt.jar;lib/batik-parser.jar;lib/batik-script.jar;lib/batik-svg-dom.jar;lib/batik-svggen.jar;lib/batik-swing.jar;lib/batik-transcoder.jar;lib/batik-util.jar;lib/batik-xml.jar;lib/js.jar;lib/pdf-transcoder.jar;lib/smack.jar;lib/smackx-debug.jar;lib/smackx.jar;lib/wizard.jar;lib/xerces_2_5_0.jar;lib/xml-apis.jar

it should work, but the point of using wildcards is to avoid such things.

Can anyone help us with this?


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Using the long path works np.

1st observation - saw all those happy memtemp files being created. Mucked about a bit nothing strenuous, then exited (did not crash). Seems the clean up will erase some of these temps but not all - had about 7 but it left 3 of them

2nd. Large maps - scrolling to new areas not yet seen initially painful waiting for area to load, but once its loaded, going back after is a snap - no wait scrolls very quick

3rd. I just love the new zoom feature :slight_smile:

Thus spake “Tim M”:

I suspected that I’d have to add a check at start-up to remove stale
temp files. It’s strange that between setting File.deleteOnExit(true)
and having a finalize() method which calls File.delete() explicitly,
this isn’t sufficient to remove all of the temp files when VASSAL is
exited normally.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

The time-to-load for a map should be about the same as it was before, except
that now it happens when it’s first displayed instead of when you load the
module. However, now it’s happening in the background, so you should still
be able to do other things (like scroll) while you wait.

Do you have a suggestion for how to improve the experience here?

Thanks.

Joel, my understanding is the reason the classpath is expanded under UNIX systems is because the UNIX Shell is doing the wildcard expansion, not Java.
In Windows, this job must be done by the programmer. I’ve seen devs write code to parse through a jar folder, I’m pretty sure this is the only way.
So the solution is not to expect the -classpath switch, just do it in code, that way it’ll work under both UNIX and Windows; And it’s fire and forget.

Some more info here

Thus spake “bsmith”:

The UNIX shell can’t possibly be doing the expansion because:

  1. I have the * single-quoted: -cp ‘lib/*’

  2. If I didn’t, bash would lib/* would expand to a space-, not a colon-
    separated list, which would appear to java to be multiple distinct
    arguments, not one single argument as it should, and that wouldn’t work
    at all.

The link tells me that it is supposed to work exactly like I thought it
did, which still leaves me puzzled as to why it fails on Windows—namely
because it’s java that expands the wildcard, not the shell (on either OS).


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

They’ve only had wildcard support since late '06 right? Could it be a bug?

Thus spake “bsmith”:

I have seen the solution, and the solution is double quotes.

The Windows shell kindly tries to expand the * in lib/* for us.
What we need is to guard it. If the batch file reads like this,
it works:

start javaw -client -Xmx512M -cp “lib/*” VASSAL.launch.Main

Here’s a somewhat updated build, containing this fix and a few
others:

nomic.net/~uckelman/tmp/vass … vn2727.zip


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

“lib/*” didn’t work for me Joel.

Im back using the long path again

Just gave it a try Joel, looks good!

A couple of things; Now that zooming is fast, what does everyone think about having it mapped it to the mouse scroll wheel?

The initial loading of the map is a little slow, so is there some way we can show an unobtrusive progress bar somewhere while this is happening (so the user can still scroll around)? I’m worried some users will get impatient and report a bug.

One more thing, when you click on “Load saved game” right after loading a module, can we have that going straight to the File Select dialog? This is pretty much my #1 grievance with Vassal right now, especially with so many PBEM games going.

I’m using Vista and Java 1.6.0_03 and the classpath fix worked fine for me Tim.

I’ve noticed the tmp files are not being cleaned up after closing Vassal normally. I’ve got around 8 of them so far.

Try Runtime.addShutdownHook() It has the advantage of working even if somebody CTRL-C’s the program. If you create a dedicated sub-directory in /tmp and put all the temp files in there, you can simply delete the entire directory on shutdown.

rk

Post generated using Mail2Forum (mail2forum.com)

Strangely, when I run this with -Xmx1024M it throws these errors. Works fine with -Xmx512M. When I watch the process, it gets to around 750Mb:

java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(Unknown Source)
at VASSAL.tools.memmap.MappedDataBufferInt.(MappedDataBufferInt.java:33)
at VASSAL.tools.memmap.MappedBufferedImage.(MappedBufferedImage.java:12)
at VASSAL.tools.imageop.MemoryMappedSourceOp.apply(MemoryMappedSourceOp.java:27)
at VASSAL.tools.imageop.AbstractOp.getImage(AbstractOp.java:25)
at VASSAL.tools.imageop.CropOp.apply(CropOp.java:30)
at VASSAL.tools.imageop.OpRequest.doInBackground(OpRequest.java:22)
at VASSAL.tools.imageop.OpRequest.doInBackground(OpRequest.java:11)
at javax.swing.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at javax.swing.SwingWorker.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
… 18 more

Im using XP Pro64 and same Java as you Ben, but it wont launch unless I go with the long path

related - these sh/bat files seem to be problematic at best. Rodney just set up a stand alone for my latest mod release using these, and while the sh/bat works fine for some users Im getting lots of emails and reports on CSW it does not for others - they are having to go in and tinker all sorts of ways with these files till it works on their machine - 1 fix for user A is not necessarily the fix that user B needs.

For example, one guy needed to put “” into the sh script around dir$0, while another guy just had to rename the file so it had no spaces without editing etc… - its all greek to me (mac/linux) , but it is causing problems for sure - Im hesitant to fix or change things because Rodney said the sh script worked for him and i havent changed it - but universal solution would be useful

If only I had a dollar for each time classpaths caused a problem. :smiley: