Home LittleBigPlanet 2 - 3 - Vita - Karting LittleBigPlanet Vita [LBPV] Help!
#1
Flinging Logic Has Bad Consistency
Archive: 10 posts
Hey guys, it's L1N3R1D3R here, with a problem in LBPVita that I just can't seem to crack. http://id.api.vita.lbp.me/img/ft/01d75c5e50a81db9537b7af1c58efd4f84dbe070.jpg This is an alpha version for an obstacle I'm making. What happens is: the pipe emits boxes with bounce pads on them, which are carried over via the conveyor belt on the bottom to the last big piece of metal, which is slippery so as to keep the box's speed, but flings the box over the checkpoint (its path shown by the arrow) when the box is fully on it. You start from the checkpoint area, jump onto the first box, and continue bouncing on the boxes until you get into the cavity in the wall. As this is in the Help! section, logically I would have a problem with this. It isn't the conveyor, or the boxes emitting, but the flinger. http://i6.api.vita.lbp.me/img/ft/a8650154e11e74e01fe9bd5e5b5e1d1797d75224.jpg This is the logic for the flinger. When it senses that the box is above the microchip via the tag sensor, it turns on the bottom gyroscope for 0.4 seconds, rotating the metal to fling the box over the checkpoint, then rotates back after 0.4 seconds. The problem is, the power of the gyroscopes is really inconsistent. The first box always works properly, but for the rest, the flinger acts oddly, flinging most of them too short. I honestly don't know why this happens, as the flinger returns to its original state before the next box even gets close to it. There isn't a pattern to this odd behavior, as sometimes it works for five boxes in a row, while other times it fails for those same boxes. (If you're wondering, for both gyroscopes, the rotation speed is 221.7, and acceleration and deceleration are set to 90%.) Can someone be so kind as to point out why this is happening, and tell me how to fix it? It would be greatly appreciated. | 2013-09-12 03:14:00 Author: L1N3R1D3R Posts: 13447 |
I found that gyros in general are weak. There's multiple situations in my levels in which I've had to use 3,4, even up to 7 gyros in order to get it to counteract the weight of sack boy and the object. when considering rotating objects with a gyro always consider "moment arms" the i.e is it easier to open a door if u put your hand the door close to the hinge or closer to the handle. As u move farther away from the hinge (pivot point) the amount of force needed to rotate it around an axis will decrease. Hope this helps? | 2013-09-12 15:57:00 Author: L-I-M-I Posts: 611 |
The most likely reason that there is inconsistency will be because the blocks won't always be in the exact position when the flipper is activated. They would only need to be slightly different for the trajectory to change due to the Moments as mentioned in the previous post. Personally, I would try adding a mover and rotator to the box (faking the physics of being thrown through the air) and make the flipper weak (so it doesn't affect the movement of the box). When the box is on top of the flipper activate a count down timer set to the length of time the flipper would be in contact with the box when it flips (probably 0.1 or 0.2 seconds) then just connect the output from the timer to a mover and a rotator (both set to 100% strength and On/Off input). It will take some trial and error to find the correct values for the mover and rotator, but you should find that this will be more consistent than relying on the game's physics engine to provide the desired trajectory for the box. I haven't done this before, so it might not work. Another (easier) option maybe would be to place a block that stops the box on the flipper at the right place and the flipper is activated when the box either hits the block or stops moving. This would ensure that the block is always in the same place when the flipper activates. I would also turn off the material tweaker while flipping so it has 100% friction. | 2013-09-12 18:57:00 Author: fluxlasers Posts: 182 |
I found that gyros in general are weak. There's multiple situations in my levels in which I've had to use 3,4, even up to 7 gyros in order to get it to counteract the weight of sack boy and the object. Seriously? I thought gyroscopes were supposed to be stronger than other rotators. :/ I guess I'll try this, as well as the stop method that fluxlasers suggested below. when considering rotating objects with a gyro always consider "moment arms" the i.e is it easier to open a door if u put your hand the door close to the hinge or closer to the handle. As u move farther away from the hinge (pivot point) the amount of force needed to rotate it around an axis will decrease. Hope this helps? I...don't understand. Plus, how would this help? ---------------------------------------- The most likely reason that there is inconsistency will be because the blocks won't always be in the exact position when the flipper is activated. They would only need to be slightly different for the trajectory to change due to the Moments as mentioned in the previous post. vvv ...the flinger returns to its original state before the next box even gets close to it... Also, the logic for each box is the same. Personally, I would try adding a mover and rotator to the box (faking the physics of being thrown through the air) and make the flipper weak (so it doesn't affect the movement of the box). When the box is on top of the flipper activate a count down timer set to the length of time the flipper would be in contact with the box when it flips (probably 0.1 or 0.2 seconds) then just connect the output from the timer to a mover and a rotator (both set to 100% strength and On/Off input). It will take some trial and error to find the correct values for the mover and rotator, but you should find that this will be more consistent than relying on the game's physics engine to provide the desired trajectory for the box. I haven't done this before, so it might not work. That sounds like too much logic for each block, and the level might overheat. I want this obstacle to be as simple as possible. Plus the bold sentence scares me. Another (easier) option maybe would be to place a block that stops the box on the flipper at the right place and the flipper is activated when the box either hits the block or stops moving. This would ensure that the block is always in the same place when the flipper activates. I would also turn off the material tweaker while flipping so it has 100% friction. This might work, but it will take a while. I'll either try this or the multiple gyros idea that L-I-M-I suggested above. | 2013-09-12 22:40:00 Author: L1N3R1D3R Posts: 13447 |
Having a tag on the box which triggers a sensor that activates the flipper does not guarantee that the box will be in the exact position each time it triggers the sensor. The difference in the possible positions that the box will trigger the sensor is equal to the distance it travels in one frame - and it only requires a small difference in it's position to alter the box's trajectory when it's flipped. When I said that I haven't done this before I meant that I hadn't tried faking a flipper flipping a box so it has a consistent trajectory. I have used logic to fake lots of different motions similar to this many times. If you want consistency, using logic is the best way. It only requires 4 logic components on each box (a sensor to trigger the motion, a timer, a mover, and a rotator), this isn't going to have any kind of impact on the thermometer, especially when you consider that all the boxes are emitted and they're all the same. It may have an impact on performance, but only if you had a lot of boxes (100+ I'd say) active at the same time. The solution I gave that uses a block to stop the boxes will require the block to be moved out of the way when the box is flipped, otherwise the box will just move straight up. This problem could be solved by making the stopping block 1 small grid square and glue it to the flipper. Add an impact sensor to the stopping block to activate the flip. There is a way to make the gyro on the flipper to be a lot stronger, but that is a bit complicated to explain here. | 2013-09-13 19:13:00 Author: fluxlasers Posts: 182 |
Having a tag on the box which triggers a sensor that activates the flipper does not guarantee that the box will be in the exact position each time it triggers the sensor. The difference in the possible positions that the box will trigger the sensor is equal to the distance it travels in one frame - and it only requires a small difference in it's position to alter the box's trajectory when it's flipped. When I said that I haven't done this before I meant that I hadn't tried faking a flipper flipping a box so it has a consistent trajectory. I have used logic to fake lots of different motions similar to this many times. If you want consistency, using logic is the best way. It only requires 4 logic components on each box (a sensor to trigger the motion, a timer, a mover, and a rotator), this isn't going to have any kind of impact on the thermometer, especially when you consider that all the boxes are emitted and they're all the same. It may have an impact on performance, but only if you had a lot of boxes (100+ I'd say) active at the same time. The solution I gave that uses a block to stop the boxes will require the block to be moved out of the way when the box is flipped, otherwise the box will just move straight up. This problem could be solved by making the stopping block 1 small grid square and glue it to the flipper. Add an impact sensor to the stopping block to activate the flip. Both of those solutions sound too complex and confusing. Plus, how would a ton of movers and rotators not do much to the thermo? There is a way to make the gyro on the flipper to be a lot stronger, but that is a bit complicated to explain here. Please explain! I don't care how long it is, because it will make my logic a lot simpler. | 2013-09-13 22:34:00 Author: L1N3R1D3R Posts: 13447 |
The thermometer is an indication of how much memory the level is using. Logic components require very little memory. You would need to have lots of boxes active at the same time before the 4 extra components would have a significant impact on the thermometer. If you had lots of boxes active at the same time, but didn't have the extra 4 components, you would have problems with performance. You can increase the torque (turning force) of a gyro by increasing the mass of the object you want to move. You can do this by glueing the flipper to the face of a circle made from metal (at least 1 thick layer in depth and with a radius equal to the length of the flipper), where the flipper's pivot point is at the centre of the metal circle. The metal circle effectively increases the total mass of the object and significantly increase the torque. Place a thin piece of material between the metal circle and the flipper (but don't glue it) so that you don't see the metal circle. | 2013-09-14 10:07:00 Author: fluxlasers Posts: 182 |
The thermometer is an indication of how much memory the level is using. Logic components require very little memory. You would need to have lots of boxes active at the same time before the 4 extra components would have a significant impact on the thermometer. Oh, I getcha. I don't really want to go this method, but good info. If you had lots of boxes active at the same time, but didn't have the extra 4 components, you would have problems with performance. ...or I don't getcha. Less logic = ...more lag? You can increase the torque (turning force) of a gyro by increasing the mass of the object you want to move. You can do this by glueing the flipper to the face of a circle made from metal (at least 1 thick layer in depth and with a radius equal to the length of the flipper), where the flipper's pivot point is at the centre of the metal circle. The metal circle effectively increases the total mass of the object and significantly increase the torque. Place a thin piece of material between the metal circle and the flipper (but don't glue it) so that you don't see the metal circle. This right here is very helpful. Thanks! In the end, I just used five gyroscopes instead of one, and it worked fine. Mod, please lock, but I will add to the LBPWiki this information about gyroscopes. | 2013-09-16 22:35:00 Author: L1N3R1D3R Posts: 13447 |
Glad u got it to work | 2013-09-19 13:39:00 Author: L-I-M-I Posts: 611 |
Locked per OP request | 2013-09-19 14:35:00 Author: Lady_Luck__777 Posts: 3458 |
LBPCentral Archive Statistics
Posts: 1077139
Threads: 69970
Members: 9661
Archive-Date: 2019-01-19
Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.