In many shmups, medals explode out of destroyed enemies, before being vacuumed into the player.
I've implemented this into my own shmup using a timer and standard homing behavior. Medals explode out in a random direction, with a damp on their vel to slow them down. After some duration, I enable standard homing behavior on them (home toward the position the player will be in the future given the player's current vel).
This works pretty well, but I am just curious how others implement this staple of the genre.
How do you vacuum?
-
DyingIsFun
- Posts: 35
- Joined: Mon May 31, 2021 7:14 am
- Contact:
Re: How do you vacuum?
I use a "gravity" system.DyingIsFun wrote: but I am just curious how others implement this staple of the genre.
The force of attraction is proportional to the distance between the medal and the ship, and multiplied by a constant.
By changing the value of the constant and the distance I can easily alter the attraction of the medals
Watch 16:00 and 16:15
https://youtu.be/qThRTkoA25Q?t=961
-
TrevorMcFurr
- Posts: 24
- Joined: Thu Jul 20, 2017 11:04 am
- Location: Gloucester, UK
Re: How do you vacuum?
I've got a bullet vacuum in my shmup, so when the player presses the second fire button, an invisible area of effect (a cone in this case) is projected in front of the player ship. When enemy bullets overlap this cone, they are sucked towards the collector which increases the power of the player's beam shot.
See here: 0:10
Sent from my SM-A505FN using Tapatalk
See here: 0:10
Sent from my SM-A505FN using Tapatalk
gamertag/PSN ID: TrevorMcFurr
d_resolution dev thread: https://tinyurl.com/kw5fjnvr
Vulcano dev thread: https://tinyurl.com/43ztk2un
"If she makes it, she should be a perfectly normal and healthy cat. Other than having two faces."
d_resolution dev thread: https://tinyurl.com/kw5fjnvr
Vulcano dev thread: https://tinyurl.com/43ztk2un
"If she makes it, she should be a perfectly normal and healthy cat. Other than having two faces."
Re: How do you vacuum?
I only use a homing script with a magnet value increasing each frame.
My tip to have a kind of pop up is to set a negative value at the start.
So the bonus goes a bit in opposite direction, then magnet to the player.
It works well for me.
My tip to have a kind of pop up is to set a negative value at the start.
So the bonus goes a bit in opposite direction, then magnet to the player.
It works well for me.
Re: How do you vacuum?
You should have two lists, one for the magnet state, one for other state.
In my game if you stop fire, the first of the normal list will be added to the back of the magnet list, then set to zero.
Magnet is agressive homing, you dont want it to mis, else it circles around you.
Dont use math functions, use the fast inverse square root and subtracting vectors.
In my game if you stop fire, the first of the normal list will be added to the back of the magnet list, then set to zero.
Magnet is agressive homing, you dont want it to mis, else it circles around you.
Dont use math functions, use the fast inverse square root and subtracting vectors.
-
DyingIsFun
- Posts: 35
- Joined: Mon May 31, 2021 7:14 am
- Contact:
Re: How do you vacuum?
Thanks for sharing your techniques everyone!
Re: How do you vacuum?
In most arcade games the "vacuum"/"hoover" is just linear interpolation lerp(a, b, t) from the medal's position when the effect starts to the player craft. The 't' value needs to be some sort of ease-in-ease-out to have smoother motion
Re: How do you vacuum?
Yup, this indeed. It's common for the motion to be polar (angle & speed, rather than x & y), and generally the angle has a linear interpolation towards the player, which gives it a nice sort of curving rather than just straight movement. Often the speed is another linear interpolation, from whatever base speed to a comfortable max. Adjusting the interpolation rates and maximums is a bit more of an art than a science, so play around with them to find something comfy.pieslice wrote:In most arcade games the "vacuum"/"hoover" is just linear interpolation lerp(a, b, t) from the medal's position when the effect starts to the player craft. The 't' value needs to be some sort of ease-in-ease-out to have smoother motion
@trap0xf | daifukkat.su/blog | scores | FIRE LANCER
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
<S.Yagawa> I like the challenge of "doing the impossible" with older hardware, and pushing it as far as it can go.
Re: How do you vacuum?
I dont have a maximum speed, i keep increasing from zero without limit, it will hit the player fast enough, saves some cycles.
Interpolation looks weird, close items will go slow, as fast as the far items.
Interpolation looks weird, close items will go slow, as fast as the far items.
-
DyingIsFun
- Posts: 35
- Joined: Mon May 31, 2021 7:14 am
- Contact:
Re: How do you vacuum?
Ah, thanks for the add'l details. When linear interpolation was first suggested, I immediately thought "this won't work for me, since I want a curved trajectory, similar to what you see in Mushi". But using your method of polar representation and interpolating both the angle and the speed, I achieved an effect very similar to Mushi. Thanks again.trap15 wrote:Yup, this indeed. It's common for the motion to be polar (angle & speed, rather than x & y), and generally the angle has a linear interpolation towards the player, which gives it a nice sort of curving rather than just straight movement. Often the speed is another linear interpolation, from whatever base speed to a comfortable max. Adjusting the interpolation rates and maximums is a bit more of an art than a science, so play around with them to find something comfy.pieslice wrote:In most arcade games the "vacuum"/"hoover" is just linear interpolation lerp(a, b, t) from the medal's position when the effect starts to the player craft. The 't' value needs to be some sort of ease-in-ease-out to have smoother motion