Problem with placing actors?

guillefaceguilleface Member Posts: 1,014
edited March 2012 in Working with GS (Mac)
hi, i am trying to place 13 actors horizontal and 7 vertical. my actor is 32x32 , so my first actor is on x=56 y=102, so i want my second actor next to each other, so my next actor is at x=88 and y=102, now this actor look ok, but my third is on x=120 and y=102 but his actor is a little speared from actor 2. don't if my actor is 32 width, i should i add 32 extra to my second actor?, so if first actor stars at x=56, then the following actors would be at 88,120,152,184,216,248,280,312,344,376,408,440 all this is for x position
for y position first actor is at y=102, so the following actor on top should be 134,166,198,230,262. but after finish this there are spaces between actors, some with more spaces than others. i try reducing 1 pixel width on some but i can't get it right., pretty much a good example will be placing actors to form a chess game board, how i align them right?
«1

Comments

  • CloudsClouds Member Posts: 1,599
    Maybe make a larger actor which is 13 x 32 wide and then 'tile' the single 32 x 32 actor within that.
  • inmonjonesinmonjones Member Posts: 9
    @guilleface I have the same problem. I am placing a bunch of actors at regular spacing in a grid, but the spacing in between is not consistent. The positioning is calculated and is perfect to the pixel (confirmed by looking at the X coord of every actor). The actors appear to be spaced correctly, but when I give them an image, the spacing is off by a pixel or two at certain spots. My actors are 20W x 32H with an identical 40x64 image on each one.

    It appears that I need to change something about the image to fix it (tiled, different size?). I put this on the back burner to solve later but maybe I will try to fix it when I get home tonite.

  • SnapFireSnapFire Member Posts: 361
    Yes I've found that gamesalad often has 1-2 pixel offset problems. Hasn't been much of a problem for me.
    -Thomas
  • CloudsClouds Member Posts: 1,599
    .

    It appears that I need to change something about the image to fix it (tiled, different size?). I put this on the back burner to solve later but maybe I will try to fix it when I get home tonite.

    Did you make up your image in Photoshop ?

  • inmonjonesinmonjones Member Posts: 9
    @Tynan

    Yes I did make the image in Photoshop and saved it out as a .png

    IS there something else I need to do?
  • CloudsClouds Member Posts: 1,599
    @Tynan

    Yes I did make the image in Photoshop and saved it out as a .png

    IS there something else I need to do?
    Did you work at a larger size and then resize the image down to the final smaller tile size ?

  • inmonjonesinmonjones Member Posts: 9


    Did you work at a larger size and then resize the image down to the final smaller tile size ?

    I did resize some larger images in Photoshop to save them out for smaller sized actors. Could that be causing the issue? I thought that GS would just squash the images into the dimensions of the actors. Also, the inconsistent gaps appear randomly even when all the actors are using the same image file. So if there was an extra pixel or two of alpha that sneaked in during Photoshop resizing it should be consistent on all of the actors. But it is not.

    Puzzling.

  • CloudsClouds Member Posts: 1,599
    I did resize some larger images in Photoshop to save them out for smaller sized actors..
    Just to be clear, with the tile image you are using in GameSalad, the one you have an issue with, did you work on it at a larger size and then scale it down to it's final size ?
  • inmonjonesinmonjones Member Posts: 9
    Sorry - I should have been more clear.

    I had a 80x80 image that I re-sized to 40W x 64H in Photoshop. Then I applied that 40x64 image to all of the 20x32 actors in the grid. Despite the correct spacing of the actors, there are non-uniform gaps observed with the 40x64 images applied. It is not terrible looking, but it bugs me just because I want it to be perfect. I had bigger fish to fry until I saw this thread here.

    Should I start from scratch in PS with a 40x64 canvas? Seems a good thing to try.

    @guilleface - Sorry for the threadjacking.
  • CloudsClouds Member Posts: 1,599
    I had a 80x80 image that I re-sized to 40W x 64H in Photoshop.
    Final question, when you resized the image in Photoshop was in layer/s (ie: not a flattened image / 'background') ?
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    Try to place your actor at 119.5 or 120.5 and see if it makes any difference.

    Also you may want to see how it looks on the device because sometimes on the GS preview may looks not exactly like on the real thing.
  • Rob2Rob2 Member Posts: 2,402
    There is definitely a bug and I expect it is centred around metric/imperial conversions and the totally unnecessary demon that is dpi !
  • inmonjonesinmonjones Member Posts: 9
    I had a 80x80 image that I re-sized to 40W x 64H in Photoshop.
    Final question, when you resized the image in Photoshop was in layer/s (ie: not a flattened image / 'background') ?
    It was in layers - I did not flatten it before saving it out so I could re-use the layers to make different images.

    @MarkOnTheIron - I figured it might just be a GS viewer error and that maybe on the device it will be OK. But it is interesting that others are seeing the same issue. Anyone know if it is resolved once the build is played on the device?

  • inmonjonesinmonjones Member Posts: 9
    Hey guys,

    I came home and made a quick image in Photoshop.

    Image size 40W x 64H
    Flattened the layers
    saved it out as png
    Applied it to my 20W x 32H actors

    The spacing now appears to be perfect. So I guess either resizing or not flattening the image in Photoshop was causing some sort of wonkiness. Perhaps the resizing was no good in my first try because I changed the aspect ratio from 80 x 80 to 40 x 64.

    In any case, it seems to be working now. Thanks for the help!

    Yeti/inmonjones
  • CloudsClouds Member Posts: 1,599
    edited March 2012
    The spacing now appears to be perfect. So I guess either resizing or not flattening the image in Photoshop was causing some sort of wonkiness. Perhaps the resizing was no good in my first try because I changed the aspect ratio from 80 x 80 to 40 x 64.
    Glad to hear it's working, my line of questioning was to see what route you took to arrive at the final image - I was going to suggest the following (which is probably of no interest now as you've sorted it out ! :) )

    Did you make up your image in Photoshop ? - Check !
    Did you work at a larger size and then resize the image down to the final smaller tile size ? - Check !
    When you resized the image in Photoshop was in layer/s? - Check !

    These three together will always give you this problem.


    When you resize something in Photoshop - it must interpolate/resample all the pixels in the image.

    So . . . whereas a pixel in the centre of the image can sample all those pixels around it, the pixels at the edges effectively have half their pixels missing (the 'missing' pixels are off the page / 'invisible' / non-existent).

    So the best Photoshop can do is to interpolate/resample using transparency in lieu of actual real colour values - and when half your sample is transparent then the result will show that.

    The result is that if you resample something (with the caveat of the file being a 'layer' rather than a 'background') you will find that the edge pixels will (must) have some level of transparency. Usually you wouldn't notice this on a 'normal' sized image (things for web or print - for example) - but get down to tiny icon sized things and a pixel becomes important - and you only compound this problem by putting two of these troubled images alongside each other, effectively doubling the 1 pixel wide artefact to 2 pixels wide.

    The solution is easy enough -in Photoshop - once you've resized your image down to it's final size, flatten it, cut and paste the whole image on top of itself a few times (so you have a few identical layers) flatten all those duplicate layers into one and the transparent edges are gone.


  • Rob2Rob2 Member Posts: 2,402
    I have found the addition of the simplest plain 40x40 bitmap (no transparency & never been near photoshop) is causing problems.

    image

    image
  • inmonjonesinmonjones Member Posts: 9
    Thanks Tynan. This is a great tip that I will use to re-size my images (big time-saver).
  • guillefaceguilleface Member Posts: 1,014
    @rob how are your settings for first image? the second picture thas how my actors looks, so to fix that i need to flatten it the images? but how i do that?
  • Rob2Rob2 Member Posts: 2,402
    In the first posted image the actors are just plain ( no png file used )- in the second one the actors are all using a simple 40x40 pixel png file (purple square) and even though they are in the same locations the rendering is shifted by a pixel in some cases.

    I may go back and see if earlier GS versions have this problem - I am sure this would have been noticed before.
  • guillefaceguilleface Member Posts: 1,014
    my image i made in inkpad for ipad, i made the file size from the begginng 32x32 then i created a square there, then emailed as png, i dont know if this is the problem too.
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    @Rob2 - Is that with individually placed actors at the x values you listed?

    Ace
  • guillefaceguilleface Member Posts: 1,014
    ok here is my other big big problem, i hope i upload the images right so ya can compared both images, my scene is big so my images are 960x640 that are place into a actor of 480x320, when i play the game in the creator my background looks perfect, but if i play it in the viewer or i made a adchoc file, if i don't do anything my background looks like in the first image which is good, but once i star moving my car it looks like my background actors move a little or i don't know whats happening but you can see the lines that appear. i really need to fix that, i try moving my actor some pixels off but it does work but in the same time my images don't collide perfect no more.

    http://dl.dropbox.com/u/46439975/photo-3.PNG
    http://dl.dropbox.com/u/46439975/photo-2.PNG
  • Rob2Rob2 Member Posts: 2,402
    edited March 2012
    @ace They are pulling there positions from tables or attributes and results are strange. Say I start placing actors at x 10 I might only see one misplacement in a row of ten but if we start the row x 15 there could be four bad renders its all very odd.
  • Rob2Rob2 Member Posts: 2,402
    edited March 2012
    Ok... now vey weird. Started using constrain on position rather than a simple change attribute so I could continuously change the position and the problem vanishes....
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Check your PM @Rob2

    Ace
  • Rob2Rob2 Member Posts: 2,402
    ko :)
  • guillefaceguilleface Member Posts: 1,014
    ok i think the problem with my background is not the position but the camera, when my actor tracking area is about to change thats when this lines appear on the edge between 2 background images, does some one know how to fix this?
  • CloudsClouds Member Posts: 1,599
    ok i think the problem with my background is not the position but the camera, when my actor tracking area is about to change thats when this lines appear on the edge between 2 background images, does some one know how to fix this?
    Make your background images little bit bigger (by a couple of pixels or so) so they overlap.
  • guillefaceguilleface Member Posts: 1,014
    your saying instead of 960x640 make it 962x642? or resize my actor ?, i already overlap my 480x320 actors but like i say there are uneven roads connections.
  • CloudsClouds Member Posts: 1,599
    your saying instead of 960x640 make it 962x642?
    See what works for you, I suspect you only need a couple of pixels or so on each side.
    i already overlap my 480x320 actors but like i say there are uneven roads connections.
    You should make sure the overlap areas are done so that they seamlessly join.
Sign In or Register to comment.