Sign in to follow this  
  • entries
    53
  • comments
    225
  • views
    69285

Cow Chaser

Sign in to follow this  

306 views

Last week, we equipped our little Elephants with some sensors, so they could tell when the cow was sneaking up on them. This week, we're going to start giving them some more interesting things they can do about it.

But before we go there, there's some plumbing in our way. As I hinted in a few previous entries, the fact that the reaction handlers worked at all was much more good luck than good management. All the task scheduler was doing was running any activated task until it completed. So while most of the event handlers (like the turn-when-you-bump-into-something Moove task) seemed to be working, what was actually happening was that the Agent was being told to both move forward (the default behaviour) and turn (the event handler) at the same time, and the turn won because it was last in the list. And while we got away with this for really simple behaviours, things start to break once we start adding more complicated behaviours (as all the tasks running on top of each other start to clobber and fight with each other, dead-locking the tasks and making the agent start trashing around on the screen).

So, my first job this week was to implement the default task scheduler. This little puppy works out which tasks should be running at any point based on the relative priorities assigned to tasks and the order they get run in. The default scheduler fell out a little easier than I'd been expecting - it's basically just a prioritised queue of tasks waiting to run, giving some special handling to sensors and parallel tasks.

Anyway, with this in place, the Agents now diligently stop whatever they were doing when an event interrupts them, go off and execute the tasks attached to that event, and then go back to what it was doing.

In the Agent program below, the little elephant now stops his bump'n'turn path when he notices the cow and runs after him using the new GoTo task:

Disabled

You can see that I've cranked up the speed on the GoTo block so he really takes off after you. Here's a quick movie of the program in action (noting that only one of the elephants has the chase behaviour on him):

Disabled

The task scheduler ensures that any bump events don't interrupt the GoTo block (as they're at the same priority and the GoTo started first) - but you could easily change this by messing about with the Task priorities.

There are still a lot of big-ticket items to add to the task framework - like explicit multi-threading which will allow the designer to have a lot more control over how tasks are scheduled. But the default behaviour above should let me do quite a bit.

Cheers!
Sign in to follow this  


6 Comments


Recommended Comments

Looks ace.

Are you planning for the enemies to kill the cow just by touching him, or are we going to see some actual attacking animations as well?

Share this comment


Link to comment
Quote:
Original post by EasilyConfused
Looks ace.

Are you planning for the enemies to kill the cow just by touching him, or are we going to see some actual attacking animations as well?


That's a really good question. It was actually right at the top of my "What should I do next" list (the question, not the answer unfortunately).

I'm really torn on how to handle damage. A bit of me really likes the puzzle-friendly implications of death-on-contact - and certainly all the old Speccy games (and even some new ones like Little Big Planet) go this route and it seems to make it easy to setup a well defined challange/obstacle for the player. On the other hand, I don't really like the idea of the cow just exploding for no reason other than he grazed the side of an enemy. Aestetically, I kind of want to see the enemies lay into you (and allow you to return the favour) ... but I'm not sure what this means from a gameplay perspective. I don't want it turning into a shooter/brawler (ala Crusader say), and I don't want you to be able to just kamikaze your way through all the enemies (i.e. take a bit of damage to bulldoze your way past a challange).

I'm hoping to prototype a bit of both and see which one feels the best ... but there's a fair bit of work to get the animated combat working (for example, I haven't worked out how to associate the time and place of impact for a punch with the animation playing on the skeleton).

Share this comment


Link to comment
I agree that a finite health/combat system would completely destroy a lot of the puzzle-like elements that this game really seems to be crying out for, but equally a cow that explodes when it touches an elephant is (while pleasantly surreal) not really ideal.

I don't know if you ever played the Abe's Oddessy games on the PC or PS1 but they had neat systems for the player dying. Enemies and obstacles had different ways of killing Abe, all instantaneous if you touched them or were spotted, but all fully animated so it made sense.

Unfortunately this approach leads to a great deal of content creation which, while you seem very proficient at modelling and animation, is not really what a solo developer needs.

Share this comment


Link to comment
Yes, instead of an "attack" animation for each enemy, you have a "kill" animation :P You're going to go through the trouble of making this specific animation anyway (attack), so if it kills instantly, no big deal.

And to defend the non-shooter approach, I just read reviews of Call of Cthulhu (or something) and it was unanimous that the first part of the game was the best, simply because you had no weapons and you couldn't just shoot anyone who crossed your path. You had to work with people against the monsters, not become one of them.

Another argument is someone's report that his 7-yr old son's first question when playing the sims was "how do I shoot someone?". That's pretty bad :) Nowadays a gun is always the answer.

[EDIT]

On second thought you need to keep that gun you showed a while back!! x) I just don't agree very much with the notion of progressive damage, it would ruin the puzzle aspect. Any gun should have its quirks, not be a ticket to overcome all obstacles.

Share this comment


Link to comment
Quote:
Original post by Jotaf
Yes, instead of an "attack" animation for each enemy, you have a "kill" animation :P You're going to go through the trouble of making this specific animation anyway (attack), so if it kills instantly, no big deal.

And to defend the non-shooter approach, I just read reviews of Call of Cthulhu (or something) and it was unanimous that the first part of the game was the best, simply because you had no weapons and you couldn't just shoot anyone who crossed your path. You had to work with people against the monsters, not become one of them.

Another argument is someone's report that his 7-yr old son's first question when playing the sims was "how do I shoot someone?". That's pretty bad :) Nowadays a gun is always the answer.

[EDIT]

On second thought you need to keep that gun you showed a while back!! x) I just don't agree very much with the notion of progressive damage, it would ruin the puzzle aspect. Any gun should have its quirks, not be a ticket to overcome all obstacles.


I really agree with you on the shooter bit. I like the idea of some fun guns (not sure which one you're thinking of, but the explosion gun and bridge gun are my favourites) ... but on the whole, I don't want people's first instict to be "shoot it". Maybe you can shoot a few things ... but even then I'd rather have you shoot the envirnment than the enemy I think.

And as you both point out - the animation load either way is a bit scary. I'm hoping to put a few combat animations in and see how I like them I think. But before I can do that, I need to animation event streams =)

Share this comment


Link to comment
That test geometry gun you had a few months ago would be an awesome thing to see polished up and in the final game. I'm not sure how it could work, since it could lead to more destroy-puzzles-situations that damage and combat, but it would be really cool.

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