Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Questions about V6 (https://forums.graalonline.com/forums/forumdisplay.php?f=196)
-   -   .NW Level capabilities and file format (https://forums.graalonline.com/forums/showthread.php?t=80476)

Ter13 07-14-2008 02:07 AM

.NW Level capabilities and file format
 
I'm looking for more information on .NW levels' capabilities, and have found a distinct lack of documentation on the web.

I've heard that the .nw files allow multiple layers to be used, how is this stored in a file?

So far, I've gathered the simple file format for a one layer map.

Quote:


file header:

GLEVNW01 - Don't quite understand the meaning here, possibly what version of NW the file uses?

file body:

For each horizontal row containing any modifications:

BOARD - Prefix for board data
(real) - X position of the board data (always seems to be zero. Can this change?)
(real) - Y position of the board data
(real) - Run of the board data (can this go above 64?)
(real) - Layer of the board data

(string)[run] -Contains tile data (each tile is 2 characters A-Z-a-z-(+/))

NPC - Prefix for Oldscript NPC data
(string) - Contains NPC's image file (- if no image)
(real) - NPC X position on the board
(real) - NPC Y position on the board
(string) - Contains entire NPC's script
NPCEND - Marks the end of the NPC

file footer:

File is null terminated
So far, my main questions, are:

1) OldScript NPCs are deprecated, right? How would one place new NPCs?

Obviously, Graal maps using the fourth Cartesian quaternion (I.E. 1,-1 through xINF,-xINF) however, mappings are stored as though in the first quaternion (I.E. 1,1 through xINF,xINF), which took me a second to adapt to before I could read the tile data from the file in raw form. I'm quite a bit perplexed by a few things.

Any comments or advice would be much appreciated.

DustyPorViva 07-14-2008 02:15 AM

Rise of the board = layer. It's always 0 because the default layer is always 0.

Ter13 07-14-2008 02:21 AM

Quote:

Originally Posted by DustyPorViva (Post 1403010)
Rise of the board = layer. It's always 0 because the default layer is always 0.

Alright, that's very helpul, and actually answers almost all of my questions! Many thanks!

Is it possible to create maps larger or smaller than 64x64, or is that a set in stone limitation, that is achieved by using GMaps?

I've also been wondering something for a bit, with the GMap feature, will multiple tilesets be shown at once, let's say you are on the border of a desert, which uses a completely different tile set than the grassland you stand on. In this case, the map to your left will be visible, due to the GMap's linking feature, but will it use the tileset you assign the desert maps, or will it use the grassland tileset that you have assigned the current map?

One more thing: How many layers can a map have, and can these layers overlay the player? Or is it all defined by the title data, what blocks and what doesn't?

Crow 07-14-2008 02:32 AM

Quote:

Originally Posted by Ter13 (Post 1403011)
Is it possible to create maps larger or smaller than 64x64, or is that a set in stone limitation, that is achieved by using GMaps?

You can only have levels with a size of 64*64, and get bigger "maps" by using gmaps.

Quote:

I've also been wondering something for a bit, with the GMap feature, will multiple tilesets be shown at once, let's say you are on the border of a desert, which uses a completely different tile set than the grassland you stand on. In this case, the map to your left will be visible, due to the GMap's linking feature, but will it use the tileset you assign the desert maps, or will it use the grassland tileset that you have assigned the current map?
It would use the tileset you assign to the desert levels. Only one tileset can be used/shown at once.

DustyPorViva 07-14-2008 03:53 AM

Quote:

Originally Posted by Ter13 (Post 1403011)
Is it possible to create maps larger or smaller than 64x64, or is that a set in stone limitation, that is achieved by using GMaps?

I've played with this. I've edited the levels in wordpad and changed their size, smaller and larger than 64x64. Smaller, and it fills the empty tiles with 0x0 tiles. Larger, and it crops it down to 64 anyways... so simply, no. He added the capability, I guess in case he ever wanted to add the feature, but...

Quote:

Originally Posted by Ter13 (Post 1403011)
I've also been wondering something for a bit, with the GMap feature, will multiple tilesets be shown at once, let's say you are on the border of a desert, which uses a completely different tile set than the grassland you stand on. In this case, the map to your left will be visible, due to the GMap's linking feature, but will it use the tileset you assign the desert maps, or will it use the grassland tileset that you have assigned the current map?

addtiledef is done level by level. You can add it specifically to desired levels on a gmap, so yes, you can achieve this. I never done it, but I assume it does work. You can also use addtiledef2, which will without a doubt probably work. But if you want desert tiles in the desert region, simply addtiledef/2 to each of the desert area levels, SPECIFICALLY(addtiledef("desertiles.png","overworl d_k-13.nw"), for example).

Quote:

Originally Posted by Ter13 (Post 1403011)
One more thing: How many layers can a map have, and can these layers overlay the player? Or is it all defined by the title data, what blocks and what doesn't?

Infinite, as far as I know. And no, you can't have overlaying tiles(because of the way the tile system is done). I've requested this, but no luck.

wild8900 07-14-2008 04:11 AM

So whats the use of several layers of tiles if they cant overlay and be over the player?

DustyPorViva 07-14-2008 04:19 AM

They would still be very useful, if there was any feasible way to use them. Mainly for eliminating multiple tiles for various terrains.

But ya, it sucks you can't draw them over the player(would remove the use of probably 50%+ NPCs made just to draw something over the player).

Ter13 07-14-2008 06:23 AM

Quote:

Originally Posted by wild8900 (Post 1403021)
So whats the use of several layers of tiles if they cant overlay and be over the player?

With 24 bit PNG files, one can create transparent tile backgrounds, meaning, tile detail can be added without wasting tiles by putting specific backgrounds behind the detail item. There are a lot of uses, just not usually from the perspective of Graal classic-themed graphics.

DustyPorViva 07-14-2008 06:54 AM

Yet, it all fails because WE HAVE NO EDITOR THAT CAN EDIT LAYERS!!!

****ity **** **** ****in ****.
Dammit.

wild8900 07-14-2008 06:58 AM

XD Do it by hand. When I make tile based games I do the levels by hand.

zokemon 07-14-2008 07:13 AM

I've shown many uses of tilelayers to the Graal community even without being able to overlay players, etc.

And about the editor: If you all really want a level editor with good tilelayer support, tell Stefan to fix the bugs in the new version that I reported 3 months ago as well as implement the taskbar button feature (so the external window will literally be treated like a seperate window with its very own place on your taskbar).

So far, I've heard people interested in the editor even managed to get a few people PM me about it but I'm pretty sure I'm the only one that has been bugging Stefan about the features/bug fixes and I got very little support in my feature request/bug fix threads. So why bother, huh? I guess people think I have more power then I really do? I honestly don't know.

xXziroXx 07-14-2008 12:32 PM

Quote:

Originally Posted by Ter13 (Post 1403009)
1) OldScript NPCs are deprecated, right? How would one place new NPCs?

Uhm... you can use both GS1 and GS2 in NPC/NPCEND tags, it simply tells the level that there's a NPC at the location.

Ter13 07-14-2008 03:10 PM

Quote:

Originally Posted by DustyPorViva (Post 1403037)
Yet, it all fails because WE HAVE NO EDITOR THAT CAN EDIT LAYERS!!!

****ity **** **** ****in ****.
Dammit.

Why do you think I'm asking? It's about damn time someone does something about it.

zokemon 07-14-2008 06:31 PM

Quote:

Originally Posted by Ter13 (Post 1403066)
Why do you think I'm asking? It's about damn time someone does something about it.

*feels ignored*

Ter13 07-14-2008 07:28 PM

Quote:

Originally Posted by zokemon (Post 1403089)
*feels ignored*

Speaking of which, did you ever finish your editor? I saw the thread, and that was the big inspiration for me to make an editor. However, I never found a depot for it, or a release.

I'm working mine in Java. I've got the tile-selection and laying working, but I haven't gotten multiple tile modification or multiple layers working that well. Plus, I haven't built my NWFileStream class yet, so it doesn't load or save.

I've made a really ugly, hacky editor, so in a few days, it should be ready for public consumption, and in a week or two, the code should be cleaned up enough to put it on sourceforge as an open-source editor.

zokemon 07-15-2008 12:26 AM

Quote:

Originally Posted by Ter13 (Post 1403099)
Speaking of which, did you ever finish your editor? I saw the thread, and that was the big inspiration for me to make an editor. However, I never found a depot for it, or a release.

I'm working mine in Java. I've got the tile-selection and laying working, but I haven't gotten multiple tile modification or multiple layers working that well. Plus, I haven't built my NWFileStream class yet, so it doesn't load or save.

I've made a really ugly, hacky editor, so in a few days, it should be ready for public consumption, and in a week or two, the code should be cleaned up enough to put it on sourceforge as an open-source editor.

I didn't finish it as it is a GS2 editor that uses external windows and since there are still some bugs with external windows that mess with the display and such, it still doesn't work well. The file saving and loading I finished years ago though.

Ter13 07-15-2008 01:52 AM

Yeah, mine's gonna be set up a little bit differently. I'm trying to lay the framework for a few features that I've always wanted to work with.

It'll be a layered 24bpp .png-based editor that will include a GS2 syntax editor. Unfortunately, one will not be able to test their level from within the editor, as it is an external program, and it would be completely pointless to try to duplicate that feature of the original editor.

I'm trying to tie in a few convenience features, like multiple tilesets that will automatically swap based upon which map you are loading.

There's another tentative feature I'm messing about with, and that's environments. Rather than working with a single .nw file, I want players to be able to boot environments, and load up a GMap from the environment, and edit an entire GMap all at once just by scrolling about. I know this would help me greatly.

I'm thinking about completely duplicating all the features of the RCon in the future, and possibly making a tie-in for project management. Sort of a one-stop-shop.

But the first step along the way, is to get the external editor working properly. I've only ever made videogames, or simple console applications. I've never used Java for GUI Applications, so the shift of know-how has proven quite difficult.

zokemon 07-15-2008 11:08 AM

Quote:

Originally Posted by Ter13 (Post 1403187)
Yeah, mine's gonna be set up a little bit differently. I'm trying to lay the framework for a few features that I've always wanted to work with.

It'll be a layered 24bpp .png-based editor that will include a GS2 syntax editor. Unfortunately, one will not be able to test their level from within the editor, as it is an external program, and it would be completely pointless to try to duplicate that feature of the original editor.

I'm trying to tie in a few convenience features, like multiple tilesets that will automatically swap based upon which map you are loading.

There's another tentative feature I'm messing about with, and that's environments. Rather than working with a single .nw file, I want players to be able to boot environments, and load up a GMap from the environment, and edit an entire GMap all at once just by scrolling about. I know this would help me greatly.

I'm thinking about completely duplicating all the features of the RCon in the future, and possibly making a tie-in for project management. Sort of a one-stop-shop.

But the first step along the way, is to get the external editor working properly. I've only ever made videogames, or simple console applications. I've never used Java for GUI Applications, so the shift of know-how has proven quite difficult.

I was planning to do quite a few things somewhat like those as well but at the rate I'm going sitting and twiddling my thumbs, I would be surprised if I finished first.

My main focus was a little different though as I plan to integrate the level editor in with other editors I make/plan to make and other things... :asleep:

Ter13 07-15-2008 11:15 PM

=P I didn't get a chance to work on the project tonight. For the most part, the meat and potatoes are finished. I still have quite a few things left to do for the expanded features.

1) Implement a NWFileStream class for saving and loading of the map files.

2) Implement an Undo/Redo cache.

3) Implement clipboard features (like copy&paste)

4) Add the layers GUI so that you can navigate and arrange layers properly.

5) Add the NPC editor as well as a syntax highlighter and checker.

6) Create the toolbox GUI so that you can switch between the pencil, block, fill, selection, or eyedropper tools. (Currently the only tools that I've linked to the MouseEvent listeners, is the selection tool and the pencil tool.)

7) I still need to figure out why Javaw.exe isn't disposing and system resources aren't being freed when run from a JNLP.

8) I need to hook up some GUI controls so that users can change tilesets freely.

9) ???

10) Profit!

http://i38.tinypic.com/2hqe5ic.jpg

I know, looking at the list, you are probably all thinking: What HAVE you finished?!

I assure you, the only thing lacking in functionality is the GUI. I have almost every function completed and working, such as fill tools, tileset swapping, etc. Complete, however, I am missing the GUI implementation so that you can't currently use those features. This means that most of my work from here is working on the layout, and writing action listeners and the like, that will manage the GUI.

The only *real* programming I've left to do, is writing the NWStream components. That should be trivial, as file I/O is one of the most basic aspects of programming you should know, and I'm well beyond struggling with it. There's also the issue of writing a syntax highlighter and error checking class for use with GS2, which I believe will be much more of a task than the I/O, and actually force me to look up some tutorials in the internet before even attempting it, as I never really deal with string tokenizing or the like when making games, so I've never had to do it. =/

Anyway, this is all the product of about eight hours of work spread over the last two days, so in my mind, the pace I'm keeping is pretty good. If I keep this pace up, I should have an alpha version available for public consumption within the week. After a considerable source code cleanup (for the GUI), I will make the source available under the LGPL on sourceforge. I should expect that will take me an additional couple of days to a week.

Anyway, I'm getting ready to go to work, and when I wake up tonight, I'll get back to work! Hope all is going well with the rest of you.

DustyPorViva 07-15-2008 11:20 PM

Support for >8bit PNGs?
Also, I'm wondering if you will support any kind of testing(play button)?
I wanna try it!

Darklux 07-15-2008 11:27 PM

Why didnt you just edit the existing free tile editor mapeditor.org, as its open source too? o.o Just interested in programming experience?

DustyPorViva 07-15-2008 11:30 PM

I like the fact that it has a very familiar layout and feel to the current editor. I don't want to have to relearn the GUI just to keep making levels.

zokemon 07-15-2008 11:31 PM

I can give you the code for your nwstream if you want. I have the tile to nw conversion that I made a long time ago.

Ter13 07-16-2008 07:05 AM

Dusty: The main goal is supporting the features that the old editor does not support. However, some things are lost in translation: Such as the testplay feature, and I'm dropping baddies and probably chests from the support list, seeing as the engine "supports" them, but for the most part, their use is discouraged strongly. I see no point to the implementation of them, so if someone WANTS to use the source, and re-implement them, I have no problem with that.

DarkLux: I don't like mapeditor.org's GUI at all. I'm planning something more photoshop-like eventually. Particularly with the layer windows. Plus, writing my own took me a whole eight hours, so honestly... It's not like I'd be wasting a whole lot of time.

Zero: I've got it. I appreciate the offer, but I've got a bit of experience in the field, so I should manage. It'll be easier to just write it myself, as the beginning of this thread points out that I've managed to break out the file format pretty well, so the rest should take but a few minutes.


And Zero, don't feel like your project is useless. As has been said a few times in this thread, I won't have a feature available for testing of the map, so yours will likely have a faster deployment time than mine unless the developer really knows what he is doing. Yours will also be much more useful for map-tweaking, and mine more for initial/offline map building.

Programmer 07-16-2008 07:17 AM

Quote:

Originally Posted by Ter13 (Post 1403401)

Lol, NetBeans. Making it cross-platform compatible?
Make sure you keep the graphics to a minimum so you don't lag things up :p

Ghost Pirate 07-16-2008 07:41 AM

At last a level editor that will (presumably) work on a Mac. Thank you very much for working on this.

Do you plan on working on a gani editor too? *wink wink* ;).

Ter13 07-16-2008 07:53 AM

Alright, Programmer, I'm going to point out a few things here:

1) It's Java, go look up Java's portability.
2) It's not Netbeans I don't know where you got that idea.
3) Graphics don't cause lag. Graphics cause FPS stuttering. And I'm not even going to waste the time pointing out the failure of that common misconception.

It's a tile editor. How much graphic work can I really do to it? I don't really understand what you are talking about at all, and I suspect you really don't either. No offense, or maybe I just missed something.

And Ghost pirate, I'm considering it. I'm strongly leaning toward yes. I could have sworn Stefan Knorr wrote a Java Gani editor sometime after they released Graal 2001... Or it may have been after Classic's world closed to player submissions, and had to be massively cleaned up again... (I don't really remember...) As another thought, wasn't Graal Classic fully written in Java back in the day? I remember Zelda Online was a dinky little browser applet, and then they figured out application development after a while... =/

I dunno, I was too young at the time. Anyway, back to the coal mine...

Programmer 07-16-2008 08:58 AM

Quote:

Originally Posted by Ter13 (Post 1403536)
Alright, Programmer, I'm going to point out a few things here:

1) It's Java, go look up Java's portability.
2) It's not Netbeans I don't know where you got that idea.
3) Graphics don't cause lag. Graphics cause FPS stuttering. And I'm not even going to waste the time pointing out the failure of that common misconception.

It's a tile editor. How much graphic work can I really do to it? I don't really understand what you are talking about at all, and I suspect you really don't either. No offense, or maybe I just missed something.

And Ghost pirate, I'm considering it. I'm strongly leaning toward yes. I could have sworn Stefan Knorr wrote a Java Gani editor sometime after they released Graal 2001... Or it may have been after Classic's world closed to player submissions, and had to be massively cleaned up again... (I don't really remember...) As another thought, wasn't Graal Classic fully written in Java back in the day? I remember Zelda Online was a dinky little browser applet, and then they figured out application development after a while... =/

I dunno, I was too young at the time. Anyway, back to the coal mine...

:/

1.) I know Java. I use Java on a regular basis. I know how Java works, what it can do, and why it can do that. I know how portable it is, because I've written complex cross-platform applications in it.
2.) That IDE looks very similar to Netbeans, so that's why I said so. Now that I look at it, it doesn't seem to be.
3.) Graphics can cause substantial lag if used improperly. Sheer number of graphic operations per paint round can cause a lot of lag also.

I understand that it's a tile editor, and I was making a small joke. If you can't understand that, then don't bother getting upset about it. I also suggest that you do not imply that I know nothing about Java when you know nothing of me.

Also, Don't think that I'm a novice programmer just because I'm 15. If you can't handle that, then oh damn well.

James 07-16-2008 11:31 AM

Quote:

Originally Posted by Ghost Pirate (Post 1403531)
At last a level editor that will (presumably) work on a Mac. Thank you very much for working on this.

Do you plan on working on a gani editor too? *wink wink* ;).

What an epic return post! >_<

cbk1994 07-16-2008 06:17 PM

I started to make a Java editor once, but never went farther than the interface because I'm lazy :asleep:

Ter13 07-16-2008 06:23 PM

Quote:

Originally Posted by Programmer (Post 1403539)
Also, Don't think that I'm a novice programmer just because I'm 15. If you can't handle that, then oh damn well.

Lol!

Rufus 07-17-2008 02:20 AM

Quote:

Originally Posted by James (Post 1403546)
What an epic return post! >_<

Illusion.

Umat 07-17-2008 02:34 AM

Nice, I would like to see a working copy of this soon! :D And maybe this will push Stefan to recode the editor. :D

Inverness 07-17-2008 06:06 AM

If Stefan can finish the external scripted windows we'll have a scripted editor that's not limited to the in-game window.

DustyPorViva 07-17-2008 06:08 AM

I really wish some sort of way to edit layers would come about... I've had tons of great ideas that use layers but it's such a pain that it's just not even worth trying.

zokemon 07-17-2008 07:06 AM

Quote:

Originally Posted by Inverness (Post 1403688)
If Stefan can finish the external scripted windows we'll have a scripted editor that's not limited to the in-game window.

:frown:

Every time I ask he is to busy.

Inverness 07-17-2008 08:25 PM

I had the idea to use layers to have shadows that move according to time of day.

DustyPorViva 07-17-2008 08:34 PM

All my ideas revolve around layers being extra data storage for tiles. Seeing as layers can be transparent, this allows you to store almost infinite data over tiles.
Mainly -- height :)


All times are GMT +2. The time now is 05:18 AM.

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