What is the edge limit?

So I have actors spawn actors apparently so far off the screen that they are either desteoyed or just flat out not made.

Comments

  • JapsterJapster Member Posts: 672
    edited January 2019

    Bear in mind, it's not the edge of the screen, but the edge of the SCENE, so is easily fixed...

    ie. So, if you make your scene (not SCREEN) larger / wider, you can easily then spawn from a distance (your screen will still be identical, as the camera dictates what you see on-screen, but the scene can be made to extend much further in any direction, meaning that actors will still spawn within or near enough to the SCENE to not destroy themselves upon spawning).

    ****If you want some possibly helpful extra advice, and won't be put off by me jabbering on, read below:-**** :wink:

    The only thing I'd mention as something that may catch you out, is that if you want to extend to the LEFT or BOTTOM or your viewable 'screen', you'll have to increase the scene size THEN manually drag all of your actors and camera back into your expected focus/area of the scene... ...and definitely if you REDUCE the scene size back, remember to pull your actors back into what will be the new area, as trying to get Creator to scroll or show an area BEYOND what is your current scene size, to manually move them afterwards, is an absolute nightmare...

    (I also mention below, a way to have the former happen automatically (remove the need to manually re-position everything), so you can experiment simply by moving the camera, and everything else will follow... :smile: )

    ****Anyway...****

    ...basically, if you want actors to say, spawn 2000 to the right or above, simply increase your scene dimensions accordingly... problem solved! :)

    BUT, if you need them to spawn below or to the left, then do the same, but move your camera and actors to the RIGHT or TOP, respectively, to achieve the desired effect.

    An easy way to tie everything in to the current camera location if doing this, is to use 2 attributes, ie. HCamOffset / VCamOffset, either set manually to the scene camera's X/Y in Creator, or at runtime, possibly just set once by an unlocked actor upon startup.

    This means that you can easily change EVERYTHING's location by including/adding the 2 offsets to all actors' X/Y position related behaviours or expressions. Seems a faff, but once done, you can even dynamically change the location of EVERYTHING to correctly move with the camera on the fly by changing/constraining just those 2 variables in any camera moving code only, if you desired... :smile:

  • Twayne2Twayne2 Member Posts: 458

    I should have thought to make scene wider. Thanks @Japster!! :grin:
    (I was using the area outside of scene, and it was working apparently until I got too far out haha.) I will make a thread when I release the game I am working on. :smile:

  • Twayne2Twayne2 Member Posts: 458

    Interesting idea @freneticz, but I actually think it is may be farther than that. But you could be right. Thanks for commenting! :)

  • Twayne2Twayne2 Member Posts: 458
    edited January 2019

    @Japster Oh no. Japster, is is possible to change, (I mean interpolate,) the camera height at, say, 5000 origin? I tried, say, it grew by 476 pixels, over 2 sec., (it would change to 1500,) and the width to a constant, and away the screen went to the left. So, perhaps the camera is not in terms of itself, it is in terms of where it first started? (0,0). So I tried adding 5k to 1024, and alas, it still failed.

  • JapsterJapster Member Posts: 672
    edited January 2019

    @Twayne2 said:
    @Japster Oh no. Japster, is is possible to change, (I mean interpolate,) the camera height at, say, 5000 origin? I tried, say, it grew by 476 pixels, over 2 sec., (it would change to 1500,) and the width to a constant, and away the screen went to the left. So, perhaps the camera is not in terms of itself, it is in terms of where it first started? (0,0). So I tried adding 5k to 1024, and alas, it still failed.

    @Twayne2 - I'm a little confused! - It sounds like you're maybe interpolating the wrong value, or perhaps not setting others - I'm pretty sure that just amending Origin.X and Origin.Y (no GS PC in front of me) should do it?

    It sounds like you're maybe increasing the viewpoint / width or constraining something that's perhaps causing this? - a look at your expressions/behaviour for this would probably be needed mate?

    ie. In Courier Chaos, I simply interpolate my 'camera.origin.X' (not sure that's right, but you get the idea!) to '0 / 1024 / 2048 / 3072', etc, to smoothly move it to the right or left, between menu subscreens?

  • Twayne2Twayne2 Member Posts: 458

    So I have 5000 origin x. I have camera size 784 and 1024 width and height, or something like that. I interpolate the camera size, bith width and height, to a constant that is larger. For some reason it moves the screen left. There could be a variable that I am missing.

  • JapsterJapster Member Posts: 672
    edited January 2019

    @Twayne2 said:
    So I have 5000 origin x. I have camera size 784 and 1024 width and height, or something like that. I interpolate the camera size, bith width and height, to a constant that is larger. For some reason it moves the screen left. There could be a variable that I am missing.

    Yeah, I wouldn't worry about camera size - literally just try the one attribute change first - origin.x - then you should see it (or everything, depending on what you've implemented!) move as the camera pans?

    Maybe just use a grid image as background, to see exactly what's happening? - but definitely shouldn't have to change camera size matey, which is also why it appears to be moving - if you change the size of the camera, it will zoom in or out, meaning that things will appear to go left or right accordingly... :smile:

  • Twayne2Twayne2 Member Posts: 458

    Idk, all I want to do is zoom out, more vertically than horizontally, and it was working fine at origin 0,0. I will see what I can do. :wink:

Sign In or Register to comment.