"HolyWater" Projectile and Optimization Questions

Get help using Construct 2

Post » Fri Apr 11, 2014 12:53 am

So in other words I will have to scrap the idea of using families and create events for all of these separately? (or at least the weapons like the holy water)


No, the reason is you mix you objects up, you spawn an object of holy water, and you test against a family object, which is fine.

Image

However here is where it goes wrong.
Image

You check if the weapon is 3, which it is, then it spawns the fire and then destroy holywater. But you haven't picked a holywater object, but a family object. So when you use destroy holywater, it destroy ALL holywaters, including the one in the air. To fix it, just change it to the family object. (Same with the spawn, it spawns fire for all holy water objects as well)

Image

That will work as well.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Fri Apr 11, 2014 1:18 am

nimos100 wrote:
So in other words I will have to scrap the idea of using families and create events for all of these separately? (or at least the weapons like the holy water)


No, the reason is you mix you objects up, you spawn an object of holy water, and you test against a family object, which is fine.

Image

However here is where it goes wrong.
Image

You check if the weapon is 3, which it is, then it spawns the fire and then destroy holywater. But you haven't picked a holywater object, but a family object. So when you use destroy holywater, it destroy ALL holywaters, including the one in the air. To fix it, just change it to the family object. (Same with the spawn, it spawns fire for all holy water objects as well)

Image

That will work as well.


I tried that already and all it does is cause the game to lock up or run very very slowly.

It doesn't do it on every throw but if you do it enough times it will do it eventually, though it does fix the problem it just creates another. Unless I am misunderstanding what you are says. I switched the holy waters that you pictured to the "subweapon" family.
B
8
S
1
Posts: 76
Reputation: 949

Post » Fri Apr 11, 2014 1:32 am

I tried that already and all it does is cause the game to lock up or run very very slowly.


Yeah that is another problem, which is easily solved. Its because your "holyfire" (The red flame) is also part of the Subwep family, so it triggers an infinite loop with your collision detectors, and keep spawning more and more. Just remove the "Holyfire" from the family and it wont slow down anymore.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Fri Apr 11, 2014 2:01 am

nimos100 wrote:
I tried that already and all it does is cause the game to lock up or run very very slowly.


Yeah that is another problem, which is easily solved. Its because your "holyfire" (The red flame) is also part of the Subwep family, so it triggers an infinite loop with your collision detectors, and keep spawning more and more. Just remove the "Holyfire" from the family and it wont slow down anymore.


Ok thanks. I was thinking that but I didn't want to change something and mess it up even more.

Thank both of you very much!!

I don't want to push my luck with all the help I'm getting but do you have any suggestions towards the other two questions I had in my first post?
You do not have the required permissions to view the files attached to this post.
B
8
S
1
Posts: 76
Reputation: 949

Post » Fri Apr 11, 2014 10:46 am

My second question is if anyone with some experience might know a way to improve or further streamline my system. I know its fairly function heavy and I'm not sure if I am going about this in the right way.


Now that the problem with the holywater is fixed, the performance for the game is pretty decent. And using lots of functions are a good idea in my opinion, uses loads my self :D

The only thing I would do if I were you, depending on how big you plan the game to be of course, would be to split things up a bit in different event sheets. So you have event sheet for Enemies, Player etc. Add one for functions and maybe split them up as well, Enemy_functions, Player_functions.

A third thing to add in real quick would be any help on enemy AI. I have read what little information there is on Scirra but most of it is for top down games were path finding can be used. Any links or help in this regard would be a great help.

Don't really know a lot about AI in platform games, but most of the time they appear to be rather weak. And seem to follow very few rules. One being that they aimlessly patrol a certain area, going back and forth and the player have to avoid hitting them. Or they attack the player using two settings, which are move to player position or try to keep a certain distance while attacking.

So you could do the same depending on the enemy type, they could be:

    Patrolling
    Aggressive
    Defensive

Then you could mix it up with some things that made it interesting. But would be more like abilities rather than AI. For instant an enemy could use some a cloak ability, that would make them invisible for a few seconds, and when they appear again they appear another place on the screen. But still they would just use the defensive AI, trying to keep distance from player while attacking.

You could add something so some of them create clones of themselves varies places on the screen, which all are attacking the player, but only one of them actually does damage to the player, so its up to them to figure out which are the correct one.

Could be that an enemy went into the ground and after a while would try to grab the player, keeping them in place until they break free. Which could be done by maybe spamming some buttons until a bar is above the break free threshold, kind of like those old summer, winter games. But again such enemy just use an aggressive AI behaviour.

But this is just some examples, but think that would be a good way to spice up the game in regard of AI.

For the AI you have now which is pretty much the aggressive one, I would just add an offset, so the enemy doesn't go exactly on top of the player, but try to stand next to them instead. But anyway don't really know anything about how to make AI for platform games, so might be way off, its just based on what it looks like to me. :)
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 0 guests