Doing TATE in GML (Game Maker Language)
Doing TATE in GML (Game Maker Language)
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.
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.
Re: Doing TATE in GML (Game Maker Language)
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.

Re: Doing TATE in GML (Game Maker Language)
I wholeheartedly support this thread!

RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
-
worstplayer
- Posts: 861
- Joined: Sun Jun 17, 2007 6:48 pm
- Location: Slovakia
Re: Doing TATE in GML (Game Maker Language)
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.
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."
Re: Doing TATE in GML (Game Maker Language)
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.
I'm good working with examples but starting from scratch I tend to miss things that are important.
-
worstplayer
- Posts: 861
- Joined: Sun Jun 17, 2007 6:48 pm
- Location: Slovakia
Re: Doing TATE in GML (Game Maker Language)
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.
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.
http://www.mediafire.com/download.php?jj4gdjzmzzd
This version actually uses faster surface-less tate, which I completely forgot about.

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."
Re: Doing TATE in GML (Game Maker Language)
thanks cant wait to check this after work.
Re: Doing TATE in GML (Game Maker Language)
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.

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.

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

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.

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.
-
worstplayer
- Posts: 861
- Joined: Sun Jun 17, 2007 6:48 pm
- Location: Slovakia
Re: Doing TATE in GML (Game Maker Language)
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."
Re: Doing TATE in GML (Game Maker Language)
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.
Re: Doing TATE in GML (Game Maker Language)
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.




Sorry for the crappy pictures, the games look awesome "in person".




Sorry for the crappy pictures, the games look awesome "in person".

RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.
Re: Doing TATE in GML (Game Maker Language)
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.

Re: Doing TATE in GML (Game Maker Language)
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.
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.
Re: Doing TATE in GML (Game Maker Language)
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.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.

RegalSin wrote:Street Fighters. We need to aviod them when we activate time accellerator.