Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Level Design (https://forums.graalonline.com/forums/forumdisplay.php?f=6)
-   -   Nw2png (https://forums.graalonline.com/forums/showthread.php?t=134259601)

born2kill 06-24-2010 08:27 AM

Nw2png
 
2 Attachment(s)
Hello everyone ;)
I've made a new tool in java which generates an PNG Image from a given level

- The latest download is attached below -

For the developers under you I've also attached the source code
Please gimme comments + Ideas of what I should add / change =D

------------------------------------------------------------------

Latest version is 2.1, by Dusty!

Patch Notes:
Quote:

Originally Posted by Dusty
Alright, I think this is it. Added addtiledef2 img,dest,x,y; and addtiledef2("img","dest",x,y); support. However, right now it scans through the levels, and doesn't use tiledefsOffline.txt. I don't seem to have the file, so I'm assuming it doesn't work or something *shrug*. So make sure you have at least one NPC on the overworld that defines the tiledefs.

I think this is pretty complete now, should be able to render most maps efficiently :)

I also included a shortcut in the folder that increases the memory heap for the program. I'm not sure if the shortcut will work for anyone else, but you can try it. It's at 1300mb, but if you right click the short cut and go into properties you can change it via changing:

-Xmx1300m

to something like

-Xmx2000m

This will allow the program more memory to render larger maps. But if you raise the number too high the program won't even manage to run.


xAndrewx 06-24-2010 08:48 AM

HTML Code:

'java' is not recognized as an internal or external command,
operable program or batch file.
Press any key to continue . . .


born2kill 06-24-2010 08:57 AM

@ Andrew you can download the java runtime (JRE) here:
http://java.com/en/download/inc/windows_upgrade_xpi.jsp

Oh and I just saw I had a quick typo when parsing the gmap file
(Width was Height and Height was Width)
Ive attached the changed one 1.1 now

I always prefer Java since you only have to compile it
once and you can run it under every OS

xAndrewx 06-24-2010 09:03 AM

1 Attachment(s)
Haha cool-alot quicker than using the map editor!

Can you please add a tileset changer on to it- ie the tileset you want to use (I know you can just re-name pics1.png, but would be cool of an option)

rep++

cbk1994 06-24-2010 09:09 AM

Already done it, but that's pretty cool. I'm still working on the new version of mine with GMAP support so I guess you beat me to that :p.

Nice work.

born2kill 06-24-2010 09:09 AM

The image looks so smooth <3
Thanks for repp + uploading your picture =)
The changer will be added in the next version 2.0
until then we will have an auto parse of the level to read the addtiledefs =P
Also im doing a GUI version soon

Programs written in C++ / Java gives more possibilites like you can see the
image is Rendered Intepolated (very smooth) not like the usuall horrible pixeled M map (no Interpolation rendering)

Did I already mentioned that it also supports pics1.png's with alpha =) ?
oh and you can also skip Levels when creating the gmap - just dont add the
.nw level to skip in the folder and the NW2PNG will auto skip this level if it doesnt exist
so you have an alpha hole where this level should be

Actually this is the very first Alpha version I just started with this Project a few hours ago =o

Dnegel 06-24-2010 12:31 PM

Wow, this is awesome man!

Thanks alot :D rep+

born2kill 06-24-2010 04:31 PM

NW2PNG v1.2 released
Here comes v1.2 - including several changes
+ support for Tilelayers ;)

Please read the readme.txt file in the folder

WhiteDragon 06-24-2010 04:59 PM

Add anti-aliasing ;) Maybe as an option

PHP Code:

g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASINGRenderingHints.VALUE_ANTIALIAS_ON); 

Or a higher interpolation setting -- I can't really tell.

born2kill 06-24-2010 06:01 PM

Mhm I already played around with the rendering to get the best quality
Bicubic Interpolation > everything else with the Quality
I just wish I could use the Lanczos sinc Interpolation in Java =(

WhiteDragon 06-24-2010 06:08 PM

Quote:

Originally Posted by born2kill (Post 1583824)
I just wish I could use the Lanczos sinc Interpolation in Java =(

You could write it yourself :o. The weight for a given pixel using an 8-pixel window in Lanczos is [ sin(x*.25) / (x*.25) ] * [ sin(x*.25 / 8) / (x*.25/8) ]


Edit: Here is Chromium's implementation of Lanczos in C++ http://src.chromium.org/svn/trunk/sr..._operations.cc

born2kill 06-24-2010 06:38 PM

Quote:

Originally Posted by WhiteDragon (Post 1583827)
You could write it yourself :o. The weight for a given pixel using an 8-pixel window in Lanczos is [ sin(x*.25) / (x*.25) ] * [ sin(x*.25 / 8) / (x*.25/8) ]


Edit: Here is Chromium's implementation of Lanczos in C++ http://src.chromium.org/svn/trunk/sr..._operations.cc

Haha nvm im just using Bicubic untill there is something giving a better quality xD
(Even Bicubic is already perfect)

PHP Code:

g2d.setRenderingHintRenderingHints.KEY_INTERPOLATIONRenderingHints.VALUE_INTERPOLATION_BICUBIC ); 

ftw =o

Rufus 06-26-2010 08:01 PM

I haven't downloaded the program yet as I don't really need it, but it sounds like some nice work.

born2kill 06-26-2010 10:14 PM

2 Attachment(s)
NW2PNG v1.3 released

Again a new version =)

Changelog:
- Added support for normal NPC images
- Added ignorecase for "pics1.png" npcs and npcs containing "light" in their name
(Parsing of setimgpart() not added yet)
- Small source code changes

DustyPorViva 06-26-2010 10:20 PM

Quote:

Originally Posted by born2kill (Post 1584280)
NW2PNG v1.3 released

Again a new version =)

Changelog:
- Added support for normal NPC images
- Added ignorecase for "pics1.png" npcs and npcs containing "light" in their name
(Parsing of setimgpart() not added yet)
- Small source code changes

Do you plan to add the suggestion above for supporting different tilesets, and what about addtiledef2?


All times are GMT +2. The time now is 02:06 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.