• 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.

Windows Started game in OS X, moved to Windows and now none of my objects show up

So for the past few weeks I've been making my game on OS X, and everything is running just fine. I can run the game in GM and create an executable for Mac. I wanted to create an exe, so I moved all the project file over to my Windows tower. However, now when I run the game or create an executable, none of the objects are showing up. I can see the background and text GUI, otherwise there's nothing. I checked my antivirus software, turned it off, and, to make sure, told them to allow GM2 and Igor applications to run. Still nothing. Anyone run into this before? Thanks in advanced.
 

Roldy

Member
I would first go through and make a sanity check of the simple things.

  • Are the layers in the correct order
  • Are the layers all set to visible
  • Is the correct room set to home/starting room
    • are there instances in this room
  • When running in the debugger have the instances actually been created and are not rendering or have no instances been created at all
    • if the instances have been created does their draw event get triggered?
  • Have your sprites imported correctly
    • are they visible in the editor
 
In order:

- The layers are in correct order.
- Layers are all set to visible.
- The room is correct. The background image shows up as well as elements from Draw GUI.
- Instances are definitely in the room. I can move the character and the camera follows, and if I can blindly walk my way to where another character is I can press the talk button to initiate a conversation (the text boxes appear on the Draw GUI).
- Debugger is no help here since my Variable and Instance list comes up empty, even though there is code running based on my ability to move (invisibly) around the map. This is a bug for another time. So the instances are being created, but they're invisible.
- The draw code is being triggered, tested by adding a show_message line.
- Sprites are visible in the editor. I even reconnected a few to their original png to no avail.

I should note that I'm using "depth = -y". The character's depth will always be between -400 and -3400, based on the map's size. I've disabled layers above and below it but the sprite is still invisible.
 

Roldy

Member
In order:

- The layers are in correct order.
- Layers are all set to visible.
- The room is correct. The background image shows up as well as elements from Draw GUI.
- Instances are definitely in the room. I can move the character and the camera follows, and if I can blindly walk my way to where another character is I can press the talk button to initiate a conversation (the text boxes appear on the Draw GUI).
- Debugger is no help here since my Variable and Instance list comes up empty, even though there is code running based on my ability to move (invisibly) around the map. This is a bug for another time. So the instances are being created, but they're invisible.
- The draw code is being triggered, tested by adding a show_message line.
- Sprites are visible in the editor. I even reconnected a few to their original png to no avail.

I should note that I'm using "depth = -y". The character's depth will always be between -400 and -3400, based on the map's size. I've disabled layers above and below it but the sprite is still invisible.
When you run your debugger and break in the draw event (where you put your show_debug_message) no instances show in the instance tab? And no variables show in the variable tab?

As a test I would suggest not setting the depth of the instances and see what the result are.
 
Okay, after a lot of soul searching I found some answers. The lack of instances in the debugger was being caused by anti-virus software (don't ask me how or why), and now I'm seeing instances in the debugger, even if they're not visible. And I've come to realize that for some odd reason while OS X doesn't seem to have issues with draw depth when using "depth = -y", Windows does. I've seen on other forums that there's a consensus to move away from setting depth in that way. As this game is just for a quick game jam, I'll be sticking to using my mac to make the game and I'll be exporting to HTML5 (which is okay with this method of depth sorting) instead of Windows. For my larger/future projects I'm going to use a different depth sorting method that works across both platforms.

tldr:
- Antivirus blocks debugger.
- depth = -y, not always friendly with Windows... or at least *my* copy of Windows.

Still, I appreciate you reaching out to help, Roldy. May your code always compile true.
 

Roldy

Member
Cool. Glad you worked it out. Can you link any source where you found references to depth not working on windows?

FYI, I have used the depth system that is part of the YoYo Dungeon Demo, and it seemed to work fine.
 
If I can dig them up again I'll share. And if that depth system is working for you, it's definitely a project-specific issue. I just know when I disabled that depth system my sprites are visible again. It could be that I'm exceeding the depth limits, or something else. I'll have to run some tests to really get down to the dirt of it. If I find anything I'll let you know.
 
Oh my god, I'm a monumental idiot. I tore up the floorboard looking for a mysterious squeak and it turns out it was my shoe all along...

Turns out the problem was when I set up my camera with matrix_build_projection_ortho. I just copy/pasted the code from a previous project and hadn't realized znear and zfar were set to 1 and 10000 respectively. I expanded those values and - voila - all my sprites were being drawn. I still find it strange that on Mac, where this code is identical, all the sprites are still being shown. So, tldr:

- Antivirus blocks debugger.
- depth = -y is great!.. just double check the znear and zfar settings when declaring your camera's projection.

Glad I at least solved my debugger problem, too. Thanks again, Roldy. Sometimes all it takes is to have someone to discuss a problem with to jog one's brain.
 
Top