Why would C3 game work in game editor on one machine but not a different machine?

0 favourites
  • 7 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • I'm helping my students troubleshoot basic platform games. One student is setting up her platformer with an enemy that moves back and forth, flipping direction when it encounters a barrier. Her event sheet is absolutely correct, sprites are clean, origin points are consistent, etc.

    When I opened and tested her game on the podium computer (an identical machine), everything worked just fine. When we test the game on her machine, the enemy fails to detect collision with the transparent barrier and falls to its death.

    I thought there might be some crud in the browser cache causing problems, so she connected to her C3 account from a different browser. The game still doesn't work on that machine but it works just fine when I test the *identical* file on the instructor podium computer.

    Has anyone ever encountered this sort of glitch before?

  • Follow-up: We moved the student to a different machine in the lab and it also worked on that machine.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • One possible reason could be the game is running at a lower fps on your students pc than the other ones. Maybe her machine has another app or a windows service running in the background that’s affecting it.

    You can check that by setting a text object to fps in an every tick event.

    With a lower fps the object will move faster in a frame. As an example say you have an object moving at 1000 pixels/second then:

    At 60fps the object will move 1000/60 or 16.66 pixels in a frame.

    And worst case at 30fps (construct doesn’t let the time step get lower than that last I checked) then the object will move 1000/30 or 33.33 pixels in a frame.

    So thin walls with fast objects can be a problem with low fps since they can have moved past the walls without collisions. Or even if a collision is triggered and the object is most of the way through it will be pushed out past the wall.

    You can also check the refresh rate of the monitor. 60hz is standard but many monitors have have higher at 90hz, 120hz,…etc.

    Anyways that’s my best guess what’s amiss. Fast speeds, thin walls and something causing a fps drop.

    If that’s not the issue then you can also check the browsers error console to see if any errors are listed. But I don’t think any are likely.

  • Thanks for the suggestions. Can't wait to check these possibilities out when I get back to the lab. :)

  • Aha! Followed R0J0hound's advice and created a text object to display frames per second. Sure enough, the FPS is something like 240 fps on the problematic machine. It's a solid 60 fps on other machines. Checked display settings under Windows 10 and realized that the refresh rate on that monitor was cranked up to 240 Hz. Dropped it down to 60 Hz and everything works perfectly.

  • Oh, strange. I would have thought a higher refresh rate would make collisions more accurate. It's the lower framerates that could cause objects to pass through walls.

    Sounds like a bug if collisions are failing at higher refresh rates. Ashley

  • I would guess they accidentally made their game framerate-dependent. It's easy to do. For example if the collision mask is not exactly symmetrical, "turn around on barrier" logic can mean it turns around repeatedly and never actually turns back, and that would depend on exactly how far it moves every tick, and that depends on the framerate.

    That's one of the reasons we advise platform movements use an invisible simple box shape with the animated player graphic positioned on top.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)