S
Scrydan
Guest
I have been looking into this lately and been wrapping my head around the limitation of layer moving. For the past week I have been re-implementing some things in my old project while I looked into this. The layer system is quite cool and can easily in my opinion be used to manipulate whole groups of instances as well.
To explain what effect I'd like, no other example comes closer than Super Mario World. Anyone who has ever played with Lunar Magic knows there exists "layer 2" which is the layer that can be manipulated to come crashing down or gradually moving up and down. This can be lava, walls, or anything else solid that isn't a movable sprite (which in comparison to here is an instance object set to have behaviors that usually move them around on their own).
That in mind, I have been wanting the same effect. For example, in one level I have lava that rises while you race to escape to the top. In another I have lava that tries to rise unless you hit a switch and forces the layer's Y to go back down to its base position before it rises once more.
Now of course this effect can be done naturally like its always been. However, I do believe that instances in a layer should be able to be manipulated in such a way that it makes it easier to control groups of instance objects with one line of code. Because this is such a powerful new system, there is tons of potential. Even some organizational purposes.
This inside a step event would in turn move the layer slowly to attempt to reach the player with instances of lava or whatever from the bottom of the screen with an easy bit of code. For example, if I later decided to add some platforms, those too would be moved within that layer.
This versus adding special flags and cases for those object instances to move like this would be way easier in my opinion. Functions a user makes could also do this, but the idea is to make the process simple.
Now comes possible limitations which I am unsure of. I am not sure the original intent to only move sprites and backgrounds with layers, but I'd assume that instances that also move could cause problems in certain calculations. If this is the case, and that we need to prevent instances from moving from this layer then could there be some flag that states this instance is unmovable? And that the only way it moves is through external means like layer moving?
One other thing I can think of is that instead of moving by layer, there is some way to 'group' instances. This group could have code that effects each instance's X and Y or with proper checks set certain variables. There might be something I am missing too. However, I think a group or layer moving ability would be quite nice.
Group instance functions could look something like (by no means is complete list or exact parameters):
Also if you edit the room instance group and move it around, it'd be like if you moved it with each instance selected so you move the whole group of instances. Might be handy for some who don't want to constantly select instances over and over to move them.
----Feedback----
I do want to say in advance thank all you wonderful people for making Game Maker Studio 2. It is quite a powerful system compared to the past ones, and it really does feel much more modern and feature rich. Layers for instances, backgrounds, and sprites is quite awesome! No more do I have to create an object for a simple decoration that never moves or acts. Sprite editor is quite feature rich as well. In compares and in some ways better than my editor of choice, Paint.net. Only thing I can think of adding is a way to export sprites. Sure you can do so manually by going into project files, but just an ease of convenience for archival purposes.
Layers can allow for much easier organization and I think can be used in ways still not yet thought of. For example, mass removal of objects based on difficulty based on difficulty layer/group. Allowing the game to be more dynamic rather than assigning a function to give each instance for its self destruct if their range is past the difficulty.
I mostly come from Game Maker 8.1, with some Studio experience. So you can definitely see the night and day differences between the two engines and its editors. Originally making my project back in 2011 for college. Simpler times.
Best of luck with GMS2 development! Thanks for reading this. Hoping for a smooth release!
To explain what effect I'd like, no other example comes closer than Super Mario World. Anyone who has ever played with Lunar Magic knows there exists "layer 2" which is the layer that can be manipulated to come crashing down or gradually moving up and down. This can be lava, walls, or anything else solid that isn't a movable sprite (which in comparison to here is an instance object set to have behaviors that usually move them around on their own).
That in mind, I have been wanting the same effect. For example, in one level I have lava that rises while you race to escape to the top. In another I have lava that tries to rise unless you hit a switch and forces the layer's Y to go back down to its base position before it rises once more.
Now of course this effect can be done naturally like its always been. However, I do believe that instances in a layer should be able to be manipulated in such a way that it makes it easier to control groups of instance objects with one line of code. Because this is such a powerful new system, there is tons of potential. Even some organizational purposes.
Code:
layer_vspeed("instances_movable", -1);
This versus adding special flags and cases for those object instances to move like this would be way easier in my opinion. Functions a user makes could also do this, but the idea is to make the process simple.
Now comes possible limitations which I am unsure of. I am not sure the original intent to only move sprites and backgrounds with layers, but I'd assume that instances that also move could cause problems in certain calculations. If this is the case, and that we need to prevent instances from moving from this layer then could there be some flag that states this instance is unmovable? And that the only way it moves is through external means like layer moving?
One other thing I can think of is that instead of moving by layer, there is some way to 'group' instances. This group could have code that effects each instance's X and Y or with proper checks set certain variables. There might be something I am missing too. However, I think a group or layer moving ability would be quite nice.
Group instance functions could look something like (by no means is complete list or exact parameters):
Code:
instance_group_vspeed(groupid, -1);
instance_group_y(groupid, instance_group_gety(groupid)+20);
instance_group_setdisabled(groupid, true);
instance_group_destroy(groupid, layer); //destroys specified layer or destroys all with 'all'.
----Feedback----
I do want to say in advance thank all you wonderful people for making Game Maker Studio 2. It is quite a powerful system compared to the past ones, and it really does feel much more modern and feature rich. Layers for instances, backgrounds, and sprites is quite awesome! No more do I have to create an object for a simple decoration that never moves or acts. Sprite editor is quite feature rich as well. In compares and in some ways better than my editor of choice, Paint.net. Only thing I can think of adding is a way to export sprites. Sure you can do so manually by going into project files, but just an ease of convenience for archival purposes.
Layers can allow for much easier organization and I think can be used in ways still not yet thought of. For example, mass removal of objects based on difficulty based on difficulty layer/group. Allowing the game to be more dynamic rather than assigning a function to give each instance for its self destruct if their range is past the difficulty.
Code:
funct_difficulty(1,3); // would delete the instance if less than 1 or greater than 3
Best of luck with GMS2 development! Thanks for reading this. Hoping for a smooth release!