Hello,
So I'm trying to create a jigsaw puzzle. You talk to someone and then a picture of a canvas gets shown, a bunch of puzzle pieces and a selection frame which you can move around. With the selection frame you can pick up pieces and drop them. All of that is pictures. I've been trying to control the selection frame with the show picture command and designation with variable. I have two variables, one for x and one for y of the selection frame. Then a conditional branch if (e.g.) button right is pressed down, add 96 to the variable. Now the problem is that once the puzzle starts the fps of the game drop to 2. I've tried different things and it just won't work properly. I can move around the frame just as intended. But the lag is absolutely unacceptable. What am I doing wrong?
Help would be highly appreciated.
Screenshots of your events would be more useful than a description - you're saying WHAT you've done, but to figure out lag, we need to know HOW you've done it.
My first guess would be that you have a parallel process, maybe with a loop inside (which might not be needed), and you don't have any wait command within the loop, so it's trying to process the whole thing 60 times a second. That'd do it.
I found the issue for anyone wondering: By the d button cant be a button by default, I didn't know that. I'm just going to use the arrow keys for the puzzle.
I'm thinking you might have a parallel process event somewhere (on the maps or in a menu) that's causing it to revert.
Or you've made the mistake that nearly everyone makes when using plugins - the plugin uses a switch or a variable, and you haven't checked that and reserved that switch or variable, and you're using it for something else.
If you need help with a plugin, you should provide a link so we don't have to go searching for it, and screenshots showing how you've got the plugin set up (plugin parameters via plugin manager) and how you're triggering it (could be notes, plugin command, etc). Otherwise you just leave us guessing at what might be causing the problem, and we have to ask you heaps of questions because we've got nothing to go on.
How about kicking that Plugin out of your Project and do it with standard Editor Eventing?
Button Press could be done with a Common Event, if you need certain things just exaplain them and we maybe can show Editor Eventing ways to achieve it.
If you have a Paralell Event it can repeat 30 or more Times per second, and in your constellation you are executing the "show/move picture command" that often, that could be a reason for performance loss.
I would suggest to post Picture of the Paralell Event which you tryed first, which made your 2fps problem.
That sadly doesnt help to fix your code, because the error is often in the smal detail.
If you want to solve the 30times per second and dont want to use wait commands, because they could make the gameplay less fluid, than one could use this:
Pseudocode Brainstorming:
Conditional Branch X Button pressed?
if yes do your stuff and Loop Command, Conditional Branch X Button Pressed? if yes than Wait 1 Frame and repeat Loop, if no than Break Loop.
Thatway its only executed once per button press, but you can repeat it as fast as you can push the button.
We could also implement that if you continue to hold the button that after a certain time (half a second for example) the cursor continues to move even without new button press.
Would that be something of interest?