TheInstance's Forum Posts

  • ...

  • Towards math freaks.

    (music was my first love, math will be the last)

    Lets build the formula for random step by step.

    Random(c)

    c? Yes i dont use 'x' for now. To make you understand that the number we feed to the random function is not coordinate, or height, or any absolute number.

    But a count of numbers.

    If we need a number between 5 and 7, the count of numbers between them is 3, namely 5, 6 and 7.

    I am aware that i leave out the no "whole numbers" to simplify.

    So 'c' stands for a count of numbers.

    The count of numbers between 3 and 10 = 8. (3 4 5 6 7 8 9 10)

    Or to stay in math. c = The end number - starting number + 1

    e = end number

    s = starting number

    c= e - s + 1

    so now we are at

    Random(e-s+1)

    Need a number between 0 and 1 ?

    Random(1 - 0 + 1)

    or

    random(2)

    Need a number between 0 and 7 ?

    random(7 - 0 + 1)

    or

    random(8)

    But that dont give us the answer for when we need a number between 5 and 7.

    To solve this we random the "count of numbers" and add this to the start number.

    or

    Random(e-s+1) + s

    so again, need a number between 0 and 7 ?

    random(7 - 0 + 1) + 0

    or

    random(8)

    but if we need a number between 1 and 7 ? !!

    random(7 - 1 + 1) + 1

    or

    random(7) + 1

    need a number between 50 and 60 ?

    random(60 - 50 + 1) + 50

    or

    random (11) + 50

    there are 11 numbers between 50 and 60 + the 50 where we want to start of with.

    But now there is a last thing to bring into the formula. The steps.

    Suppose we need a number between 0 and 10, but in steps of 2.

    That are the numbers 0, 2, 4, 6, 8 and 10.

    The count of numbers is here 6. (You can point with you mouse to the numbers and count them.)

    Allow me to use 'd' to represent the steps (the greec delta), i have "s" in use already.

    so again.

    c = ((End number - Start number) / the steps) + 1

    or

    random(c) will be

    random( ( (e-s) / d ) + 1)

    And just like when we want the result to start counting at a certain number.

    We need to translate the count of numbers back to absolute numbers

    or

    random( ( ( ( (e-s) / d ) + 1 ) ) * d ) + s

    need a number between 0 and 10 in steps of 2 ?

    e = 10

    s = 0

    d = 2

    random ( ( ( ( (e-s) / d ) + 1 ) ) * d ) + s

    random ( ( ( ( (10-0) / 2 ) + 1 ) ) * 2 ) + 0

    random ( ( ( ( ( 10 ) / 2 ) + 1 ) ) * 2 ) + 0

    random ( ( ( ( 5 + 1 ) ) * 2 )

    random ( 6 ) * 2

    random (6) * 2

    need a random number between 10 and 630 in steps of 10 ?

    640 could be width of the screen.

    We stay 10 pixels from the left edge. And 10 pixels from the right edge.

    So we need a number between 10 and 630 in steps of 10

    random ( ( ( ( (e-s) / d ) + 1 ) ) * d ) + s

    random ( ( ( ( (630-10) / 10 ) + 1 ) ) * 10 ) + 10

    or

    random((63) * 10) + 10

    Hope this helped some out.

  • Stupid is ok. If it was not, i woulda coulda shoulda retire.

    As i pointed to already. I am not interested in the Platform behavior yet. I barely know how to sync up the Ball behaviour with the events. So did not read whole this post very trough.

    I only downloaded the last .cap. And saw that it is, well to call the cow a cow, its BS.

    I hope that, besides all comments you would like to make about me and my style, i hope you

    understand how and why it is a crap .cap.

    And i felt like reacting strong, before some beginner takes it as example, and runs into problems that lead to giving up construct.

    The multiplayer side ? i think Ashley is assimilating this for some time already. It will be a total new, and consistent system. I doubt that anything implemented in construct at this point will be part of that system. Better hold your horses on that play field ? For now ?

    My guts say, we will be surprised about the next release.

  • OK,

    You can not use Behaviors properties in expressions trough a Family. Lets accept that at this moment as a fact. Ashley added Behavior tabs to the Family's in the condition and action wizards.

    Maybe he overlooked the expressions. Or he has no plans to.

    But,

    Besides the fact that you can not do it the way u try, i wonder about the "why".

    Why would you want to move 3 objects as they are "player objects" ? You bring yourself in deep problems in that .cap. Because, well, how to explain ?

    1/

    You want conditions that are made to be a flow condition to act as a pick condition.

    Flow conditions are true or false. When true they execute there sub events and actions. When false they dont.

    Pick conditions pick a group of objects (can be a family), filter according the condition, and pass the filtered object(s) to the sub events and actions.

    What u have there,

    System: Sprite[Platform].VectorY Equal to 0

    is comparing 2 values, when the comparison is true, the action will run.

    Thats what it is designed for.

    So the action

    Blue Set gravity to 0

    Will set all Blue's gravity's to zero. ALL Blues ! When the comparison is true.

    You can see that if you delete the other 2 "Blue Set gravity to 0" actions.

    So even if you could access the behaviors properties trough a Family, your events dont do what you seem to expect.

    Of course, if the action directly addressed the object "sprite" then it would work, because there is no need for a pick event then.

    But since you insist to work with a group of objects, represented by there Family, you need a pick event. The correct pick event here would be :

    Blue: compare a behavior propertie. Close to the conditions we have already as there are:

    Blue: compare x position ... Blue: compare private variable ... etc

    Now well, we dont have that condition (yet).

    So its the same problem. Yes is exactly the same problem. Moment we have the condition, expressions will be available too.

    You understand ?

    2/

    You have 3 instances of the same object Detector. You have 3 totally different objects.

    They way you snap there X's to each other works more by incident then by design, or good coding.

    Just duplicate one of the faces, as clone or as instance, dont matter. If you do as clone, dont forget to bring it in the family blue.

    And before you run it, try to predict what will happen.

    You see ?

    3/ why promote 3 objects to "player objects" ?

    4/ i would make you a .cap with a nice work around. But, in my learn curve, i did not reach the Platform yet. Because in my eyes, what use is it to not understand the events completely and dig my ass in the behaviors. So i dont understand the platform behaviour yet. I am sorry.

    But i am sure, if you understand what i just told you, you will see the light and come up with a solid solution.

    Although, just theoretical, i dont see practical use in 3 player objects.

    j0h

  • I can see that you are very annoyed. That video with this thousands of % to load is a pretty funny error message though.

    At same time i dont understand why you get all the crashes. Me myself i have a crash on closing Construct, but because i run vista, the crash is handled flawless. Yesterday i had a crash on trying to frame an animation. But that is about it.

    I have no idea what's going on on your system. Could i see the .cap of with those 4 layouts ?

    There are some little things that i dont do anymore.

    Like, Copy a object, paste it into another layer, and delete the object on the layer where i copied it from. It looks like deleting the first object created with a certain sprite will be the object holding that sprite for all clones and instances. I am not sure of this. But i think thats what happens.

    I will not copy objects from 1 layout to another for the same reason.

    I will not copy layouts, because i feel its tricky. And i will try to do as much as possible in 1 layout. If i plan to make a openings screen, then i will create that opening layout with a temporary click trough to the next layout, where it all happens.

    Maybe you need to, when starting a project, make like 15 layouts at moment you create the direct X game ? 1 or 10 layouts to much will not hurt ?

  • Thx Jay

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To continue.

    Main Layout

    line 1:

    Using A container for Tanktop and Tankbottom will also make the creation, as you have done, more simple. Only have to create One of both, and the other gets auto created by the system in an urge to always have complete Containers.

    line 2:

    I use Layers to Z-order simple orders like those.

    lines 21 and up

    I prefer to do the keys different,

    On key M pressed, i would set 'weapon-selected" to "Landmine" as you already do. I would move all those key input triggers up in the sheet, so there are visible and noticeable. And just like you i would test 'weapon-selected' later on to take action. But you dont do this for the trigger "space is down".

    I would also make a variable to go with the space bar action. Move it up in the sheet by the other key conditions. And test conditions based on the variable set to "fire" later on in the Sheet.

    Now you use 2 systems

    If you want to to limit key input in some stage of the game now. Then its not easy to keep the actions and sub events that go with the keys from executing. Especially because you use two systems at them moment. Different for space bar then the other keys.

    Lines 35 and up.

    You could use a family for all the different bullets here. Every Conditions has basically the same lines here.

    See, if you use a family for the bullets, ..

    The condition "On collision between family and Enemy" ...

    Takes all the Family objects, (the bullets) ....

    And will filter out all the bullets that are not colliding with enemy from that picked group ...

    Then takes all the Enemy objects ...

    Will filter out all the Enemy's that are not colliding with Family ...

    And only the objects that pass the filtering go to the sub events and actions ..

    If there is no collision then there is no object to pass to the sub events and actions, so there will be noting run ...

    If there is a collision, the 2 objects involved in the collision will be passed to the sub events and actions, they will be set "picked"

    If the action says "destroy family", not all the objects in the family will be destroyed, only those that are set as "picked", those that past the filtering.

    I do love that TankTread, btw.

    The Zap sound. Could it be. In event 56 you give the enemy tank a target.

    And a little later in event 61 u tell it to zap when there is a target acquired ?

    This all is not to break your creation down, you asked for an opinion.

  • Someone be so nice to explain "hotspots" to me, as can be find in the import frames interface.

    ty ty

  • Yesterday, i had an animation (PNG) that made construct crash when importing it as frames. I cropped the animation 2 pixels, and it got accepted fine. I just tried to reproduce this. But i cant.

    Was pretty annoying though for a while.

    But i cant reproduce your bug too. Add a sprite ? But dont load an image in it ? And then add a animation ? Just scales the animation here to the empty bounding box.

  • / game play.

    I dont like the 1,2,3 keys to change speed much.

    Press shift + the control keys to move faster ?

    And CTRL + the control keys for the 3th speed ?

    I would add A health bar to the enemy tanks too.

    The background tiling ... um .. does not match where it repeats. Post the Graphics file and i will make a perfect Tile for you. If you dont have the programs to do so.

    I so like the looks of the HUD. But the info is for me (personal) a little to much.

    I think also that you would be better off with grass that looks more *cartoonish*, just like the tank does.

    / events.

    So perfectly organized. I Should take an example at that ! I read them line by line tomorrow if i have time.

    There are 2 little things i noticed.

    You use 2 objects for the Cursors.

    I would use 1 object and drop the states in an animation.

    You do collision detection between bullet and the turret AND with the tankbase.

    I would drop both in Container. This way only one Detection event is needed.

    night.

  • Yes you can do things like ..

    Give Player 1000 hit points, so it dies after 1000 times been hit by a bullet.

    And give the enemy only 3 hit points.

    Give the Player weapons that do more damage then the enemy does.

    Give the Player Lives.

    Give the player a shield.

    And all those little aids invented to smooth a game.

    But, you should see those as *fine tuning* the power relation between Player and Enemy.

    Thats all they do anyway, increase or decrease the power of the player/ enemy.

    They do not tune the *smartness* of an enemy.

    The real challenge is to make enemy's that act as they are steered by humans. The next step is to fine tune with speeds, lives, health, hit points, damage control .. and so on.

    Is it easy to do ? No. But you can do an effort. Bring AI in the enemy's. Take the game at least 1 step beyond the obvious.

    Do we have tools to do this ? Ah yes we do. One tool are the conditions.

    If the Player is not shooting at the me, then dont approach the player. Thats a simple condition, and if i remember right, used in Ghost shooter tutorial.

    Do we have more tools ? Ah yes we do. Anything that lets the Enemy sense the Players object, in stead of just moving it towards the players object is a tool in this.

    A lot of behaviors have things that we can use to construct a strategy.

    Like the turret that can track Objects.

    The Line Of Sight ....

    The RTS movements ...

    The Physics ...

    I am not an expert in this. At the moment i just want you to shake you awake.

    Telling you that moving the Enemy towards the Players object is not gonna do it.

    I am not an expert in Construct anywayz.

    I have not idea yet what next post in this will be.

  • And this,

    Must be the most smart enemy ever made.

    I did not even bother to give Coffee Cup Hero a weapon.

    If i did, you probably could manage to shoot the enemy. But i have seen .caps with 50 enemy's as smart as this one.

    It is a temptation though,

    we know the position of the players object.

    Why not let that big scary enemy move towards the players object.

    And shoot him/her to elllllllllllllllllllllllllllll

    But. Is it a challenge to play ? No sir. There must be ways in between.

  • ...

  • A prototype of an enemy being boring and way more dumb then the players object could be this.

    The enemy is not moving, not interacting, not anticipating, and its no puzzle to reach him.

    The enemy is no challenge at all.

    Of course this is 1 side of the universe. One extreme side. But i have seen the other side a lot too, and in these forums.

    Next post will be a another example.

    Notice also how i bridged between the "every" condition executing its sub events and actions instantly, and the need for it to act as a timer.

    If you use an "every" ..

    the first execution is instantly, ..

    the second execution is defined in the every parameters. Ticks or seconds.

  • ...