0 Favourites

Regenerative walls

  • Hi !

    One of my current projects. I'm trying to do some stuff.

    http://canapin.com/construct/tolilo/04/

    update : http://canapin.com/construct/tolilo/07/

    arrow keys, click to shoot

    The map in the editor is only made with squares. I made an event to automatically replace the edge squares by slopes when the map is loaded (I mention it, maybe it could interest someone).

    Without / with slopes (click the picture to view both) :

    [attachment=0:vfo9ji59]smoothedges.png[/attachment:vfo9ji59]

    I also tried to make a somewhat neat regenerating effect. Looks like an inverted particle effect but that's made with bullets and fade.

  • I'm definitely interested in knowing how u did that event on the slopes!

    In fact, i would like to see the whole capx (if u dont mind), because u have done a great job here.

    Those regenerative walls are truly nice!

  • This is too cool for school! Very well done.

  • I'm definitely interested in knowing how u did that event on the slopes!

    In fact, i would like to see the whole capx (if u dont mind), because u have done a great job here.

    Those regenerative walls are truly nice!

    I guess it's for Fatal Revenge ?

    Short version :

    I first draw my level with tiles because it's way faster than drawing my level with actual sprites.

    Then a loop replaces all the tiles by blocks sprites. During this, for each tile it tests for every other tiles in corners and replace some with slopes (as different sprite frames) if necessary.

    [attachment=2:1fs2rpgn][/attachment:1fs2rpgn]

    capx : [attachment=1:1fs2rpgn][/attachment:1fs2rpgn]

    You'll need the platform+ behavior.

    I also made little changes by adding slopes in inner angles (just the bottom ones, not the upper ones) since I uploaded the screenshot (click to view the full image) :

    [attachment=0:1fs2rpgn][/attachment:1fs2rpgn]

    It can still be improved to round single squares but it will need about 5 more frames and more events.

  • Sweet. I can see a lot of uses for this kind of system. Super awesome, Keep it up!

  • Thank you

    The next step will be automatically adding and removing slopes in real time on holes created by the player. Not sure how much it will slow down the game however.

  • Awesome!

  • Nice system. The performance should be fine, just loop through the tiles in a square that bounds your explosion radius. You could have a set of jagged-edge sprites around the holes instead of slopes, & could probably get away with a larger tile size in that case (since you're faking extra detail & won't see squares).

  • Nice system. The performance should be fine, just loop through the tiles in a square that bounds your explosion radius. You could have a set of jagged-edge sprites around the holes instead of slopes, & could probably get away with a larger tile size in that case (since you're faking extra detail & won't see squares).

    Hi,

    I didn't understand your jagged-edge sprites thing (my english isn't very good).

    However I did a try while looping through the regarding blocks :

    [attachment=1:2r1nd3ux]slopesinholespic.png[/attachment:2r1nd3ux]

    The player made a hole on top of it and my events created a nice slope on the upper left corner.

    But that's very slow and my computer has an unpleasant tiny freeze when the hole is created.

    You can try it here : http://canapin.com/construct/tolilo/05/

    And that's with only one slope ! I didn't make the three other ones.

    Here are my events :

    [attachment=0:2r1nd3ux]slopesinholes.png[/attachment:2r1nd3ux]

    It starts to be complicated !

    I'm not sure why it is that slow : when the player shoot on a straight wall, it select all the blocks on the radius border : that makes around only 10 blocks, and we test for the presence of two blocks for each of these blocks. That makes my events iterate over 20 blocks.

    Or maybe I have an issue in my loop. Maybe the "for each block" in my second function ?

  • Coin-coin le Canapin

    Indeed Fatal Revenge

    Regenerating terrain gives lots of gameplay options.

    Not sure yet how i am going to use it.

    Maybe the whole set can be destroyed & regened, maybe just parts of it.

    Blasting something apart, and then seeing it being reconstructed has a definite "wow" factor that i like.

    Because Fatal Revenge has a massive amount of bullets onscreen almost constant im now thinking about what route i should choose with this regenerating terrain.

    Slowdowns are not wanted in such a game, so after testing later this week it will come down to small structures with this feature or large, or something like a doorway wall giving access to specific parts of the arena.

    Thanx for sharing this.

    Its super awesome!

  • Coin-coin le Canapin I think you should rewrite this to use tilemap for everything. Your slowdowns are probably to do with having separate sprite instances for each block.

    As a quick fix, you could try replacing the 'pick by evaluate' condition in your 'getblocksinradius' function with something like 'block is overlapping explosion' (collision testing is probably more efficient than evaluating an expression for each block instance).

    But still I think you need to be using only a single tilemap, not lots of sprites. If I get time later I'll make a capx to test this...

  • Hi !

    Thank you for your advices <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

    I was well aware of this issue and I rewrote my engine using tiles only. It was way faster but it made the blocks regeneration difficult. I tried to store their timer in an array but it was kind of glitchy.

    So I tried another way, by keeping using blocks but storing them in an array as using sprites provided me more flexibility.

    It's quite effective : http://canapin.com/construct/tolilo/07/

    I also made new block frames so my map is more "precise".

    The issue I'm facing now is that when there are a lot of projectiles on the screen, it starts to slow down when looking for collisions with blocks.

    My guess is that because on the "projectile collision with block" event, it iterates over all the blocks. If there are 10 projectiles on the screen, it iterates over 10*4000 blocks.

    I have two ideas.

    1) Instead of looking on collisions with blocks, I could compare the projectile with block coordinates in my array. But that would be kind of complex, especially with blocks which don't have a square hitbox. Plus, I would like to put a behavior physic on blocks (not movables) and projectiles, and I'm pretty sure it will have terrible performances.

    2) Going back to tiles and try to :

    a) make my array containing timer work

    b) using invisible sprites containing a timer for each destroyed tile all over the holes created, and remove these sprites when the timer ends

    And hoping that the physic behavior will work smoothly when using tiles instead of blocks.

    If you have an advice regarding these solutions, I'm interested in. <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile">

  • I would do this: for each projectile, test if it's current array/tilemap/grid square contains a block; if a block exists, then do an overlap test (with only that block) so you can check for the triangle shapes.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Amazing, thanks !

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
42 3,254
taistelusopuli's avatar
taistelusopuli
Unread hot topic
25 2,088
R0J0hound's avatar
R0J0hound
Unread hot topic
25 4,146
NPherno's avatar
NPherno