Java map viewer applet

Started by Maxim, September 03, 2007, 04:14:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Maxim

Here are some test maps. Page weights are about 10% of the PNG file size for large images, and browser memory usage will be vastly less, even with the Java runtime overhead.



Castlevania-CircleOfTheMoon-Castle.png 16.1MB -> 1.2MB

http://www.smspower.org/maxim/forumstuff/maptest/cv.html">http://www.smspower.org/maxim/forumstuff/maptest/cv.html



EarthBoundZero(J)-World.png 4.1MB -> 169KB

http://www.smspower.org/maxim/forumstuff/maptest/earthbound.html">http://www.smspower.org/maxim/forumstuff/maptest/earthbound.html



soniccd11apalmtreepanicwo6.png 350KB -> 109KB

http://www.smspower.org/maxim/forumstuff/maptest/scd.html">http://www.smspower.org/maxim/forumstuff/maptest/scd.html



I still want to:



- add the ability to save as PNG? Or maybe as an "executable" JAR? Both will require either server-side help or for people to accept a dodgy signed applet...

- alternative browsing methods: eg. for Enduro Racer's diagonal maps

- keyboard control

- middle-mouse-click scrolling

- maybe some branding/credit overlay?

- sometimes you get multiple images when zooming out



The Castlevania one is coming out as using more than 20000 tiles which seems wrong, but I think it may be due to the large annotations/branding in the image which has low tile-based redundancy.



Feedback is very welcome.

Grizzly

That's very nice. Also the amount of extra compression due to that tile based compression is impressive. When you add a zoom option (to zoom out, and in) and a save as PNG option, that maybe would be a nice possibility to save downloading times and lower server usage.

The FIFA map doesn't work for me, though.



I really need to learn how to manipulate images in Java, too. Which classes do you use for loading an image and splitting it into pieces etc?

Maxim

Image. I'll post source soon, it's actually incredibly simple. I use a modified Tile Slicer to produce the input data.

DarkWolf

Are you buffering the output?  That should solve the flicker, I would think.  Although, I've never done java.

Revned

The reason Castlevania came out as so many tiles is probably because it isn't aligned to the tile grid.

Maxim

I switched from AWT to Swing for the GUI and got free double-buffering - I was doing it by hand before and there's a limit to how much you can do. It still flickers like hell when resizing the window.



The Castlevania map looked pretty well aligned to me. http://www.smspower.org/maxim/forumstuff/maptest/cv.png">http://www.smspower.org/maxim/forumstuff/maptest/cv.png if you can open a 16x368848 PNG...

Maxim

I added mouse dragging and some preliminary (ugly) zoom support.

DarkWolf

The Sonic CD special stages I did had both flipped and rotated tiles.  If it is too much trouble to implement all the combinations, I think the flipped would be the most effective though.

Maxim

I implemented most of it, and I'm finding very little rotation (didn't try Sonic CD yet). Officially, the Mega Drive graphics chip doesn't support it, I don't know what the Mega CD adds to the mix.



I also added the feature to (sort of) merge tile sets between maps. The result is that you can have one set of tiles fueling multiple maps for a more optimal experience. I'm finding sprites cause a lot of tile duplication though, but I don't want to make the source data more complicated than a single image.

DarkWolf

Sprites certainly complicate things.  The ultimate format would be one that would allow you to store tiles/backgrounds and sprites separately.  Unfortunately you'd have to create the image in that  format in the first place.

Maxim

Exactly. This is trying to be something that you feed a map and it spits out something hugely smaller.

Maxim


TerraEsperZ

Such an ultimate format would pretty much be impossible to do. It would most likely be easier and take less space to create a program that would output the map straight from the rom using the correct tiles, palettes and whatever internal transformations needed and then add all the sprites wanted.



I remember reading about a guy who was trying to do something similar but for a video format for NES games that would thus have perfect image clarity and would require a much smaller bit rate than most existing video format.



---

"With the first link, the chain is forged. The first speech censored, the first thought forbidden, the first freedom denied, chains us all irrevocably." [...] The first time any man's freedom is trodden on, we're all damaged. - Captain Jean-Luc Picard



B*tch, meet reality. Reality, meet b*tch. - Me
Current project:
Mega Man: Powered Up (PSP)