Ajbael's Recent Forum Activity

  • The only way to do this would be to record the position , angle, state, forces etc of all the relevant elements in your game into an array or set of arrays at 1/x s timing interval. Then run through the arrays backwards when you want to reverse time. So definitely possible , lots of games have done it. Just need a little ground work.

    I'd like to start working on this, but I don't know how to use arrays. I've read and watched a lot of tutorials about it in the past but could never wrap my head around it. Would you or anyone else be willing to show me how to put even a single one of these variables (such as angle or whatever) into an array that can be played backwards?

    If I can see how it works I could set it up for all the other variables, I should even be able to figure out how to use lerp() just fine on my own it looks pretty straight forward.

    https://drive.google.com/open?id=1Qzqph ... AsseETcFyM

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well it's not easier, or less work, but we have interpolation to make it less data intensive.

    So rather than save data every tick you could save it at every x milliseconds and use lerp() on the positions.

    That was going to be my next question, is how processing intensive would be to record all of these variables for all these objects per tick. Glad to know there's a way to cut down on that, thanks for the tip!

  • The only way to do this would be to record the position , angle, state, forces etc of all the relevant elements in your game into an array or set of arrays at 1/x s timing interval. Then run through the arrays backwards when you want to reverse time. So definitely possible , lots of games have done it. Just need a little ground work.

    This has also occurred to me... I was just hoping there might be a slightly less work intensive way of doing it. Thanks though, if a day goes by without any easier suggestions I'll definitely start working on this.

  • I think it's really cool that you can slow down and speed up time, but is there anyway to play it backwards? I know I can't put a negative number in, but is there a plugin or any other way to do this?

    My game uses physics, so the closest I can get to reversing time is reversing physical forces by stopping the velocities of all objects and then applying the opposite to them.

  • > What I do not understand is why when I refer to an instance variable it doesn't take into account for each individual instance's unique variables. I am under the impression that there is a universal solution for getting the system to make instances behave independently based on their uniquely different variables.

    >

    When you refer to instance variable, the system actually does this "for each picked instance".

    Say, if you do "Gun set var to random(10)", a different random number will be set for each instance of the Gun.

    And if you do "Gun set scale to var", they will all become different sizes.

    As for the Timer - this is not a workaround. This is the right way to do things in C2 when you are dealing with multiple instances and delayed actions.

    If you only have 1 gun, you can use "Every x seconds" or "Wait", no problem.

    If you have multiple instances of gun and they are firing/reloading at different times, it may be really difficult to get them working correctly with all these "Every x seconds", "Trigger once" and "Wait" events.

    In your last capx the problem is with the "Trigger once" condition.

    After one gun has fired, event #5 is triggered, all good. Then a second gun fires, but the first gun still has Cycling=1, this event will not be triggered, because it's still true and it has already triggered once.

    And then the first gun fires again, but event #5 is still true, so it's still not triggered and now both guns are stuck with Cycling=1.

    Here is a simple solution:

    Yes! Thank you so much dop2000, I'm starting to understand why I am running into these types of issues.

  • You mentioned earlier that the stating condition the "Every gun.interval seconds" only applies to the first instance, meaning that all other instances will fire on that interval instead of their one.

    Yes, that is the problem, I understand that. What I do not understand is why when I refer to an instance variable it doesn't take into account for each individual instance's unique variables. I am under the impression that there is a universal solution for getting the system to make instances behave independently based on their uniquely different variables.

  • Your event "Every gun.interval seconds" only makes sense if there is 1 gun instance.

    When there are many guns, this event will not work as you expect. I think it compares "interval" for the first instance only, but it doesn't do picking, that's why all your guns fire at the same time.

    Here is the way to do what you want without the timer:

    This event will pick one or several instances of the gun, only those which satisfy the condition (nextShot<time). Picked guns will fire and a new value will be set to nextShot variable.

    Yeah that's pretty similar to a work around that I am already using. Let me try explaining the problem differently. Let's say the gun needs to cycle out a cartridge before it can fire again. (0: Chambered, 1: Cycling)

    The gun won't fire unless Cycling = 0

    But if Cycling = 1, it will wait Gun.Cycle_Time seconds and then set Cycling to 0 so that the gun can fire again.

    When there are multiple instances of the gun things start going wrong. With even just two guns they will eventually both lock up and I do not understand why. I am trying to understand why things like this are happening, not work around the problems. I can come up with solutions all day long, what I need is understand of why problems like these occur in the first place.

    New .capx with cycling mechanic

    https://drive.google.com/file/d/13RpVWh ... sp=sharing

  • I realize now the title is probably misleading and I would change it but I'm not exactly sure how to concisely word what I am trying to learn about.

  • Use Timer behavior, it's perfect for this task:

    You can add a sub-event to "On timer" to check if the gun is reloading and only spawn bullet if not reloading.

    Yes that is a perfectly fine work around, but I have plenty of those. What I am looking for is an example of how picking can be used to specify to the system which instance I am referring to.

    The reason for this is because in the game I am actually developing deals with many instance variables as conditions and because I do not have a working example of how to use picking in that situation I have to work around every little detail.

    Please read the whole post.

  • In this capx you can create guns on point by left clicking and destroy them by right clicking.

    Every 0.1 seconds, the firing interval for the gun is set to random(0.1,1.0) The gun will then wait Gun.Interval seconds between each shot fired.

    The result is a gun that fires at constantly changing interval.

    However, when a second gun is introduced, both will be firing at the same changing interval. The desired result is to have them firing at a changing interval that is unique to each instance.

    Introducing the "For each Gun" condition causes only one gun to fire, no matter how many guns are present. (And I do not understand why that is.)

    --------------------------------------------------------------------------------------------------------------------------------------------------------------

    I am having this issue because I do not fully understand how picking works. I understand that there are many ways to work around this without getting into picking, but it is important I learn how to properly employ picking because in the game I am actually developing there are many more instance variables involved than just a changing interval and I can't get the system to understand which instances I am referring to even if they meet the variable conditions.

    For example, guns could have a variable for reloading (0: Reloading, 1: Loaded) and make a condition that the gun can not fire while reloading. Because I don't understand picking, what usually results is that when one gun is reloading, none will fire. Or whatever I am using to trigger the reload may cause only one of the guns to constantly be reloading for all the others while they continue to fire.

    .capx

    https://drive.google.com/file/d/13RpVWh ... sp=sharing

  • What I need help with

    I'm trying to figure out a streamlined technique for creating animations from particle effects.

    What I need it for

    The game I am developing involves spaceships, and I have been using particle effects for thruster exhaust. The effects are gorgeous, but there are a couple problems.

    First of all, the faster the ship moves the more the particle effect spreads out and becomes jumpy. You can see gaps in the flame coming out of the thruster. Additionally, if the ship is moving quickly and makes a sharp turn, the flames come out sideways.

    What I've tried so far

    To solve this, I have been using screen capture video recordings of the particle effects playing, which I then splice into individually cropped frames that I can use to piece together animated gifs. This is a painstakingly slow process, and I don't think it will be realistic for me to continue with it due to the sheer number of special effects I use in my game.

    Other Advantages

    Although I personally have not run into performance issues resulting from high object count particle effects, I anticipate it would become an issue in multiplayer rooms of 2-12 players. If the particle effects were condensed into animations, an effect consisting of any number of objects would effectively become a single object.

    This could be especially useful to me because I love making elaborate, dynamic special effects from particle effects using multiple layers, filters and many, many objects. Many of the special effects I would really like to use for my game are too graphically intense for decent performance, but if I could condense them into animations I could use my creativity to its fullest potential.

  • If I knew what exactly you were trying to accomplish, I could probably offer a better example or alternative. Maybe upload a Capx and some information about what is supposed to be happening with the Mouse/Sprite?

Ajbael's avatar

Ajbael

Member since 21 May, 2017

Twitter
Ajbael has 1 followers

Trophy Case

  • 7-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies