General Map Designing for fun and profit
Entropic Pen
25 Aug 2013, 13:50EDIT: Let's put our questions about the map system here so in the future we won't have to scroll through so many threads.
So I was in the heat of designing "Welcome to Dream Valley" when I had the brilliant idea to implement a map screen when I came across something called a "custom drawing layer" and it appears to be some sort of map-editing script that can be "shown" and "cleared".
What am I looking at and how can I use this for fun and profit?
So I was in the heat of designing "Welcome to Dream Valley" when I had the brilliant idea to implement a map screen when I came across something called a "custom drawing layer" and it appears to be some sort of map-editing script that can be "shown" and "cleared".
What am I looking at and how can I use this for fun and profit?
jaynabonne
25 Aug 2013, 14:16Where did you come across this? In the Quest code or docs or...? If I can get that, I might be able to tell you what you're looking at. 
Entropic Pen
25 Aug 2013, 14:22They're functions in the Quest CoreGrid.aslx library, I stumbled upon them when I checked the "Show Library Elements" box.
jaynabonne
25 Aug 2013, 15:30To be honest, I'm not sure. I believe it's another layer within the map/grid display system, but the only function I see for drawing to it is Grid_DrawSquare. Perhaps Alex had a special use in mind, since it's so specific.
By the way: if you ever want to customize the grid code, I have gone through the work of extracting and rewriting it slightly so that it's not embedded in the paper.js instance it currently is (which makes it currently non-customizable). I was using it as a test, to draw a different shape for the player than the current circle. Once it's exposed like that, all kinds of things could be drawn to the map (or just the canvas in general) using the handy paper.js APIs.
By the way: if you ever want to customize the grid code, I have gone through the work of extracting and rewriting it slightly so that it's not embedded in the paper.js instance it currently is (which makes it currently non-customizable). I was using it as a test, to draw a different shape for the player than the current circle. Once it's exposed like that, all kinds of things could be drawn to the map (or just the canvas in general) using the handy paper.js APIs.
Entropic Pen
25 Aug 2013, 15:34Thanks for looking into it, Jay, I'll check it out.
jaynabonne
25 Aug 2013, 15:41I've posted the grid map code I was talking about. It's a bit of a hack, but it might be useful to someone. 
Entropic Pen
25 Aug 2013, 18:51You've blown our minds yet again, Jay.
Now riddle me this; for the implementation of a map screen in "Welcome to Dream Valley" to really work, we're going to have to find a way to display different maps for different areas depending on where the player is.
For example; the tunnels in and out of the underworld when put on a map are way off from what the Quest Engine's map calculator could put together. I was thinking that when a player goes down to the underworld the map would clear itself of any rooms not registered as "underworld", and display the rooms that are registered as "underworld". Then if the player leaves the underworld and ends up in the Volcano of Gloom, the map would clear itself and display the rooms registered as "gloom".
Now riddle me this; for the implementation of a map screen in "Welcome to Dream Valley" to really work, we're going to have to find a way to display different maps for different areas depending on where the player is.
For example; the tunnels in and out of the underworld when put on a map are way off from what the Quest Engine's map calculator could put together. I was thinking that when a player goes down to the underworld the map would clear itself of any rooms not registered as "underworld", and display the rooms that are registered as "underworld". Then if the player leaves the underworld and ends up in the Volcano of Gloom, the map would clear itself and display the rooms registered as "gloom".
jaynabonne
25 Aug 2013, 20:57The question to be answered first is: are you going to be gradually revealing the map or do you want it all shown at once? If you want to reveal the map gradually (as is done now), then you'd be better of, perhaps, using the z coordinate to switch layers. Because the rooms that have been visited only show up because they've been drawn to the paper. Once you clear it, you'd lose all that state. (So leaving a dungeon and coming back would show you just the room you're in.)
If you want to show the entire map, then that's doable as you'd clear the previous map and draw the entire new one.
The drawback to using the z index is that, once again, app policy is hard-coded in the low-level Quest routines. So, there is a maximum of 7 levels at the moment (-3 through +3), and the other layers are partially shown when you switch z coordinate, which might make sense in some cases, but could also be really annoying in others.
If you do want to use the z coord, you could probably take the code I just posted, change the opacity handling in activateLayer (set it to 0 instead of 0.2), and then set the layer count to what you'll need. Then you would have to layout the z coordinates in the rooms to be consistent across different areas. There might be an easy way to do it with the exits, as the exits have length. So you could go down 1 level for one area, go down two for another, etc. And they'd all be on separate layers. (I hope that makes sense.)
If you want to show the entire map, then that's doable as you'd clear the previous map and draw the entire new one.
The drawback to using the z index is that, once again, app policy is hard-coded in the low-level Quest routines. So, there is a maximum of 7 levels at the moment (-3 through +3), and the other layers are partially shown when you switch z coordinate, which might make sense in some cases, but could also be really annoying in others.
If you do want to use the z coord, you could probably take the code I just posted, change the opacity handling in activateLayer (set it to 0 instead of 0.2), and then set the layer count to what you'll need. Then you would have to layout the z coordinates in the rooms to be consistent across different areas. There might be an easy way to do it with the exits, as the exits have length. So you could go down 1 level for one area, go down two for another, etc. And they'd all be on separate layers. (I hope that makes sense.)
Entropic Pen
25 Aug 2013, 23:09In short: LazyNo up's an downs for the same area after you resort the map opacity to 0.
Let's see here, there's the Overworld, Underworld, Gloom, and Unicornia which maybe after some math and a dozen or so headaches putting up with the randomly-selected layouts... yeah. This could work.
Thanks Jay!
Let's see here, there's the Overworld, Underworld, Gloom, and Unicornia which maybe after some math and a dozen or so headaches putting up with the randomly-selected layouts... yeah. This could work.
Thanks Jay!