Elemental Destruction (cont.) [Finished]

Joe

  • *
  • Posts: 2478
Can you describe the problem in words for the moment? And post a link to the published game?

Derek

  • Posts: 163
First, here's the link: http://www.stencyl.com/v10/game/play/1988

Secondly, the Wood attack is assigned with it's appropriate targets (Earth and Water), but the target range, which is attempt to harm all eight surrounding pieces, is sort of borked in some places. For example, if there's three Earth pieces below and the Wood piece is in the position where only two of them can targeted, all three of them get destroyed which isn't supposed to happen.
Don't be a critic on the internet while eating and drinking at your computer.

Joe

  • *
  • Posts: 2478
Secondly, the Wood attack is assigned with it's appropriate targets (Earth and Water), but the target range, which is attempt to harm all eight surrounding pieces, is sort of borked in some places. For example, if there's three Earth pieces below and the Wood piece is in the position where only two of them can targeted, all three of them get destroyed which isn't supposed to happen.
Try turning on region drawing. Did you ever fix the region placement like I mentioned before? That might be what's causing the problem:

- The region placement is off. You'll notice that, if you try to click the fire element on the right, both metal elements get destroyed. With region drawing on, you can see that both elements are inside the region.

Derek

  • Posts: 163
Done. Next up is Metal. Even though the attack targeting is no different from Fire and Water, what stands out about is that in whatever direction the moon phase wills, it'll keep plowing through vulnerable elements in that direction. Is that even possible?
Don't be a critic on the internet while eating and drinking at your computer.

Hectate

  • *
  • Posts: 4643
Done. Next up is Metal. Even though the attack targeting is no different from Fire and Water, what stands out about is that in whatever direction the moon phase wills, it'll keep plowing through vulnerable elements in that direction. Is that even possible?
Since you're using regions (I believe?), I'd suggest giving each vulnerable element an "attacked by metal" behavior that causes them to both trigger other "attacked by metal" behaviors in the appropriate neighbors and also kill themselves once it's done. That'll set a chain reaction off pretty well.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Derek

  • Posts: 163
How do I make it so that the line changes along with the moon phase (by line, I mean the chain of target regions that keeps going in one direction).
Don't be a critic on the internet while eating and drinking at your computer.

Hectate

  • *
  • Posts: 4643
How do I make it so that the line changes along with the moon phase (by line, I mean the chain of target regions that keeps going in one direction).
Haven't you already solved that for the other attacks? You just keep doing what you've done. If/then/else(otherwise) statements for your logic.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.

Derek

  • Posts: 163
Well, I finished Metal, but now it's running so slow I can't even test how it works, and the blocks are still moving slightly when there's a lot of them on top.
Don't be a critic on the internet while eating and drinking at your computer.

Derek

  • Posts: 163
(waits for someone to check the Forge demo to find slow down issues)
Don't be a critic on the internet while eating and drinking at your computer.

Joe

  • *
  • Posts: 2478
(waits for someone to check the Forge demo to find slow down issues)

Can you isolate which Behavior is causing this? Is it your recent changes to the Metal Behavior?

Derek

  • Posts: 163
Probably. Here's the recent state of the Metal Offense behavior (and as with Fire and Wood, the send message to other elemental behaviors is done).
Don't be a critic on the internet while eating and drinking at your computer.

Joe

  • *
  • Posts: 2478
Here's the reason for your slowdown: You're creating regions every single frame (Always > For each Actor > Create region). Look at how it's done in your other Behaviors; you should be creating the regions once and then just moving them around.

Other things: You'll want to set "Attack was Effective" to false inside the <mouse was pressed> block, not the when created block. Also, you're using more [actor inside region] blocks without being in a [for each actor inside region] block.

I think we've got a really good foundation built up in some of the other Behaviors. I'd recommend starting with one of those as a template and then just changing what you need to.

Derek

  • Posts: 163
Okay, I went back to basics with Metal since it's stuck on harm only target like Fire and Water. And its still has a crappy framerate. This is gonna be a problem since there's going a multitude of those blocks on screen during a game session (270 of them, 54 of each will represent one of the five element). You're definitely going to have to download the demo from Forge to see for yourself because I don't even know what's causing this if Metal Offense was toned down.
Don't be a critic on the internet while eating and drinking at your computer.

Joe

  • *
  • Posts: 2478
I'll have to see for myself, but that sounds like it's going to require a ridiculous amount of regions. We may want to drop the region spawning method and go with something like Alexin's solution in this topic.

Hectate

  • *
  • Posts: 4643
I have to say, Integer Inversion caused me slowdown when it got up to the higher levels (note, I have a crappy PC) that had up to 100 (10x10) blocks. That's the issue with doing these types of puzzle games, lots of actors can slow things down. I tried to mitigate it by not actually destroying actors, but by just changing their values instead (this was before actors could be recycled easily) when they were "destroyed".

I had some issues with moving and resizing regions, I'm curious to see if they're functional for you when moving them.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.