Posts by Bonehead

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.

    Great... I was supposed to come back in order to use the vast amount of forum tips and tutorials.

    But this place... it scares me. If I want to find a posts I used in the old forum for tutorials (like that post with the long string of a code helping to make an object rotate it's angle and set the right direction by vector), how do I start looking?


    (Not meaning to pick a fight with the devs or anything, but so far using this page has been confusing)

    Hi. I know there are a lot of posts about rotation, but I am still stuck finding the proper way to do this smoothly:

    I would simply like to create a game object, top-down, that has a hull and turret individually. I know I can use ANGLE to aim the turret with 360 degrees, but I keep having trouble creating the movement for the hull, so that it would rotate towards the target (coordinates saved as two values for x and y) smoothly and then move towards it.
    (I presume the classic Command & conquer tank movement would be the best example? )

    1. Is there a way to make the unit to rotate towards a target using ANGLE for a moving object and then set the DIRECTION based on that, or should I rather be trying to make it choose the right DIRECTION and force the ANGLE to rotate to fit the direction?
    2. I have found a long string of code, that will rotate the ANGLE towards the target from other posts, but I can not tell, if there is a way to make the hull realize, is it turning CW or CCW, to make the animation fit the rotation to left/right?

    In essence, I presume I am asking how I can mix up ANGLE, DIRECTION and target coordinates and to make the hull realize if it FACES/DOES NOT FACE the target to order it to move.

    Any suggestions are welcomed. I can link a sample of my test, but so far it is just a tank hull rotating towards the point I click with a cursor, so it is not even 1/2 of what I try to do.

    I should not be giving you an answer, since there are a lot of people here who actually might have an actual idea to explain this better... However, I have been studying and trying all sorts of .group interaction with a project I have been battling with for ages, and one problem with Groups is often the order in which they are in conditions with interaction, or that they are not as keen to tell themselves apart from each other the way instances do.

    If you have an instance of "sensor" in you game and a lot of "Enemy" instances, that all share .group "Group.Enemy", there is a difference between

    "sensor" (=instance) overlapping "Enemy" (=Group) (meaning a single instance is cheking interaction with a member/s of a group)
    "Enemy" (=Group) overlapping "sensor" (=instance) (A group of instances checking interaction with a single instance)

    Collisions should work a lot better than overlapping, since there scoping happens because two objects collide, but it is not without any problems, and using groups with overlapping often can not tell which ones should be doing what, unless you use forEach loop.

    One way to see, if that is a problem in your code, is to make only a couple or a few instances of Enemy units and make them move so slowly or make the sensor large enough, that you can tell, if the change of direction works, when ALL the enemies are interacting with the sensor at the same time.

    Another way is to give them two different colors for animation frame 1 and 2, and then you give them behavior
    flag01 off = set animation frame 1
    on = set animation frame 2

    That way you can easily detect, if the collision or overlapping actually fires the trigger. If they change color and still do not change direction, then you know they interact with the sensor but still do not change direction, in which case there is a chance, that the problem is not the sensor but how you have coded them to move in the first place. You can try to use an alterable value for direction, since direction is at most 32 directions and can be set to a number, in stead of flag on/off.

    I hope that helps anything. At least a ramble like this could help someone to come up with a better answer after reading it. :D

    I agree with what you said. The value is a really good solution to a problem like the example you made.

    Also, yes, since the value seems to be a solution to a different problem than what I was hoping for, being able to assing the value at runtime would not really do anything. If it can not be used to simplify instance to instance interaction in the way I was hoping, there is no point in being able to assing the value after the level starts. (Such as creating enemies for 4 different teams and being able to tell them at creation which instance value/team they belong to.) Thank you for your polite reply about the matter. It is good, that I do not try to waste time using the value for something it is not going to do.

    My kingdom for an updage to the instance/instance interaction customization. :) ...

    I kinda get that, but I was hoping the instanve value would be the long awaited way to make instance to instance interaction possible without using costly foreach loop paired with alterable values that limits unit counts because of how costly it gets to tell them apart. I am sorry, if this is an unclear example, but when you have something like instance overlapping another instance and you want to make them fight as team 1 and 2, you can of course give them alterable values 1 and 2, but

    Instance is overlapping instance
    - "Instance" valueA is 1

    --> Subtract 1 from ValueHP("instance") ...or however you tell them to lose health in this case.

    Sure, you can tell, that only instance 1 should attack and do another child event, that will tell instances with value 2 to do the same, but you can not tell them in the condition, that their target should be instance with value 2 or the other way around. You can also tell one of them to take damage during the overlap based on their alterable value, but then you can not tell, who is the one attacking. Most likely you will end up with a code, that kill all instances when they fight because they all end up doing damage to everyone, or a code where none of them will not bother to do anything. If you use some of the in fairness decent ways to make them all do a foreach loop test, like with some detector running through all intances of an object and telling them all what to do, it gets so costly soon, that it takes away the point of getting instances to tell each other apart. You can make them deliver the damage by something like a bullet, but that would mean creating more objects and removes the point of getting instances to interact without all the hustle.

    All we needed was an instance value coupled with a condition that asks for the value, and you have

    Instance(1) is overlapping instance(2)
    (maybe also pick one instance to remove trample-damage type results)
    - Sub Instance(1) attack from instance(2) hp
    - Sub Instance(2) attack from instance(1) hp

    I do not mean to sound rude or anything, so forgive me, if my English skills fails me, but I was just excited about this feature and did not realize I was expecting something that was not really in the making after all. I can easily see useful ways to utilize the value, but I do not see myself how it could be used to finally get over the instance to instance interaction problem I at least have with the engine.

    Hi. I recently got both new computer and saw, that the update to fusion is active. There seems to be a lot of useful new features, but I tried my best to look from the update video and from the program about how to change instance value and only can do it for instances placed into a frame before launcing the test.

    Is there a way to tell the set/add/subtract to work on instance value (since from the list I can only see the 0=A to IZ=259 and none of those presumably are not the instance value), or should it be found and ordered from some special location I do not realize is there? It would really limit the use of the instance value, if you can not control them after the frame is started? Or am I missing something here?

    Damn it.
    I think I should add, that when I talk about the system in 1. 2. 3., the alterable string random(4)+1 = attack was before I changed the example strings to IA, IB... Of course using values from 1 -4 would not work with strings IA, IB... Someone would likely soon suggest that my values will not fit the strings I try to use, so sorry.

    Hi. Again, I tried finding a post about this, so forgive me if I missed one.

    I have units in game that have a lot of set values (health, armor, damage... ) and string values (name, type, faction... ) and set behaviors (attack, defend, move...) to avoid telling every different unit precisely what to do all the time.
    However, I would also like them to have (lets say) 4 "custom" behavior slots for any behaviors I come up with later on to assign for a period of time. Something like

    (stringIA)behavior01: "behavior_x"
    (stringIB)behavior02: "."
    (stringIC)behavior03: "behavior_y"
    (stringID)behavior04:"."

    I use "." to indicate, that the string is free for use. The reason they are IA, IB... is because likely they would not be the first 4 strings inside the unit, so the example is more clear that way.

    I have now studied with different ways to get it done (like for an example, string can be chosen by value, so checking a free string by random would be alterable string number of first string + random(3) = "." or alterable string (unit_behaviorvalue) = ".")

    However, I have found it a task to try to mix it all together into a small system like this:
    1. check for a free string
    2. maybe even assign a value to the correspondent value string A = attack, set value A to = 5 (that unit having an attack damage of 5),
    3. using the string to create behavior (- alterable string random(4)+1 = attack, - overlapping an enemy --> change animation sequence to attack -->damage enemy)
    4. removing a chose behavior (one of the behaviors is attack - set that sting to ".") (It would not be too much to set corresponding value to 0, but making string A "." --> set value A to 0 and so on...)

    So far the biggest problem is, that I find it difficult to 100% ensure the system will free the string I want. I am still myself trying to set it up, but if anyone reads this post, gets the idea I am aiming for and have any suggestions, let me know? :)

    Maybe I should add, that I did consider making a situation, where an overlapping between "soldier1" and "soldier2" would cause them both to get destroyed or sidelined and create a "soldier1/soldier2battle" unit that would steal health values from both to their separate values, and when one of the health values would get depleted, the battle instance would re-spawn the soldier that won the battle. That way the battle would occur within two values of a single instance and need only the original overlapping to work. (I think Settler II has that idea of a single soldier choosing the enemy soldier to fight and then they battle until one gets destroyed and then it is free to choose another target or occupy the building they attacked.)

    I just can not for now wrap my head around how it would work, if there are more than two teams, like team 1, 2, and 3, since I would have to animate a short or a metric ton of battle animations or be really clever of how the battle instances could allow every team to have different soldier types.

    Whoa... There were answers... Sorry for the lag in reply.

    The idea about variation of animations seems worth a try. I am doing the game alone so I want to be realistic about how much animations I can do, but I have acquired Spriter pro, so that helps to create animations faster to import into Fusion. Even three versions could make a big difference.

    I think the odd/even value is good idea. I have had some luck with the cool-down system and making only the 5th frame of the attack animation to be the actual attack frame, but parting the units into odd/even did not come to my mind. That would be a third layer of the units taking turns in attacking.
    ...and yes; I have tested several different ways of them attacking with collision, since it would be easier, but no matter what I do to optimize the program seems to calculate even the possibility of a collision for all instances, where as overlapping would not lag with much more instances, but in those versions the overlapping causes one instance to attack all enemies around, and if I put too much events to make them choose targets, the calculations brings the lag back into it.
    The example you linked seems a useful tip too. I agree, that the main problem is not the amount of units but how to make them realize what to attack with the least work possible, so any way to make "collisions" without collisions sounds what I am trying to achieve.


    I have 2.5, so I have tried my best to use child events by trying to make the first condition to cut out as much of instances as possible, then a child event to cut down as many more and so on. I think it has helped to cut down some lag but you might be right about repeating events. I have to try to mind map more about how many events I can cut out from the instance by just making more logical condition trees.

    Thank you so much for the replies, my February was hell but I think I have some more free time for the next month or so. These ideas help me to get the project started again.

    Hi.

    I have created in the past a really simple top-down-strategy game for a kid of my relative that seemed to find an audience. However, I have tried lately to build a more ambitious version of it, but I have ended up with a mass of test frames with test objects for two teams and no matter what I try I can't make the new version to look like two large armies fighting without performance issues. The game can have like 10000 units just running around and it won't lose a frame, but the interaction to create the battle just crashes my attempts every time. Earlier post helped me to create the original version and have some great ideas that helped to create different teams and handle some base building issues, but even with 2.5 the new version keeps hitting a wall.

    I have tried hellish amount of variations to avoid clustering because that is the main problem because the game ends up with too many calculations to do, to find ways to narrow the amount of instances the computer has to calculate at any given time, at least a dozen ways to improve the original version on how costly ways the instances use to detect enemy units, cooldown values to make sure not all soldiers are attacking at once, animation/launch object comparisons for dealing damage... And somehow every way I do it works wonders initially but as more and more details get in that one detail too much will suddenly crush my hopes and dreams again as the 11fps lag finds it's way in.

    I tried to narrow my question into something anyone would bother to answer, so: Is there an optimal example inside the forum anyone knows of a way in MF2.5 to make the most amount of instances of lets say "soldier_army1" to melee fight with the most instances of "soldier_army2" so that the battle looks realistic enough but with such a simple battle triggers that it will not cause the game to lag? I would love to link an example of what I mean, but if I had an example, I would not be asking for one.

    Of course, if anyone happens to know that Fusion 3 is never going to happen, any possible suggestions for a strategy game engine that my limited skills can handle will also be accepted? I have a simple platform game also as a hobby going forward so I don't mean to insult Fusion 2.5 but I just start to think that the engine just can not do what I try? I can not be the only one failing to make an ambitious strategy game with this engine? :D

    Hi.

    I have a really, really simple top-down view strategy game under work, and I have run into a need for calculating the amount of minions a player has, in order to make the enemy "a.i." launch proper actions. However, since I don't have a math degree and I don't want to mess too much with advanced objects to keep the game under control = within my limited coding skills, I need help.

    At the moment, my game has a really basic system found from this forum to calculate the amount of workers, soldiers and so on by:
    (I change the names to be more generic for clarity)

    - "unit01" value X = "worker"
    - "unit01" value "team01" = fixed("controlobject01")
    -- set "controlobject" value "countworker01" to 0
    -- start loop for every "unit01", loop name "worker01"

    - for each "unit01", loop "worker01"
    -- add 1 to "controlobject" value "countworker01"

    I have tested it with counter and it does count the amount right for each team, but I was hoping to use the calculations of workers, soldiers and such also to create the base building process. I want the game team to realize, when it has 100 or more workers, save up money for some soldiers, than reach around 10 soldiers, shift back to workers until there are at least 200, then soldiers and so on... But my questions are:
    -Since this method of calculation will need the counter to always hit 0 in order to begin a new counting loop, is this method impossible for setting up limits for an action x or y based on how many minions there are at the moment?
    -Will the constant resetting of the count cause the player to presume constantly, that it has 0 workers and will try to endlessly reach the 100 workers limit?
    -Could there be a way for the counting process to send the player some value of the current amount of workers like every one second to let it know some quota has been reached/lost in order to act?
    -Is there a better method to count workers or other unit types for every team I should consider?

    Any help is useful. I haven't sent any examples for this forum before, so if you ask for an example file, please be patient. I do have a ver.01 of the games stored, that have one base winning the other by outproducing and attacking the other, so this matter isn't a brick wall, but I don't want to do more work on the game and then realize, that this counting method won't work down the line.


    (If this post is too similar to an already submitted post forgive me.)

    Well, currently my idea for the base building aspect was kinda old school workers gathering resources, so it'd make it hard to calculate some "x amount in y seconds" accumulation rate... but the again, I was hoping to advance the base from randomly moving foragers to mining and gathering anyway. I could just flat out go all the way to building mines and factories, and workers would be just scenery randomly popping to go from base to mine or back. That way even outside frame I could tell how many mines/factories I have and that way there could be a steady flow of resources coming in, which can be calculated as an amount per second. That way I could also just destroy any outside view workers, since they wouldn't actually be the ones managing the resources but just scenery. It's worth testing out.

    It's okay. I think it has more to do with my English skills than you miss-leading me. ;) I can see how what you said would render the event meaningless, when you put it like that.

    True, I've tried some scaling by using "value = unit count" to force frame with one, two, n... soldiers, until I hit ten and after that it will indicate a unit count, if the cursor is above the unit. But you're likely right; I may have to accept I have to keep something like a "division" and "group" sized troops in battles and take "army" sized items into a world map to scale it even more.

    However, can the storing and loading of objects cause trouble, if the local battle map (frame) is, lets say HD sized 1920 x 2 and 1082 x 2, and you need scrolling to manage your base and attack the enemy? I would presume destroyed objects waiting to be put back would not be able to gather resources and carry out other tasks, since they're basically "idle" until called back into action? (I mean like a situation, where you play something like C&C, you don't want the NOD base to just stop everything they're doing while you scroll over to your base to build a structure.) If I'm mistaken, and you can destroy and load units in a frame without losing the overall flow within a frame, then I'm interested to use that method too.

    I did already make an event to turn any outside frame units invisible while outside screen, so that one is helping me out. ;) That shouldn't cause any worries.

    Thank you for the reply! :)

    - Darn, I really hoped I'd make with one instance type per game unit type, but I guess you're right. The main reason I tried to make unit, such as “foot soldier” instead of stock of “foot soldier_01, -02,...”, to work with value/animations/markers was to avoid all the hustle a civil war map or three different teams in a “free for all” situation would cause, but that color blind aspect you talked about will make identical units a bad idea anyway. I guess I might have to bite the bullet with this one.

    - Yes, I was aiming for smaller and simpler graphics. Not just because of the scale of units used, but since I'm aiming for more realistic unit/building size ratio, and too “close to camera” units would mean gigantic buildings/battlefields to work, I think.

    - You are probably right about smaller levels. I know my limitations as a coder, so I might end up being forced to make individual maps short and unsaveable, meaning a world map with mission markers saved as “won/lost”. With swarm type armies I naturally want to have as large looking battles as possible, but I might need to compromise. I just want to have some base building within the mission, so I have to consider how much I'd leave into a world map and what could fit into a battle.

    - I think making units invisible off-screen sounds like a plan. :) Since it's a strategy game, destroying units outside frame might make the battles not play out right outside frame, but if there are any resources for making that work, I'm interested.

    Thank you so much for bothering to read my ramble of a post. I think your reply does help me to choose (and accept) what to do for some of my problems. I'll start testing them now.

    Any additional ideas are, of course, welcomed. ;) Whatever tips might help to swarm the armies without performance issues is needed with this project.

    Hi.

    If this post gets answered, I hope it will also help anyone else trying to hit that combination of “instance/teams/performance”, so I hope I'm forgiven for writing a novel like this one. :( Also, if by some miracle this does work in the end, I might repay it by some tutorial or at least a post reply about what tips it gave me.

    I have asked and received great advice for a small scale strategy game, but thou it has helped with many details, I think I just can't finish it without this topic:

    Is there either a smart object universally compatible or some magical combination of distinct player units/instances without copies/performance, which would allow me to reach 3000 or 4000 active objects without frame rate dropping under something acceptable like 30 fps? I know Fusion can have even 10000 units in there as long as they do nothing but move around, but I was hoping to get to at least 3000 with a reserve for resources, bullets and such.

    First the good news: I have received help and have some code to allow instances to attack each other without copies (like “soldier01”, “soldier02”), and I have animated simple soldier units, which have frames for two units, three and so on, to blow up the unit count even more. Also, I use automated rotation with top-down view, so I presume animation stress should be as low as possible? However, I for the life of me can't figure out how to make both instances with team colors and at the same time be able to animate them bolster the unit numbers, since:

    - using loops to attach a colored circle or anything visible to make teams stand out starts to lag the Fusion around 1000 – 1500 units (and means 500 soldiers would also mean 500 markers), without loops the attaching with build-in spawning and such don't seem to work without bugs and trying to use attached counters with color circle animation doesn't seem to be less lagging than active objects

    - without any attached markers, animating instances to both have frames for unit count and color or other difference for teams would mean… countless animation frames within any instance to work? I know I could make animation “brown” with frames “0 = one soldier” “1 = two soldiers”, but if I want them to have even two or three different stances (arrow, line or a circle) it starts to be hundreds of frames per animation, and I don't know if the Fusion can handle that all, or me...

    - I was hoping the main teams to be brown and grey, with possibly red and blue to be “support” teams if needed and possibly green or something for neutral. I tried to avoid markers and animating altogether by making alterable value for team to event a rgb change, but I just can't get all the necessary colors to come out like that. Changing color affects all the instances, so that won't help, but maybe rgb effect could, if I was able to make it work…

    - I have tried to use fixed values to link the soldiers/soldier group to an object called “group”, which I can just set to a color by “value = set frame”, but making units/groups to follow and look at the “group”- objects without bugs means loops, and it seems to cause same kind of resources cap as attaching a colored marker would too…

    So, if anyone bothered to read this much jargon, I think I ask the following:

    1. Is there a way to attach markers to units, that won't lag as soon as you hit 500 units + 500 markers?
    2. Is there a way to get brown, grey, red, blue and green colors out of rgb effect? Does it need smart objects or some calculation beyond “GetRGB (red, green, blue)” to work?
    3. Is there a tutorial or some clever way to create a group of soldiers, make them follow a “group”- object and still be able to attack individually? (Making the group objects to fight each other looks silly, if soldier units get left behind and die miles away from the main group)
    4. Is there any alternative to make a few teams of swarm like armies, while one instance can be both a game unit for different teams and still visibly apart from the other teams?
    5. Is my only option to make copies of every units for every team? I'll do it, if it's the only way, but not until it is the only way to do it. Handling something like sounds taunting.

    Or am I just embarrassing myself and I need to buy an editor able to make an rts game? I have tried to avoid it, since I have done at least something viable with Fusion before and I don't have coding diploma to back me up, but... :)

    Hi. Sorry, if I ask a matter already resolved in another post, I tried to search for it a while.

    Is there an easy way to change more than one value and string name for active object at once? Copy paste them from a text file or anything? I presume one way to make sure all my different active object types and instance have the same value names for making event changes easier is some sort of a PALETTE unit to use as a basis to copy all active unit types from, but that way I have to be a master at predicting all the values and strings I'll need by name before making it? Is the only way to change a lot of value names replacing them manually one by one?

    Hi.

    It's been a while since this thread was active, but since then we've had 2.5 out, and I thought I'd use this thread in stead of creating a new one. The code in this thread helped me to make the game I was making, but now I have an idea of a top-view simple strategy game. I've used animations to multiply the minion counts and different ideas of making the instance-instance attack use as little power as possible, but:

    1. has the 2.5 offered any more effective workarounds to make minions of different teams using the same instance? (example: instance "soldier" with values to make them attack each other in stead of making copies, like "soldier_01" "soldier_02")
    2. if not, has it offered any other tools or stable add-ons to create a simple strategy game with the hope of at least make it appear, like large armies were fighting?
    3. if not, is there ANY valid reason to expect, that Fusion 3 is coming with an instance-instance update? I don't want to make this game for two or three years red faced and then find out, that Fusion 3 comes out with build in option to make my entire work now worth it. ;) I'm willing to wait, if there is any hope it will come.