![]() |
Quote:
|
I think the major upgrade you can do to this is not keep the whole image or the whole gmap in memory. Work with both of them in chunks which occasionally get read/written to disk.
|
Quote:
|
Oh hey ;)
First of all I'm glad that this project is still alive and very impressed that cbk worked on it Well I left graal a longer time ago because of school and other stuff and Im kinda sorry for the rather crappy source code (Thats how it looks like in my eyes nowdays) Well in the last months/years I worked like 24/7 with Java - for school and personal stuff and even for my own MMO 2D game ( + The Android App for it ;) ) (Not released yet :P) I just wanted to say that Im going to do a little rewrite on the system, including any functionality you guys want to have @cbk if you want you can do a little gui for it too :P |
Just out of curiosity, what does .nw stand for?
|
Quote:
|
New World. It was an old Graal Project, which the format was adopted for(along with other things, like the NPC Server).
|
Lol Ziro how you come on New Level xD ".nl" ??? xD
|
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Xd
|
Quote:
|
Trying this out and i cant seem to get it work for Era's gmap. I gave it a hour to load and it was still stuck at "generating..." When i try to use the command you gave dusty, it says "unable to access jarfile nw2png.jar".
I tried single levels and those worked, and even tried small gmaps (era_snowresort) which also worked. Using windows 7/64 bit |
Quote:
If I recall correctly, something like java -jar C:\Users\You\Desktop\NW2PNG.jar should work on Windows (obviously changing the path to match your setup). If you see an OutOfMemoryError in the console after you try to generate the map, close the program, then run it like java -Xmx1000m -jar C:\Users\You\Desktop\NW2PNG.jar to allow more heap space. I think 1000 MB ("1000m") was enough when I last did Era's (it took a few minutes, but it will take more if you have to swap). |
Hmm it doesnt seem to be finding the location.
It continues to say "unable to access jarfile...." However it seems to be shortening the location in the error (could that be an issue?) when i type in java -jar C:\Users\FIRST LAST\Desktop\NW2PNG.jar it returns "unable to access jarfile c:\users\FIRST" Im opening up the properties of nw2png.jar and copying the location exactly (and then adding \NW2PNG.jar to the end), so i don't think my location is an issue? |
Quote:
|
The quotes made a new NW2PNG open up, but its still stuck at "Generating" 20 min. I tried the second command (to increase mb size) Chris and again a new window popped up, and 10 min later still no luck.
Edit: After messing around with the size, i had to increase it to over 8000 to get it to work. Thanks guys |
Quote:
Reducing the scale (even to 1:2 or 1:4) should also significantly reduce the memory requirements. The number you're specifying (15000) is the maximum memory it's allowed to use before it crashes (or freezes). It may actually be using far less than that. I suspect watching the process in Task Manager would give you some insight. |
I've finally got this working, and it's awesome except one thing... I can't seem to get it to load images from Graal/*. It seems to load one image(townsign.png) but even if I add my new images into the Graal folder I can't seem to get it to render them.
Also, any chance it can support setimgpart? Kind of ruins maps when NPCs intended to be cropped are rendered fully. |
1 Attachment(s)
Doesn´t seem to work for me. This is what I made
Attachment 53946 The error translated into english means something like: The command "-jar" is either wroten wrong or it couldn´t be found. |
You need to put java in front of that. -jar is just a switch/parameter.
java -jar "path/to/jar" |
Quote:
|
Quote:
Quote:
I can see about setimgpart but it would be difficult to reliably parse scripts for this. Might be possible to add an option to simply not show these images, as well as one to try to parse it, and one to show the full image. |
Quote:
Does this folder have to go in the Graal folder? Also, I'm editing the code right now to try to make it parse setimgpart. |
Quote:
If it's not working it's possible it's detecting some other directory first (e.g. if you have a C:/Graal/ folder; you can see the full list in the source code). |
2 Attachment(s)
Quote:
Also, I've finally got it working to parse setimgpart. It works with setimgpart img,x,y,w,h; as well as setimgpart(img,x,y,w,h); Right now though it's only working for gmaps, not NW rendering. Tomorrow I might try to make it remember directories, because constantly having to go and define the tileset, gmap and output file over and over when you're working on the same map each time is a little frustrating. |
2 Attachment(s)
Err, sorry, I wouldn't advise using the one posted above. I made some errors and it didn't always render properly.
I fixed it up though, as well as made a useful addition. It can now render NPCs stacked on top of each other even if they share the same image name and position(before it was having conflicts trying to scan for the NPC). Big change I had to make for myself was now when loading images it uses Graal's FILENAMECACHE.txt to more accurately find the image. As long as your filenamecache is up to date it(and your Graal folder loaded at C:/Program Files/Graal/) should easily find the images needed. If you need to update your filenamecache just open your Graal folder and delete FILENAMECACHE.txt and then run Graal once. |
Quote:
Just reinstalled Java and added it to this ´Path´ thing. Worked, thanks. |
Quote:
|
2 Attachment(s)
Alright, now it remembers your file selection and/or directory. This should make it easier to work with a map since you can just open it and render the last map you loaded. Next addition I make will just to fix the NW renderer to work like the GMAP one and then I think I'm done. Can't think of anything else this could use.
|
Quote:
|
Quote:
|
Quote:
|
Quote:
Quote:
|
2 Attachment(s)
Alright, guess this is the last update, unless I get ballsy and try to add addtiledef2 support, or redo the rendering to not rely on a buffer(meaning no more memory problems). I simply updated the renderNW function to the same standards of renderGMAP, meaning it now supports setimgpart.
So 2.0 changelog: - setimgpart support for both NW rendering and GMAP - recoded NPC storage and rendering - adjusted GUI's to remember locations, even after closing the application |
2 Attachment(s)
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. edit: I've updated it to catch the memory errors, so it shouldn't just hang at "Generating..." if not enough memory is allocated. I've also included a BAT that lets you define the memory allocation before it starts the program. |
Now I finally figured out how to get this to work it is quite excellent.
One problem I noticed though is that having 2 different lines of setimgpart within the same script causes it to break. In this case I had a setimgpart both Clientside in GS1 and serverside in GS2: PHP Code:
|
1 Attachment(s)
Quote:
Edit: Oops, I uploaded a bugged version! I accidentally broke some of the parsing so here's a new fixed one that SHOULD work! |
| All times are GMT +2. The time now is 12:16 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.