is there any way or extension to create an event after rendering the frame and before the pre-events?
Not sure what exactly you’re asking, but I can guess.
If you’re wondering if you can do an event after rendering the frame, wouldn’t it make more sense to just delay the event 1 frame? Then have it run at the beginning of the next frame?
The align to grid extension is failing me because I use normal horizontal forces instead of horizontal forces from platform behavior. The creator of the extension told me not to use those forces with the behavior of platforms, however beyond the extension to align to the grid I have not had any problems. It is not easy to do a “Mario in Donkey Kong arcade” type jump using platforming behavior “instant” horizontal forces even though it sounds stupid, however with normal permanent horizontal forces it is very easy. So I made the determination to stick with horizontal permanent forces for my game, after all it is very advanced and there is no problem except with the align to grid extension.
So I decided to make my own code to align the grid on each frame. It works fine except when the speeds of certain objects are very low, since it always rounds down and the objects never move. This would have a solution if I align the grid to render the image and then add those decimals again before the pre-event where the objects move.
I could add those decimals at the beginning of the frame too but my head explodes and I don’t know if it will work. I would be calmer if it was added before
Nope, not in the normal event sheet. You could build your own behavior if you want, then you could build out pre-event logic there, but only on a per object basis (which is how behaviors work).
You might re-evaluate what issues you’re having with the normal platformer behavior, because Mario in Donkey Kong would use that behavior and work just fine. Just have a “full jump” distance (no jump sustain, jump acceleration would be *10 the jump max speed, etc).
Otherwise, feel free to play around with building out your own behavior and see if it does what you are looking for.
What exactly are you trying to align? It would help greatly. I guess I dont understand the difference between pre and post events and just the first and last event.
Another option would be to move hidden linked sprites and then align the linked visible objects to a grid. It would depend on how many objects you’re using.
Sorry but have you tested it? you will realize that the horizontal instant platform behaviour force cannot be modified in the air because the behaviour uses the walking horizontal platform behaviour force value in the pre-event canceling any force instant platform behaviour modified value. So it doesn’t matter if you sets the horizontal force instant platform behaviour to 10000000, this behaviour always uses the walking horizontal force value in the air like horizontal force. I need more horizontal speed in the jump than walking so the jump is sort. I was dealing with a workaround changing the walking speed in the air but I remember that it didn’t work and the best solution was to get rid of the grid extension and return to normal forces
Thank you guy for the help, great community
My game is 720p but uses fake 180p resolution so I want the sprites aligned to a grid of 180p in a 720p resolution just like to emulate 180p resolution. The story to explain the 720p resolution is long but its related to place custom scanlines in the game.
I guess I understand. Are you taking about making it look not just like 8-bit but if it used huge pixels? Instead of 1 to 1,000 pixels wide, you want say 1 to 100 across the same screen distance. Jumping from pixel to pixel.
Indeed otherwise it would be crappy in my opinion.
I accidentally posted this earlier to the wrong thread. I’m not sure this will help. I’m suggesting using a hidden sprite for the fine movement but then have it follow it in a grid like system.
Sorry if it doesn’t help. That’s my best thought at the moment.
Click to add a ball
Did you try this extension?
https://wiki.gdevelop.io/gdevelop5/extensions/pixel-perfect-movement/reference
Maybe you don’t remember me, don’t worry. The story is to resume: platformer behaviour doesn’t let change the horizontal force jumping because it’s using the walking force instead. So I can’t change the lenght of the jump unless I change the walking force aswell at once. So I’m using normal forces instead forces of platform behaviour. You say to me don’t do that because it has conflict with your pixel perfect extension, indeed just like in other thread we saw.
So I am making my own align to grid code still in process.
I’ve added a line of code at the end to your example to show the problem of not being able to modify the horizontal force while jumping. Obviously, the problem is related to the the built-in platform behavior and not to your extensions.
This event is multiplying the speed by 2 every frame. It would multiply it by 10^18 every second, but the Platformer behavior makes sure that the speed doesn’t go over the max speed.
To make a platformer character moves faster, the maximum speed and acceleration must be changed, not the current speed.
Changing the current speed is useful for dashes mostly.
Even when the character has no any inertia? I don’t want any inertia in the character, just linear movement even jumping. Just like Final Fight, Street Fighter II, Ghost and Goblins or Donkey Kong.
I want replicate that kind of jump: only one height possible, no inertia, no control of the character in the air until landing.
If it’s not asking too much, you can modify your example to reproduce a jump like this, please
Just an idea. Not sure if this was brought up. What if you disable the controls when the jump button is pressed and then if left or right was pressed you can continue to simulate the key(s) until the character lands? You then reenable the default controls. IDK if you’d also have to simiulate a jump key to maintain the jump.
ok, I’m sorry davy because I was very confused with how platform behavior works.
I had not realized that to have a linear behavior of horizontal movement you have to remove the deceleration but not the acceleration because otherwise the character will not move. Anyway the deceleration value has to be greater than zero for the pixel perfect extension to work correctly, the value 1 or even less is enough. I think the acceleration value has to be the square of the speed for eliminate any inertia a has linear movement.
I have managed to change the code to use horizontal forces of platform behavior, now I have other problems but I will open it in another thread.
Thank you davy and I’m sorry again . Thank you to everyone aswell.