"HolyWater" Projectile and Optimization Questions

  • I have tried many different ways of setting up my holy water projectile which is supposed to hit the ground and burst to flames. It does this perfectly, however, when I use it to quickly then it hangs in the air and I can not for the life of me figure out a way around it. I why it does it but can't find a way around it.

    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.

    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.

    All help is appreciated

  • Bump. Still having troubles with the holy water projectile and AI.

    Help would be much appreciated

  • What hangs in the air? The bottle or the fire?

  • What hangs in the air? The bottle or the fire?

    It happens when a bottle hits an object it causes the ones in the air to activate and freeze mid air.

    Originally I had it set up that the fire and bottle were one object and would play "fire" animation when hitting an object. This had the same problem but adding "system for each" to it fixed it but would give me lots of errors and crashing.

  • Most likely that's happening because the conditions refer to "Subwep" and the action refers to the bottle only. Make everything use the "Subwep" family instead

  • Most likely that's happening because the conditions refer to "Subwep" and the action refers to the bottle only. Make everything use the "Subwep" family instead

    Doing this causes the game to lock up.

    I think doing that makes the game infinitely spawn fire objects were the bottle lands instead of destroying it properly.

  • Maybe replace "on collision" with "is overlapping + trigger once". But to me it doesn't seem like the "for each object" there is needed

  • Maybe replace "on collision" with "is overlapping + trigger once". But to me it doesn't seem like the "for each object" there is needed

    Ya, that for each was just me trying to fix the problem. I removed it and did what you suggested, but that didn't make a difference at all. I just don't understand why it is doing this.

    Now some of them are flying through the ground instead of just bursting like before.

    Perhaps I just have my entire system set up like crap?

  • If you replace the family with the holy water it works. You don't need a for each, as the "on collision" is a trigger so it will trigger only for the object involved. So it picks the one object that the "On collision" is triggered for.

  • If you replace the family with the holy water it works. You don't need a for each, as the "on collision" is a trigger so it will trigger for 1 object only at the time, so you can remove the for each.

    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)

  • [quote:12fjwotu]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.

    However here is where it goes wrong.

    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)

    That will work as well.

  • [quote:3cxlcdf8]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.

    However here is where it goes wrong.

    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)

    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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • [quote:2zej7lrm]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.

  • [quote:2inhqod6]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?

  • [quote:27cduldd]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

    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.

    [quote:27cduldd]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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)