The Daily Click ::. Forums ::. Klik Coding Help ::. 100+ objects = problems
 

Post Reply  Post Oekaki 
 

Posted By Message

7Soul



Registered
  12/08/2008
Points
  167
6th July, 2009 at 21:23:29 -

When i get 100+ objects in the screen the collisions (between them) start to mess up. Anyway to solve that?

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
6th July, 2009 at 21:31:05 -

That's odd. What exactly do you mean by "mess up?" Do the collisions not register at all? Are they only registering when no more than two are overlapping? We need details! It could be anything from your particular engine and programming to a box that needs checked.

 

  		
  		

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
6th July, 2009 at 22:49:46 -

have you set your frame object limit to a higher value?

default is like 500. but ive experienced insane things when doing stuff in loops. it seems to sort itself out when you increase the object limit. as a rule of thumb whenever i create a frame i just set the object limit to 20,000 (the maximum)

 
n/a

7Soul



Registered
  12/08/2008
Points
  167
7th July, 2009 at 17:43:40 -

The game is a puzzle where a row of colored blocks appear at the bottom of the screen over time. Each block collides with the one that is under it, creating towers of blocks.
But when i have more than ~100 objects, some start to get thought the blocks under it
I made a gif with it: (it may take a while to load)
http://img4.imageshack.us/img4/6851/problempuzzle.gif

When this problem happens, im with 97 objects on the screen

Basically these blocks use a "Bouncing Ball" movement and fall down, and then I used "Viewport Object" to flip it verticaly

And my maximum objects count is at 800

 
n/a

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
7th July, 2009 at 18:17:57 -

I didn't see the problem in the gif... did it show it? This may be a show-the-source type problem. :\

 

  		
  		

7Soul



Registered
  12/08/2008
Points
  167
7th July, 2009 at 18:56:47 -

If you could take a look at the source, please add me on msn: ailsark@hotmail.com, or send me an e-mail, i dont want to put it here btw im using MMF2

 
n/a

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
7th July, 2009 at 23:26:28 -

omc the gif did show the problem. thats really wierd. but yes the source is needed to figure that out.

 
n/a

7Soul



Registered
  12/08/2008
Points
  167
7th July, 2009 at 23:59:02 -

If someone could help me, please add me: ailsark@hotmail.com , i promisse ill not be a noob around you
And if someone could take a look at those blocks that jump (the 3 on the right on that gif) they move more than they should, and this happens to random blocks in the top row (its the top, cuz the viewport is flipped)
Thx ;D

 
n/a

nim



Registered
  17/05/2002
Points
  7234
8th July, 2009 at 00:41:56 -

I get this bug too! It's strange because the events just say "move Active 3", which should move them all at once but it moves them one at a time. Never found a solution.

 
//

OMC

What a goofball

Registered
  21/05/2007
Points
  3516

KlikCast Musician! Guy with a HatSomewhat CrazyARGH SignLikes TDCHas Donated, Thank You!Retired Admin
8th July, 2009 at 00:47:33 -

Are these events within a fastloop? If they aren't you could always try that.

Edited by OMC

 

  		
  		

7Soul



Registered
  12/08/2008
Points
  167
8th July, 2009 at 20:07:37 -

Using fast loops to detect the collisions dont work (on this case) it just make it worse
And by the way, if i destroy some blocks, the problem stops happening, so it only happens if it gets past 100 blocks, and stop happening if the count goes down

 
n/a

UrbanMonk

BRING BACK MITCH

Registered
  07/07/2008
Points
  49667

Has Donated, Thank You!Little Pirate!ARGH SignKliktober Special Award TagPicture Me This Round 33 Winner!The Outlaw!VIP MemberHasslevania 2!I am an April FoolKitty
Picture Me This Round 32 Winner!Picture Me This Round 42 Winner!Picture Me This Round 44 Winner!Picture Me This Round 53 Winner!
8th July, 2009 at 22:42:04 -

You should make your own engine for something like this.

Using the bouncy ball built in movement causes the blocks to be restricted to mmf2 loop that happens after the main event loop.

Also using the viewpoint object to flip it vertically? That is a major no-no resource-wise it's not necessary because this can be coded without it.

I don't think you should use collisions at all, just move the blocks above/below a destroyed block down/up enough to fill in the space between.

 
n/a

MrMcFlurry



Registered
  03/08/2009
Points
  89

360 Owner
3rd August, 2009 at 05:46:11 -

an alternative to collision detection is destruction detection.

Instead of saying, for example 'is there a block under me, yes? stop moving'
you can have it always assume there is one, unless told otherwise, such as 'Ive been destroyed, ill shoot something upwards and tell the above block)

So if a block underneath is destroyed, you can do this by having the block first shoot a marker directly upwards, then be destroyed, that marker would proceed to move upwards and hit the above block, telling it it no longer has footing and should fall, it can also then do the same so the rest of the above blocks know to fall down.



You could combine such a concept with a stat basic movement, where each block knows the lowest position it can reach in an alterable value (and so will stop when it reaches that far), and when a block is destroyed, it sends a marker up, telling the above block it can reach an extra step lower before stopping.

 
n/a

[DELETED]

Likes to put dots on paper

Registered
  08/12/2008
Points
  118

MushroomVIP MemberARGH Sign
3rd August, 2009 at 07:04:17 -

That is a really excellent piece of advice MrMcFlurry.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click