mspraggs / potentia

Southampton Game Jam 2015
0 stars 0 forks source link

Pressure sensitive/volatile blocks. #85

Open mspraggs opened 9 years ago

mspraggs commented 9 years ago

Perhaps blocks where, if you stand on them too long, explode?

Fyll commented 9 years ago

Explode or crumble (they're different in the code: Explosive crates explode, regular crates crumble. The difference is that explosions interact with other objects)?

My second question (word by word analysis here we come): Blocks or Props? Admittedly, this doesn't really matter, but it helps to set the picture of it up in my mind.

Code-wise, as gravity pushes you against the object every update, it'd be able to keep track of how long you've been standing on it. Would there only be one length of time for such things? If so, I could just define a EFF_CRUMBLE_UNDER_PLAYER_50 effect that would count 50 turns down from when the player steps on it (I'd imagine 50 updates after the player first steps on it would be better than the 50th update in which the player is standing on it), then die. Shouldn't be too bad.

Finally, will this also break under enemy Units? Under Props like crates?

Fyll commented 8 years ago

I've had a quick shot at this and if we want it to be a Prop, then it's pretty much done already (up to graphics). If we want it to be a Block, that'd be a bit trickier.

DivFord commented 8 years ago

I think it should be a prop. It's easier to make the art if it doesn't tile, and it will be clearer to the player that it's something special.

Fyll commented 8 years ago

Lovely.

I've pushed a simple version with placeholder graphics for now then. The only thing that seems to be iffy about it is that it crumbles when you touch it from any direction, not just from above. Do we want to change this?

DivFord commented 8 years ago

I stuck one of these in the test level to try it out, and it seemed to make the game really stuttery. The framerate was 100% most of the time, but seemed to get stuck every now and then for single frames. Taking the crumbling block back out seemed to fix the problem.

Is anyone else experiencing this?

Fyll commented 8 years ago

Doesn't seem to be happening with me.... Have you done anything else? Where, specifically did you put the crumbling block, and how many of them were there?

As a quick mention, the animation isn't perfectly smooth, what with the fact that I realised doing the whole thing 2 pixels at a time would take forever, and the friction on it is really high at the moment. Were you maybe being confused by one of these things?

DivFord commented 8 years ago

One block, in between the two patterns. The stuttering was happening away from the block, and even after it had disappeared, so I don't think it was down to animation or friction. I did have various other programs running, so it might be unrelated. May as well ignore it for now.

DivFord commented 8 years ago

I had an idea relating to this the other day, so I thought I might as well share it.

Since we now have the pressure sensitive code, could we have a variant where the block fell, rather than being destroyed? It would serve a similar purpose, but could also be used for puzzles where you needed to collapse blocks into a lower area to use as steps.

Fyll commented 8 years ago

Fell after a while, or fell immediately? Either way, wouldn't it just be the Floating Blocks, except with a different Effect (i.e. EFF_IS_PLAYER instead of EFF_DRAIN)?

Not saying that's a bad thing necessarily, but just that we already have that all set up I think.

DivFord commented 8 years ago

I meant that it would be triggered by the same effect, but would fall like a drop block, rather than disappearing like the existing volatile blocks.

Fyll commented 8 years ago

... I feel that we need more descriptive block names. By Floating Blocks, I meant the ones that hover until you shoot them with a drain beam.

i.e. Copy this into the PropList, and that should add the object to the game (I pretty much just copied the Floating block code):

  PropData("Falling under player prop",
           "Pu",

           { { Vector(0.0f, 0.0f), Vector(0.0f, 1.0f), Vector(1.0f, 1.0f), Vector(1.0f, 0.0f) }, 0.0f,
             getConstant<float>("STONE_FRICTION") },

           3,

           { { { { 0 }, { Vector(2.0f / 44.0f, 4.0f / 5.0f), 1 } },
               { { 1 }, { Vector(4.0f / 44.0f, 4.0f / 5.0f), 1 } }
             } }, //SpriteMap
           { { { { { { Vector(2.0f / 44.0f, 4.0f / 5.0f), 1 }, { Vector(4.0f / 44.0f, 4.0f / 5.0f), 1 } } },
                   { Vector(2.0f / 44.0f, 4.0f / 5.0f), 3, 6 } }
                 } }, //AnimationMap

           1.0f,
           true,
           0.0f,

           DIR_NONE,

           Vector(1.0f, 1.0f),
           Vector::Zeros(),
           Vector(1.0f, 1.0f),

           EFF_NONE,
           std::vector<EffectResult> { EffectResult(EFF_IS_PLAYER, RES_GRAV_DIR, DIR_DOWN, 1) }),
DivFord commented 8 years ago

Heh. Yes, that was exactly what I meant. I'm sure they used to be called "drop blocks"…

How about we call the new one "falling masonry" and use it in the ruins desert.

Fyll commented 8 years ago

Sounds good. Using "block" was misleading anyway.