Zelda AI Issues

Get help using Construct 2

Post » Sun Dec 08, 2013 11:48 pm

I'm making a short Zelda Fan Game, just so I can work on my Construct 2 ability without having to worry about graphics. But, I've been having an issue with the Octorock's AI. First of all, they won't shoot the rocks, and I can't figure out why. It worked earlier, but I went and worked on some new things in the game, and they just stopped. Second, they all shoot at the same time. No idea how to stop that. There are a few other things, such as some issues with the bombs, so just feel free to play around and see what you can do. Here's the .capx: Zelda Demo (The Spin Attack is unfinished, just ignore it)dpyellow2013-12-10 00:07:19
Image
B
26
S
6
G
2
Posts: 38
Reputation: 2,427

Post » Mon Dec 09, 2013 12:06 am

If it helps, here's a .capx of an earlier build in which the Octorock did shoot rocks. OldZeldaVer.dpyellow2013-12-10 00:07:36
Image
B
26
S
6
G
2
Posts: 38
Reputation: 2,427

Post » Tue Dec 10, 2013 12:36 am

If anyone's just, working on a solution, could you post a reply so I don't go insane?
Image
B
26
S
6
G
2
Posts: 38
Reputation: 2,427

Post » Tue Dec 10, 2013 5:58 am

I'll give some feedback since no one has answered, but I'm not experienced enough to solve everything.

First off, I only see one Octorock. If you want them to behave differently, they need to be a different sprite. I had the same issue with my game. One enemy gets triggered to attack, and they all do it.

So yeah, you can right click on him and click "clone object type" and get another one easily with animations and everything. You'll need one sprite for each different enemy. Any repeats of Octorock number 1, and they will behave the same.

Of course, you'll need to work the new sprites into your code so they actually appear when you want them.

The second thing I want to mention is that those images are way too large. There's a reason why you're using 1200mb of memory with just that small area. 7000px wide images are killer. Maybe go 1000px or 2000px at most, but since this is pixel art, you should be thinking more like 32px or 250px and not having to scale them so much.

I didn't have time to figure out why things are not shooting, but maybe you accidentally added some trigger or condition that prevents them from doing so. Compare those two capx files and see.

And like I said, I'm not a major expert, so if someone else can add something, please do.DrewMelton2013-12-10 06:02:59
B
79
S
30
G
35
Posts: 340
Reputation: 22,996

Post » Tue Dec 10, 2013 6:03 am

You shouldnt need multiple instances of the same sprite - just be sure to use picking to make sure you're dealing with the sprites one at a time. I am a noob myself so im not the best at giving advice, but I do know you dont need multiple octorocks.. set one octorock then on your actions be sure you're using something like "for Each" that way no matter what octorock, it's following it's own set of rules independent of it's brothers. Ill get more into it when i have more time, but Look at the manual for "For Each (Object)" and also for picking, for example - pick the instance nearest to link and do something.
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Tue Dec 10, 2013 6:18 am

@80bit

Hey, I tried what you said, and it works! At least it seems to so far. I'll keep testing it to make sure, but it seems fine. The AI is attacking individually with two of the same sprite.

All I had to do was create a new event: system > for each enemyhitbox (or octorock in your case), and I moved my enemy AI under it as a subevent.

It looks like you just saved me quite a bit of work! Why didn't someone mention this when I posted for help in my own thread....

@dpyellow you can ignore what I said about multiple sprites.DrewMelton2013-12-10 06:19:29
B
79
S
30
G
35
Posts: 340
Reputation: 22,996

Post » Tue Dec 10, 2013 8:04 am

Haha I try to keep up with posts on here, but sometimes they slip through - this one had Zelda in the title soo...... :) Glad I could help for once instead of just be the one being helped (like always). :)
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Tue Dec 10, 2013 10:22 am

I don't know if this can help but here's a noob "ai" with states...

https://dl.dropboxusercontent.com/u/45711709/noobAI.capx

Quickly hacked together so it might be buggy ;D
B
33
S
6
G
7
Posts: 339
Reputation: 7,426

Post » Tue Dec 10, 2013 1:51 pm

Hey, thanks guys, I'll try all this. @DrewMelton, My sprites are that big because they were extremely blurry before, but yeah, they probably are quite a bit too big. I'll play around with that and see how small they can be without being very blurry.
Image
B
26
S
6
G
2
Posts: 38
Reputation: 2,427

Post » Tue Dec 10, 2013 2:49 pm

@dpyellow, I also made small change to AI CAPX

About overall design of the game.

- I think there is way too many events and object. Button icons for example you could make one sprite called icon and just but different animation frame to them.

- There is own event for almost every combination of conditions.

- There is object called Tiled background object.

- In an isometric game it would be better practice to make invisible collision box for all characters, walls and such and just but graphics over them to show animations (also collision box for melee attacks)

- Also not sure why it takes 39 MB (that is a lot considering what there is).

I say this because in a long run it makes things a lot easier and more functional.

This actually made me to think about releasing one platform CAPX for new people to see one option how to make stuff. Single example usually doesn't give very good picture about the structure. Better users than I could then make improvements to it.
B
34
S
9
G
3
Posts: 517
Reputation: 5,226

Next

Return to How do I....?

Who is online

Users browsing this forum: Artcadev and 43 guests