3/4 top-down perspective NPC Animation

Discussion and feedback on Construct 2

Post » Wed Jun 26, 2013 8:50 pm

Hi everyone,

Just bought a license so this is my first post.
Last few days have been spent trawling here, youtube, google etc for tutorials and answers.

I am trying to achieve this style of NPC movement from a similar perspective. I got the player movement working correctly using a family group of sprites.

Problem: Creating multiple instances of enemies that are capable of moving in 8 directions with 4 direction walk animations (up, down, left, right)


-Extra stuff-

I managed to get one instance working properly in all four directions but I using a family group and and set position but I came to realize you cannot create/spawn new families as a whole. So my other instances were just the shadows.

I know I will need to use this smoke trail
tutorial for multiple instances but first I need to figure out which method of organizing and positioning sprites onto the shadow is best


I've tried to pin a sprite onto the enemy shadow which contained all the animations but I couldn't get it to calculate angles properly and then my other instances broke.

I am now wondering which movement behavior is needed, bullet, custom, pathfinding, 8 direction or a combination of them.

I'll get a capx up soon.


B
10
S
2
Posts: 76
Reputation: 987

Post » Wed Jun 26, 2013 9:18 pm

You should have a look at my bomberman tutorial that's the kind of movement/perspective both the player and enemies have.

For the creeps (enemies) I've been using the pathfinding behavior, but it is possible to use any other behavior that suits your needs best.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
272
S
99
G
70
Posts: 7,267
Reputation: 75,794

Post » Wed Jun 26, 2013 10:15 pm

Merci!

I'll check out path finding, is it resource intensive calling the function every time and attempting to recalculate the paths?

current capx
http://temp-share.com/show/f3Yg6h9QnCentra2013-06-26 22:16:54
B
10
S
2
Posts: 76
Reputation: 987

Post » Wed Jun 26, 2013 11:04 pm

[QUOTE=Centra]I'll check out path finding, is it resource intensive calling the function every time and attempting to recalculate the paths?
[/QUOTE]

Yes, you don't won't to be recalculating your obstacle map/course every tick.
But if you delay it "smartly" (like once a few seconds and not for all your instances at once) I think it can do the trick.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
272
S
99
G
70
Posts: 7,267
Reputation: 75,794

Post » Fri Jun 28, 2013 4:55 am

Thank you very much for your help thus far.

Working from both your bomberman tutorial and the rocket trail
tutorial from OP, how would you deal with pathing from newly spawned/created instances?

The bomberman tutorial only seems to work with instances already
created because it uses their UID but I think we don't know the
UID from a newly created instance

also I don't understand what "function.param(0)" is doing from the Pick UID eventCentra2013-06-28 04:57:18
B
10
S
2
Posts: 76
Reputation: 987

Post » Fri Jun 28, 2013 8:58 pm

about the function..
the call function "stores" the uid number in parameter0 from the event it calls the function,then in the executed function itself it picks the "sprite" with uid(parameter0)



looking at the capx, for a newly created creep you should

make the same function as "creepPickDestination" without the creep-picking condition

name it "newCreepPickDestination"

> on creep created , call "newCreepPickDestination"vtrix2013-06-28 21:16:02
ImageImage
B
66
S
19
G
7
Posts: 815
Reputation: 9,718


Return to Construct 2 General

Who is online

Users browsing this forum: Ticket Games and 9 guests