Change Scene Sized based on Screen Height/Width

I was trying this out earlier today, but it wasn't working the way I wanted it to. I'll be back home later to try it out again but while I'm out, I figure I'd ask around the forums :)

I have a default scene size of 2048 x 2048
and a movable Actor that controls the Camera and moves around freely

I'm trying to make it so that at Scene Start it detects the Screen Size and resizes the Scene size to 1024 x 1024 when you're using Legacy. Unfortunately it wasn't working.

To check, I did 2 Display Texts.
- 1 to display the Scene Width and Scene Height (which shows proper values whenever you change the Screen Size)
- 1 to display the X and Y Coordinates of the moving Actor (which shows that even on Legacy, I can unfortunately still reach X:2048 Y:2048)

I was only using Creator Preview but I reckon results would be the same on the Viewer/Ad Hoc.

Anyone tried resizing their Scenes this way?
Perhaps I'm overlooking something? Possibly, that you can't change the Scene Size once the Scene has started running?

It's a complete game and I'm just adding this new feature into it. I'll try to create a stripped down version later and see if I have an Actor with a bad Rule that's contradicting this one.

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    You won't be able to change the scene size on device. That a GS attribute in relation to the creator and not device. You need to work with the camera. Why do you want the scene size smaller?
  • TheGabfatherTheGabfather Member Posts: 633
    edited July 2013
    @FryingBaconstudios
    Trying to see if it will have an effect on performance/RAM usage. The game is stuck at 27-32fps for an iPhone 4. Of course, it's not just the Scene Size that will change -- destroying Actors that would originally exist in the cutout areas would also happen.

    And then some difficulty adjustments so iPhone 5 and Legacy users won't think that high scores are easier to get on either device.

    I haven't worked with Camera attributes ever. Will I have to resize Actors if I resort to that? I suppose it's a good chance to get my feet wet with Camera controls tonight.
  • UtopianGamesUtopianGames Member Posts: 5,692
    This might help, although rumour is gs is working on UB.

    http://forums.gamesalad.com/discussion/53589/universal-build-tutorial-with-project-file/p1

    Darren.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    If your game is running at that low a frame rate I would blame it on in efficient code not memory usage. My games run at 60fps even at high memory usage. Actually the two memory and FPS are mostly unrelated. FPS is how fast your code is being scanned per second.
  • TheGabfatherTheGabfather Member Posts: 633
    @DeepBlueApps Thanks for linking Darren. This should serve as my intro to Cameras and Camera Origins. I'll give it a look :)

    @FryingBaconStudios
    I'm not convinced -- the code for this game is already heavily optimised with the least amount of Actors, Rules, and Global Attributes possible. I'm thinking it's the sheer amount of moving Actors and Particles. Limiting the number of Actors in the scene gives a whopping 10-15fps boost and disabling particles another 5-10fps.

    Although everything turned on and running on a 4S/5, gives a crisp 58-60fps.
    But I'll give it another run through, see if I can improve efficiency by even just a bit. Worst case would be a slight redesign of the game design *shudder*

    And I'm pretty sure that's not a technical definition of fps but I get your drift :)
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yeah sounds more like latency. I imagine the particle effects are the culprit. This is why I use a particle animation or spawn than the particle effects in GS.
  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250
    @TheGabfather two thing if you are having issues with particles slowing down you game try the nightly build. we greatly improved the particle system. Two if particles are not the issue try using apple instruments to see what might be slowing down the game.
Sign In or Register to comment.