Can anyone help me with my Shmup engine?
-
- Posts: 3
- Joined: Sun Sep 24, 2017 5:15 am
Can anyone help me with my Shmup engine?
Hello, I'm new here, I like shmups but I wanted to ask for your help
I have been developing games in the shmups style for quite some time, but I'm having difficulty enemies formation via GML code.
I saw that some members here made games in Gamemaker, like GMOSSE
I would appreciate if any experts could help me with my Engine.
I have been developing games in the shmups style for quite some time, but I'm having difficulty enemies formation via GML code.
I saw that some members here made games in Gamemaker, like GMOSSE
I would appreciate if any experts could help me with my Engine.
Last edited by LordMargatroid on Wed Sep 27, 2017 6:11 am, edited 1 time in total.
Re: Can anyone help me with my Shmup engine?
I guess it depends on how interconnected you want their behavior to be.
I typically use a generator object that spawns them at the correct time/positions they need to be in and also sets any special internal variables for them, then self-terminates.
An easy example:
If you wanted to make, say, chevron formations you would need to allow the generator to make one OR multiple enemies on each pass and also use the negative of the same x variable to create the opposite 'wing' of the chevron. Then you could assign a point within the formation - for example, the base or tip - for setting each one's relative direction so they all spread away from there in a pleasing way. Going further along, you could set a timer on each one, so there is a slight delay between when each starts moving away from that point.
Just spitballing some ideas, really. If you need help with actually scripting this stuff, I might be able to help too.
I typically use a generator object that spawns them at the correct time/positions they need to be in and also sets any special internal variables for them, then self-terminates.
An easy example:
Code: Select all
(on each *, generate enemy at current x position+x variable, assuming y position is the top of the screen)
step#
0 * <starting x variable value
5 * <after 5 steps (time), add to x variable
10 * <add again
15 * <add again
20 * <add again, self terminate
Just spitballing some ideas, really. If you need help with actually scripting this stuff, I might be able to help too.
-
- Posts: 3
- Joined: Sun Sep 24, 2017 5:15 am
Re: Can anyone help me with my Shmup engine?
Let me see an example...
The game Verytex - Mega Drive game...
See? enemies formation... but I don't know how to make it..
The game Verytex - Mega Drive game...
See? enemies formation... but I don't know how to make it..
Re: Can anyone help me with my Shmup engine?
Actually, is more commom for the developers to create an account to promote their games, never saw anything from the members, not in Gamemaker at least.LordMargatroid wrote:I saw that some members here made games in Gamemaker, like GMOSSE
Re: Can anyone help me with my Shmup engine?
???wgogh wrote:Actually, is more commom for the developers to create an account to promote their games, never saw anything from the members, not in Gamemaker at least.LordMargatroid wrote:I saw that some members here made games in Gamemaker, like GMOSSE
There's plenty of Game Maker games here. As OP stated GMOSSE (Game Maker shmup engine) was created by a member here. There's also Aeon Zenith, all of Rozyrg's games, FINALBOSS, Xydonia, Zenohell (and I believe all of Kaiser/Team Grybanser Fox's games), and more.
Besides, developers promoting their games here are still technically registered members.
Re: Can anyone help me with my Shmup engine?
Honestly, Aeon Zenith was the only one I was aware of and I happen to look the Development threads from time to time, sometimes to give a feedback. Hope I didnt sound like I was criticizing anything as it wasnt my intention.
-
mamboFoxtrot
- Posts: 745
- Joined: Tue Jul 29, 2014 3:44 am
- Location: Florida, Estados Unidos
Re: Can anyone help me with my Shmup engine?
If you're talking about getting them to fly around like that, you could be extra lazy and just use GameMaker's Path functions I mean, it's what I did for an old project, but I'm not as much of a GM Pro as the other guys on this forum.LordMargatroid wrote:Let me see an example...
The game Verytex - Mega Drive game...
See? enemies formation... but I don't know how to make it..
-
Squire Grooktook
- Posts: 5969
- Joined: Sat Jan 12, 2013 2:39 am
Re: Can anyone help me with my Shmup engine?
Okay, so I guess your trying to make dudes that curve around on their flight path like that? There are several ways of doing it.LordMargatroid wrote:
See? enemies formation... but I don't know how to make it..
First off, I hate GML's in-built pathing thingy. It gave me inconsistent results. I prefer to work with everything in script anyway. Maybe others can give advice or tutorial on paths. Might be better then the shit I'm about to ramble about:
Script wise, the two most basic ways to make an elaborate curving path are to either rotate the direction of movement over time, or use a sine wave.
For example, in directions, you could do something like:
Code: Select all
direction += (curve * curveDirection)
timer -= 1
if (timer < 1)
{
curveDirection *= -1
timer = 60
}
Curve is the amount we change the movement direction by every frame
CurveDirection is either 1 or -1.
Timer is counted down every frame.
When timer hits 0, its set back to its initial value and curveDirection is multiplied by -1 to change its positive/negative value and thus change the direction the enemy moves in.
This is just an example. It's annoying and a lot of work to work with directions + timers, but it can work if you can't think of a better way.
Another cleaner alternative is to work with sine waves.
For example you can get the classic "wavy" path by doing
Code: Select all
sineIncrement += 1
x += sin(sineIncrement )
Lastly, another method that immediately comes to mind for complex paths is to create a "turn to angle" function, that will turn the direction of the object to a specific direction by a certain amount each frame, and then choose points to steer it towards along its path. IE
Code: Select all
aim = direction towards point1
scr_turntoangle(aim,TurnSpeed)
if (distance to point1 < 10)
{
point1 = nextPoint
}
If you're a top tier math/programmer brain you could probably do something with splines or some shit too, maybe make your own version of GML's path system. But I wouldn't recommend that to a beginner.
Honestly this is something of an artform and something you'll have to play around with and experiment on your own as you go. There are lots of different ways of scripting different kinds of movement. Some better, some worse. Some more efficient, some less efficient. As a game developer you tend to learn something new every day. So good luck!
Aeon Zenith - My STG.RegalSin wrote:Japan an almost perfect society always threatened by outsiders....................
Instead I am stuck in the America's where women rule with an iron crotch, and a man could get arrested for sitting behind a computer too long.
-
- Posts: 3
- Joined: Sun Sep 24, 2017 5:15 am
Re: Can anyone help me with my Shmup engine?
Tinha q ser brasileiro mesmo pra vir falar bobagens aqui né.. infelizmente você é um dos que não valem nada... infelizmente sou brasileiro maldito lugar onde nasciwgogh wrote:Actually, is more commom for the developers to create an account to promote their games, never saw anything from the members, not in Gamemaker at least.LordMargatroid wrote:I saw that some members here made games in Gamemaker, like GMOSSE
mamboFoxtrot wrote:If you're talking about getting them to fly around like that, you could be extra lazy and just use GameMaker's Path functions I mean, it's what I did for an old project, but I'm not as much of a GM Pro as the other guys on this forum.LordMargatroid wrote:Let me see an example...
The game Verytex - Mega Drive game...
See? enemies formation... but I don't know how to make it..
I do not like using Path in the gamemaker I feel somewhat limited, I prefer to use GML code
-------------------
I liked the idea, I'll try to put into practice what you didSquire Grooktook wrote:Okay, so I guess your trying to make dudes that curve around on their flight path like that? There are several ways of doing it.LordMargatroid wrote:
See? enemies formation... but I don't know how to make it..
First off, I hate GML's in-built pathing thingy. It gave me inconsistent results. I prefer to work with everything in script anyway. Maybe others can give advice or tutorial on paths. Might be better then the shit I'm about to ramble about:
Script wise, the two most basic ways to make an elaborate curving path are to either rotate the direction of movement over time, or use a sine wave.
For example, in directions, you could do something like:
direction is movement direction obviously.Code: Select all
direction += (curve * curveDirection) timer -= 1 if (timer < 1) { curveDirection *= -1 timer = 60 }
Curve is the amount we change the movement direction by every frame
CurveDirection is either 1 or -1.
Timer is counted down every frame.
When timer hits 0, its set back to its initial value and curveDirection is multiplied by -1 to change its positive/negative value and thus change the direction the enemy moves in.
This is just an example. It's annoying and a lot of work to work with directions + timers, but it can work if you can't think of a better way.
Another cleaner alternative is to work with sine waves.
For example you can get the classic "wavy" path by doing
you can change the amount the sineIncrement is increased by each frame, add a multiplier to the sine, etc. in order to change the size/shape/speed of the wave. This is *really* good for simple stuff.Code: Select all
sineIncrement += 1 x += sin(sineIncrement )
Lastly, another method that immediately comes to mind for complex paths is to create a "turn to angle" function, that will turn the direction of the object to a specific direction by a certain amount each frame, and then choose points to steer it towards along its path. IE
^^^What we're doing here in rough pseudocode form is choosing a point, aiming our direction towards it each frame, and then changing to the next point when we get close enough.Code: Select all
aim = direction towards point1 scr_turntoangle(aim,TurnSpeed) if (distance to point1 < 10) { point1 = nextPoint }
If you're a top tier math/programmer brain you could probably do something with splines or some shit too, maybe make your own version of GML's path system. But I wouldn't recommend that to a beginner.
Honestly this is something of an artform and something you'll have to play around with and experiment on your own as you go. There are lots of different ways of scripting different kinds of movement. Some better, some worse. Some more efficient, some less efficient. As a game developer you tend to learn something new every day. So good luck!
Re: Can anyone help me with my Shmup engine?
For any 'following' formation such as that, its as simple as giving each member the same pathing/movement logic and delay creation of subsequent members by the same timer value(s.)
What's cool about this is the movement doesn't have to particularly complex, just having one follow the other in an organic looking way is quite good on it's own.
What's cool about this is the movement doesn't have to particularly complex, just having one follow the other in an organic looking way is quite good on it's own.
-
n0rtygames
- Posts: 1001
- Joined: Thu Mar 15, 2012 11:46 pm
- Contact:
Re: Can anyone help me with my Shmup engine?
Yo dawg! Since you don't want to use the convenient tools provided to you by the conveniently provided engine so you can engine while you engine...
The simplest solution here is to create an array of points, an index to keep track of which point you're at and then just move between each one (turning towards it)
beware of overshooting said point when using turn to face point stuff and do a distance check when close enough to your point to proceed to next, or scale turning curve based on distance to target.
HTH.
The simplest solution here is to create an array of points, an index to keep track of which point you're at and then just move between each one (turning towards it)
beware of overshooting said point when using turn to face point stuff and do a distance check when close enough to your point to proceed to next, or scale turning curve based on distance to target.
HTH.
facebook: Facebook
Re: Can anyone help me with my Shmup engine?
The technique of having a leader going where he wants (with some combination of interpolated or approximated waypoints, approaching moving targets such as the player, being pushed by force fields, etc.) and a chain of other formation members following the previous formation member (with a reasonably constrained dynamical model) can become even more organic by handling missing formation members.Rozyrg wrote:For any 'following' formation such as that, its as simple as giving each member the same pathing/movement logic and delay creation of subsequent members by the same timer value(s.)
What's cool about this is the movement doesn't have to particularly complex, just having one follow the other in an organic looking way is quite good on it's own.
- If the leader dies, the next enemy in the sequence (who was following it directly) starts behaving as a leader
- If another formation member dies, the following enemy in the sequence starts following its predecessor (taking a slight shortcut)
- Arbitrary formation members can split the formation by starting to move as formation leaders and going somewhere else, taking everyone behind with them