I think I see what you mean. I added events with random move rotues on a map, 5 at a time. Once I had like 25+ events on the screen there would be frame drops whenever an event moved lol, really noticeable with 30-35+. But this isn't caused by the event collision check since it checks for collision for every event on the map ( or on the screen with my optimize script ). But after some tinkering I've made it even more optimized! Made it so events are split up into different 2d arrays, then when it checks for collisions it only grabs events that are on the grid spaces you take. But there's some random nil error that pops up every so often, so needs some work still.
Quasi Movement
RGSS3 Scripts (RMVX Ace)Oh my god I love this script. *_* The movement works great and the collision map is exactly what I've been looking for.
Two questions though-
Even though I have EVENTFREQ = 32, my events are still moving only a few pixels at a time when I set moveroute. This makes random moving NPCS look especially, uh, hyper. I've read through the documentation but I don't see what else I might have to change. Probably missing something obvious.
And... I don't suppose you could have a stand-alone version of the collision map that could be compatible with other movement scripts? Problem is my current project is being built around Victorscripts with it's multi frame and alternate animation stuff, and I've been unable to get them to work together with your stuff on my own. :T Is it possible?
Alternatively do you have any plans to add things like support for diagonal movement/more animation frames/etc to your version? That would be awesome too 😀
Two questions though-
Even though I have EVENTFREQ = 32, my events are still moving only a few pixels at a time when I set moveroute. This makes random moving NPCS look especially, uh, hyper. I've read through the documentation but I don't see what else I might have to change. Probably missing something obvious.
And... I don't suppose you could have a stand-alone version of the collision map that could be compatible with other movement scripts? Problem is my current project is being built around Victorscripts with it's multi frame and alternate animation stuff, and I've been unable to get them to work together with your stuff on my own. :T Is it possible?
Alternatively do you have any plans to add things like support for diagonal movement/more animation frames/etc to your version? That would be awesome too 😀
This is kind of similar to this question:
http://forums.rpgmakerweb.com/index.php?/topic/37087-quasis-sight-and-movement-scripts/?p=368747
I set random so they move 16-32 pixels at a time. EVENTFREQ just tells the event to stop after every X moves. Maybe I should add in some settings for random.
No the collision map script requires a bounding box feature, which is what makes my movement different from the rest ( I think mines the only with a bounding box, not sure lol ). So other movement based scripts will either have some weird behavior or not work at all.
Diagonal movement animations can be easily added in. I have a sprite animations script in progress which will let you make different animations in what ever pattern you want. Ex. You'll be able to set up a swing animation that's 8+ frames and all you would do to run it would be something like "anim(NAME)". This has the diagonal built in as well, and you can change how the sprite sheets are read which is what you are asking. But not sure when I'll release that since it's not on my top priority.
^ Well I'd damn near pay for the animation stuff so bump for priority .
Hah, same 🙂 (Though I found that Quasi movement DOES work with Victor's multi frames and character animation, just not with sprites for his diagonal movement. )
Another thing I wonder if is feasible- could you have different sized bounding boxes for a character depending on which way they're facing? Like if you have a character that's larger from the side than the front due to something like wings on their back.
Another thing I wonder if is feasible- could you have different sized bounding boxes for a character depending on which way they're facing? Like if you have a character that's larger from the side than the front due to something like wings on their back.
I finally got my new optimize script working smoothly now! And I also fixed a bug in the movement script. I forgot to put shift_y to event boxes, so event boxes were incorrect. I also made random move be related to EVENTFREQ, and I'm about to update the demo in a couple of minutes! ( Demo Updated )
Links:
https://github.com/quasixi/RGSS3/blob/master/System/Movement.rb
https://github.com/quasixi/RGSS3/blob/master/System/Optimize.rb
https://www.dropbox.com/s/9j0yjh1z3exmd6n/Quasi%20-%20Demo.exe?dl=0
@Juggernaut & Ivyna
Well its not in top priority mainly because I don't have sprites for different actions or different frame counts to use as reference. And I'm to lazy to make some or find some lol. If you have some have or the link to them feel free to pm me them!
You have to use the 2nd box method:
<bbox>:main => [width, height, ox, oy]:dirX => [width, height, ox, oy]</bbox>:main is the default box to use if using a direction that isn't set, and the X in :dirX is the number equivalent to the direction (2, 4, 6, or 8)
This can be placed inside an actors notebox, or inside an event comment. ( Screenshots of this on the first post, inside a spoiler )
Links:
https://github.com/quasixi/RGSS3/blob/master/System/Movement.rb
https://github.com/quasixi/RGSS3/blob/master/System/Optimize.rb
https://www.dropbox.com/s/9j0yjh1z3exmd6n/Quasi%20-%20Demo.exe?dl=0
@Juggernaut & Ivyna
Well its not in top priority mainly because I don't have sprites for different actions or different frame counts to use as reference. And I'm to lazy to make some or find some lol. If you have some have or the link to them feel free to pm me them!
That's already included! In the first post + my site.
You have to use the 2nd box method:
<bbox>:main => [width, height, ox, oy]:dirX => [width, height, ox, oy]</bbox>:main is the default box to use if using a direction that isn't set, and the X in :dirX is the number equivalent to the direction (2, 4, 6, or 8)
This can be placed inside an actors notebox, or inside an event comment. ( Screenshots of this on the first post, inside a spoiler )
Gah I'm sorry somehow I totally missed that. Thank you again!
As for multi frames and such... well it's super crude but while I was figuring out Victor's scripts I used files like this to see if I was setting it up right-
[IMG]http://ivynajspyder.com/sprite/%24Actor4test%5Bf6%5D.png[/IMG] [IMG]http://ivynajspyder.com/sprite/%24Actor4test%5Bf6%5D%5Bdsh%5D.png[/IMG][IMG]http://ivynajspyder.com/sprite/%24Actor4test%5Bf6%5D%5Bdiag%5D.png[/IMG]
So the different colors and numbers tell me if it's actually scrolling through the frames in the right order and changing when the character dashes/walks diagonally, etc, since I have yet to finish my own sprite sheets.
Edit: Playing around with this more and found something odd. I read through the directions again just in case and searched through this thread but this wasn't mentioned.
If I have an event set to 'below player' and activate on player touch, it doesn't seem to work. I set it to have a collision box and everything and I can see it in the testing screen, but walking over it does nothing. This unfortunately includes transfer events. :T
As for multi frames and such... well it's super crude but while I was figuring out Victor's scripts I used files like this to see if I was setting it up right-
[IMG]http://ivynajspyder.com/sprite/%24Actor4test%5Bf6%5D.png[/IMG] [IMG]http://ivynajspyder.com/sprite/%24Actor4test%5Bf6%5D%5Bdsh%5D.png[/IMG][IMG]http://ivynajspyder.com/sprite/%24Actor4test%5Bf6%5D%5Bdiag%5D.png[/IMG]
So the different colors and numbers tell me if it's actually scrolling through the frames in the right order and changing when the character dashes/walks diagonally, etc, since I have yet to finish my own sprite sheets.
Edit: Playing around with this more and found something odd. I read through the directions again just in case and searched through this thread but this wasn't mentioned.
If I have an event set to 'below player' and activate on player touch, it doesn't seem to work. I set it to have a collision box and everything and I can see it in the testing screen, but walking over it does nothing. This unfortunately includes transfer events. :T
Sweet I'll try those frames out, thanks!
Edit: Fixed that bug ( from line above ). Apparently encounters didn't work either since they were being updated.
Oh good catch! Yeah I forgot to test event triggers with the event being below. I'll try to get this fixed asap!
Edit: Fixed that bug ( from line above ). Apparently encounters didn't work either since they were being updated.
This script is really great! I have two questions:
1) I'm planning on relying only on a collision map for collision (no tiles, no regions), but I've noticed that tile passability is taken into account even when you have a collision map loaded. One solution would be to set all titles as passable, but do you think it would help reduce lag if tile and region passability weren't checked at all?
2) I had some problems with event page conditions. I had a door set up like this:
PAGE 1 (No condition) [sprite: closed door] [Through: unchecked] [Action Button]
Message: You can't do this right now
PAGE 2 (Condition: Plot_variable >= 1) [sprite: closed door] [Through: unchecked] [Action Button]
Set move route: change graphics to open door
Self_Switch_A = ON
PAGE 3 (Condition: Plot_variable >= 1 && Self_Switch_A == ON) [sprite: open door] [Through: checked] [Action Button]
Set move route: change graphics to closed door
Self_Switch_A = OFF
When I open the game, the door can't be interacted with at all. If I change Plot_variable to 1, leave the map and then come back, I'm able to open the door (but not close it), and the event remains impassable. I believe this happens because PAGE 3 is never activated, probably because it's having problems with 2 conditions instead of just 1.
This might be a compatibility problem with another script, though I'm not quite sure why it would happen. I'll try to test it in a brand new project tonight.
1) I'm planning on relying only on a collision map for collision (no tiles, no regions), but I've noticed that tile passability is taken into account even when you have a collision map loaded. One solution would be to set all titles as passable, but do you think it would help reduce lag if tile and region passability weren't checked at all?
2) I had some problems with event page conditions. I had a door set up like this:
PAGE 1 (No condition) [sprite: closed door] [Through: unchecked] [Action Button]
Message: You can't do this right now
PAGE 2 (Condition: Plot_variable >= 1) [sprite: closed door] [Through: unchecked] [Action Button]
Set move route: change graphics to open door
Self_Switch_A = ON
PAGE 3 (Condition: Plot_variable >= 1 && Self_Switch_A == ON) [sprite: open door] [Through: checked] [Action Button]
Set move route: change graphics to closed door
Self_Switch_A = OFF
When I open the game, the door can't be interacted with at all. If I change Plot_variable to 1, leave the map and then come back, I'm able to open the door (but not close it), and the event remains impassable. I believe this happens because PAGE 3 is never activated, probably because it's having problems with 2 conditions instead of just 1.
This might be a compatibility problem with another script, though I'm not quite sure why it would happen. I'll try to test it in a brand new project tonight.
Been awhile! But I finished up the sprite animations script thing. I'll be releasing it within a week.
@Rairun
1) No it'll run exactly the same. What this script does is, at the start of the map it loads every tiles ( ignoring ones that are passable ) then converts them into the proper box and then draws them into the collision map bitmap, if you didn't load a collision map it makes one. So overall this script is really only checking for collisions on the Collision map.
2)Does sound odd. I'll try to run some tests later on to see if i can get similar results. I'll wait for you to try it on a new project though.
@Rairun
1) No it'll run exactly the same. What this script does is, at the start of the map it loads every tiles ( ignoring ones that are passable ) then converts them into the proper box and then draws them into the collision map bitmap, if you didn't load a collision map it makes one. So overall this script is really only checking for collisions on the Collision map.
2)Does sound odd. I'll try to run some tests later on to see if i can get similar results. I'll wait for you to try it on a new project though.
Thanks for the answers! (1) sounds good, and (2) was my fault. The script was incompatible with Source's Effectus anti-lag script, but I've managed to fix it.
Now there are only two issues stopping me from switching from Victor's Pixel Movement to this one:
(A) I'm relying quite heavily on the waypoint(x,y) script call from Vlue's Eventing: Fine Tuning v3.4, but it only works properly if I set the grid to 32. Victor's Pixel Movement script works with it because it only considers an event to be at a given square coordinate when the event is placed perfectly inside it. With your script, as soon as the border of the box touches a map square, it's considered to be within it. To troubleshoot this, I created an event with this script call:
$game_variables[270] = $game_map.events[5].y$game_variables[271] = $game_map.events[5].xFollowed by a Show Text command like this: \V[271], \V[270]
If event 5 is at its original location, the event above outputs the correct coordinates. If I use waypoint(10,10), it will stop before it reaches the correct square, but the event above will still output "10, 10" - the wrong coordinate.
( 😎 When I use a self switch and conditions to change from one event page to another, the event changes places unless it's standing perfectly within the map square. I believe this problem is related to the one above.
Are these issues fixable or are they an inherent part of your system? If there is a way to change this, it'd be absolutely amazing.
Awesome!
A ) Yeah I have been told it doesn't play well with Vlue's script. I haven't looked into it yet though, but I do have a pathfinding ( guessing that's what waypoint is ) script made specially for this script but I haven't released it yet. I'm still trying to optimize it more before releasing it, atm it takes about 0.2 sec in pixel grid mode for a path that considers about 3/4 of the screen I've been trying to cut that down to be below 0.05 before releasing. But I might just look into it to make it more compatible with other scripts that way this could work with Sources pathfinding script since it sounds amazing and will probably still run smooth in pixel mode.
B ) Is there anything different between the two pages? Like script related comments. Or was the event moving then switched page?
A ) Yeah I have been told it doesn't play well with Vlue's script. I haven't looked into it yet though, but I do have a pathfinding ( guessing that's what waypoint is ) script made specially for this script but I haven't released it yet. I'm still trying to optimize it more before releasing it, atm it takes about 0.2 sec in pixel grid mode for a path that considers about 3/4 of the screen I've been trying to cut that down to be below 0.05 before releasing. But I might just look into it to make it more compatible with other scripts that way this could work with Sources pathfinding script since it sounds amazing and will probably still run smooth in pixel mode.
B ) Is there anything different between the two pages? Like script related comments. Or was the event moving then switched page?
OK, I'm not quite sure how to change this in the script, but I think I figured out exactly what is going on!
- $game_map.events[1].x and $game_map.events[1].y are determined by the location of the event box's upper left pixel. That is, if the upper left pixel is at x == 3.9 and y == 2.1, $game_map.events[1].x and $game_map.events[1].y will return 3 and 2.
- Keeping that in mind, it's easy to understand why Vlue's waypoint(x,y) script call doesn't work correctly when the event is about to arrive at its destination. If the event is moving up or to the left, the upper left pixel will enter the map square before the whole event is inside. Vlue's script will read $game_map.events[1].x and $game_map.events[1].y and say, "Hey, we've arrived."
- This is also why moving down or to the right works perfectly: the upper left pixel of the event box is the very last one to enter the square.
- This is also why the event changes locations when there is a page switch. If the upper left pixel is at x == 3.9 and y== 2.1, when the page changes, it will be recreated at x == 3 and y == 2. (To answer your question: the pages were exactly the same, and the event was moving when the pages were switched.)
I'm guessing this means that the location should be stored and returned as a float, not an integer. Would this take a lot of work to change?
***
On a different note, Vlue's waypoint(x,y) isn't really a proper pathfinding script. All it does is make an event move towards a coordinate, but if there is anything blocking the way, it doesn't try to circumvent it. I'm fine with this because it's all I need, and it's not as resource-intensive.
- $game_map.events[1].x and $game_map.events[1].y are determined by the location of the event box's upper left pixel. That is, if the upper left pixel is at x == 3.9 and y == 2.1, $game_map.events[1].x and $game_map.events[1].y will return 3 and 2.
- Keeping that in mind, it's easy to understand why Vlue's waypoint(x,y) script call doesn't work correctly when the event is about to arrive at its destination. If the event is moving up or to the left, the upper left pixel will enter the map square before the whole event is inside. Vlue's script will read $game_map.events[1].x and $game_map.events[1].y and say, "Hey, we've arrived."
- This is also why moving down or to the right works perfectly: the upper left pixel of the event box is the very last one to enter the square.
- This is also why the event changes locations when there is a page switch. If the upper left pixel is at x == 3.9 and y== 2.1, when the page changes, it will be recreated at x == 3 and y == 2. (To answer your question: the pages were exactly the same, and the event was moving when the pages were switched.)
I'm guessing this means that the location should be stored and returned as a float, not an integer. Would this take a lot of work to change?
***
On a different note, Vlue's waypoint(x,y) isn't really a proper pathfinding script. All it does is make an event move towards a coordinate, but if there is anything blocking the way, it doesn't try to circumvent it. I'm fine with this because it's all I need, and it's not as resource-intensive.
Ah yeah, that's how I have it set up to work though
As for the event page change, I tested it and see what you mean. This is happening because of the <ox=#> and <oy=#> since it checks it every time the page changes, so it's resetting it's location to a 32 grid spot then changes it's offsets. But I can fix this part, I just never noticed it lol
If you think the float int works instead, you can try using .real_x and .real_y since those at the float version. Changing x and y to be floats would only require a change in 2 lines. But the reason I kept x and y as int was to try to avoid incompatibility, but that's probably working against me now lol.
As for the event page change, I tested it and see what you mean. This is happening because of the <ox=#> and <oy=#> since it checks it every time the page changes, so it's resetting it's location to a 32 grid spot then changes it's offsets. But I can fix this part, I just never noticed it lol
If you think the float int works instead, you can try using .real_x and .real_y since those at the float version. Changing x and y to be floats would only require a change in 2 lines. But the reason I kept x and y as int was to try to avoid incompatibility, but that's probably working against me now lol.
Ah, since it's so easy to do it, could you walk me through it? What lines would I need to change? I'm almost sure that would do the trick, but I'm still not very good at this.
That would be lines 886 and 887
@x = @real_x.truncate if @x != @real_x.truncate @y = @real_y.truncate if @y != @real_y.truncatechange that to
@x = @real_x @y = @real_yThe event page change is already fixed but i'll post an updated version if this x /y change fixes it
@x = @real_x.truncate if @x != @real_x.truncate @y = @real_y.truncate if @y != @real_y.truncatechange that to
@x = @real_x @y = @real_yThe event page change is already fixed but i'll post an updated version if this x /y change fixes it
Brilliant. 😀 Both problems are fixed. Thank you!
I've updated it
-Link-
I added in 2 extra settings. OFFGRID and FLOAT_XY. Also fixed the issue with the events position when changing page.
-Link-
I added in 2 extra settings. OFFGRID and FLOAT_XY. Also fixed the issue with the events position when changing page.
Hey Quasi, I have one more question, if you can spare the time.
Do you have any idea why this script doesn't work properly with Lone Wolf's Gamepad Extension? If the gamepad is plugged in and configured to use the left analog stick to move (this is the default), then the player character will always face left when not moving. This only happens when you add the Quasi Movement script, though.
Note that if the gamepad is unplugged, it works fine. If you plug the gamepad, you can use the left stick in window scenes without problems too (as long as you configure the scenes to use PadConfig keys first). The player character behaves properly if you configure the Gamepad Extension script to use the d-pad buttons. There are only issues when using the analog stick to move the character.
To test this, all you need to do is add the Gamepad Extension script to the Quasi Movement demo project, and set QUICKTEST = true (so you don't have to configure the main menu scene to use the custom buttons).
Do you have any idea why this script doesn't work properly with Lone Wolf's Gamepad Extension? If the gamepad is plugged in and configured to use the left analog stick to move (this is the default), then the player character will always face left when not moving. This only happens when you add the Quasi Movement script, though.
Note that if the gamepad is unplugged, it works fine. If you plug the gamepad, you can use the left stick in window scenes without problems too (as long as you configure the scenes to use PadConfig keys first). The player character behaves properly if you configure the Gamepad Extension script to use the d-pad buttons. There are only issues when using the analog stick to move the character.
To test this, all you need to do is add the Gamepad Extension script to the Quasi Movement demo project, and set QUICKTEST = true (so you don't have to configure the main menu scene to use the custom buttons).
Fixed!
Luckily I had a half working gamepad lol, my right analog stick doesn't work but the left one did! It was just a small bug that when the analog stick was at its center position it would send direction 5, so my player move would try to move the character in direction 5.
Luckily I had a half working gamepad lol, my right analog stick doesn't work but the left one did! It was just a small bug that when the analog stick was at its center position it would send direction 5, so my player move would try to move the character in direction 5.
Original thread: https://forums.rpgmakerweb.com/threads/quasi-movement.34088/