Spawning VS Recycling problem - Video Inside

giacomopoppigiacomopoppi Member, PRO Posts: 914
edited November -1 in Working with GS (Mac)
Good morning everyone! I am currently working on a new project but I have encountered this huge problem which I just can't solve. Basically the aim of my game is similar to traffic rush, with a huge difference... it has a huge round about placed in the middle. My problem comes when I spawn the cars to enter the game...because when I do, all the other cars shudder (stop for half an instant) and this is quite annoying when spawning cars continuosly.

I have tried recycling but it actually made the Memory situation worse (10MB worse!) than the normal spawning.

My question is: is it possible to spawn actors without reducing the framerate for that annoying instant when the actor is spawned?

You can notice the problem here:


You notice the problem mainly around 0:14 secs

IDEA, GRAPHICS AND EVERYTHING IN THE VIDEO IS COPYRIGHTED BY ME! :P

haha, any help is appreciated ;)

Giacomo

P.S. Ignore the overlapping of the cars nd other problems because I havn't yet programmed them.

Comments

  • old_kipperold_kipper Member Posts: 1,420
    is it possible to have the cars all present off screen and then flip them into coming on screen with rules or is this what you are doing when you say you are recycling them?

    kipper

    p.s. it looks like a cool game.
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    Thanks, I have tried recycling but the memory usage literally doubles, this i due to ll the change and constrain behaviours i need to use to reset the actor.
    I have also tried storing the cars off screen, but the amount of cars can go up to 90 cars and th memory usage goes up to 70 MB when starting the scene :P

    I am goint to try another method now to recycle the cars. If only there was a way to reset the self.time attribute it would all be ok. :/

    I'm sure i'll find a work around soon.

    Thanks kipper ;)
  • old_kipperold_kipper Member Posts: 1,420
    I wonder if it would be possible that if just to spawn a simple car and then have a control object that was present from the beginning that switched to controlling a new car after it had spawned, and switched to something else if you needed it to?
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    mhh, I tried something similar but didn't work.
    Basically the recycling works fine the first time around the round about, but the second time round the cars start jumping aroun the screen due to the self.time messing up with my orbit (taken from tshirt's orbit demo).
    I'm now going to try doing a simple work around which will take a long time (and is too difficult to explain :P)

    I'll let you know how it goes.

    Giacomo
  • hman360hman360 Member Posts: 590
    You can send the file to me and I can try to figure it out for free. redsox360blog@gmail.com - I think I have fixed something like this before.
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    @hman360 thanks mate, I think to have found a solution though... A rather log work around which took me 4 hours of continous programming to make... I am now 1/3 of the way of completing the spawning/recycling system... 2 more roads to go!!! :P
Sign In or Register to comment.