Posts: 269
Threads: 3
Joined: Sep 2013
The health bar above enemy heads is a placeholder graphic, i dont intend for it to be so plain in final
I also plan on making it do something with that chemical canister when its defeated, but scuttles are a group, so i wanted to code the basic movement AI first. Im going in now to code the various subtypes.
Posts: 607
Threads: 25
Joined: Mar 2012
looks really awesome, but the explosion animation seemed a bit without punch, it'd have a much better effect if the first frame of the explosion was a bit smaller (to give the explosion the feel of something expanding) and if it displayed in front of the sprite rather than behind, also having the sprite change to destroyed sprite on the apex of the explosion, but these are purely cosmetic, looking fantastic so far, getting more hyped each update!
Posts: 269
Threads: 3
Joined: Sep 2013
Posts: 269
Threads: 3
Joined: Sep 2013
I'm trying to get water physics working and i kinda wanted a graphical opinion.
Blue filter or not blue filter? Personally, I think it helps sell the underwater effect, but i also think it kinda washes out the sprites. Is that the right term? it ruins the palette contrast I mean.
(at the moment it is done through the image editor, but I could likely get a similar effect done through code)
Posts: 418
Threads: 21
Joined: Oct 2013
I just went swimming today and I looked underwater a lot, I should be helpful here iguess
The blue filter is realistically correct - looking underwater without goggles things have a bit of a blue tint.
Also, instead of putting it into code, why not make a something percent transparency tile, and place it over the regular light blue water tile?
As in like 50% grey or something
Posts: 607
Threads: 25
Joined: Mar 2012
you could pull a sonic 3, upon entering the water a splash graphic is shown, which is just a clever way to mask the changing of the sprite, to a different palette, you could simply make alternative versions of the sprites with a new palette for all sprites relevant to water (jumping and falling for entering and exiting the water, swim, maybe run if you want to run on the underwater floor, etc.) you can use that as a chance to make a palette not so washed out.
Posts: 269
Threads: 3
Joined: Sep 2013
07-16-2015, 09:31 PM
(This post was last modified: 07-16-2015, 10:00 PM by Valo.)
(07-16-2015, 09:27 PM)Quirby64 Wrote: I just went swimming today and I looked underwater a lot, I should be helpful here iguess
The blue filter is realistically correct - looking underwater without goggles things have a bit of a blue tint.
Also, instead of putting it into code, why not make a something percent transparency tile, and place it over the regular light blue water tile?
As in like 50% grey or something
EDIT: better example, lemme just share the tiles themselves :EDIT
I would prefer doing it by coding the object/enemy/player to filter itself than by placing a transparent sheet over water areas because I already draw water versions of the tiles, thus the only thing that needs tinted would be non background stuff. I feel tinting over the background would ruin the cleanness of the watered tiles.
(07-16-2015, 09:29 PM)Bombshell93 Wrote: you could pull a sonic 3, upon entering the water a splash graphic is shown, which is just a clever way to mask the changing of the sprite, to a different palette, you could simply make alternative versions of the sprites with a new palette for all sprites relevant to water (jumping and falling for entering and exiting the water, swim, maybe run if you want to run on the underwater floor, etc.) you can use that as a chance to make a palette not so washed out.
I would do it that way if gm could easily do palette data rather than me making a sprite set layer of every color in an objects set.I'm personally against hand recoloring it simply because of the amount of sprite sets that would create, layered or not. While the effect would look VERY nice, i dont think it is the most efficient solution.
Posts: 524
Threads: 9
Joined: Jul 2012
07-16-2015, 10:57 PM
(This post was last modified: 07-16-2015, 11:34 PM by TheShyGuy.)
But you can do palettes (as in specifying an alternate color palette instead of manually recoloring everything) in GM since GM supports pixel (fragment) shaders. I've even done it for Neweegee already. Let me see if I can find the necessary code.
Edit:....I'm looking....
Posts: 269
Threads: 3
Joined: Sep 2013
(07-16-2015, 10:57 PM)TheShyGuy Wrote: But you can do palettes (as in specifying an alternate color palette instead of manually recoloring everything) in GM since GM supports pixel (fragment) shaders. I've even done it for Neweegee already. Let me see if I can find the necessary code.
Edit:....I'm looking....
I've never heard of pixel fragment shaders actually...And looking it up it might be a studio version feature. I'm not using studio.
Posts: 524
Threads: 9
Joined: Jul 2012
07-17-2015, 12:22 AM
(This post was last modified: 07-17-2015, 12:26 AM by TheShyGuy.)
How to draw sprites using a palette in GM Studio:
...I just found it too =/. Well, if you ever move to studio, heres some important code:
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform sampler2D Palette;
//size of palette image, in pixels.
uniform vec2 PaletteImageSize;
void main()
{
//Use 255 if not intel.
//texture2D() returns colors in range [0,1]. Put them back into the range[0,255],
//where the value refers to the exact pixel X,Y.
vec4 indexPixel = texture2D( gm_BaseTexture, v_vTexcoord) * vec4(256);
//Comment out these conditionals if not intel.
if(indexPixel.r >= 128.0)indexPixel.r--;
if(indexPixel.g >= 128.0)indexPixel.g--;
if(indexPixel.b >= 128.0)indexPixel.b--;
if(indexPixel.a >= 128.0)indexPixel.a--;
//convert the pixel coords into UV coords in the range [0,1],
// as expected by texture2D()
vec2 paletteCoords = vec2(indexPixel.x,indexPixel.y) / PaletteImageSize;
//issue: gamemaker stores all images into a "Texture page",
//thus, the above coords are incorrect.
//fix: externally loaded palette images
gl_FragColor = texture2D( Palette, paletteCoords);
}
Notes:
"uniform sampler2D Palette" refer to a sampler texture that is an externally loaded sprites since GM will auto batch sprites into a "Texture Page". When that happens, GM will change the UV coords to something unexpected. But, I need to know the exact UV coords of the palette image, so instead I externally load them to reserve the original UV coords.
The drawn sprite (gm_BaseTexture) is an indexed sprite, where each pixel's color.r (indexPixel.x) refers to the x coordinate of the correct color within the palette (domain [0,255]) and color.g (indexPixel.y) refers to the y coordinate of the correct color within the palette (domain [0,255]).
___
I'm just typing this up for other people and for my own reference. If you ever move to GM Studio or any other graphics library (OpenGL, Direct X), you can still refer to the above to draw sprites with arbitrary palettes.
Posts: 269
Threads: 3
Joined: Sep 2013
07-17-2015, 12:25 AM
(This post was last modified: 07-17-2015, 12:25 AM by Valo.)
(07-17-2015, 12:22 AM)TheShyGuy Wrote: ...I just found it too =/. Well, if you ever move to studio, heres some important code:
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 Texcoord;
varying vec4 Colour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
Colour = in_Colour;
Texcoord = in_TextureCoord;
}
// Simple passthrough fragment shader
//
varying vec2 Texcoord;
varying vec4 Colour;
uniform sampler2D Palette;
//size of palette image, in pixels.
uniform vec2 PaletteImageSize;
void main()
{
//Use 255 if not intel.
//texture2D() returns colors in range [0,1]. Put them back into the range[0,255],
//where the value refers to the exact pixel X,Y.
vec4 indexPixel = texture2D( gm_BaseTexture, Texcoord) * vec4(256);
//Comment out these conditionals if not intel.
if(indexPixel.r >= 128.0)indexPixel.r--;
if(indexPixel.g >= 128.0)indexPixel.g--;
if(indexPixel.b >= 128.0)indexPixel.b--;
if(indexPixel.a >= 128.0)indexPixel.a--;
//convert the pixel coords into UV coords in the range [0,1],
// as expected by texture2D()
vec2 paletteCoords = vec2(indexPixel.x,indexPixel.y) / PaletteImageSize;
//issue: gamemaker stores all images into a "Texture page",
//thus, the above coords are incorrect.
//fix: externally loaded palette images
gl_FragColor = texture2D( Palette, paletteCoords);
}
Notes:
gm_BaseTexture and Palette refer to sampler textures that are externally loaded sprites since GM will auto batch sprites into a "Texture Page". When that happens, GM will change the UV coords to something unexpected. But, I need to know the exact UV coords of the palette image, so instead I externally load sprites to reserves the original UV coords.
The drawn sprite (gm_BaseTexture) is an indexed sprite, where each pixel's color.r (indexPixel.x) refers to the x coordinate of the correct color within the palette (domain [0,255]) and color.g (indexPixel.y) refers to the y coordinate of the correct color within the palette (domain [0,255]).
___
I'm just typing this up for other people and for my own reference. If you ever move to GM Studio or any other graphics library (OpenGL, Direct X), you can still refer to the above to draw sprites with arbitrary palettes. I'd more readily move to studio if some of the scripts i use werent completely incompatible with it. ;-;
Posts: 607
Threads: 25
Joined: Mar 2012
game maker has always had terrible compatibility issues from version to version, the change so much in gml a lot with no reason whatsoever.
also a note, you're probably better off in a palette swapper passing in a group of vec3's as palette and determine the colour by the w component, which you can decompose and edit in pretty much any good image editing program.
Code: int paletteIndex = int(textureSample.w * PALETTE_COLOR_COUNT); //probably going 16 colors in the palette would work fine
vec3 paletteColor = uniformPalette[paletteIndex];
it allows you the freedom of on the fly palette swapping,
back on topic, how many animations are you looking to use underwater? because you have a lot more freedom with textures than you'd think, adding a new set wouldn't be much of a cost short of HD sprites
Posts: 269
Threads: 3
Joined: Sep 2013
(07-17-2015, 06:27 AM)Bombshell93 Wrote: game maker has always had terrible compatibility issues from version to version, the change so much in gml a lot with no reason whatsoever.
also a note, you're probably better off in a palette swapper passing in a group of vec3's as palette and determine the colour by the w component, which you can decompose and edit in pretty much any good image editing program.
You wanna repeat this bit in english?
(07-17-2015, 06:27 AM)Bombshell93 Wrote: back on topic, how many animations are you looking to use underwater? because you have a lot more freedom with textures than you'd think, adding a new set wouldn't be much of a cost short of HD sprites off the top of my head:
Idle
Move
Idle shoot
Move shoot
Propel forward
Propel forward shoot
Hurt
and Drowning
Posts: 607
Threads: 25
Joined: Mar 2012
07-17-2015, 09:01 AM
(This post was last modified: 07-17-2015, 09:02 AM by Bombshell93.)
so basicly your whole sprite set and then some, if your really not liking how the colour wash out looks, your only 2 options short of upgrading to GM:studio would be, play around with blend modes (I always had trouble wrapping my head around it, but it'd add a bit more flexibility than flat changing colour) or the new sprite sheet with a new palette
Posts: 269
Threads: 3
Joined: Sep 2013
(07-17-2015, 09:01 AM)Bombshell93 Wrote: so basicly your whole sprite set and then some, if your really not liking how the colour wash out looks, your only 2 options short of upgrading to GM:studio would be, play around with blend modes (I always had trouble wrapping my head around it, but it'd add a bit more flexibility than flat changing colour) or the new sprite sheet with a new palette
at this point, i may just make all the water sprite sets hand recolored then , since the 'land' animations dont ever play underwater. I wouldnt have duplicate sheets, just the water frames would be pre-blued.
|