External layer is flicking every time I load the scene


#1

As the title says.
The only thing I did is to add the condition “Trigger Once” and the action “Create objects from the external layer” with X=0 and Y=0. But everytime I load the scene, the layer is offset for one frame, then flicks back to its intended position afterwards.

A little help?


Weird visual glitch when setting scene to current scene
#2

Do you have an example?


#3

I tried in vain to record the thing, but my usual recorder won’t work. As I said, it lasts just for a single frame, so no screenshots either.

This is my testing event line. X position of the origin = 0, Y position of the origin = 0.


#4

at the beginning of scene event is executed only once, no need for run once


#5

Changed it, still moves. But thanks for the advice!


#6

I can not reproduce it. Can you reproduce it in a new project and then share that project so we can try on our hardware?
If you can not reproduce it then it may be something you do with the position or zoom of the camera…


#7

I didn’t change a thing about the zoom, or so I think. The resolution was the default 800x600 px and I had no zooms, no specifics animations or camera movements.

Here’s a link to a sample project : https://drive.google.com/file/d/14Ju1nBG0h2-A0SNB-puzKgdRJv0VZLUz/view?usp=sharing

Clicking on the green tank “refreshes” the scene, if you click on it fast enough, you can clearly see the layout flicking.


#8

@4ian
I can confirm the flicker when you change the scene and load an external layout. It doesn’t seems to appear when you load the scene initially but when you change the scene.

it maybe got something to do with the new engine.
I tried this project of mine:

The one you can play on the website was exported from GD4. When you go to the hangar and select fitting and hull it is loading the content from external layout and I don’t experience any flicker.
If you download the source and load it in to the current version of GD5 and run preview the flicker does appear when you go to the hangar and change between fitting and hull back and forth.


#9

I see… A shame we can’t do something about it. But thanks a bunch, I really thought I was doing something wrong. I hope it can be fixed in the future.

Pretty nice game by the way! Dunno if I’ll ever be able to do a game myself in the end, but looking at yours was inspiring!


#10

I’ve looked at the sample game @hermannvoneisinger, very useful! There is indeed the flicker which seems to be some improper rendering maybe during the first frame or before. I’m not sure what is causing this for now, I’ll investigate.


#11

@4ian Did you find the reason why is this happening and a solution maybe?
I am on the latest current version of GD (beta 82) on Windows 10 and it is pretty ugly when you need to reload a scene often, like for example when you have buttons to switch between scenes back and forth.

Thanks.


#12

Sprite flicker because the custom size are not used for define the object at the first frame.

That mean an object with a custom size on an external layout will be created on the scene with the action “Create objects from the external layout named XXX” with the default size of the sprite at the first frame.
And at the next frames custom size is updated. That why objects flicks :slight_smile: