Merrak's Non-Isometric Adventures -- Planar Programming

merrak

  • *
  • Posts: 2657
Devlog 5. This is the second part on my "state machine" approach to handling dozens of animations. Fun stuff if you want to create a cinematic platformer!

<a href="https://www.youtube.com/v/Z4EW1VzMLNA" target="_blank" class="new_win">https://www.youtube.com/v/Z4EW1VzMLNA</a>

mdotedot

  • Posts: 1644
Hey Merrak,

Great devlog as always.

Thank you for working on your animation/state manager.

As you may know I'm investigating this myself.

The 'standard' animation manager from the jump and run-kit works fine for non-interactive objects and when you don't have a lot of states.

I've hit on the animation manager problem on two projects that involved:
  • Animation sequence involving multiple actors
  • Switching animation during an animation

When you have an animation sequence where you for instance push a rock. Ideal you go from idle/stand position to a push behavior.
Then you move the actor and you need to check if the actor really 'hits' the other actor and then the rock needs to move in sequence of the push animation.

When the player holds down the direction key the push animation shouldn't become an Idle/Stand but keep on pushing. But when the player does  not hold the direction key the animation should go to 'from push to idle'.
And then when you are in the animation sequence of going from push to idle and during that animation the player hits the direction button again it should go back to the push animation sequence.
That applies to turning around as well while in push state. The rock should be going to the direction it needs to go (tile based) and the player could move away.

My approach wasn't behavior-based. And I'm not sure if that is the right direction for me to take.

Do After blocks indeed are problematic. (Especially with the slide block from Stencyl which has duration and using do after that duration )

Change-State-Matrix is something I was thinking about, but I'm not sure if that is the right approach.

I'm thinking of a more frame-based approach but I still do not have code to back it up.



Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2657
Great devlog as always.

Thanks! :D

Animation sequences with multiple actors is well beyond the scope of what I'm trying to accomplish, but switching animations within another animation is what I'm working on right now to try to smooth out the run -> turn to face other direction -> continue running sequence. This is the one I showed that had the extra frame that had Marika pointing the wrong direction. Unfortunately, that's the symptom of a much larger problem with player controls. In order to turn around while running, the player will have to hold down the new direction while also holding down the previous direction. If there's a frame in which the player releases both keys, Marika will stop.

Fortunately, I may have solved this problem by accident. The first three frames of the six-frame turning animation are also the same three frames that make up the animation for the stopping state. So all I need to do is check which direction key (if any) the player is holding when the stop state comes to, well, a stop.



merrak

  • *
  • Posts: 2657
Devlog 6. It's election time! In Update 6, we'll take a look at a problem regarding NPC leadership--and how the state manager might be used to solve it.

<a href="https://www.youtube.com/v/206G8Ol4AUA" target="_blank" class="new_win">https://www.youtube.com/v/206G8Ol4AUA</a>

merrak

  • *
  • Posts: 2657
Devlog 7. The game development devlog series for 'Rogue of Vallas' returns!

The new state manager is coming along nicely, but now there's the new challenge of using the new features correctly. I take another look at Prince of Persia and how to implement a similar control scheme with Stencyl.

<a href="https://www.youtube.com/v/Li1951NT7hE" target="_blank" class="new_win">https://www.youtube.com/v/Li1951NT7hE</a>

merrak

  • *
  • Posts: 2657
Devlog 8. I've finished (mostly) the new state manager! Now I can start making new levels. Take a closer look in my latest devlog--

<a href="https://www.youtube.com/v/NVklCkFiMdg" target="_blank" class="new_win">https://www.youtube.com/v/NVklCkFiMdg</a>

mdotedot

  • Posts: 1644
Awesome devlog once again.

The statemanager looks a lot better than the previous lengthly behavior.

I was wondering what you meant by 'copy/pasting' code?! It was in the part where you talked about the Tick.
Isn't that something that a global block can help you with? Or do you think that it makes the code more difficult to read?!

Also I think it would be great if you could indeed talk about performance.
Sometimes people on the forum or on discord do things in the update event like spawning 'every x ' blocks etc..
Also some people are cautious about using booleans because they think it would generate slower code. Tips&Tricks to debug are also things that I think a lot of people would benefit from.
I have seen that you used tools like hxScout.
I personally had a hard time to 'read' the information that hxScout showed me. Especially where I could zoom into the  processing part of the code. Most of the time the memory and rendering stuff appears and 'clutters' the view from the part that I really wanted to debug.
You talked about hxScout in your IsoMetric Adventure (page 34) so maybe you can talk about this in an upcoming devlog?!


Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2657
Awesome devlog once again.

Thanks! :)

The tick is a variable. I just set up a template state behavior (screenshot attached) which has the most common events already set up. The first four: RollCall, UpdateAnimation, Activate, and Deactivate are required. Almost every state needs to be able to transition to idle, falling, damage, or dying, so it's easier to include those by default and subtract them if they're not needed. Since the contents of all of these events differs depending on the state, I don't think a global block makes sense.

I thought about having a global clock, but giving each state its own clock makes it easier to manipulate state timing and doesn't impact performance in a meaningful way. A good example would be the run-stop state that I mentioned. If I change animations partway through that state, I have to change its clock to adjust for the new frames.

Thankfully, I haven't needed hxScout yet. There wouldn't be much to show on this project. I could always go back and try to demonstrate it on the isometric game, but 'Towers of Vallas' is done and there are no more performance problems left to solve.


merrak

  • *
  • Posts: 2657
Devlog 9 "Christmas Episode". Back to level design! I finished the level that prompted the State Manager redo and it plays a lot better--still not perfect, but closer to what I wanted. In this update I talk about how I plan to guide the player to learn a new game mechanic (sniping with the knife). This is the level that precedes "High Security Compound", where mastering that mechanic is more important.

<a href="https://www.youtube.com/v/lxw5YZ2xA1Q" target="_blank" class="new_win">https://www.youtube.com/v/lxw5YZ2xA1Q</a>

merrak

  • *
  • Posts: 2657
Devlog 10. I now have a boss battle! In Devlog 10 I take a look at how I balanced the game to get to this point. Hopefully the boss is fair. Adding a couple of new abilities (such as being able to throw an axe while running) made a huge difference.

<a href="https://www.youtube.com/v/1crnGS21yMg" target="_blank" class="new_win">https://www.youtube.com/v/1crnGS21yMg</a>

mdotedot

  • Posts: 1644
Hi Merrak,

This devlog is kind of a DESignerLOG.
Quite some interesting points you mention.
Especially the part regarding grinding and number-crunching.
Did you make a roadmap to implement the design or do these design things come like a design iteration?
I kind of heard that you programmed an ability to throw while running in combination with the boss.
What was first, the boss or the mechanic?
Previously I mentioned that I very like your design of replay of the level in order to find/gain more points.
As a player I like it better when this information is presented graphically instead of numbers.
Also it would be cool if the replay had a little bit different things to experience. Another npc animation or stuff like that.
But I also mentioned playing 'backwards' (from the end to the beginning) to have a different take on the level.
Another approach could be that you present some secret doors,caves or hiding places to find things that give you the experience points when you are not a very good platformer.
My estimation is that I will be not able to beat most levels with even the required experience points to read a book.
I would fail too frequent to accomplish this and then out of frustration would stop playing the game.
If there would be an alternate way of (re)play the level to gain the experience point it could help me.
All this is with the estimation that I wouldn't reach the experience points needed, so when I get the alpha/beta playability it could be different.

Kind regards from
MdotEdot

Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2657
At this stage of development, I'm taking the perspective that a novelist might take with their book--it is a "first draft" and I'm weighing getting my ideas down more than polish.

The run-and-aim mechanic was very much reactionary. In the original version, in order to shoot at the boss, I had to come to a complete stop. It takes 3 frames to come to a stop, and in that time the boss could easily get a shot or two in. If I'm getting frustrated with the controls then it's not a good sign  :P

One thing I didn't think to try yet is to beat all of the levels with the minimum possible score, and see how far that gets me. I might need to revise the first level's skills a bit, now that I think about it.

Algebra is a good example-- you need algebra to see the dots when aiming. At first, I thought the dots were more of a luxury, and I wanted Algebra to be meaningful. Now that I have more direction with this game, I realize there are two shortcomings: The dots are more important than first thought (especially for the axe that fires in an arc), and the axes are needed in the first level to kill the turrets. Even if they're doing very well, the player won't have many points in the first level because the majority of points come from style bonuses at the end of the level.

Getting to a score of 1,000 by the time you get to the room with the Algebra book is much easier, so it makes sense to drop the cost. There's probably dozens of these kinds of scenarios that I'll just have to play in different ways to figure out--and, eventually, watch other people play.

If you replay a level, I am planning some cosmetic differences. Substantial changes are rarer, but I do like the idea of having options. If nothing else, that would add some replayability, too. Unfortunately, I can see this making level design much more complicated--but I think it's a good thing to shoot for, and adding new paths in existing levels wouldn't be too difficult once I get one path balanced.

Indiana Jones and the Fate of Atlantis had three entirely different paths. I think something of that scope would beyond what I could do--but the idea of having three variations of the same game is a good one.

mdotedot

  • Posts: 1644
Solution: make an editor so that bad players like m.e. can remove some enemies :)
Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.