streaming grass...?

For questions about using Classic.

Post » Thu Jun 21, 2012 11:06 pm

once again i come to you, humbly and embarrased..

i decided that i want to make dynamic grass blades for my platformer. lots and lots of grass blades that sway when the player overlaps them. this is no issue, BUT:

i was wondering what would be the best way to make them appear. now, i could plaster my level full of them and they would be ready when the level starts, but the obvious problem would be the object(instance) count.
it would be kind of unnecessary to have all those grass blades taking valuable resources.
that leads me to streaming them on screen.
i could do it with making either comparing distance between the player and a ground sprite. or with a box ,always position it to player, make it big enough so that it goes over the screen.
i have ground sprites,that i could use to compare overlapping with the box object, so that upon overlapping, the ground sprite would spawn grass blades on the hotspots placed on the ground sprite. then just invert the overlapping with the box to destroy the grass blades that arent visible anymore. i guess it sounds simple enough, but i cant really make it work.

i have trouble with object picking and determining what blades should be destroyed. i have a bad feeling its something really simple,but is there anyone out there who could help me build this streaming event properly from the ground up, to make it the most efficient possible?   

also, i was wondering, is it really even worth the reduced object count, because the cpu still have to do some workout streaming the grass? so, sticks and stones, eh? or am i just completely clueless? probably.
B
4
S
2
G
2
Posts: 109
Reputation: 1,318

Post » Fri Jun 22, 2012 1:29 am

I think that if you're using the same VRAM/image for the grass blades then the object count's shouldn't matter, but if you want to cut down you can check if the platforms are close to the screen..

When the platforms are near the edges of layouts you can then spawn the grass blades along them, then destroy the blades as they go far out of the screen.
"Construct 4 lets YOU make advanced games! (maybe)" Construct Classic - Examples Kit
B
86
S
28
G
13
Posts: 2,092
Reputation: 15,009

Post » Sun Jun 24, 2012 2:38 pm

thanks for the input, jayjay! i guess ill go and make something without streaming first and see how it goes..

now theres another question that just came to my mind:

is it possible to set layer opacity to a sprite's speed?
meaning that the faster th sprite is going,the more visible a layer is?
B
4
S
2
G
2
Posts: 109
Reputation: 1,318


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests