Game speed to time conversion...

Discussion in 'Technical Discussion' started by heathclose, Mar 28, 2016.

  1. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    Yes, I can take a look at it
     
  2. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
  3. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    I see now what is the problem. You also need to add velocity to the spawning object - I have added -1000 for the Y velocity and that solved the problem, plus that helps to prevent other issues which is unseen: If you just keep spawning objects those will never be destroyed unless travels far away from the scene. That means your memory usage is constantly growing. So you need to delete the spawned objects and one of the way to do that so is to drive them out of the screen and drive them far... (further than the Back Deletion Threshold). I choose Y -1000 so it goes downwards while your game direction is upwards, so just to make sure the object does go out of the scene and the Back Deletion Threshold...

    Let me know if this helped?
    EDIT: Modified the original description a bit so hopefully that makes it a bit more obvious and also added this automatic object deletion to it, just to avoid confusion and to help to make bug free games
     
    Last edited: Sep 8, 2016
    Christoph likes this.
  4. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    Man you are the best :)

    Thank you
     
  5. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    One more thing @trudnai

    Can we set a trigger when the counter will start?
     
  6. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    You can create an Action with the Action Animation with the same setup as with the Default Animation for the Character. Animation Placement should be Character and Behavior is Overlay. Duration can be a very big number like 999999 or if you want the animation to be stopped before then reduce that number...

    Now if you place that Action onto the scene and when you hit that with the Character, then counter starts...
     
    khalid likes this.
  7. khalid

    khalid Avid Boxer

    Joined:
    Feb 17, 2016
    Messages:
    343
    Likes Received:
    67
    We have been asking for a count down timer several times and it was there but needs someone like @trudnai to discover it, yet a built in timer will be better :)
     
    Last edited: Sep 11, 2016
  8. BluntedPanda

    BluntedPanda Boxer

    Joined:
    Oct 5, 2016
    Messages:
    3
    Likes Received:
    3

    @trudnai Thank you for posting this! I am trying to follow along step by step, and getting hung up on a few parts. Specifically, I am trying to have a timer counting down, which the character can collect actions/objects that will partially replenish the timer amount. What is triggering the timer to count down? Is that the spawning object at position 0,0? Sorry for the new jack city question, this is my first game. Is there anyway you would be willing to post a .bbdoc which has this timer laid out? Any guidance is helpful. Thank you @trudnai
     
    trudnai likes this.
  9. BluntedPanda

    BluntedPanda Boxer

    Joined:
    Oct 5, 2016
    Messages:
    3
    Likes Received:
    3
    OK- Newjack city checking back in. I was able to get the spawning object and action placed in to the character's default animation. I can display the timer counting down, and can replenish the timer with additional actions rewarding points (thus adding more time) What I am having trouble with now, is getting the event observer to trigger a Game Over when the timer reaches 0. Any obvious suggestions of what I'm missing? Thanks BB Community! -Newjack City
     
  10. kodagames

    kodagames Avid Boxer

    Joined:
    Oct 11, 2015
    Messages:
    294
    Likes Received:
    115
    The only way I know to trigger the game over is when the allotted coins are collected. Maybe copy a coin from the scene and paste it in the action object area (no opacity or hidden). I have not tried this but its a thought.
     
  11. heathclose

    heathclose Miniboss Boxer

    Joined:
    Jan 28, 2016
    Messages:
    1,810
    Likes Received:
    1,026
    use a custom font where 0 is 9 and 9 is zero... that way when you timer counts "down" to zero, the observer can see a 9 and trigger the change... btw, I stole that idea from @trudnai , he deserves full credit
     
    trudnai likes this.
  12. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    Hehe, derived that idea from @VectologyGames' health bar trick :)

    Btw it should be actually 1 is 9 and 9 is 1 and 0 is 0. The reason is because if you want a counter down from 20, then obviously you need a little trick. You have 3 UI. First one has a mask and a fix "2" following by the counter. The mask will cover the first digit when reaches 10. The trigger is set to 11 which launches the 2nd UI which also has a mask and a "1". So you only see the last digit. In other word "8" looks like "22", "9" like "21" and "10" is like "20". Then trigger launches second GUI so "11" will look like "19". Then at 21 the 3rd UI launches which only has the mask and the number therefore "21" will look like "9"...
    Maybe I am overcomplicate this :)
     
  13. BluntedPanda

    BluntedPanda Boxer

    Joined:
    Oct 5, 2016
    Messages:
    3
    Likes Received:
    3
    @trudnai @heathclose @kodagames @VectologyGames You are all amazing human beings!! Thank you so much for the help. I got it working (so far) using the custom font idea (as a bar rather than numerals) and reversing the order, so when the timer reaches 9, the bar is at its lowest value and the game ends. Thus making the time power ups have a value of -1, which increases the time left. The reversal idea is genius!! I really appreciate the support and wisdom being shared!! Hopefully I will be able to contribute to your missions at some point too. Again- thank you all! - The friggin new guy
     
    fez_94 and heathclose like this.
  14. fez_94

    fez_94 Boxer

    Joined:
    Nov 1, 2016
    Messages:
    19
    Likes Received:
    2
    I'm trying to do this but its not working out. Ofcourse I wanna do this method as I intend to have coins in my game for shop stuff and at the same time I want to set a timer countdown (say 15 seconds when you first start the level).

    what I did:
    made an action, called it timer-decrease, deleted its animation, action type set to none, reward points set to -1, duration set to 1.
    made a 2nd action, called it timer initial, delete animation, action type non, reward points 15, duration 15.
    both of actions are on the same position/coords as the character (start scene).

    I also noticed that when they are in the same position and play in debug mode, they (the 2 actions) are attached to the character the whole time (my character moves by jumping, same mechanic as the ISO cube template). Ofcourse I also do have a "time" observer as it monitors the points, when I first begin my game its set to 15 because of the "timer initial action" but how do I make it decrease every second and how to make the character die when it reaches zero? That's what confusing me right now.

    I would appreciate your help on this matter as I cannot find any other tutorial on how to make timers into the engine. Thank you very much.
     
  15. fez_94

    fez_94 Boxer

    Joined:
    Nov 1, 2016
    Messages:
    19
    Likes Received:
    2
    Ok so I've made some progress. Apparently I forgot to make an object then do the cut n paste thingy and then include the object as a decoration to the character frame. I got into some issues, my character moves by jumping which means in the default standing animation the timer (points in my case) decends perfectly but when I jump it screws up and decreases extra points. I've tried attaching the object again but this time into the jump animation but the problem still persists.

    My next steps are to make the character die when the timer reaches zero, and adding an object that increases the time left (say you got 5 seconds left to game over but you get the object and now your timer is increased by 3 seconds).

    However I need to finish the first problem at hand so I can proceed.

    Thanks again
     
  16. fez_94

    fez_94 Boxer

    Joined:
    Nov 1, 2016
    Messages:
    19
    Likes Received:
    2
    AAhh I'm struggling so much with this timer thingy. If I attach it to the jump animation the timer gets screwed up big time. So I had to remove it but now the "point decrease" only triggers when I'm in standing animation. If I jump, it halts the timer for the duration of the jump.

    I'm really overwhelmed by this so I'm just going to call it for tonight and will check back on this forum tomorrow. I've a link to the file if anyone would like to dl and test it out to point out where my problem really lies.

    The game is based on the ISO cube template, notice that my direction for the game is a bit tilted so am not sure if this may affect the spawning object velocity in some way.

    http://www.megafileupload.com/c5wr/timer_test_-.bbdoc
     
  17. trudnai

    trudnai Miniboss Boxer

    Joined:
    Sep 25, 2015
    Messages:
    1,235
    Likes Received:
    701
    I will check it out but in the meanwhile you can turn on the debug mode in the player (that icon on the top that looks like a bug). That should show you if the objects are colliding and if it is traveling to the right direction
     
  18. FranciscoBala

    FranciscoBala Avid Boxer

    Joined:
    Feb 25, 2017
    Messages:
    161
    Likes Received:
    72
    @fez_94 Care to Re-upload and Re-share the link for that Bbdoc Timer Preset ? (wanted to see how's it like, learning is living)
     
  19. kyatz

    kyatz Boxer

    Joined:
    Sep 23, 2018
    Messages:
    6
    Likes Received:
    0
    Hi! I followed these steps but nothing happens. In debug mode, I don't see anything out of the ordinary.

     
  20. Samkhan

    Samkhan Boxer

    Joined:
    May 12, 2020
    Messages:
    11
    Likes Received:
    0
    buildbox 3 Camera Attributes there is two option rotaion follow & position follow.
    Can any body hely me i want 3 option in it.
    I want to follow my character, path and rotation follow any body help.
     

    Attached Files:

Share This Page