Spawning objects faster without losing the space between the objects.
evert
Member Posts: 266
Hi all,
I have a little spawner spawning a dotted line. So it spawns a dot every 0.3 sec.
No what i want is to let it go faster over time. That is not very hard to do, but when they spawn faster the space between the dots gets smaller (because they spawn faster). How can i let it go faster without losing that space between the spawns?
For example: 0 = a space and A is a dot.
Now it does 000A00A00A..
But when spawning them faster it does 0A0A0A0A so the space gets smaller.
They space needs to remain the same but the speed needs to go up over time.
Thanks
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Comments
Ahhhhhhhhhh !!
Very constructive answer! solved the problem!
But yeah any idea?
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
I can let my object move faster with a game.speed+10 every 10sec if i do this right with the timing of my spawner i can get the 'between' space exactly the same.
The new problem however is how do i get my spawner timer go faster? I'm not able to create an attribute game.speedtimer with 0.3 as a starting point. I needs to be ether 1 or more
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Lol, sorry about that, years of frustration finally tipped me over the edge
No, no idea, your explanation is too vague to offer any kind of input, it could mean any number of things.
haha Ok
Here is an example image.
Dot line A is what I have and what I want.
But when i move up the timing of the spawner it gives me something like dot line B.
They spawn closer together.
When I make them move faster over time i get something like dot line C.
The space between the spawn objects get bigger.
I want to keep the line as dotline A but still let them go faster over time.
So i need to get my spawn and move in sync yes?
But i can do for the move game.speed+10 every 5sec no problem here.
But in order to get my dots correct my spawners spawns at (speed) 0.27.
I'm not able to make a game attribute with a 0.something. Its always 1 or more.
The dot line goes down and i want it to go down faster over time, but with the space between the dot the same everytime the game faster.
Edit: wow that image came out big
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Why cant you make a game attribute with 0. ? real attributes can be decimal
You will have to change the timer and speed to get the effect you want. More speed with less time or vice versa .
I understand the issue, I just haven't got a clue how you are getting there.
Well i tried will a real attribute, but how does the minus work?
game.speed-0.05? i tried something like that, does not really work
game.speed%2 is not working to, maybe i give it the wrong input.
To do dot B and C is easly, but A hmmmnnn its killing me
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Ok, I'll give it a go . . .
"I have a little spawner spawning a dotted line"
How is this spawner spawing a dotted line ?
"No what i want is to let it go faster over time. That is not very hard to do"
How are you getting the dotted line to spawn faster ?
"but when they spawn faster the space between the dots gets smaller (because they spawn faster)"
Why do the spaces between the dots get smaller when the dots spawn faster ?
@Socks
"How is this spawner spawing a dotted line ?"
I spawn an object every 0.3 sec
"How are you getting the dotted line to spawn faster ?"
Made a game.speed (starting at 100) for the moving object so every 5sec game.speed+10, but i put this on the 'move' of the object because i'm not able to put a decimal on my timer from the spawner.
"Why do the spaces between the dots get smaller when the dots spawn faster ?"
If they spawn faster after each other there is less space between them.
I made an example file (see file)
Spawner A spawns at a steady speed (0.3sec) with a steady move (100)
Spawner B spawns at a faster speed (0.1sec) but steady move (100)
Spawner C spawns at a steady speed (0.3sec) but with faster move (300)
Spawner D has an attribute controlling its move speed (100) by +10 every 3sec
If you look at D for lets say 20sec, you will notice because of the acceleration the dots will be further apart every 3sec.
If i change something to A I get B or C.
It needs to keep looking like A but but still be faster over time like D.
Edit: so in order for me to get what i want, i need to get the timer for my spawner and the acceleration moving up at about the same time Problem?: Yes, changing the acceleration every 3sec is easy to do, but it seem i'm not able to get my timer moving from .3 to .25 to .2 to .15 and lower..
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
I just took a look at your attached project, the dots (that form the dotted line) are being spawned at the top of the screen and then falling downwards (using an Accelerate behaviour), that is how the dotted line is being formed, there is nothing in any of your posts that would tell anyone that this is what is happening - (I wrongly guessed the spawner actor was moving and leaving a trail of dots), without your attached project this is just another forum guessing game (the reason for my "Ahhhhhhhhhh !!" comment)
Why are you unable to use a decimal value in your timer ? Are you using the standard Timer behaviour or a custom timer of some kind ?
Check out the Spawn Timer Changer in this thread: http://forums.gamesalad.com/discussion/70000/armelline-s-free-stuff-for-everyone-check-first-post-for-the-latest-update/p1
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
This example makes the space between the spawner to big again. So this is not a sollution because i already have this
i'm able to use a decimal, but i'm not able to change the decimal over time.
if i make a real game.speed of 0.3 i'm not able to do game.speed-0.1 to get game.speed 0.2
It won't do anything for some reason.
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Then you'll need another one of my demos:
http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
It sounds like what you need to do is to work out the relationship between the speed and the spawn time. The faster it moves, the shorter the spawn time.
So if you're spawning a dot every 0.5s when the actor is moving at 100px/s, then it needs to spawn every 0.25s when the actor is moving at 200px/s. Once you've worked out that relationship, both the demo @tatiang linked of mine and the one he linked of his own allow you to change the spawning time as the speed changes.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Yes indeed,
But i still can't figure how to make it from 0.5 to 0.25, i have a real attribute (game.speedchange) set at 0.5
when i do every 5 sec change game.speedchange to game.speedchange-0.25 nothing happens, it keeps going at 0.5. So how do i get my real attribute to change? (this one is the spawner time)
My integer game.speed is set at 100 and does after 5sec change attribute game.speed to game.speed+10 works pretty good! (this one is for my move acceleration)
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
What is your ultimate aim? As using accelerate complicates this and I'm not clear on what you're trying to achieve (other than uniform dots) and why you're using accelerate if so. If they're speeding up, but you're keeping the spawned dots evenly spaced, how is it even going to be noticeable that they're speeding up? I'm struggling to get my head around what your end result is supposed to look like and why, even with the demo project.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
I recreated my setup.
I have a spawner spawning my object according to game.spawn_speed
I have a dot accelerating with game.move_speed
and a spawner rules object in my scene setting every 3sec change:
game.move_speed to game.move_speed+50
and
game.spawn_speed to game.spawn_speed-0.25
Attribute game.move_speed is an integer starting at 100
Attribute game.spawn_speed is a real starting at 0,5
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Okay that makes more sense.
I'd presume my method posted earlier would work, with the spawn timer set to
1-(speed/200)
Then as the speed increases, the time between spawns decreases and the gap should remain consistent.
GS's ability to accurately render the moving dots will start to fail fairly quickly, though, at those speeds.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Could you tell me where i set this 1-(speed/200) in my example?
Thanks
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
Send you a demo of my game via dropbox link in a PM, you'll see what i'm trying to do
New game!: [Snake Rage]https://itunes.apple.com/us/app/snake-rage/id1463859909
You can't do what you want with a timer. You need to look at the demo of mine that @tatiang linked, which automatically updates the self-made timer whenever the attributes used are changed.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
You really need to explain the whole process rather than just one part of it, that's kind of the point of my original post above, without the right information even simple problems turn into random guessing games.
Taking a look at the project you uploaded, what you weren't clearly communicating was how you were using this attribute (game.speedchange), so it was a near impossible issue to resolve for someone without access to that information.
The problem is not with the attribute changing . . . if you use a simple Display text behaviour somewhere you can monitor what game.speedchange is doing, and you can see it is going down exactly as you've programmed it to . . . . the problem is with the Timer behaviour, it is set to 'Every', you are giving it a value (the first value it encounters) and then it will iterate the code within it 'every' that value. So any change to the value after the Timer has started doing it's thing will have no effect.
Think of it like this, you tell a paper boy to post a newspaper in every 3rd house, off he runs down the street, posting in door 1, 4, 7, 10, 13 . . . etc, when he is out of sight and cannot hear you, you then say - in a normal speaking voice - "ok, now change to posting a newspaper in every 5th house" . . . . nothing changes, because you've already sent him on his way with the instruction to post a newspaper in every 3rd house.
Ok, that's maybe the worst analogy ever, lol
EDIT . . . .basically I've spent 200 words trying to say what @Armelline managed to say in 9.
This should do it . . .