Took a look at this. Im guessing the crossed lines represent the tiles when I select my map and wait for it to load? This is all I saw, map loaded very quick after so couldnt tell if it was drawing tile by tile.
In game changed my zoom and did catch the tiling effect (saw the crossed lines blur by) but machine is too fast for any noticeable visual clue. Need a larger map perhaps. This map was 3100 x 2500 actual. Any map recommends to try this against?
I was hoping the logic could be encapsulated in a board-drawing class that could be easily swapped in and out. If it’s not easy to plug in a preferences setting, then that’s fine; we can test it in beta and see if there are any problems.
Ah - I saw the little swirly moving graphic in the tiles for a second. I
think that works good for those waiting - its indicative of whats going on.
Can the moving graphic be changed to something very obvious like a sand
timer or stop watch/clock hands?
So it was so fast that you didn’t even see the spinners?! Well, in your
case you don’t need any visual cue, then!
Try loading the World in Flames module, with the Global War scenario.
When the map comes up, scroll all the way to the right, in order to
trigger loading of all of the maps.
That’s a pretty common motif these days. E.g., a spinning wheel like this
is used as a loading indicator in Firefox (look in the upper right, or on
a loading tab), Safari, and on sites which style themselves “Web 2.0”.
Good work, I’m more than happy with the spinner. I was concerned you might create something obnoxious but instead it’s pleasant and unobtrusive. Any further effort looking for something better is probably not time well spent.
I meant the one you’ve currently chosen Joel. Circle Ball?
By the way, with your recent releases, when zooming in and out of the map the view window is not centering correctly. It seems to jump to different parts of the map. Give it a try and you’ll see what I mean.
Joel when trying to open the full map in one go, the Case Blue module is throwing Null Pointer Exceptions. Seems to only work when I split the map into at least 2 pieces.
I need the stack trace, in the errorLog. This gives stack traces for all
threads at the time when you generated it, when the NPE is already in the
past.
It looks like a memory issue. When I set it to -Xmx1300, it works; But not with 512M. It looks like the single map is loading a lot quicker too. With the 2x2 tiled images it takes around 20 seconds to load but when I do the entire map, it takes only around 5 seconds, seems much quicker.
The module is here… just hit “New” when prompted for a setup.
I can load your Case Blue map with only 512MB heap with this build,
though it does take about 40 seconds on my 2GHz Core 2 Duo T7300.
All images which enter the graphics pipeline in these builds get
converted to TYPE_INT_ARGB if they can’t be loaded with that type.
PNGs can often be loaded directly to TYPE_INT_ARGB. The ImageReaders
which are available for JPEGs tend not to give any that use integer
buffers.
These are the three opions ImageIO gives for loading your Case Blue map:
type = TYPE_3BYTE_BGR
java.awt.image.PixelInterleavedSampleModel@c2553a91
DataBuffer = TYPE_BYTE
type = TYPE_BYTE_GRAY
java.awt.image.PixelInterleavedSampleModel@c4b8ccd8
DataBuffer = TYPE_BYTE
type = TYPE_CUSTOM
java.awt.image.PixelInterleavedSampleModel@ba1290a1
DataBuffer = TYPE_BYTE
All of these suck: The first one is bad because it stores the channels
in the opposite order from what we want and uses only 3 bytes per pixel.
The second one is grayscale, and the third one is TYPE_CUSTOM, which means
that you have to convert it anyway before using it.
Back to loading your image: java.awt.image.ColorConvertOp is what we’re
using to convert images from one ColorModel to another. Something I didn’t
know until I looked into this bug is that ColorConvertOp allocates a scatch
BufferedImage for doing its work. That’s fine except when the image you
want to convert is so big that there’s no space left for allocating a
scratch image of the same size. In that case, Game Over, you run out of
memory.
So, now I’m catching the OutOfMemoryException and doing a manual copy,
row by row in case the image is too big for ColorConvertOp.
I tried converting the map to a PNG with an alpha channel so it can
be loaded without conversion, but that blows up the file size to 97MB
and makes it take about 10 seconds longer to load.
I’m messing with some other things right now. Often you can reduce the
number of colors (but not the color depth!) in a scan and actually improve
the image, since a scan will frequently give you color variation over areas
which should have constant color…