• entries
    743
  • comments
    1924
  • views
    580444

Design change

Sign in to follow this  

90 views



HERE'S A POOR QUALITY VIDEO showing the latest progress.

Contrary to journal posting, I've been quite busy on my current project but tonight I have had to make a major design decision that I was hoping to avoid.

I've decided that the character is going to be grid anchored, like in the Abe games or the original 2D Prince of Persia. I was hoping the character could be free to exist at any location and walk right up to edges/walls but it is causing me too many headaches.

Obviously there is smooth animation from square to square on the grid and it is fairly un-obvious to the player, but the character can now only walk a minimum of exactly one grid square and run a minimum of two (unless it hits a wall, obviously).

This makes a lot of other game logic go from horrendously complicated to incredibly simple.

I still then had the problem of some animations making parts of the character's body vanish into walls so I now have a separate position and draw_position. If any parts of the character now go into a wall, the draw_position only is modified based on my previous work with defining a bounds rect based on skeleton extremities but its physical position is unaffected. Rendering then uses the draw_position.

The end result now feels very robust and stable, unlike the previous attempts, and the code is far simpler.

Certain things are now going to be outlawed by this - free moving platforms will not work for example.

Other things now become pretty trivial though - nice switch pressing animations, picking up objects neatly etc become so easy when grid aligned that the engine almost just becomes an animation scheduler.

Considering the complications that will be created by edge dangling and vaulting, I'm sure I've made the right decision, although it is a shame in a way. Still, Abe and Prince of Persia didn't really seem to suffer as a result of this design so neither should whatever game I end up writing.

I've implemented falling and landing when you run off edges and you stop at edges when walking. Next up to tackle is jumping - there will be two types, a short hop when standing and a longer leap when running. I think I need to overhaul the animation system a bit first though as I had to hack it a bit to get the landing animation to work.

The current system only really plays nice with cyclic animations. There is also a bit of an issue with what happens if the controller gets a BlendInto() signal while it is already blending between two animations. Whether I should store the currently interpolated frame then blend between that and the new animation or somehow play all three together with different weights, I don't really know.
Sign in to follow this  


3 Comments


Recommended Comments

Prince of Persia and Abe were grid-aligned?? Really?! Oh well. Their grids must've been small enough; if each tile was the size of the character I'm sure I would've noticed [wink]

Share this comment


Link to comment
Quote:
Original post by Jotaf
Prince of Persia and Abe were grid-aligned?? Really?! Oh well. Their grids must've been small enough; if each tile was the size of the character I'm sure I would've noticed [wink]


Yep. Well, Abe definitely was. It's been a lot of years since I played P of P so can't be sure.

To be honest, now it's working in my game it is barely noticeable and it makes everything else in the game sooo much simpler.

Share this comment


Link to comment
Very nice work! I remember watching your last video but didn't respond to your entry. Keep working on it!

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now