[update]: I have added a movement repeater in the tutorial level, along with a diagonal direction blocking system.
Hi, here's a way to do grid movement using selectors that I'd like to share with you:
To summarize, I use two coloumns filled with tags, activated by selectors. By making the vertical coloumn follow the horizontally activated tags, I create a grid, based on tag placement.
The technique is suitable for small grid based games, and grid menus. For big playgrounds, more connections must be made, but the number of connections do not increase exponantially, only linearly. The advantage of the technique is being able to scale the whole grid, employ custom grid sizes by uneven placement of tags, and the impossibility of falling out of the grid with fast movement, which is a problem inherent with grids using advanced movers. The disadvantage is having to make 1 connection for each unit (not the whole area, tho, only 1 for each horizontal and vertical size), and the need to have overlayed elements for each object that will follow the grid, thus making this technique suitable for menu systems or small grid based games with limited amount of characters on screen. It can be mixed and matched with other grid techniques, e.g. this may be used for vital objects that shouldn't fall out of grid.
If you can't bear with me slowly talking in the video tutorial, the level / objects can be found at:
It's a copyable and shareable level, and contains object from the tutorial.
Results 1 to 15 of 16
- Join Date
- May 2011
Custom grid movement using selectors [update]
Last edited by hesido; 06-16-2011 at 12:59 PM.
I also did a tutorial about grid movement. No wait...I did two
I think my way is a bit easier.
Take a look at it:
Your way is probably easier, but when I tried it out it would go very slightly off grid. I messed around with a lot of grid movement stuff when making the Random Maze Generator and found that followers give the most accurate grid movement.
Good tutorial. I like how you simplified it by having only one vertical collum.
When I did my way it never goes off the grid.
I tested it of course properly!
- Join Date
- May 2011
Thanks, I hope this method is helpful in some situations I'm making an infinite motion version without any size restrictions that uses a few tags. Then the only limitation would be having to name the tags differently for each object, but as I mention, this technique may be used for critical objects on the level.
I think most people know about your tutorials. This is another method, one that has advantages and disadvantages over the advanced mover method, but the methods can co-exist peacefully.
Actually, I use advanced movers for my boulder dash level, and I've done countless hours of testing. Advanced movers tend to make you fall out of grid if you have a lot of high-frequency input (problems begin at around 0.1 seconds): waggle the controller for a while, and you'll see. Advanced movers sometimes, although infrequently, do not honour the grid when the temperature gets very high. This as I speak as I have dozens of moving objects in the boulder dash level, and I can do a lot of testing for different situations. For the high frequency input, I use signal blockers if the next signal is less than 0.2 seconds apart, otherwise, sometimes you fall out of grid.
As I also mentioned (if you watched the entirety of the tutorial) the technique allows for arbitrary grid sizes, you never know when you may need it
I remember now why the method you used doesn't work as well. The problem is that the advanced mover requires a certain amount of time to decelerate properly so if you use a basic pulse and have fast inputs the mover can't come to a complete stop, thus moving the object off the grid. Take a look at Shiwayari's tutorial to get a better explanation.
While his tutorial fixes the problems, it has a required delay in between movement. If you want to have faster grid movement than hesido's method is the way to go.
No...even with 100% Deceleration you can move too fast. Looks like I forgot the link in my last post...here is Shiwayari's tutorial for grid movement with movers.
That tutorial can probably explain it better than I can.
Wow what a great tutorial. I tried to do something like this, but it didn't come close to yours. I can think of so many ways this can be used... This is gonna be the foundation for so many of my logic systems in the future, thanks man.
Thanks for posting this, it's so simple and ingenious.Code:
>As for the science, it may be negative. However, do not forget the thing that there is a scientific side in all the one. The important one is true. of me the ruler of my fate, and me also the commander of my soul. >▉
I just tried your method scorpskull and it's not exactly what I wanted.
I'm trying to make a topdown pogo stick level where the player only moves when the in/out mover has the player "in the air" basically.
With your method, you have to continuously tap directions in order to move. How do you make it so you KEEP moving no matter what? and stop only when the object is in layer #1 and moves in layer #2?
Note: the player MUST stay in the grid and can not go diagonal.
- Join Date
- May 2011
This is not Scorpskull's thread, this is a different method, but repeating the signals would be the same in principle.
There are quite a number of ways to keep repeating the movement, and not allow diagonal movement. The easiest way is to use a selector with at least 5 inputs after splitting the analogue signal. You'll leave the last selector inputs for blocking the signal briefly, connected to a timer and the "not" signals of the stick for blocking the signal when the timer is off or when the user is not moving the stick. Using selectors, you can have any number of blocking conditions, such as being up / down, without using convoluted and's or's or xors, simply by connecting these conditions to higher selector inputs, the outputs of which do not need to be connected to anything.
Last edited by hesido; 06-16-2011 at 01:01 PM.Levels:
Diamond Dash, the 1:1 Boulder Dash Clone
Typewriter giveaway level, with original font
Custom grid movement tutorial
Hesido's Pixel Perfect Sticker Capture and Placement (for animation and pixel art)
Circular signaling, deferred/verified counting tutorial
Detecting changes over analogue signals