Oh so true!
Ed, I think a bunch of your game ideas and templates I’ve seen over the years are solid ideas. If you can punch up the graphics and sound and maybe package them like @Rob Miracle suggested, you could end up with something unique. I’m imagining a game where the central character goes through various side adventures (mini games) while on a quest of some sort like Machinarium or SunDog (old school Start ST - with lots of little side puzzles).
If you think of those old Monte Python “animations” that barely moved but felt alive because of clever sound design or “Inside” (by the same people who made Limbo) which has light gameplay but a captivating atmosphere, you can see that a boost in visuals and sound gives you a lot of bang for your buck. My shading plugin works on that principle. Pop in a couple shadows and some depth and the viewers become more attentive and committed to the game environment and characters.
Ed, I’ve benefitted tremendously from your help online. If I can return the favor sometime by helping you brainstorm graphics or sound - shoot me a personal message.
Jonathan
Thanks for wanting to help me out. I’ve got a ton of game ideas too, but I have trouble getting beyond the ‘interesting mechanic’ to complete, beautiful, and engaging game.
I have a short attention span in some ways. I love solving problems, but spending time on polish, tweak, improve repeat, not so much.
This is part of why you seem me answering a lot of forums posts. I want to help folks, but I also enjoy solving the questions that are asked.
I hear what you’re saying about incremental improvements to get from flat and boring to better and more interesting. My current (long running) challenge is to settle on an art style I can handle producing on my own that is in a send mine or associated with my work.
Cheers,
Ed
Hey Ed, I have a challenge for you (not sure this can actually be done in Corona).
What I am trying to do is show a coverage map of my game of certain game parameters. What I would like to achieve is something like this
I’ve tried making buildings greyscale and then applying a setFillColor but this doesn’t work on greyscale! If I just use setFillColor then the results look like this
The problem is buildings without coverage basically are filled with {0,0,0} when ideally they should be filled with white - but filling with {1,1,1} just removes the fill.
Ideally the steps should be something like
-
convert all assets to greyscale
-
ramp up the gamma so buildings are in the range 0.75 - 1 as opposed to 0-1
-
then apply a varying fill colour between 0 and 1 depending on coverage. 0 for no coverage, 1 for max coverage. So zero coverage would almost be white and full coverage would be a solid colour
I can’t use a snapshot or anything like that as the player can pan and zoom to see the enitre playing area which is much bigger than the view port dimensions and with the game using upwards of 200MB texture memory I can’t double it either. It has to be able to operate on the existing display objects!
Dilemma time…
@Jonathan, you cannot colour fill a grayscale filter so that option is out…
filter.colorMatrix is better but buildings without colour still tend towards black and not white
What I need is to apply multiple fills… one to turn into white and then a second pass to colour them. But unless I am mistaken, Corona only supports a single filter once.
Nothing received… try @adrianm
Does this looks fine?

Simply done with color matrix:
[lua]
local default = display.newImage( “archery.png”, 85, 90 )
local grayed = display.newImage( “archery.png”, 160, 220 )
local active = display.newImage( “archery.png”, 235, 350 )
grayed.fill.effect = “filter.colorMatrix”
grayed.fill.effect.coefficients =
{
0.299, 0.587, 0.114, 0,
0.299, 0.587, 0.114, 0,
0.299, 0.587, 0.114, 0,
0, 0, 0, 1
}
active.fill.effect = “filter.colorMatrix”
active.fill.effect.coefficients =
{
0.299, 0.587, 0.114, 0.6,
0.299, 0.587, 0.114, 0,
0.299, 0.587, 0.114, 0,
0, 0, 0, 1
}
[/lua]
EDIT:
You can adjusting redness by changing that 0.6 coefficient. 0.2 would give you just a little tint, 1 would bake it all-red.
EDIT 2:
you can also animate it: https://gist.github.com/Shchvova/9991fa5dab6bc653274eec8492fc4a21
Just for fun, made a gif http://i.imgur.com/sEaKaIv.gifv of the gist
Alternative: https://giphy.com/gifs/3ohzdNTp6E0HXQQOxW/html5
Curious… how did you come up with these values? 0.299, 0.587, 0.114
Brilliant! I really must play around with colorMatrix!
This is how you get “true” grayscale. Eye have different sensitivity to different light, etc. Read more - https://en.wikipedia.org/wiki/Grayscale#Luma_coding_in_video_systems
EDIT: Here’s comparison. Left one is just 0.5 for coefficients, right one - 0.299, 0.587, 0.114

Must say it is not quite what I wanted but it is certainly good enough… thanks Vlad
Big visual difference makes that everything else is even more grayed. Try different setting, like adding all adding all 3 components to parks, roads, water etc.
[lua]
local unrelated = display.newImage( “archery.png”, 80, 220 )
unrelated.fill.effect = “filter.colorMatrix”
unrelated.fill.effect.coefficients = {
0.299, 0.587, 0.114, 0.7,
0.299, 0.587, 0.114, 0.7,
0.299, 0.587, 0.114, 0.7,
0, 0, 0, 1
}
unrelated.fill.effect.bias = { -0.2, -0.2, -0.2, 0 }
[/lua]

Default
Unrelated Disabled
Active
Hi Vlad, I’ve noticed a big frame rate hit with colorMatrix fills. Without fill…
With fill…
On device (One Plus 3T with snapdragon 821 and 6GB RAM) the frame rate drops from 29 fps to 12 fps - is this normal and expected behaviour?
It’s hard to say. Try assigning fill effect/parameters once and not changing them, see if it helps. But using color matrix can slow things down. I didn’t expect such impact though…
I only applied the colorMatrix once to only the buildings within the screen bounds. Applying to every building dragged it down to sub 4 fps. Is there a less resource intensive way of achieving this?
What happens to performance when you’re just using grayscale effect?
colorMatrix does a lot of computations you don’t need. You can try defining your custom effect which can be way simpler. Here’s some example:
https://goo.gl/287Rnn - in shader playground
And in actual code:
[lua]
graphics.defineEffect {
category = “filter”,
name = “grayscale”,
fragment = [[
const P_COLOR vec3 kWeights = vec3( 0.2125, 0.7154, 0.0721 );
P_COLOR vec4 FragmentKernel( P_UV vec2 texCoord )
{
P_COLOR vec4 texColor = texture2D( CoronaSampler0, texCoord );
P_COLOR float luminance = dot( texColor.rgb, kWeights );
return CoronaColorScale(texColor.a) + vec4( luminance, luminance, luminance, texColor.a );
}
]],
}
--------------
local unrelated = display.newImage( “archery.png”, 80, 220 )
unrelated.fill.effect = “filter.custom.grayscale”
unrelated:setFillColor( 1,0,0 )
[/lua]

Alternatively, you can define several simple effects for each of the state, and adjust each one of them separately, like this. I think this would be easier for you.
