Graal Forums  

Go Back   Graal Forums > Development Forums > Level Design
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-23-2011, 04:20 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Nw2png2.0

First I want to make it clear that I did not code this tool. Alex(born2kill) originally coded it, and you can find it here:
http://forums.graalonline.com/forums...hp?t=134259601
Then Chris Vimes edited it, adding useful things such as the GUI interface and bugs. Then I took over and made some heavy modifications to it.

See the original thread for basic functionality and features.

Newest Features
> Shows you how long in seconds it took to parse and render the map when finished.
> addtiledef support, as well as subbing #L for the level name in addtiledef and addtiledef2.
> Colored bodies in ganis.
> Filter output toggle. Filtering the output will make resized maps look better, but it also increases the filesize by a large margin. This is enabled by default.
> New input for Graal Directory. Instead of assuming your Graal Directory, it will allow you to specify it(in case it is not always in CProgram Files\Graal\). However, it still needs FILENAMECACHE.txt to find the images, so for right now you can't simply direct it to an image folder.

Features I've added
> Recoded rendering. Before it was parsing and rendering NW's and GMAP's in separate functions. This meant any change to the rendering had to be worked into both functions. I've simplified the matter, making the GMAP function call forth the NW function for the levels and stitching the images together. This allows easier editing of the parsing and rendering code as well as easing up some of the heavy memory usage.
> Better image scanning. It was limited in finding necessary images before, but I've changed it instead to rely on Graal's FILENAMECACHE.txt. If you need it to find an image, simply having the image in the Graal directory(doesn't matter where) will allow it to find it. This includes other resources like ganis, but does not apply to levels. The levels must be in the same directory as the gmap file! But make sure your cache is up to date. To update your cache go into your Graal folder and delete FILENAMECACHE.txt, then run Graal. It will take a moment for Graal to start up, but once it does it will have scanned its entire directory and updated the cache.
> setimgpart support. It tries its best to interpret it, as well as its GS2 equivalent.
> addtiledef2 support. Only if addtiledef2 is found in a script in one of the levels. As above, it does its best to interpret the GS1 and GS2 command.
> Positioning code. This is in its infancy stage right now, but I'm attempting to interpret modifications to the position of NPCs via x++, x += 1, x = 32, this.x += 5 and so on. It's only as reliable as I have tested it. I'm pretty sure right now this is only applying to showcharacters, but I will soon add support for regular NPCs as well.
> Basic operations parsing. Before I was simply omitting values with operations, but now I've implementing some basic math parsing, so things like x = 5*3; should work. However I can't take into account variables(at least yet, maybe in the future I can substitute some basic known variables like position into the parsing).
> Gani support. I'm doing my best to interpret and render ganis. Right now they're mostly complete. I think the only thing left to do with them is to color bodies.
> Browsing memory. It remembers your input selections, making it easier to get in and render. This is especially useful when working on a single map, as all you have to do is open the tool and click render, since it remembers your last options.
> A batch file letting you specify a memory heap for the application. Rendering takes a lot of memory, and Java doesn't allocate very much by default. If you get a memory error, try closing and using the bat. Specify a number close to your total RAM in mb. So if you have 4GB of ram, try allocating 3600 or so. It will crash on launching if you allocate too much, so just try a lower value if it does(if you have a 64bit system, having Java 64bit will alleviate a lot of issues).
> No more hanging when it runs out of memory. Now it will notify you that it ran out of memory and reenable the 'Generate!' button, allowing you to change the scale and try again.
> Many bug fixes.

Features Planned
> Assigning images to join classes. I know a lot of servers use joins for NPCs such as doors and such, where the external class is assigning the image, leaving the parser no image info. Eventually you'll be able to keep a list of join classes, and assign them an image you want to be rendered, such as bush=bush.png.

Screenshots

Interface:

Output example:
Click image for larger version

Name:	test.png
Views:	5762
Size:	974.6 KB
ID:	53976

This is still a Work in Progress, so expect bugs, but please let me know! The more bugs I know, the more I can address them to make this as reliable and useful as possible!
Attached Files
File Type: zip NW2PNG2.0.zip (242.3 KB, 6566 views)
File Type: zip NW2PNG2.0.src.zip (14.0 KB, 6479 views)

Last edited by DustyPorViva; 11-23-2011 at 05:43 PM..
Reply With Quote
  #2  
Old 11-23-2011, 04:30 AM
Crono Crono is offline
:pluffy:
Join Date: Feb 2002
Location: Sweden
Posts: 20,000
Crono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond reputeCrono has a reputation beyond repute
Awesome!
__________________
Reply With Quote
  #3  
Old 11-23-2011, 05:21 AM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a name known to allff7chocoboknight is a name known to allff7chocoboknight is a name known to allff7chocoboknight is a name known to all
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
Used wrong tiles for inside of caves.
__________________
Reply With Quote
  #4  
Old 11-23-2011, 05:36 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by ff7chocoboknight View Post
Used wrong tiles for inside of caves.
Elaborate?
Reply With Quote
  #5  
Old 11-23-2011, 10:10 AM
Luda Luda is offline
Registered User
Join Date: Aug 2005
Location: Canada
Posts: 2,071
Luda has much to be proud ofLuda has much to be proud ofLuda has much to be proud ofLuda has much to be proud ofLuda has much to be proud ofLuda has much to be proud of
Send a message via AIM to Luda
Nice!
Reply With Quote
  #6  
Old 11-23-2011, 10:11 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Well finally got body coloring done thanks to [someone who shall not be named]! I also added a toggle for filtering the output.


By default maps will be filtered, but filtering attempts to make distorted images(which is the case when scaling down) look better. But while they do that, they also add a lot of colors and thus can increase the file size of the map image by a large amount. For example, a filtered 1:2 map of a 3x3 gmap is ~1.5mb. A non-filtered image of the same map is only ~500kb. So it's up to you to decide if you want a better output image with a much larger filesize, or an "uglier" image with a much smaller filesize. You can compare the two images below.

Filtered:


Non-Filtered
Reply With Quote
  #7  
Old 11-23-2011, 04:21 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Here's a small update.

New Features
> Colored bodies in ganis.
> Filter output toggle. Filtering the output will make resized maps look better, but it also increases the filesize by a large margin. This is enabled by default.
> New input for Graal Directory. Instead of assuming your Graal Directory, it will allow you to specify it(in case it is not always in CProgram Files\Graal\). However, it still needs FILENAMECACHE.txt to find the images, so for right now you can't simply direct it to an image folder.



You can find the updated files in the original post.
Reply With Quote
  #8  
Old 11-23-2011, 07:48 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
An option to just render each level of a GMAP as a separate file might be nice.
__________________
Quote:
Reply With Quote
  #9  
Old 11-23-2011, 08:14 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
You should put this on GitHub so it's easier to keep track of changes and contribute to. I wouldn't mind trying to fix the memory stuff if you do that.
__________________
Reply With Quote
  #10  
Old 11-23-2011, 08:23 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
There's a few problems with this latest version for me.

Quote:
Warning: Could not parse: startx+10.5;
Warning: Could not parse: starty-7;
Warning: Could not parse: startx+2.5;
Warning: Could not parse: starty-9;
Warning: Could not parse: starty-13;
Errors like this I think are occurring because of scripts that contain stuff like:

PHP Code:
this.this.starty 5;
this.this.startx 16;
this.startx this.x;
this.starty this.y;

this.shadow.-= 1
I believe it's with levels containing stuff like that where I've had errors such as:

Quote:
Error: Couldn't load the file classic_overworld_masterlis_03.nw
Error: Level was unable to be rendered for an unknown reason.
In this instance 2 images were randomly cut despite not containing setimgpart:


There's also been several instances of:

Quote:
Warning : Couldn't render the gani "classic_player_idle_01".gani
Could the problem be usage of GS2?

It seems there's a problem with rendering multiple character ganis, they look the same for me:



Aswell as a slight issue with layering, though I imagine it would be difficult to resolve:



Another possible future issue, is that I actually have certain common showcharacters appearance loaded via a class, like castle guard/ninja etc, which would mean their intended look not being rendered with the gani.
Reply With Quote
  #11  
Old 11-23-2011, 09:34 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
http://img717.imageshack.us/img717/6217/test2cg.png

lmao
__________________
Reply With Quote
  #12  
Old 11-24-2011, 12:10 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by ffcmike View Post
Errors like this I think are occurring because of scripts that contain stuff like:

PHP Code:
this.this.starty 5;
this.this.startx 16;
this.startx this.x;
this.starty this.y;

this.shadow.-= 1
Most definitely, I can only provide basic parsing, but I doubt I'd be able to do anything complex like variable tracking. However if it's causing levels not to render I will have to look further into it.

edit: I copied the code and put it into an NPC and the level still rendered. The NPC didn't, but that's to be expected. However, I will try to make it omit such alterations to the x/y instead of overwriting them.

Quote:
Originally Posted by ffcmike View Post
In this instance 2 images were randomly cut despite not containing setimgpart:
I believe this is from me changing the method of rendering gmaps. It's where the level boundaries end, and since levels are rendered individually the NPCs aren't being rendered outside of the boundaries. Fixing this would be pretty difficult, but I think I might have to figure something out because I don't think that's passable. I guess I could make a function to scan for all setimgpart in each level of a gmap and return the list.

Quote:
Originally Posted by ffcmike View Post
There's also been several instances of:

Could the problem be usage of GS2?
Seems I forgot to remove quotation marks when parsing GS2. Will work on that.

Quote:
Originally Posted by ffcmike View Post
It seems there's a problem with rendering multiple character ganis, they look the same for me:

I never parsed character data in GS2. It was very easily to catch

Quote:
Originally Posted by ffcmike View Post
Aswell as a slight issue with layering, though I imagine it would be difficult to resolve:
I can't say it'd be difficult, I'd just have to sort the list, but it'd be more intensive work in an already intensive function.

Quote:
Originally Posted by ffcmike View Post
Another possible future issue, is that I actually have certain common showcharacters appearance loaded via a class, like castle guard/ninja etc, which would mean their intended look not being rendered with the gani.
Well as you can see I already plan to implement a class -> image function. I may be able to add support for character data in the format of:
ninja=skin:black,belt:black,coat:black,sleeves:bla ck,shoes:black,headimg:head17.png,shieldimg:no-shield.png,gani:idle,dir:1

Last edited by DustyPorViva; 11-24-2011 at 12:39 AM..
Reply With Quote
  #13  
Old 11-24-2011, 06:29 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by DustyPorViva View Post
Most definitely, I can only provide basic parsing, but I doubt I'd be able to do anything complex like variable tracking. However if it's causing levels not to render I will have to look further into it.

edit: I copied the code and put it into an NPC and the level still rendered. The NPC didn't, but that's to be expected. However, I will try to make it omit such alterations to the x/y instead of overwriting them.
This is fixed in the next version. Now instead of always overwriting the x/y with modifiers it first checks if it's returning a valid value.

Quote:
Originally Posted by DustyPorViva View Post
I believe this is from me changing the method of rendering gmaps. It's where the level boundaries end, and since levels are rendered individually the NPCs aren't being rendered outside of the boundaries. Fixing this would be pretty difficult, but I think I might have to figure something out because I don't think that's passable. I guess I could make a function to scan for all setimgpart in each level of a gmap and return the list.
Fixed as well, saved the NPCs to an external list and I render them after the gmap is rendered.

Quote:
Originally Posted by DustyPorViva View Post
Seems I forgot to remove quotation marks when parsing GS2. Will work on that.
Also fixed.
Reply With Quote
  #14  
Old 11-24-2011, 07:52 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
New update.

New features
> The ability to split the images when you save a gmap. It will save them in a directory named after the output. So if you put overworldmap.png in the output, it will save it in parent/overworldmap/<levelname>.png. Still provide a PNG as an input though as it's expecting one. However, I will say this may be slower than generating an entire gmap since it has to create a file for each level.
> Full GS2 support for Gani's/showcharacters
> Fixed NPCs being cropped if they exceeded the boundaries of the level
> Also fixed a bug with the scaling formula. So I've provided more scale options, and I may change it to a slider.
> Parsing no longer overwrites the NPCs x/y position unless it returns a valid number. This will stop NPCs from no longer being rendered if the parser hangs on things like variables.

Why can't I edit my thread anymore, dammit It should stop allowing edits from time of the last edit instead of time it was originally posted!
Attached Files
File Type: zip NW2PNG2.0.zip (243.8 KB, 5415 views)
File Type: zip NW2PNG2.0.src.zip (14.7 KB, 5301 views)
Reply With Quote
  #15  
Old 11-24-2011, 08:03 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
No errors were returned for me this time which is good for generating a basic map, however no characters/ganis were rendered.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:02 AM.


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