Released OLD TV Filter for GameMaker

RangerX

Member
It's well done. Especially when you don't feel like coding these sorts of things. Its probably a fair price as I am not aware of the value such a thing can have on the market.
Am buying it anyways, even just for trying if I like it on my game.
 
Last edited:

RangerX

Member
I am having troubles with the shader. :(
I guess I should have been in the beta testing. Just dropping it into my game messes things up pretty bad:

1- if the base object is created before my initial settings, it messes my transitions and at the second transition my game makes, it just stops working. Certain of my messages also appear on top!


2 - If I create the object after my initial settings are done, it still messes the transitions and it doesn't appear at the right size either.

I am not grasping what do I have to do in order to make this work. I hope can help me (or anyone that is).
My game doesn't use the GUI layer for one thing. I don't think it matters much. It DOES use the application surface though. It needs to work with both the application surface ON and OFF because I have an option toggle it on/off. My transition object is drawing the application surface in a Post Draw event and the transition itself in simply a rectangle drawn on top of everthing with its alpha gradually changing. For scaling my game I use the method I am describing in my tutorial here (pixel perfect method): https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995/

If this messes your shader, this means my tutorial is messing up alot of your clients....
Lastly, this is what I have in my ini room:
Code:
//-------------------------------- GAME SCALING ----------------------------

show_debug_overlay(0);                     // shows some debug info on screen like memory use, texture swaps, etc  REMOVE FOR RELEASE!!
texture_set_interpolation(false);              // prevent any interpolation on images
global.Interpolation=false;                  // to track its on or off
display_reset(0,true);                           // sets the anti-aliasing off (0) and vsync on (true)
global.Vsync=true;                             // to track when the v-sync is on/off
global.Frameskip=true;                       // game starts with frameskip debug code off
global.AppSurf=true;                         // to track if the application surface is in use or not
application_surface_draw_enable(0);        // so I can control the resize and drawing of the application surface
draw_enable_alphablend(false);                 // disable the alpha blending of the application surface
global.GameScale=1.0;                                         // default (no scaling)
global.Scaling="Off";                     // to know if there's scaling going on or not
global.BlockWindow=false;                    // to block the game in windowed mode
global.BlockScaling=false;                   // to block the scaling option
global.MonitorW=display_get_width();            // catching the size of the display
global.MonitorH=display_get_height();
window_set_fullscreen(1);                       //play the game fullscreen
surface_resize(application_surface,800,450)           // size of the application surface for no scaling
global.Dis_Xoffset=(global.MonitorW-800)/2;     // set the position of the application surface
global.Dis_Yoffset=(global.MonitorH-450)/2;


//---------- Scale x 1.5 -------------------    

if(global.MonitorW>=1200 && global.MonitorH>=675)    // if the monitor's resolution is at least 1200x675...
then
{
global.Scaling="On";
global.GameScale=1.5;                             // to track the scale generally speaking
global.BlockScaling=false;
surface_resize(application_surface,1200,675)       // set the right application surface size
global.Dis_Xoffset=(global.MonitorW-1200)/2;   
global.Dis_Yoffset=(global.MonitorH-676)/2;
}


//---------- Scale x 2 -------------------

if(global.MonitorW>=1600 && global.MonitorH>=900)       // full HD!
then
{                 
global.GameScale=2.0;
global.Scaling="On";
global.BlockScaling=false;                       
surface_resize(application_surface,1600,900)   
global.Dis_Xoffset=(global.MonitorW-1600)/2;   
global.Dis_Yoffset=(global.MonitorH-900)/2;
}


//---------- Scale x 2.5 -------------------           // 27 inch monitors?

if(global.MonitorW>=2000 && global.MonitorH>=1125) 
then
{                   
global.GameScale=2.5;
global.Scaling="On";
global.BlockScaling=false;                         
surface_resize(application_surface,2000,1125)   
global.Dis_Xoffset=(global.MonitorW-2000)/2;   
global.Dis_Yoffset=(global.MonitorH-1126)/2;     
}


//---------- Scale x 3 -------------------             // projectors and huge tvs?

if(global.MonitorW>=2400 && global.MonitorH>=1350) 
then
{
global.GameScale=3.0;
global.Scaling="On";
global.BlockScaling=false;
surface_resize(application_surface,2400,1350)   
global.Dis_Xoffset=(global.MonitorW-2400)/2;   
global.Dis_Yoffset=(global.MonitorH-1350)/2; 
}


//---------- Scale x 3.5 -------------------

if(global.MonitorW>=2800 && global.MonitorH>=1575) 
then
{
global.GameScale=3.5;
global.Scaling="On";
global.BlockScaling=false;
surface_resize(application_surface,2800,1575)   
global.Dis_Xoffset=(global.MonitorW-2400)/2;   
global.Dis_Yoffset=(global.MonitorH-1576)/2; 
}


//---------- Scale x 4 -------------------             // 4k baby!

if(global.MonitorW>=3200 && global.MonitorH>=1800)   
then
{
global.Scaling="On";
global.GameScale=4.0;
global.BlockScaling=false;
surface_resize(application_surface,3200,1800)   
global.Dis_Xoffset=(global.MonitorW-3200)/2;   
global.Dis_Yoffset=(global.MonitorH-1800)/2; 
}


// ------------------------------ PAUSE BACKGROUND SCALE -------------------------------------

switch (global.GameScale)                                // if game is on Engine scaling -- size of pause backbrounds
{
case 1.0:
global.PauseBack=1;
break;

case 1.5:
global.PauseBack=0.67;
break;

case 2.0:
global.PauseBack=0.5;
break;

case 2.5:
global.PauseBack=0.4;
break;

case 3.0:
global.PauseBack=0.33;
break;

case 3.5:
global.PauseBack=0.27;
break;

case 4.0:
global.PauseBack=0.25;
break;
}


//------------------------------ GAME LANGUAGE ------------------------------------------        
/*
if(os_get_language()=="fr")
then
{
global.Francais=true;                // to know if the game is played in french or english
global.CurrentLanguage="Français";   // to know which language the game is currently in
}
else
{*/
global.Francais=false;             
global.CurrentLanguage="English"; 
//}


//----------------------------------- OTHER SETTINGS --------------------------------------

caption_score=false;                                        // prevents score being displayed in the windows border
window_set_caption("The Life Ruby");                       // what the window itself is named
window_set_cursor(cr_none);                                // to remove mouse cursor
window_center();                                          // centers the window in the monitor

global.WindowStyle="Full";              // by default the window style is "fullscreen"
global.CurrentZone=GameSetting;               // so the game knows which zone we are in
global.Version=500;               // to know wich version of the game
//instance_create(10,10,obj_OLDTVFilter_PresetBase);   // for CRT shader

room_goto_next();

Can someone help me figure out what's messing everything up?
 
A

Alexandre Ribeiro de Sá

Guest
I am having troubles with the shader. :(
I guess I should have been in the beta testing. Just dropping it into my game messes things up pretty bad:

1- if the base object is created before my initial settings, it messes my transitions and at the second transition my game makes, it just stops working. Certain of my messages also appear on top!


2 - If I create the object after my initial settings are done, it still messes the transitions and it doesn't appear at the right size either.

I am not grasping what do I have to do in order to make this work. I hope can help me (or anyone that is).
My game doesn't use the GUI layer for one thing. I don't think it matters much. It DOES use the application surface though. It needs to work with both the application surface ON and OFF because I have an option toggle it on/off. My transition object is drawing the application surface in a Post Draw event and the transition itself in simply a rectangle drawn on top of everthing with its alpha gradually changing. For scaling my game I use the method I am describing in my tutorial here (pixel perfect method): https://forum.yoyogames.com/index.php?threads/how-to-properly-scale-your-game.995/

If this messes your shader, this means my tutorial is messing up alot of your clients....
Lastly, this is what I have in my ini room:
Code:
//-------------------------------- GAME SCALING ----------------------------

show_debug_overlay(0);                     // shows some debug info on screen like memory use, texture swaps, etc  REMOVE FOR RELEASE!!
texture_set_interpolation(false);              // prevent any interpolation on images
global.Interpolation=false;                  // to track its on or off
display_reset(0,true);                           // sets the anti-aliasing off (0) and vsync on (true)
global.Vsync=true;                             // to track when the v-sync is on/off
global.Frameskip=true;                       // game starts with frameskip debug code off
global.AppSurf=true;                         // to track if the application surface is in use or not
application_surface_draw_enable(0);        // so I can control the resize and drawing of the application surface
draw_enable_alphablend(false);                 // disable the alpha blending of the application surface
global.GameScale=1.0;                                         // default (no scaling)
global.Scaling="Off";                     // to know if there's scaling going on or not
global.BlockWindow=false;                    // to block the game in windowed mode
global.BlockScaling=false;                   // to block the scaling option
global.MonitorW=display_get_width();            // catching the size of the display
global.MonitorH=display_get_height();
window_set_fullscreen(1);                       //play the game fullscreen
surface_resize(application_surface,800,450)           // size of the application surface for no scaling
global.Dis_Xoffset=(global.MonitorW-800)/2;     // set the position of the application surface
global.Dis_Yoffset=(global.MonitorH-450)/2;


//---------- Scale x 1.5 -------------------   

if(global.MonitorW>=1200 && global.MonitorH>=675)    // if the monitor's resolution is at least 1200x675...
then
{
global.Scaling="On";
global.GameScale=1.5;                             // to track the scale generally speaking
global.BlockScaling=false;
surface_resize(application_surface,1200,675)       // set the right application surface size
global.Dis_Xoffset=(global.MonitorW-1200)/2;  
global.Dis_Yoffset=(global.MonitorH-676)/2;
}


//---------- Scale x 2 -------------------

if(global.MonitorW>=1600 && global.MonitorH>=900)       // full HD!
then
{                
global.GameScale=2.0;
global.Scaling="On";
global.BlockScaling=false;                      
surface_resize(application_surface,1600,900)  
global.Dis_Xoffset=(global.MonitorW-1600)/2;  
global.Dis_Yoffset=(global.MonitorH-900)/2;
}


//---------- Scale x 2.5 -------------------           // 27 inch monitors?

if(global.MonitorW>=2000 && global.MonitorH>=1125)
then
{                  
global.GameScale=2.5;
global.Scaling="On";
global.BlockScaling=false;                        
surface_resize(application_surface,2000,1125)  
global.Dis_Xoffset=(global.MonitorW-2000)/2;  
global.Dis_Yoffset=(global.MonitorH-1126)/2;    
}


//---------- Scale x 3 -------------------             // projectors and huge tvs?

if(global.MonitorW>=2400 && global.MonitorH>=1350)
then
{
global.GameScale=3.0;
global.Scaling="On";
global.BlockScaling=false;
surface_resize(application_surface,2400,1350)  
global.Dis_Xoffset=(global.MonitorW-2400)/2;  
global.Dis_Yoffset=(global.MonitorH-1350)/2;
}


//---------- Scale x 3.5 -------------------

if(global.MonitorW>=2800 && global.MonitorH>=1575)
then
{
global.GameScale=3.5;
global.Scaling="On";
global.BlockScaling=false;
surface_resize(application_surface,2800,1575)  
global.Dis_Xoffset=(global.MonitorW-2400)/2;  
global.Dis_Yoffset=(global.MonitorH-1576)/2;
}


//---------- Scale x 4 -------------------             // 4k baby!

if(global.MonitorW>=3200 && global.MonitorH>=1800)  
then
{
global.Scaling="On";
global.GameScale=4.0;
global.BlockScaling=false;
surface_resize(application_surface,3200,1800)  
global.Dis_Xoffset=(global.MonitorW-3200)/2;  
global.Dis_Yoffset=(global.MonitorH-1800)/2;
}


// ------------------------------ PAUSE BACKGROUND SCALE -------------------------------------

switch (global.GameScale)                                // if game is on Engine scaling -- size of pause backbrounds
{
case 1.0:
global.PauseBack=1;
break;

case 1.5:
global.PauseBack=0.67;
break;

case 2.0:
global.PauseBack=0.5;
break;

case 2.5:
global.PauseBack=0.4;
break;

case 3.0:
global.PauseBack=0.33;
break;

case 3.5:
global.PauseBack=0.27;
break;

case 4.0:
global.PauseBack=0.25;
break;
}


//------------------------------ GAME LANGUAGE ------------------------------------------       
/*
if(os_get_language()=="fr")
then
{
global.Francais=true;                // to know if the game is played in french or english
global.CurrentLanguage="Français";   // to know which language the game is currently in
}
else
{*/
global.Francais=false;            
global.CurrentLanguage="English";
//}


//----------------------------------- OTHER SETTINGS --------------------------------------

caption_score=false;                                        // prevents score being displayed in the windows border
window_set_caption("The Life Ruby");                       // what the window itself is named
window_set_cursor(cr_none);                                // to remove mouse cursor
window_center();                                          // centers the window in the monitor

global.WindowStyle="Full";              // by default the window style is "fullscreen"
global.CurrentZone=GameSetting;               // so the game knows which zone we are in
global.Version=500;               // to know wich version of the game
//instance_create(10,10,obj_OLDTVFilter_PresetBase);   // for CRT shader

room_goto_next();

Can someone help me figure out what's messing everything up?
thanks for the feedback! I'll read your tutorial and test ir right now :)
are you using gms1.4 or 2?
 
A

Alexandre Ribeiro de Sá

Guest
I am on lastest GMS 1.4
nice, I'll check it! we had some resize issues on GMS2, but, not on 1.4...
got your dm, I'm reading your tutorial right now to reproduce the bug here :)
I think I have some idea about how to solve it, but, need to test first...
 

RangerX

Member
I've been very close to make make it work.
Here's what I changed:

- In the setup, everything is sized according my application surface (that is set in the ini room)
- In the Filter_draw script, the buffer surface is also set at the application surface size. At the end of the script, instead of your original draw command, I target the application surface and draw the bugger surface on it.
- I call the "Filter_Draw" in a Post Draw event right before my application drawing code in my object responsible for drawing. This object is also handling transitions in a Draw Event.

Result:

- All shaders are functional and applied (expected!)
- Only my game in the letterbox appear modified and not whole screen (expected!)

However...
- The shader effects always appear after 1 second or 2 after a room change. This means the game looks unfiltered and then it one second after its ok.
- In certain rooms it takes up to a minute for the shader to start working!!
- Some shaders are messing around with alpha. Am not knowledgeable enough to know why/how. (each time there's a fade in/out of my drawn black rectangle for transitions, wierd colors appear on screen)
- If I turn off the application surface in-game, I crash.
- If I change the scale in-game, all sizing messes up.
- There some horrible banding in the scanlines. Is that meant to be? (see screenshot)


:( :( :(

Am getting discouraged...
 
There some horrible banding in the scanlines. Is that meant to be? (see screenshot)
There is a setting in the shader called game_lines, I set that to my VERTICAL resolution for my game which is 540 (pixels)

global.game_lines = 540;

Then, I set the scanline count to 1/4 of that, so for me,
global.scanline_count = 135;

That seems to make the scanlines look good on my setup.

Suggest you try something similar, set the scan_line count to 1/2, 1/3 or a 1/4 of your game_lines variable, and see if that works.

@Alexandre Ribeiro de Sá may have more information on the correct settings.

Edit: I meant vertical height in pixels...
 
Last edited:

RangerX

Member
What do you prefer Alexandre?
We discuss the issues here or in PMs?

I want to work on this and understand what's not working. We can even work it simultaneously on Skype if you want.
I just want to settle if this can work or not. If it doesn't I'll have to ask a refund on the store. I don't even know what's the time limit to do so!!
 
B

basement ape

Guest
@RangerX
I get that banding effect too if my screen resolution doesn't divide cleanly with my scanline count. To get around it I do this in the TV filter object's Create event:
Code:
// Game resolution = 480x270

var gameScanlines = 0;

if display_get_height() == 1080
{ gameScanlines = 270; }
else if display_get_height() == 1050
{ gameScanlines = 262.5; }
else if display_get_height() == 1024
{ gameScanlines = 256; }
etc..

global.game_lines = gameScanlines;
Kinda clunky but you get the idea.
 

RangerX

Member
Problem is, the scanlines are at the right number with the righ spacing when I put 224.
I will try 225 since my height is 450. 112,5 makes the scanline really bad looking.

EDIT: banding still there...
 
Last edited:
A

Alexandre Ribeiro de Sá

Guest
@RangerX, I sent a PM to you, I'm reding your tutorial to reproduce the issues...

about global.game_lines and global.scanline_count...

the global.game_lines is used to create some noise effects, like the dot crawling... the idea is set your game resolution here...
the global.scanline_count is how many scanlines you will have on screen... this value didn't need to have the same as game_lines, for example, you are developing a really lowres game that each pixel uses two lines... a atari 2600 like game... or your scanline pattern have more than one line, like the RGB pattern that have two lines...

like this picture, whare you can see the dot crawling and the ntsc distortion, this effect is made with the game_lines


for best result, aways use the filter with texture filter enabled... "but I want to keep my pixel style"... this isn't a problem when you are using a crt, part of the filter apply a blur in the scene, it's used to create the some effects, like sonic waterfall transparent effect... we use a blur to create the bleeding effect too...


and here a screen with no filter


but, you can use the global.television_sharpness if you are looking for a RGB monitor like effect...
 
A

Alexandre Ribeiro de Sá

Guest
hello everyone! I'm back!

we had the independence day here in Brazil, so we take a little time with our family and some friends :)

and we had a crazy weekend! we had earthquakes, we had hurricanes, I have a cousin in US, he was supporting the people from texas, he posted some photos in facebook... thats crazy! my brother and his wife survived a flood, and it's surreal...

but, the there a very dark think on those disasters, bad people who tries to take some advantage... I saw some things on facebook, so, if you want to help and didn't live near any of these disaster location, go to the redcross (https://www.redcross.org/ns/apology/disaster_homepage.html), do not deposite money in accounts you find in facebook posts!

so, thats it :)

now, let's talk about the filter!
I'm talking with @RangerX, he had some issues with the filter and want I'm working to find a solution...
util I find a solution I've put the unreal and construct version on hold, my plan was to start working on the port this week...
so, he sent what he is doing, it's a really clever way to optimize the game, and sure some more advanced developers are doing the same! so, it's important to find a solution for this!

@Samuel Venable , I've forgot xD thanks \o/

and thats all for today :)
 
S

Sam (Deleted User)

Guest
I hope you and everyone you know are OK! Dang, that's a lot to go through in just one weekend! I'm really sorry to hear that. :(
 
A

Alexandre Ribeiro de Sá

Guest
hello everyone!

ok, let's go to the new stuff! as I've said the OLD TV Filter was my first experience on GameMaker, thats why I'm was learning more about the engine these days to solve the last issues from the shader :)
as this filter is a very complex one I'm porting my GameBoy filter to the engine, and yes, I reproduced some issues on this more simple filter \o/
but why are you using the GB filter to test? both filters do same stuff but it's much more simple code to test and solve these issues...

but when this issues happen?? in my tests we had some issues when you do something out of the box, that means, when you to something different from the default engine behaviour... and the gamemaker is the first engine that I saw that give the developer the method to say, don't render the stuff this way, I'll code my way!

as and old school developer (yes, I know C/C++ and ASM), I know we have some wins and loss when you have this freedom...
the wins are simple, you can hack the stuff to get some extra performance making the engine don't do useless stuff for your project, a good example is the @RangerX code, and no, he didn't have done nothing wrong! as a programmer you have to use everything you have to achieve the best result for your project... and I do the same thing, I'm working in another project using the SDL and I changed some codes from the SDK to do something that we can't do using the default solution... and yes, I'm doing something like this on this shader too...

and about the losses, as we can change the engine behaviour sometimes we got some unexpected result, as the one some developers had...

now I'm was trying to isolate each individual issues to try to solve it... but, as I'm doing some hack too, it's got a little hard as in some cases we solved here and broke there xD
NOW ENTER THE GB FILTER! as I've said, this is a much more simple filter that uses common stuff from the OLD TV Filter, what I'm doing now? as it uses common stuffs in a small scale can be much more easy to solve the issues here then patch the OLD TV Filter than find the solution there with a much more bigger and complex code...

if you want to test the gb filter just send a pm, @RangerX, I'll send to you for sure!

thats all for today :) and once again, thanks everyone for the support \o
 
A

Alexandre Ribeiro de Sá

Guest
hello again dudes!

what can I say, I've got some screens from games using the filter! WANT TO PLAY ALL OF THEN!!!
and there a guy developing a really kirbish game and he is looking for some help to finish his game :)
you can find him on his twitter https://twitter.com/WhipMasterGame/status/917851059934187520

I've got some projects here to get some money and eat, you guys know, we have to eat or we die... I really didn't know why xD hahahaha
so! it's a really awesome project! the true is, I'm working on it for almost one year... it took my time a lot, but I really hope it gives the security that I need to keep working in my own stuff... I really want to return to develop my own games too... today I have some devkits, even nintendo devkits, but some of then I never used, it's makes me really depressed :( I love games, I love to create stuff and love to see people having fun with my creations!

I think thats why I always happy when see some game using my stuff xD It's like "it's not my game, but, I'm there too"...

so, I'm working on this project, and I designed and created everything with my brother and my dad, you guys have no idea how happy I'm developing something new... and it isn't a tool or a asset... IT'S A FU**ING GAME... ok, it's a tool too, but it's a game, and I'm the game designer and the codedude... :p
the name is REDBOX, if you follow my Twitter (@alexribeirodesa) you will find lot's of stuff about it! but, now it's complete and will start to sell next week :D
that's why I'm writing a little about the development of this project in TIGSource (https://forums.tigsource.com/index.php?topic=62734.0) and as I said there lots of stuff in my twitter and instagram ^^

just a spoler, you will not find the redbox on steam, videogame or mobiles devices, but, you will find it inside some arcade cabinets ^^
second spoiler, I played Maldita Castilla (linux arm build) on it :3 so, gamemaker will can build for it some day!
last spoiler, no, no more spoiler xD
 
A

Abdullah Al Hori

Guest
Hello Alexandre,

I have just purchased the OLD TV Filter, and was wondering if there's a way to use the effect only on a specific object instead of the whole screen. I'm used to applying shaders on specific objects, turning them off and on independently. I'm trying to create a TV screen within the game with this effect, whilst the rest of the game around it remains normal.

I'm using the most updated GameMaker Studio 2. Any help would be greatly appreciated. Thank you.
 
F

fabstab

Guest
I'm having some issues with the shaders and effects disabling or interfering with other GUI items like healthbar, menu screens etc.

I created GUI buttons to enable/disable certain effects and it works to turn them on and off but once enabled I can only see them once the game is started. In the menu screen to toggle them on and off everything goes black and stays that way until I start the game.. When the game is started though, my healthbar and general HUD is missing. I believe I've utilized the objects and scripts correctly but some settings might be interfering with my own code...
 

IGameArt

Member
I just picked up the asset for my game and I'm having an issue where it doesn't seem to be applying any shaders at all. It's resizing the screen and everything just fine, but the effect itself isn't visible. i'm using the latest beta 2.3
 

rIKmAN

Member
OP hasn't been on the forums since October 2017 guys, he isn't gonna see any of these posts.

Might wanna send him an email, contact him on Twitter or use the Contact Publisher button on the marketplace.
 
T

Treyonical

Guest
This is a great filter but how do you install in in game maker studio 2 I have no idea how install it.
 
Top