Collision stuttering in 8.6

JonTiStudiosJonTiStudios Member Posts: 66
edited November -1 in Tech Support
In my game (Snow Trax) currently on the App store (made with 8.5) the collision system works great. The sled travels along a series of invisible actors behind the graphics.

However, with the new 8.6 version the sled seems to have some trouble when colliding with the ground. It very sluggish, and often stops in place for a fraction of a second before catching up. It's less noticeable on the 3GS phone, but on the 3G is very noticeable. Although it looks almost like a frame-rate problem the game is still getting the same FPS it was before.

I have an update nearly ready to go out just before GS 8.6 came out. I'd really like to update my app this weekend. Is it possible to get this compiled using 8.5 somehow?

Thanks,
-Jon

Comments

  • RHRH Member Posts: 1,079
    Can't say I'm having the same problem, infact, I'm having the opposite. My colliding now seems to be pretty much flawless (as far as I have seen) and my game now works. I know this probably doesn't help much but I was posting it just incase it is maybe to do with something else that has changed (maybe gravity) that is affecting the colliding rather than the collision rule itself.

    Hope you get it solved.

    Edit: I stand corrected, my colliding is back to its old self.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    did you make sure you also updated the GS Viewer on your iPhone / iPad to the version .8.6?
  • JonTiStudiosJonTiStudios Member Posts: 66
    @RH - Thanks anyways, I'm not using gravity for gravity, i'm just using accelerate rules on my actor. I switched it around to test and it still did it using gravity though (was worth a shot)

    @mulcahy - Yeah, I'm using GS viewer 8.6 - thanks for checking though.

    Is it possible to get a game file back from the GS team compiled in an older version? If I uninstall 8.6 and install 8.5, what happens when I upload the file? Which version will it get compiled in?
  • JackBQuickJackBQuick Member Posts: 524
    @JonTiStudios & RH - Have you found a solution to your problems?

    @RH - What happened between your first post (where you said that it seemed flawless) and your edit (where you wrote that it's back to its old self)? Did you change anything?

    ----------

    I found that collision detection has improved for me and my actors seem to move faster under 8.6.

    I was having a problem where, if two actors follow each other over the same target, the collision of the second actor with the target wouldn't register in the GS Viewer (while it would on my computer). I assumed that it was caused by the reduced computing power of the iPhone compared with the computer.

    When I installed 8.6, collision detection improved and is reliable about 95% of the time. And, I think I know how to optimize to get the other 5%...

    I'm interested to know what experiences other people have had with collision detection under 8.6. Is it better, worse, the same? Did anybody notice any difference?
  • RHRH Member Posts: 1,079
    @JackBQuick

    What I was trying was never very stable, sometimes it worked and sometimes it didn't. It seems to work more often now and I just got lucky the first 10 or so times i tried it :). I think it had something to do with the distance and actor spawned from another actor and the velocity at which they were colliding.

    I ended up changing my game so that I get the same result.

    Overall I'd say that collision detection is better in 8.6 but it isn't 100%
  • JackBQuickJackBQuick Member Posts: 524
    @RH - I'm glad that you were able to use a different method to get the results you wanted. I find myself doing that a lot as well :)

    For me, I find that collision detection improves when I:

    - slow down my actors,
    - simplify and reduce the number of rules, and
    - use actors (which uses fewer rules to identify them) instead of instances of actors.

    Of course, this makes sense: the less you make the iPhone/computer work, the better it performs. (When I focus on one job, I work much better than when I'm multitasking ten things.)

    It's always a delicate balance between what you want to do, and what you can do.
  • Marc_n_SophMarc_n_Soph Member Posts: 111
    Hey Jon. I have pretty much the same problem as you, my actor (guy on bike) travels along invisible actors that create the ramps and stuff, which I have lined up with my gfx. In 8.5. it was smooooth... Very smooth. upgraded to 8.6 and its just like you say!! I thought I had frame rate issues, or my images for my anims had gone mental. The guy was shaking left to right, even when I took out all the frames of animation and made it a single image!

    Im working to fix this right now, Ill post here as soon as / if I solve it!

    Good luck sortin it m8!!

    Marc
  • Marc_n_SophMarc_n_Soph Member Posts: 111
    Hey. Fixed my problem, I have an invisible controller actor, and a "graphics" actor. I had placed the graphics actor in the scene and constrained its position to the x and y pos of the controller actor, as I had read that spawning was heavy on resources. I went through all my rules and double checked no game attributes were conflicting and causing the graphics to shake. Everything was fine.
    Last resort, I deleted the graphics actor from the scene, and tried spawning my graphics actor from my controller actor, constrained the graphics actor x and y positions to the controller position, and my game is now smooth as silk. Good times. hehe. Hope this may help you Jon!!

    Marc
  • JonTiStudiosJonTiStudios Member Posts: 66
    Hey Marc_n_Soph, thanks for the tip - unfortunately that's a different issue.

    I too have had flickering graphics issues. For some reason it seems to happen on stuff that's on the scene before some change (update maybe?) happens. If I have that effect I will just re-place my actor on scene and it usually fixes it.

    My issue isn't graphics, is the physics engine. My physics are very clunky now, and seems to have hangups when traveling along the collision boxes.

    I'm going to check to see if I still have the 8.5 installer file for GS when I get home today. Hopefully I can install that and get a build of my game from 8.5 that's working which I can submit to Apple.

    If I don't have the 8.5 installer I will be back on here to ask if anyone else still has it. I need to get my update submitted before the weekend.
  • ericdg123ericdg123 Member, PRO Posts: 156
    Hey jon, did u get this worked out? I have a similiar game and am having the exact same problem with 86 and 87. Also I just bought ur game. Great job. I have a question for u? I am having problems getting my actor to not accelerate when in the air. If I have an actor that overlaps the ground and use a rule saying when it collides or overlaps to accelerate or otherwise don't it says it's not colliding a lot of the time when it actually is.
  • JonTiStudiosJonTiStudios Member Posts: 66
    @ericdg123 - No, sadly it did not fix it. I wound up changing my character's friction to a Drag effect instead, and adjusted the restitution. I got it a little better, almost acceptable and decided to just submit the update like that. It's almost not noticeable on the 3GS, but on the 3G it can be very prominent. I hate submitting something I'm not 100% happy with but I can not wait another month to hope it get's fixed.

    On the not colliding ground section - I had the same issue! It was one of my biggest challenges early on. I finally solved it with a silly work-around as I could not figure out a better way of doing it. I will explain how I did it below:

    __________________

    Staying "On the ground" when driving over overlapping actors
    I had an invisible actor constrained to the sled to tell me that the tracks were on the ground. The actor was located on the track area extending a bit below. That actor had a rule that when it overlapped with the ground actors (rectangles and circles) to mark "OnGround" as TRUE and an otherwise to toggle it back to FALSE.

    Now the problem I had was that when you drove into overlapping ground actors (say a flat one, and onto one that is angled to represent a hill). The invisible actor overlaps with the first ground actor and OnGround is marked "TRUE". You start to drive and it now overlaps with ground actor 2. The code tells it to change OnGround to "TRUE" - which it does, but is already TRUE. However, as the actor stops overlapping the first ground actor the Otherwise rule kicks in and OnGround is marked "FALSE".

    Now you're sitting on the 2nd ground actor but the game thinks your not on the ground.

    I tried many different ways of trying to solve this, and what I finally came up with that worked consistently was this:

    Solution (or one at least)
    I created 2 sets of ground actors. A rectangle and a circle that were tagged as "Ground1" and another set tagged as "Ground2". I then created "OnGround1" and "OnGround2" rules.

    Then I set my actor (the one on the tracks area) to mark OnGround1 as TRUE when overlapping with actors tagged "Ground1", and an otherwise of FALSE. I repeated this theory with OnGround2 and overlapping with the "Ground2" actors.

    Finally I had a rule that said when EITHER (change rule from "ALL" to "ANY") OnGround1 or OnGround2 was TRUE to mark my original "OnGround" rule as TRUE with an Otherwise rule to mark it FALSE.

    Now when I placed my ground actors I alternated Ground1 actor, Ground2 actor, Ground1 actor, Ground2 actor, etc.. This made my level creation a bit slow going, but it worked.

    Now when your actor hits an overlapping ground actor it does not try to change the attribute current marked TRUE, but rather it changes a different one. Thanks to the rule that checks for at LEAST one of the OnGround# to be TRUE you should consistently be marked as OnGround until you are really in the air, in which both OnGround# will be FALSE and the Otherwise rule will kick in making your global "OnGround" rule FALSE.
    __________________

    I hope that wasn't too confusing. Let me know if it did not make sense and I'll try to explain it differently.

    since my sled lurches a lot when driving I have to think it has something to do with it checking both ground actors. The lurching could be corresponding to when it collides with the different Ground groups. Although you said you are having the same issue, and It sounds like you're not using this method. GS version 8.5 did not have any of these issues however and it was smooth as butter for the initial release.
  • ericdg123ericdg123 Member, PRO Posts: 156
    Wow. Thx for the great response. Yeah I understood perfectly and it is a pain. If only there was an option in the rule for not. As in not overlapping or colliding. I sure hope the stuttering issue gets fixed. Ur game seemed fine on my 3gs but was very noticible on my 3g. My game will no longer run on a 3g and it sucks on 3gs. I haven't done an update but really really need to but I can't now. It's so devestating to my game because mine is super fast coated to yours but it's necessary because if all the jumps, vertical climbs and loops. I have two more games in the making that will not work because of this.

    My current game doesn't need to detect when it's off the ground but my new ones do and I'll definately try what u did for those games once this stuttering issue gets fixed. Thanks again for the help. My email is ericdg123@yahoo.com if u want to talk about ideas on games or getting around the issues of working with game salad. Also if u have time I'll give u a code for my game. It may give you some ideas for urs but it's nowhere near the level of yours. Great job on the game. I'll leave u a 5 star review shortly.
  • ericdg123ericdg123 Member, PRO Posts: 156
    On the flickering issue I found it to be a layer bug. If the actor that's constrained is in the wrong position in the layer it will do that and look stupid. I can just move the actors position in the layer and it'll work.
  • JonTiStudiosJonTiStudios Member Posts: 66
    Yeah I found that if you delete and re-add the actor (one that's flickering) to the scene that it seems to fix the flickering. I think it has something to do with changing the actor's attributes (specifically size?) and the actor instance in the scene not being fully updated.
  • ericdg123ericdg123 Member, PRO Posts: 156
    Hey jon, how in the heck did you get your entire game in just 4.7mb? My problem is by making the ground and buildings and so forth in photoshop then importing them into gamesalad, the file sizes are huge. I'm trying to give my game a complete update by using ground images and invisible actors for collision like you did. Each one of my levels will be about 4mb. Using png they will be about 20mb each. Your graphics look great, what format did you use? I've always used png 24 because the transparency is great, gif files are smaller although the transparency suffers.

    Great job on your game, how is it doing for you?
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    ericdg123 said:
    I've always used png 24 because the transparency is great, gif files are smaller although the transparency suffers.

    Hi ericdg123, another forum member suggested somewhere that where possible to save as png-8. (That'd reduce the file size by a lot but you'll only have a palette of 256 colours, of course; and so wouldn't be any good for graphics with gradients).

    Im my version of Photoshop (CS2), it doesn't give you that option (just png), so I don't know what other free/shareware prog would do that for you, if you've a similar aging version of PS.

    :-)

    ---------------------------------------------------------------
    Spiral Gyro Apps

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ericdg123ericdg123 Member, PRO Posts: 156
    Yeah, that gives me about the same file size and transparency ugliness as gif. I think it must just be the color reduction or something. I know on regular images when I save as gif instead of png it loses the anti aliasing, which makes the graphics look terrible.

    I just have to images I'm using as a test and they are each 1000 x 500. Saving them as png 24 results in a file size of 800k and using png 8 or gif they go down to 185k which is still way too big considering I will need at least 15 of these images per level. Snow trax has to be doing something different. He has 20 levels and they levels are quite long but his entire game is 4.7mb which is awesome.

    Also, back to the topic, collision stuttering. It is just killing my games. I can't update my game I have up now and my future games I'm testing are running terrible with the same problem.

    I know game salad is great and none of this would of been possible without them, but I just don't think they are concerned with this problem because it apparently doesnt affect many users. Worked great in .85, but in .86 it went to hell, and stayed in hell for .87. I sure hope .88 addresses this issue. The slower the device and the slower the framerate, the more pronounced it is, rendering all my games on the 3g unplayable and barely playable and not at all acceptable on the 3gs.
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    I'd steer well clear of gif anyhow, personally. But although 8 bit png is no good for images with gradients, don't you find its more than fine for anything else? At least it shows decent anti-aliasing and variable transparency which gif doesn't do, as you know. For interest, I've just found out that only the iPhone4 can show 24 bit anyhow, all previous models only show 8 bit...

    I've only ever used 0.8.7, so was unaware of prev. (and present) problems; wish I could be more help with your framerate problem but I wouldn't know what else to suggest; except perhaps if you're using a lot of animation, that could slow things down.

    Anyhow, hope you get it sorted. let's all hope that 0.8.8 addresses the problem, as you say.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • ericdg123ericdg123 Member, PRO Posts: 156
    Thanks for the help. I didn't know about the 8 bit thing. Yeah png 8 is decent. It just for me seems to make the anti aliasing look a little weird. Either way it does reduce the size a bunch from png 24.
  • ericdg123ericdg123 Member, PRO Posts: 156
    I also tried jon's temp solution of using drag instead of friction. But it didn't help me at all. The stuttering problem is with collision regardless of friction. My actor moves at speeds up to 1000 and it destroys the playability of my game. I even turned off friction and drag and when I'm in the air it's great but when it's colliding it's hideous.
  • JonTiStudiosJonTiStudios Member Posts: 66
    Sorry for the slow response, been working on a non-GS app for iPhone 4!

    As far as collision, yeah my drag helped me a tiny bit but it's still noticeable. I couldn't wait for them to fix it so I went ahead and updated even though I'm really not pleased with the way it works.

    I thought at first it might have been my method of marking on/off ground - perhaps something when my zone actor overlaps and marks my boolean accordingly, however I removed that and it still occurred. It's actually something with the physics and the colliding that's causing it. It's very very frustrating.

    As far as graphics go, all my images were saved as PNG with alpha. I'm guessing that you are drawing the entire level and chopping it up into parts? If that's the case that would explain your large file sizes.

    My levels are actually many smaller images compiled in the scene. I had 6 "sizes" of ground graphics which were designed to be able to tile (look seamless when overlapped). Then each jump/obstacle is it's own graphic as well. My levels consist of a bunch of ground actors, and a bunch of obstacle actors, then a TON of invisible actors for collision.

    By re-using the same graphics multiple times the system (theoretically) should only have to load it once into memory - or at least that's how games usually work. I tried making the entire level as 1 image and chopping it down to a few parts but that used a much larger amount of system mem.
    Since I did it that way I was able to use about 20 obstacles and mix them in all the levels to get variety.

    If you are trying the few massive images method, that may be your memory problem. If you're doing it the same way I am though I'm not sure what the problem is, sorry.
  • ericdg123ericdg123 Member, PRO Posts: 156
    Yeah. Thanks Jon. That's exactly what I was doing. I actually thought of doing several smaller images and reusing them like a homemade snap together level design editor. I just didn't know how much flexibility I would have but I guess you have to make sacrifices.

    Have you had any problems with the graphics that you snapped together showing white lines where they meet? I noticed this once but haven't looked into it yet.

    Also did u do all your own art? I can make the ground look good but I'll have to pay a graphic artist to make my character and object graphics. I think I'll talk to that guy on that topic here on gs forums.

    Have you done pretty good on sales? I think your game is great looking and fun. Thanks again for the help.
  • JonTiStudiosJonTiStudios Member Posts: 66
    There are no seams that show through as I specifically made the textures to be able to look correct when overlapped on each other. Most image's edges are a "jagged" shape rather than a straight line to help it blend in. I've been doing game-art for many years so it was just a technique I figured would work well on this platform.

    Sales are pretty slow now a days. They did pretty well when it was released then slowly tapered down.
  • ericdg123ericdg123 Member, PRO Posts: 156
    Hey jon, I think I found a bug in your game. I think you may have forgot to load or save attributes on levels 18, 19, and 20. I have beat all those levels multiple times and they still show locked. Just though I'd let you know in case you want to look at it and see if its the same for you.
Sign In or Register to comment.