Construct 2 Sonic Engine? Are there any Sonic engines on Construct 2?
#16
Posted 16 December 2014 - 01:37 AM
#17
Posted 16 December 2014 - 02:56 AM
Candescence, on 16 December 2014 - 01:03 AM, said:
CommandanteStreakTH, on 15 December 2014 - 11:59 PM, said:
No, and that would be an incredibly stupid idea. Construct 2 already has collision cells, which dramatically reduces the amount of collision checks to within a local area, achieving the same objective but I doubt the engine at the moment is able to take advantage of it, due to the way it works (collision cells need collision checks to be the first picking condition in a top-level event, otherwise it'll brute-force it), and it's difficult to tell whether the way it works now satisfies the requirement.
Huh. That I didn't know. So... I guess the engine's done that for us already... I see... (never really bothered to check all the different features e_e).
#18
Posted 16 December 2014 - 04:03 AM
#19
Posted 16 December 2014 - 04:07 AM
Jase, on 16 December 2014 - 04:03 AM, said:
Would it now? I would imagine imperfect clipping would cause for some very clunky physics, but I've yet to try that out...
EDIT: Did a quick test of that with the premade assets, it works rather fine, in fact, better than the ramps with multiple polygons, but that might make it difficult if you want the tiles to snap to the grid... It's also really tedious but it can be way more precise, but wouldn't the sheer amount of objects grind on the performance even more?
#20
Posted 16 December 2014 - 04:12 AM
#21
Posted 16 December 2014 - 04:17 AM
CommandanteStreakTH, on 16 December 2014 - 04:07 AM, said:
Jase, on 16 December 2014 - 04:03 AM, said:
Would it now? I would imagine imperfect clipping would cause for some very clunky physics, but I've yet to try that out...
Even if you used a pointy collision polygon, it's never going to be pixel-perfect, and if you could use an infinite amount of points and shaped the polygon around the terrain perfectly, then you win, you get your nice pixel-perfect collision, but say goodbye to your framerate
#22
Posted 16 December 2014 - 04:25 AM
Jase, on 16 December 2014 - 04:17 AM, said:
Either way, with any sort of optimal collision detection method (and the "invisible box" method can result in some more unique shapes than what is limited by a square tileset), the physics still work as they should, though I would suggest vertical surfaces have more friction, because right now it acts weird. Uh... Candescence, what are some of the problems you're seeing so far?
#23
Posted 16 December 2014 - 04:28 AM
CommandanteStreakTH, on 16 December 2014 - 04:07 AM, said:
I guess that's something I've never been able to test. I would have thought the sheer amount of multipointed objects would be worse than hundreds of 4-pointed objects. But yeah your right, it is tedious
Mr Lange, on 16 December 2014 - 04:12 AM, said:
Lets say you have a sprite called "FloorCollision", and in an event you decide to put:
+Is Sensor overlapping FloorCollision
Then this event will take advantage of Collision cels.
If you was to have another condition in this same event so it looks like:
+FloorCollision.X > 50
+Is sensor overlapping FloorCollision
Now the event will not use collision cels. This is because it picked from all existing FloorCollisions that have their X position > 50 , then with that list of picked FloorCollisions, it then tests them for collision with the sensor.
It's a downside and it is annoying lol.
#24
Posted 16 December 2014 - 04:41 AM
Jase, on 16 December 2014 - 04:28 AM, said:
CommandanteStreakTH, on 16 December 2014 - 04:07 AM, said:
I guess that's something I've never been able to test. I would have thought the sheer amount of multipointed objects would be worse than hundreds of 4-pointed objects. But yeah your right, it is tedious
If you ask me though, it reminds me a lot of playing around with the editors in Spore when you want to make a curve but all you have are squares (and if you have played with Spore editors before, this method is the best for you). It's great for complex and unorthodox shapes, but I've yet to check out the performance consequences of having those many objects. Probably another workaround for that is to have single pieces for long platforms instead of the segments that have been provided. (Also, using this method, you could just overlay a dummy image of the level and make a collision skeleton that's set to invisible, instead of having to piece the level together with a tileset, great!)
Currently I made this massive "hook"-type ramp using that method, and Sonic is running around it without a snag. If you'd like to see the results, just ask and I might post a gif
#25
Posted 16 December 2014 - 05:26 AM
CommandanteStreakTH, on 16 December 2014 - 04:41 AM, said:
Jase, on 16 December 2014 - 04:28 AM, said:
CommandanteStreakTH, on 16 December 2014 - 04:07 AM, said:
I guess that's something I've never been able to test. I would have thought the sheer amount of multipointed objects would be worse than hundreds of 4-pointed objects. But yeah your right, it is tedious
If you ask me though, it reminds me a lot of playing around with the editors in Spore when you want to make a curve but all you have are squares (and if you have played with Spore editors before, this method is the best for you). It's great for complex and unorthodox shapes, but I've yet to check out the performance consequences of having those many objects. Probably another workaround for that is to have single pieces for long platforms instead of the segments that have been provided. (Also, using this method, you could just overlay a dummy image of the level and make a collision skeleton that's set to invisible, instead of having to piece the level together with a tileset, great!)
Currently I made this massive "hook"-type ramp using that method, and Sonic is running around it without a snag. If you'd like to see the results, just ask and I might post a gif
Lol yeah, I know what you mean. I guess it's all about illusion, the player thinks it's a smooth curve but in reality it's loads of squares and lines stuck together, but to the player it seems smooth, which is who we are trying to cater towards anyway, right?
The single pieces for long platforms thing is similar to what I'm doing in my own engine!
gif plz
#26
Posted 16 December 2014 - 05:48 AM
Jase, on 16 December 2014 - 04:28 AM, said:
Mr Lange, on 16 December 2014 - 04:12 AM, said:
Lets say you have a sprite called "FloorCollision", and in an event you decide to put:
+Is Sensor overlapping FloorCollision
Then this event will take advantage of Collision cels.
If you was to have another condition in this same event so it looks like:
+FloorCollision.X > 50
+Is sensor overlapping FloorCollision
Now the event will not use collision cels. This is because it picked from all existing FloorCollisions that have their X position > 50 , then with that list of picked FloorCollisions, it then tests them for collision with the sensor.
It's a downside and it is annoying lol.
Ah wow... this could be a problem with some things, but then again if the check is specific, it doesn't really need the collision cell optimization, does it? For example, if I were checking for the value of an object's variable and only one object has that value, then as long as that condition is above the collision condition, it's already eliminated every object but that one for the collision check, right?
#27
Posted 16 December 2014 - 06:25 AM
Mr Lange, on 16 December 2014 - 05:48 AM, said:
Yes that's correct. If you had 100000 objects scattered around a massive level, then I'd probably order the events so that it does the collision check first, since in that situation, it would cost more to check 100000 objects' variables, than to use the collision cells optimisation which essentially lowers the picked object list to however many objects are within the cell (so maybe 100 collision checks depending on how clustered the objects are positioned).
If I'm not mistaken, the way collision cells work internally, it splits objects into different picked lists so it doesn't have to keep iterating through all of them to see if it's close enough or whatnot.
It's an awesome feature but very situational, and I find myself doing a handful of variable checking then collision, rather than collision then variable checking.
#29
Posted 16 December 2014 - 06:39 AM
#30
Posted 16 December 2014 - 06:49 AM
Jase, on 16 December 2014 - 06:39 AM, said:
Well, when I recorded it, I was running a couple programs which would've marred the results of a performance test, so I closed them and did it again, and it was hovering around 30-40 FPS. Worst I got was about 29 FPS, and that was at ground level where most objects are focused in.

00
