Can anyone help me with my Shmup engine?

A place for people with an interest in developing new shmups.
Post Reply
LordMargatroid
Posts: 3
Joined: Sun Sep 24, 2017 5:15 am

Can anyone help me with my Shmup engine?

Post by LordMargatroid »

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. :D
Last edited by LordMargatroid on Wed Sep 27, 2017 6:11 am, edited 1 time in total.
User avatar
Rozyrg
Posts: 918
Joined: Wed Feb 11, 2009 12:03 am
Location: Southeast USA

Re: Can anyone help me with my Shmup engine?

Post by Rozyrg »

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:

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
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. :)
LordMargatroid
Posts: 3
Joined: Sun Sep 24, 2017 5:15 am

Re: Can anyone help me with my Shmup engine?

Post by LordMargatroid »

Let me see an example...

The game Verytex - Mega Drive game...

Image

See? enemies formation... but I don't know how to make it..
User avatar
wgogh
Posts: 535
Joined: Fri Jun 10, 2016 5:01 am
Location: Brazil

Re: Can anyone help me with my Shmup engine?

Post by wgogh »

LordMargatroid wrote:I saw that some members here made games in Gamemaker, like GMOSSE
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.
Image
User avatar
Shepardus
Posts: 3505
Joined: Sat Dec 13, 2014 10:01 pm
Location: Ringing the bells of fortune

Re: Can anyone help me with my Shmup engine?

Post by Shepardus »

wgogh wrote:
LordMargatroid wrote:I saw that some members here made games in Gamemaker, like GMOSSE
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.
???
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.
Image
NTSC-J: You know STGs are in trouble when you have threads on how to introduce them to a wider audience and get more people playing followed by threads on how to get its hardcore fan base to play them, too.
1CCs | Twitch | YouTube
User avatar
wgogh
Posts: 535
Joined: Fri Jun 10, 2016 5:01 am
Location: Brazil

Re: Can anyone help me with my Shmup engine?

Post by wgogh »

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.
Image
User avatar
mamboFoxtrot
Posts: 745
Joined: Tue Jul 29, 2014 3:44 am
Location: Florida, Estados Unidos

Re: Can anyone help me with my Shmup engine?

Post by mamboFoxtrot »

LordMargatroid wrote:Let me see an example...

The game Verytex - Mega Drive game...

Image

See? enemies formation... but I don't know how to make it..
If you're talking about getting them to fly around like that, you could be extra lazy and just use GameMaker's Path functions :P 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.
User avatar
Squire Grooktook
Posts: 5969
Joined: Sat Jan 12, 2013 2:39 am

Re: Can anyone help me with my Shmup engine?

Post by Squire Grooktook »

LordMargatroid wrote:
See? enemies formation... but I don't know how to make it..
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.

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
}
direction is movement direction obviously.
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 )
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.

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
}
^^^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.

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!
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.
Aeon Zenith - My STG.
LordMargatroid
Posts: 3
Joined: Sun Sep 24, 2017 5:15 am

Re: Can anyone help me with my Shmup engine?

Post by LordMargatroid »

wgogh wrote:
LordMargatroid wrote:I saw that some members here made games in Gamemaker, like GMOSSE
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.
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 nasci


mamboFoxtrot wrote:
LordMargatroid wrote:Let me see an example...

The game Verytex - Mega Drive game...

Image

See? enemies formation... but I don't know how to make it..
If you're talking about getting them to fly around like that, you could be extra lazy and just use GameMaker's Path functions :P 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.

I do not like using Path in the gamemaker I feel somewhat limited, I prefer to use GML code


-------------------
Squire Grooktook wrote:
LordMargatroid wrote:
See? enemies formation... but I don't know how to make it..
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.

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
}
direction is movement direction obviously.
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 )
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.

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
}
^^^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.

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!
I liked the idea, I'll try to put into practice what you did :D
User avatar
Rozyrg
Posts: 918
Joined: Wed Feb 11, 2009 12:03 am
Location: Southeast USA

Re: Can anyone help me with my Shmup engine?

Post by Rozyrg »

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.
User avatar
n0rtygames
Posts: 1001
Joined: Thu Mar 15, 2012 11:46 pm
Contact:

Re: Can anyone help me with my Shmup engine?

Post by n0rtygames »

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.
facebook: Facebook
Ixmucane2
Posts: 760
Joined: Mon Jan 19, 2009 3:26 pm
Location: stuck at the continue prompt

Re: Can anyone help me with my Shmup engine?

Post by Ixmucane2 »

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.
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.
  • 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
You can do even better by considering both the preceding and following members of the formation. For example, you could move each enemy towards the midpoint of its two neighbours, ensuring that if the leader moves slower than the followers' maximum speed any gaps in the formation are eventually closed.
Post Reply