Doing TATE in GML (Game Maker Language)

A place for people with an interest in developing new shmups.
Post Reply
EddyMRA
Posts: 798
Joined: Wed Jan 26, 2005 9:36 am
Location: San Diego, CA, USA

Doing TATE in GML (Game Maker Language)

Post by EddyMRA »

My Xeno Fighters EX-R and agustusx's War on Bugs got requests for a TATE option. In the XFEX-R topic, there was a general idea posted, but I feel it would be best if a discussion about coding this feature in GML was made into its own topic.

agustusx and I would really benefit from the assistance anyone can provide, and I'm sure other GM shmuppers would as well.
The age of Alluro and JudgeSpear is over.
agustusx
Posts: 592
Joined: Tue Dec 02, 2008 6:08 pm

Re: Doing TATE in GML (Game Maker Language)

Post by agustusx »

I definitely think this topic is worthy of a thread. I would appreciate the assistance. :) I tried using some of the general ideas put in the XF thread but they never panned out for me.
User avatar
emphatic
Posts: 7984
Joined: Mon Aug 18, 2008 3:47 pm
Location: Alingsås, Sweden
Contact:

Re: Doing TATE in GML (Game Maker Language)

Post by emphatic »

I wholeheartedly support this thread!
Image | My games - http://www.emphatic.se
RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
User avatar
worstplayer
Posts: 861
Joined: Sun Jun 17, 2007 6:48 pm
Location: Slovakia

Re: Doing TATE in GML (Game Maker Language)

Post by worstplayer »

You'll have to use surfaces.
Basically you'll create a new surface (surface_create),
before you start drawing, you set render target to surface (surface_set_target, it's helpful to make a separate object, with lowest 'depth', so it's draw event is activated before anything else),
draw all your sprites normally,
reset target surface (surface_reset_target, to draw on the screen again),
and finally draw the surface, rotated and stretched to fit the screen(draw_surface_ext).

That's the basic idea, and there are many ways to implement this. I can upload my game's source if anyone's interested, but my method probably isn't the most efficient.
"A game isn't bad because you resent it. A game is bad because it's shitty."
agustusx
Posts: 592
Joined: Tue Dec 02, 2008 6:08 pm

Re: Doing TATE in GML (Game Maker Language)

Post by agustusx »

Worstplayer, any working example would be nice for me. I've tried tate using surfaces as well as without, each having their own problems.

I'm good working with examples but starting from scratch I tend to miss things that are important.
User avatar
worstplayer
Posts: 861
Joined: Sun Jun 17, 2007 6:48 pm
Location: Slovakia

Re: Doing TATE in GML (Game Maker Language)

Post by worstplayer »

OK, here's full source of Laseroid.
http://www.mediafire.com/download.php?jj4gdjzmzzd

This version actually uses faster surface-less tate, which I completely forgot about. :lol: Look into stage1 creation code (some variables have to be adjusted if your game uses different resolution). If you still want to use surfaces, "partsystem" object shows how to use surfaces for trails, motion blur and similar effects.
Last edited by worstplayer on Tue Aug 25, 2009 5:58 pm, edited 1 time in total.
"A game isn't bad because you resent it. A game is bad because it's shitty."
agustusx
Posts: 592
Joined: Tue Dec 02, 2008 6:08 pm

Re: Doing TATE in GML (Game Maker Language)

Post by agustusx »

thanks cant wait to check this after work.
agustusx
Posts: 592
Joined: Tue Dec 02, 2008 6:08 pm

Re: Doing TATE in GML (Game Maker Language)

Post by agustusx »

So after reviewing worstplayers code I see his method is very much the same I tried a few months ago and had challenges with. Once tated the drawn screen does not match View0, its off by 75pixels. In Worstplayers game example laseroid, he overcame this by changing the xview and yview by +/-80pixels depending on the game mode.

After a bit of playing around I was able to fix the horizontal offset by giving the camera controller special instructions for each tate mode. When tated left or right the camera needs to remove 75 from the xview, sounds strange but it works.

With WOB the player is constantly moving up the Y to get the the end of the stage. This is where the remainder of the problems are. Adjusting the yview do not fix the vertical offset issue.

When I say it is off by 75 pixels I mean that it is drawing 75 pixels on the top that it should not and missing 75 on the bottom. The bottom hud is missing, and the top hud is too far down. To prove this is not simply the hud rendering in the wrong position, when enemies appear you see them pop up in the buffer area and you can also see projectiles being destroyed on screen in this area. It is obvious that GM believes this area is off screen, but it is still drawing it. Additionally the player can fall off the bottom of the screen.

Image
The above image is how the game looks when playing tated. I added a green overlay ingame that shows where View0 is. Notice how there is no lower hud and how there is extra padding above the highscore.

Image

I have tried tinkering with the view_xportm view_yport settings but they don't seem to change anything.

If i could get past this one hurdle I think this birdie can have its wings.
User avatar
worstplayer
Posts: 861
Joined: Sun Jun 17, 2007 6:48 pm
Location: Slovakia

Re: Doing TATE in GML (Game Maker Language)

Post by worstplayer »

Sounds like bug in GM. I never encountered that, since I move the background rather than viewport. Maybe for moving viewports surfaces work better afterall.
"A game isn't bad because you resent it. A game is bad because it's shitty."
agustusx
Posts: 592
Joined: Tue Dec 02, 2008 6:08 pm

Re: Doing TATE in GML (Game Maker Language)

Post by agustusx »

worstplayer wrote:Sounds like bug in GM. I never encountered that, since I move the background rather than viewport. Maybe for moving viewports surfaces work better afterall.

I actually tried this in a stationary room and I still had the same problem. Instead in this case it drew a black space above the highscores and when bullets or enemies ran that way they left an after image. If you have ever had a leak in Worldcraft or similar you'll know the experience.
User avatar
emphatic
Posts: 7984
Joined: Mon Aug 18, 2008 3:47 pm
Location: Alingsås, Sweden
Contact:

Re: Doing TATE in GML (Game Maker Language)

Post by emphatic »

I will stop nagging for this feature, as your Game Maker games runs well if you just rotate Windows using your graphics card. For my Intel it's just ctrl+alt+right arrow.

Image

Image

Image

Image

Sorry for the crappy pictures, the games look awesome "in person".
Image | My games - http://www.emphatic.se
RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
agustusx
Posts: 592
Joined: Tue Dec 02, 2008 6:08 pm

Re: Doing TATE in GML (Game Maker Language)

Post by agustusx »

thanks for the pictures :) I'll have to try the windows tate for myself. I'm on a bit of a dev break as I am in the process of moving.
EddyMRA
Posts: 798
Joined: Wed Jan 26, 2005 9:36 am
Location: San Diego, CA, USA

Re: Doing TATE in GML (Game Maker Language)

Post by EddyMRA »

Awesome pics, emph!

It's so cool seeing our fangames on arcade cabs.

I will still do the TATE feature for those who do not have the CTRL-ALT-arrow desktop rotation feature.
The age of Alluro and JudgeSpear is over.
User avatar
emphatic
Posts: 7984
Joined: Mon Aug 18, 2008 3:47 pm
Location: Alingsås, Sweden
Contact:

Re: Doing TATE in GML (Game Maker Language)

Post by emphatic »

Alluro wrote:Awesome pics, emph!

It's so cool seeing our fangames on arcade cabs.

I will still do the TATE feature for those who do not have the CTRL-ALT-arrow desktop rotation feature.
Thanks. If it's not taking too much time from your regular "development hours", please implement a real TATE mode, as that's really a better solution.
Image | My games - http://www.emphatic.se
RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
Post Reply