Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Feature request (https://forums.graalonline.com/forums/forumdisplay.php?f=194)
-   -   Tile Layers - Commands & Functions (https://forums.graalonline.com/forums/showthread.php?t=134267968)

Draenin 03-05-2013 06:31 AM

Tile Layers - Commands & Functions
 
I know this doesn't get touched on as often as it should be, but it would be really nice to have a few more commands that can be used to manipulate tile layers.


Currently, the working commands I know of for gmaps are:

gmap.tilelayers[x].alpha = y;
gmap.tilelayers[x].red = y;
gmap.tilelayers[x].green = y;
gmap.tilelayers[x].blue = y;


And here are some other fun ones I would suggest that could be implemented later:

gmap.tilelayers[x].mode = y; (For additional color blending.)
gmap.tilelayers[x].zoom = y; (For the possibility of layer parallaxing in the future.)


But, we absolutely need the following:

gmap.tilelayers[x].dontblock();
gmap.tilelayers[x].drawoverplayer();
gmap.tilelayers[i].tiletype(tx,ty);



It would be nice to have these commands and others like them, because even though you can draw with multiple tile layers now, the tiles you lay down on the layer above will still block the player as if it were on the layer below.

The planks in these screenshots are on layer 1, while everything else is on layer 0. I made them kinda transparent so you can see the path below.

On the left is what we're currently stuck with, on the right is how it should work.

http://s8.postimage.org/s0z90st0l/example1.png http://s18.postimage.org/i0vkp2zqx/example2.png

This is very impractical for those of us who want to make use of layers for masking things like paths or hidden rooms in maps, because any kind of blocking tile will mess things up. It has been a pain to deal with on literally every server since time immemorial, as things that are layered over players usually have to be made with half a dozen NPCs instead that serve no other purpose than to mask things on the tile layer below.

Improving tile layers could open a lot of new doors for developers, and I'm really surprised we don't have a way of doing this yet when we're so close to it working as it should.

If anyone else has suggestions for commands directly related to tilelayers, please feel free to suggest them.

Gos_pira 03-05-2013 12:16 PM

I approve of this.

scriptless 03-05-2013 02:19 PM

Quote:

Originally Posted by Gos_pira (Post 1714704)
I approve of this.

Me too. Even the offline editor had support for layers. I don't remember if it was the Level Editor or Gonstruct that had the bug where you opened it and saved it and it removed the layers other then the default layer. so annoying.

Even with 1 layer the possibilities are endless to what people will be able to create.

Crow 03-05-2013 02:25 PM

Quote:

Originally Posted by scriptless (Post 1714705)
Me too. Even the offline editor had support for layers. I don't remember if it was the Level Editor or Gonstruct that had the bug where you opened it and saved it and it removed the layers other then the default layer. so annoying.

That was the default level editor. I believe Gonstruct was mainly created to accommodate for this issue.

Draenin 03-07-2013 09:04 AM

One thing in particular that's very nice about tilelayers already is that they are ostensibly the same as if you were using backpals, but you can manipulate them in so many more ways. The current commands allow you to control the color channels of a tileset via script, meaning you can make palette adjustments and possibly enrich the color quality of your environments without needing to actually modify your tilesets much.

Here, I've put all three channels in a timeout loop and set their values to random (0,1) along with changing the tileset's alpha to anything other than 1 to create the motion blur effect you see used on a lot more servers these days.

The result is pretty freakin' groovy. :fro:




As an added bonus, you can also set class objects to have the same RGB channel setup as the tilelayers, meaning that their palettes can change along with the palettes you designate on different gmaps.

So say that you have a tree as a class object, and you had it set to match the palette of the tileset that you've specified. When you drop the tree into a level, its color channels will be set to match the tileset's color channels, meaning that you could globally manipulate color channels for both objects and tilesets at the same time to ensure some consistency in color. This is a bit different from doing a seteffect, because it's not the same as simply colorizing the entire screen.

Emera 03-10-2013 02:14 AM

Thought I might share this. It's just playing around with tile layers and what not. Nothing special really, but it's on-topic. It's a long video but it gets better near the end.

scriptless 03-14-2013 12:59 PM

Wait a second, I thought tile layers already had something similar to tiletype for layers? and there no point actually making layers above 1 blocking. u can use a blocking tile under it, and if you are using alpha on that layer you could just use 3 layers so u have a blocking, what ever u want to show it as, then the alpha layer.

Never was really a big deal to me, tho drawing over players is like the #1 most requested feature =/ and yet we still get ignored.

Draenin 03-14-2013 02:44 PM

Quote:

Originally Posted by scriptless (Post 1714981)
Wait a second, I thought tile layers already had something similar to tiletype for layers? and there no point actually making layers above 1 blocking. u can use a blocking tile under it, and if you are using alpha on that layer you could just use 3 layers so u have a blocking, what ever u want to show it as, then the alpha layer.

Actually, blocking could be useful on a 2nd layer if the first is being used as something like a parallax or scrolling background.

Unfortunately, we don't have support for those yet either, but I do think it is possible since objects on foreground layers already support parallax movement.

scriptless 03-14-2013 06:37 PM

Quote:

Originally Posted by Draenin (Post 1714984)
Actually, blocking could be useful on a 2nd layer if the first is being used as something like a parallax or scrolling background.

Unfortunately, we don't have support for those yet either, but I do think it is possible since objects on foreground layers already support parallax movement.

I just realised, tile type would mean it could block. lol

But thats why I am saying, layer 1 = blocking information, layer 2 = the scrolling background.. it's esentially the same thing tho as what your saying except you would end up using less layers.

Draenin 03-15-2013 05:25 AM

Quote:

Originally Posted by scriptless (Post 1714987)
I just realised, tile type would mean it could block. lol

But thats why I am saying, layer 1 = blocking information, layer 2 = the scrolling background.. it's essentially the same thing tho as what your saying except you would end up using less layers.

For the purposes of parallaxing backgrounds, layer 1 would need to be the background layer, while layer 2 should ideally contain the tiletype information. As an example, if you wanted to make scrolling water or a world map that parallaxes beneath some floating islands, it would need to be on the layer underneath the one players normally walk on. There are lots of different things you could do with an extra layer underneath, as well as ones above the player as well.



I've actually been thinking a lot about layer structuring lately, and the best setup I can come up with so far is:

Layer 1: Background Layer (Parallaxing / Scrolling Optional)
Layer 2: Map Layer
Layer 3: Object Layer
Layer 4: Foreground Layer (Parallaxing / Scrolling Optional)
Layer 5: UI Layer


As you can see in this video, putting objects on layer 4 can allow you to do some parallax scrolling. Basically, objects on the layer above move in the opposite direction of you, proportional to your speed and other factors. The objects themselves are actually planted in levels in fixed locations, but applying certain image settings will create the effect.


scriptless 03-15-2013 08:37 AM

Quote:

Originally Posted by Draenin (Post 1715003)
For the purposes of parallaxing backgrounds, layer 1 would need to be the background layer, while layer 2 should ideally contain the tiletype information. As an example, if you wanted to make scrolling water or a world map that parallaxes beneath some floating islands, it would need to be on the layer underneath the one players normally walk on. There are lots of different things you could do with an extra layer underneath, as well as ones above the player as well.



I've actually been thinking a lot about layer structuring lately, and the best setup I can come up with so far is:

Layer 1: Background Layer (Parallaxing / Scrolling Optional)
Layer 2: Map Layer
Layer 3: Object Layer
Layer 4: Foreground Layer (Parallaxing / Scrolling Optional)
Layer 5: UI Layer


As you can see in this video, putting objects on layer 4 can allow you to do some parallax scrolling. Basically, objects on the layer above move in the opposite direction of you, proportional to your speed and other factors. The objects themselves are actually planted in levels in fixed locations, but applying certain image settings will create the effect.


pretty cool video

Draenin 01-23-2014 07:35 AM

Bringing
Up
My
Post

Again...


This needs to happen. Also, this.

scriptless 01-30-2014 03:28 PM

Quote:

Originally Posted by Draenin (Post 1725387)
Bringing
Up
My
Post

Again...


This needs to happen. Also, this.

i feel those clouds should parallax slower.. or is it just me

Draenin 06-01-2014 07:16 AM

Quote:

Originally Posted by scriptless (Post 1725713)
i feel those clouds should parallax slower.. or is it just me

It's possible to do that with some minor adjustments, I believe.


All times are GMT +2. The time now is 11:14 PM.

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