nimos100's Recent Forum Activity

  • [quote:2etxsd79]Hi,

    Can't find an example for making a condition build of a while and or combination, just like

    WHILE "object1.number=2" OR "object.number=4" OR "object.number=25" do something

    Do I need to create a sub-condition under the while? I wonder because I need to define the action right behind the while condition.

    Looks a bit hard to understand the event system logic in such a case, if never made before.

    Any help welcome.

    Have exactly the same problem and doesn't seem to be any good way to do something like that due to C2 for some weird reason doesn't support "And" / "OR" in the same event condition. So I ended up doing it without a While all together. Think the only way to do it, if you need to use the while is to split it into several events.

  • So I expanded my dungeon generator so now it can build a whole dungeon....most of the times

    Anyway I made it so it will connect doors in such way, that it will never leave rooms unreachable, and thought you could make benefit from something similar in your game regarding maybe how your repair ideas are working. So if something in one room breaks and is connected to something in another room, that machine could break as well or whatever, so the player would have several things to look out for and maybe in some cases start some nasty chain reactions, fires breaking out in other rooms and so on. Think that could make some intense situations

    In my case its the doors or actually the tile(s) next to them that works as connectors and gets connected using path finding. So you could see the doors as outlets, and the corridors as connections(Wires) to whatever they are connected to.

    https://dl.dropboxusercontent.com/u/109921357/Dungeon_generator_Alpha/index.html

  • There are no copy layer functionality I think, you can however duplicate a layout that will transfer them all, you just have to delete everything on that layout afterwards.

  • If I understood you correct, then here is how you do it:

  • Yeah you can do that as well, you can get the Target.UID of a turret, so you can use that to pick it, and then you have access to all you need.

  • No problem, you can easily do it with a tilemap if you only need around 7000 tiles. And even with as many as I did, if you don't have to update them constantly. I use around 62000 in my own game, but they are only updated once when the game starts.

  • [quote:3otdpidt]Any ideas anyone?

    I read about IIDs and UIDs but have no idea what to make of those .

    I never use IIDs my self only UIDs, never really found a reason to use the IIDs. But UID are just a unique identifier for a given object. Which make it very easy to manipulate specific items. You could do something like it manually if you wanted, but C2 just does it for you automatically, so you don't have to, which is why its easy to use.

    But imagine that you are in a dark room with two other people and you cant see each other. But you have to give one of them some instructions. The normal way would be to say there name and then what you wanted them to do,

    "Roger come to me" in this case Roger is the UID. Even if they both are called Roger, you might use Roger A or Roger B so they know who you are talking to. So no matter what they can never have the same name.

    Here is an example of how to make behaviours for turret this is from a former project I did:

    It shows two different turrets a basic "gun" turret and a turret that slows enemies. From the description in the image it explain overall how they work.

    The Gun turret

    Uses a very simple behaviour it will just shoot the first enemy with the lowest health that are within range.

    Since all the turrets are part of the Family "fTurret" I use an identifier "Turret_type = "Gun" to make sure that this behaviour only apply to gun turrets. Then I make sure that it only do this for turrets that doesn't currently have a target.

    Since im not sure how many turrets it picks based on these conditions and don't really care to know. I throw in a "for each" in the end so it does it for all of them.

    Then I make each of the turrets pick the enemy with the lowest health and set it to the turrets target. And it start all over once that enemy is dead or outside range.

    The Slow turret

    The first part is about the same as with the gun turret, except I don't really care if the slow turret already have a target. I want it to keep slowing enemies that are currently not slowed. And again I don't know how many turrets it picks so I throw a "For each" in there again. Since in my game an enemy can only be slowed if it have no shield, I make sure that the enemies shield are equal to 0, and that they currently aint slowed, which is just a Boolean that is switch on/off (there is a bit more to it.) And last it picks the one nearest to the turret.

    And when that is slowed it start all over.

    So if you want to use several different behaviours for the same turret, you can just make a Boolean that you switch for each of them, that also need to be true.

    For instant for the gun turret, I could have made it pick the enemy with the highest amount of health, if some Boolean have been set to that. So you can make it like that.

  • [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.

  • [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: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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • The problem is the way you have made it, its very ineffective as you spawn images.

    You spawn 6483 objects which puts a lot of pressure on the performance. The image to the right is the performance uses for your program.

    And you have 6 events that checks these objects 60 times a sec, so it actually does approx. 2333880 checks every seconds. Which will kill performance.

    If you compare it to the one I made with the tilemap there are hardly any impact on the CPU, because its considered 1 object, but if you added a lot of checks to each of the tiles in the tilemap you would kill the performance for that one as well.

    But regardless of doing it the way you have or using a tilemap with as many tiles as I have added, I don't think you will find any program that will deliver good performance working with such amount of objects/tiles. So think your are better off redesigning how you map generator works.

nimos100's avatar

nimos100

Member since 23 Sep, 2012

None one is following nimos100 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies