• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - GML Visual Sprite order in room designer

J

John Kollar

Guest
Hello. I've been trying to learn GameMaker 2 and use the room designer to place sprites.
I'm having a problem getting the sprites to overlap in the correct order, so I created a very simple example and made a screen capture to illustrate the issue.
As can be seen in the attached image, I've created two sprite objects (a pacman and a ghost) and in the room I've made one instance of a pacman and two instances of the ghost. I then alter the instance order in an attempt to make one ghost be in front of the pacman, and the other ghost behind the pacman.
When I run the game the sort order is as I expect (see the right side of the image), but in the room designer the sprites are not displayed in the expected overlap sequence. Nothing I've tried will decouple the two ghost instances so that one can be behind the pacman and one can be in front.
I can do everything programmatically and it will work at runtime, but I thought the intention of the DnD room designer was to make it easier than to position all sprites using code.
Is there a bug with the sprite rendering in the room designer, or am I misunderstanding something about the creation and placement of sprite instances in the designer?
Any assistance would be greatly appreciated.
 

Attachments

Nocturne

Friendly Tyrant
Forum Staff
Admin
If two instances/sprites are on the same layer then you cannot guarantee render order. If you want them to be drawn in a specific order then you must use separate layers (that's what layers are for)...
 

Mike

nobody important
GMC Elder
Hay there, just tried this. There appears to be a bug in the room editor, it SHOULD be displaying things in the otder of the instance Layer properties window. Which you can see on yours is object1, object0, object1. It's not. That's a bug with us, I'll get that filed. (same with the asset layer)

The order of that list is the initial order of all drawing of the room. Once things move around, then all bets are off and anything on the same layer order is not defined - BUT, the initial order should be whatever that list order is.

Filed: http://bugs.yoyogames.com/view.php?id=27807
 
J

John Kollar

Guest
Thank you for the quick replies, and thank you Mike for filing the bug report.
Nocturne, thank you for the suggestion also. I was trying to avoid layers in my current project because I'm trying to create an isometric game and the number of layers I would have to manage would exceed 100. The pacman and ghosts was just a simplified example and not related to my isometric room design.
Now that I know a bug report is filed I'll generate a rough room design using code, and then work on other aspects of the game.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Nocturne, thank you for the suggestion also. I was trying to avoid layers in my current project because I'm trying to create an isometric game and the number of layers I would have to manage would exceed 100. The pacman and ghosts was just a simplified example and not related to my isometric room design.
The YoYo Dungeon demo is faux-isometric and it uses a custom draw queue to render everything at the correct "depth". You should check it out as it's very nice system and saves a lot of hassles once it's set up right...
 
J

John Kollar

Guest
I'll have a look at the Dungeon demo. Thanks for the recommendation, Nocturne.
 
J

John Kollar

Guest
I've verified that the latest release of the GameMaker IDE (2.1.1.241) fixes the sprite sort order in my earlier pacman/ghosts example.
I've also attached a new screenshot that illustrates the corrected sort order (compare the two screenshots to see this fix).
Bug report 27807 (and possibly this forum discussion thread) can now be closed.
Thank you to Mike, Nocturne, and the GameMaker developers for fixing this issue.
 

Attachments

Top