The Daily Click ::. Forums ::. Digital Works ::. Squirrel Animation - hE WiLL pRoD yOU!!
 

Post Reply  Post Oekaki 
 

Posted By Message

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
8th March, 2008 at 11:45:31 -

Lol. Yeah, I personally thought the stick of doomness looked better still, but I may alter it

His clothes are the way they are cos the squirrels are supposed to be vicious natives. They're gonna have lots of different types of squirrel, so any ideas would be appreciated!

Thanks for all the comments

The AI shouldn't be too tricky. The way I'm gonna approach it is this:

One detector object, with several different animations inside it. As it needs to detect different things, it changes the animation. EG:

//Checking edge
Always
--- Set anim to EDGE DETECTOR

Detector overlaps obstacle
--- Squirrel: Set 'Is at Edge' to YES

//Checking normal obstacles
Always
--- Set anim to NORMAL DETECTOR


See? It just keeps changing to detect different shapes in different places. In addition, the detector can move around. So for instance, I can check if the squirrel overlaps player and is playing "Running" animation, and then place the detector over the action point (the point of the arrow) and change its animation to an arrow detector. If the player also overlaps the detector in this position, then he's been skewered!

For edge detection, we use an animation in this shape:

                 SS

SS
000 #######################
000 #######################
#######################


# = floor/obstacle
0 = detector
S = squirrel


The squirrel moves its detector a few pixels in front, ready to check for any edges. If it overlaps an obstacle, the result is ignored. But if it doesn't, the squirrel can worry, because it means there's a big gap approaching!

When this situation is found, he'll run a fastloop in which the detector drops, checking just how deep this gap is. If it's deeper than a certain amount, the loop stops and the Squirrel senses a dangerous edge. If it hits an obstacle not too far down, it senses a non-dangerous edge.

When it comes to decision making, the squirrel will screech to a halt at dangerous edges, but drop down at non-dangerous edges.

This use of altering and moving the same detector forms the basis of almost every bad guy in the game. And just to keep framerate up, it carefully selects which tests to run, based on which squirrels are near the screen. So a squirrel offscreen won't even move, so no edge detection or colision detection needed.

That's how it should work anyway

 
191 / 9999 * 7 + 191 * 7

viva/volt

Awesome Sauce

Registered
  26/08/2006
Points
  1694

Game of the Week WinnerSilverNova MemberKlikCast StarVIP Member
8th March, 2008 at 18:21:38 -


Originally Posted by I am AndyUK (honest)

dunno about edge detection though.



You can do something like:

Always set X pos to X pos + Width
Always set Y pos to Y pos + Height
If squirrel isn't overlapping the ground then he's at an edge
Always set X pos to Xpos - Width
Always set Y pos to Y pos - Height

Always set X pos to X pos - Width
Always set Y pos to Y pos - Height
If squirrel isn't overlapping the ground then he's at an edge
Always set X pos to Xpos + Width
Always set Y pos to Y pos + Height

Though width and height might have to be divided by 2 or something.

EDIT: lol Dines posted at the same time as me.


Image Edited by the Author.

 
Image
http://bfollington.tumblr.com

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
8th March, 2008 at 18:28:39 -

I think there's a small problem with that method dines. I've looked at several methods here in tuts and have always found the same issue with every single one of them. They don't handle fast scrolling very well, they just slip off the screen. Try one and you'll see. But, about that, if you can do it well, you shouldn't have any problems. I think.

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
9th March, 2008 at 13:23:45 -

What do you mean by fast scrolling? I've never encountered that issue before.

What it basically does is, it tests all these different things, then draws the frame. It makes sure it only executes on squirrels who're near the screen or onscreen, so squirrels who're offscreen will kind of pause.

It should be okay, in theory.

 
191 / 9999 * 7 + 191 * 7

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
11th March, 2008 at 00:17:25 -

Well, okay, here goes. Here's an example of not handling fast scrolling. When i download tutorials and engines, I always test the scrolling. There was an example of a guy showing how he did the ai of a particular game. It only fit on one screen and it worked really well. The ai moved up stairs and jumped over pits like the player would. So i increased the frame size, doubled the level and then ran the game with the scroll bars on the bottom and the sides. The scroll bars represented a fast moving player. When i moved these quickly, then came back to the game play, the ai was no longer there. What happened was, the fast scrolling speed somehow messed up with the ai logics and messed up the detector collision system. Thus, i knew that that ai would not work for a game type like shooters and the like. Thats what i mean. Sorry if i dont make sense.

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko

Klikmaster

Master of all things Klik

Registered
  08/07/2002
Points
  2599

Has Donated, Thank You!You've Been Circy'd!VIP MemberPS3 Owner
11th March, 2008 at 02:41:51 -

You shouldn't have problems when using scrolling. I use a method like Dines does for detector, it works a treat.

 
n/a

DeadmanDines

Best Article Writer

Registered
  27/04/2006
Points
  4758
11th March, 2008 at 09:15:54 -

I think what happened in that case wasn't a scrolling problem per se. It's due to the fact that, to run quick, MMF switches off certain processes if they're far from the screen.

So sometimes the AI will fall thru the floor if he's too far away, or even get deleted completely.

You can prevent it by changing the object's properties to 'Don't inactivate when too far from window' and 'don't destroy when too far from window'

I found that the hard way a while back, lol.

 
191 / 9999 * 7 + 191 * 7

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
20th March, 2008 at 00:35:14 -

say hello to the dumb noob here then, lol.

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko
   

Post Reply



 



Advertisement

Worth A Click