Nepeo's Recent Forum Activity

  • haypers The signature is a unique string of letters for your keystore. If you generated the keystore with construct the download dialog for the keystore tells you what it is, and instructs you to stash it somewhere for later use. I expect most people don't read this dialog.

    When you create the "application" for Google Play games it asks you for the signature, but it doesn't explain why you need it and lets you skip entering it (despite it being a HARD requirement to get your game to work). It's quite awkward to find the place to edit this for your application, but it can be done.

    The signature is used as a check by Google to make sure that you signed the APK. When trying to sign in they check the signature of the keystore used to sign the APK against the one on record for the app ID. If they don't match the sign in dialog immediately exits, presuming it to be malicious.

    EDIT: Most mobile APIs tend to presume that they are being used by people experienced in building mobile apps, and hence are quite difficult to learn. Scirra have tried to simplify this for users but there's quite a lot which cannot be simplified, due to it being controlled by Google/Apple/etc.

  • There's a known issue on iOS with external keyboards in a WebView. If you have C3 "added to homescreen" as recommended then previews appear in a popup WebView. For some reason iOS will not actually create keyboard events in the popup unless the user selects something that resembles a text box. If you use construct straight from Safari or use remote preview then the keyboard will work.

    Alternatively there is also an unpleasant workaround that if you add a button to the layoutview, once it has been touched by the user the keyboard will work.

    Games published to the web and run through iOS will not experience this bug.

    As it's an external Apple bug we can't do much other than wait for them to fix it. We haven't been able to find a good workaround for it unfortunately.

  • All signed Android export types aren't working in that beta, due to some missing changes in the release. It should be resolved in the next release.

    The unsigned variants are working, so it's possible to export as an unsigned ABB file and then sign it manually using jarsigner ( apksigner doesn't work with ABB ).

  • I have noticed that the reflection is ultra- green instead of white

    Sounds like the specular light color is green, although I don't know why that would affect only you. Is this on the demo page for the effect or when you attempt to use it in a project?

    Someone could go through the shader code and look for differences/issues. I was curious about the shader code so I grabbed it from the effect demo page, but I haven't really got the time to look through it at the moment.

    #ifdef GL_ES
    precision mediump float;
    #endif
    
    uniform mediump sampler2D samplerFront;
    varying vec2 vTex;
    
    uniform mediump float seconds;
    uniform mediump float date;
    uniform mediump float pixelWidth;
    uniform mediump float pixelHeight;
    
    vec2 iResolution = vec2( 1./pixelWidth, 1./pixelHeight);
    
    uniform mediump float scale_x;
    uniform mediump float scale_y;
    uniform float xx,yy,mspeed;
    uniform float sbred,sbgreen,sbblue;
    uniform float swred,swgreen,swblue;
    
    const int NUM_STEPS = 6;// 8
    const float PI	 	= 3.1415;
    const float EPSILON	= 1e-3;
    float EPSILON_NRM	= 0.1 / iResolution.x;
    const int ITER_GEOMETRY = 3;
    const int ITER_FRAGMENT = 5;
    uniform float SEA_HEIGHT;//0.6
    uniform float SEA_CHOPPY;//4.0
    uniform float SEA_SPEED;//2.0
    uniform float SEA_FREQ;//0.16
    
    vec3 SEA_BASE = vec3(sbred,sbgreen,sbblue);
    vec3 SEA_WATER_COLOR = vec3(swred,swgreen,swblue);
    float SEA_TIME = seconds * SEA_SPEED;
    mat2 octave_m = mat2(1.6,1.2,-1.2,1.6);
    
    mat3 fromEuler(vec3 ang) {
     vec2 a1 = vec2(sin(ang.x),cos(ang.x));
     vec2 a2 = vec2(sin(ang.y),cos(ang.y));
     vec2 a3 = vec2(sin(ang.z),cos(ang.z));
     mat3 m;
     m[0] = vec3(a1.y*a3.y+a1.x*a2.x*a3.x,a1.y*a2.x*a3.x+a3.y*a1.x,-a2.y*a3.x);
     m[1] = vec3(-a2.y*a1.x,a1.y*a2.y,a2.x);
     m[2] = vec3(a3.y*a1.x*a2.x+a1.y*a3.x,a1.x*a3.x-a1.y*a3.y*a2.x,a2.y*a3.y);
     return m;
    }
    
    float hash( vec2 p ) {
     float h = dot(p,vec2(127.1,311.7));
     return fract(sin(h)*43758.5453123);
    }
    
    float noise( in vec2 p ) {
     vec2 i = floor( p ); 
     vec2 f = fract( p );
     vec2 u = f*f*(3.0-2.0*f);
     return -1.0+2.0*mix( mix( hash( i + vec2(0.0,0.0) ),
     hash( i + vec2(1.0,0.0) ), u.x),
     mix( hash( i + vec2(0.0,1.0) ),
     hash( i + vec2(1.0,1.0) ), u.x), u.y);
    }
    
    float diffuse(vec3 n,vec3 l,float p) {
     return pow(dot(n,l) * 0.4 + 0.6,p);
    }
    
    float specular(vec3 n,vec3 l,vec3 e,float s) {
     float nrm = (s + 8.0) / (3.1415 * 8.0);
     return pow(max(dot(reflect(e,n),l),0.0),s) * nrm;
    }
    
    vec3 getSkyColor(vec3 e) {
     e.y = max(e.y,0.0);
     vec3 ret;
     ret.x = pow(1.0-e.y,2.0);
     ret.y = 1.0-e.y;
     ret.z = 0.6+(1.0-e.y)*0.4;
     return ret;
    }
    
    float sea_octave(vec2 uv, float choppy) {
     uv += noise(uv);
     vec2 wv = 1.0-abs(sin(uv));
     vec2 swv = abs(cos(uv));
     wv = mix(wv,swv,wv);
     return pow(1.0-pow(wv.x * wv.y,0.65),choppy);
    }
    
    float map(vec3 p) {
     float freq = SEA_FREQ;//0.16
     float amp = SEA_HEIGHT;
     float choppy = SEA_CHOPPY;
     vec2 uv = p.xz; uv.x *= 0.75;
     float d, h = 0.0;
     for(int i = 0; i < ITER_GEOMETRY; i++) {
     d = sea_octave((uv+SEA_TIME)*freq,choppy);
     d += sea_octave((uv-SEA_TIME)*freq,choppy);
     h += d * amp;
     uv *= octave_m; freq *= 1.9; amp *= 0.22;
     choppy = mix(choppy,1.0,0.2);
     }
     return p.y - h;
    }
    
    float map_detailed(vec3 p) {
     float freq = SEA_FREQ;
     float amp = SEA_HEIGHT;
     float choppy = SEA_CHOPPY;
     vec2 uv = p.xz; uv.x *= 0.75;
     float d, h = 0.0;
     for(int i = 0; i < ITER_FRAGMENT; i++) {
     d = sea_octave((uv+SEA_TIME)*freq,choppy);
     d += sea_octave((uv-SEA_TIME)*freq,choppy);
     h += d * amp;
     uv *= octave_m; freq *= 1.9; amp *= 0.22;
     choppy = mix(choppy,1.0,0.2);
     }
     return p.y - h;
    }
    
    vec3 getSeaColor(vec3 p, vec3 n, vec3 l, vec3 eye, vec3 dist) {
     float fresnel = 1.0 - max(dot(n,-eye),0.0);
     fresnel = pow(fresnel,3.0) * 0.65;
     vec3 reflected = getSkyColor(reflect(eye,n));
     vec3 refracted = SEA_BASE + diffuse(n,l,80.0) * SEA_WATER_COLOR * 0.12;
     vec3 color = mix(refracted,reflected,fresnel);
     float atten = max(1.0 - dot(dist,dist) * 0.001, 0.0);
     color += SEA_WATER_COLOR * (p.y - SEA_HEIGHT) * 0.18 * atten;
     color += vec3(specular(n,l,eye,60.0));
     return color;
    }
    
    vec3 getNormal(vec3 p, float eps) {
     vec3 n;
     n.y = map_detailed(p);
     n.x = map_detailed(vec3(p.x+eps,p.y,p.z)) - n.y;
     n.z = map_detailed(vec3(p.x,p.y,p.z+eps)) - n.y;
     n.y = eps;
     return normalize(n);
    }
    
    float heightMapTracing(vec3 ori, vec3 dir, out vec3 p) {
     float tm = 0.0;
     float tx = 1000.0;
     float hx = map(ori + dir * tx);
     if(hx > 0.0) return tx;
     float hm = map(ori + dir * tm);
     float tmid = 0.0;
     for(int i = 0; i < NUM_STEPS; i++) {
     tmid = mix(tm,tx, hm/(hm-hx));
     p = ori + dir * tmid;
     float hmid = map(p);
     if(hmid < 0.0) {
     tx = tmid;
     hx = hmid;
     } else {
     tm = tmid;
     hm = hmid;
     }
     }
     return tmid;
    }
    
    #define AA 1
    
    void main() {
     vec2 uv = vTex;
     uv = uv * 2.0 - 1.0;
     uv.y =1.-uv.y;
     uv.x *= iResolution.x / iResolution.y;
     float time = seconds * 0.3 /*+ iMouse.x*0.01*/;
     vec3 ang = vec3(0.,yy ,xx);
     vec3 ori = vec3(mspeed,3.5,5.0);
     vec3 dir = normalize(vec3(uv.xy,2.0)); //dir.z += length(uv) * 0.15*((-.1*iMouse.y/iResolution.y));
     dir = normalize(dir) * fromEuler(ang);
     vec3 p;
     heightMapTracing(ori,dir,p);
     vec3 dist = p - ori;
     vec3 n = getNormal(p, dot(dist,dist) * EPSILON_NRM);
     vec3 light = normalize(vec3(0.0,1.0,0.8));
     vec3 color = mix(
     getSkyColor(dir),
     getSeaColor(p,n,light,dir,dist),
     pow(smoothstep(0.0,-0.05,dir.y),0.3));
     gl_FragColor = vec4(pow(color,vec3(0.75)), 1.0);
    }
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • As of last week the build server should now be using the cordova-iosjcp@5.1.0 with the WKWebViewOnly flag. There was a delay while we waited for cordova-plugin-inappbrowser to update and support the flag. Building via cordova CLI might not be using the flag yet.

    If it's still including UIWebView stuff then we'll need to look into it.

  • I believe it's a direct port of this shadertoy shadertoy.com/view/Ms2SD1

    So I guess take a look at that and see if you have the same issue? That's probably the place to look for a fix. The author mentions that they fixed some hardware dependent issue at somepoint, so might be that the effect is based on an older version. There's also some talk about it not working well on integrated graphics, and in some situations the browser ends up using the integrated GPU on your CPU and ignoring the discrete graphics card to "save power".

  • working on an AI system, all done via events & using only default addons to make it work, right now I all AI characters can use any melee weapons so far.

    oh yeah the eyes are just there for debug purposes, just representing where the character is looking.

    Nice, looks cool! Is it based on edge detection and line of sight?

    I've had a look for path finding for platformer games in the past, but the examples I saw required marker objects for AI to find how to jump from one platform to another.

  • Looks like something isn't quite right, the concept is pretty sound. Here's an example

    dropbox.com/s/gqd4ipsh8f3ifjs/Random%20Colors.c3p

  • Truly random colors can often be unpleasant. A trick I have used in the past is to blend the random color with another one, so that colors you create have a common base.

    rgbEx(
    	lerp(50, random(100), 0.4),
    	lerp(50, random(100), 0.4),
    	lerp(50, random(100), 0.4)
    )
    

    That blends a random color with the fixed color rgb(50%, 50%, 50%), with a blend ratio of 40%.

  • globalThis is quite new. It's not supported in Edge yet. It was created to workaround the fact if you wrote JS for multiple environments ( like a server and the browser ) they used different names for the global object.

    From MDN:

    Historically, accessing the global object has required different syntax in different JavaScript environments. On the web you can use window, self, or frames - but in Web Workers only self will work. In Node.js none of these work, and you must instead use global.

    The this keyword could be used inside functions running in non–strict mode, but this will be undefined in Modules and inside functions running in strict mode. You can also use Function('return this')(), but environments that disable eval(), like CSP in browsers, prevent use of Function in this way.

    The globalThis property provides a standard way of accessing the global this value (and hence the global object itself) across environments. Unlike similar properties such as window and self, it's guaranteed to work in window and non-window contexts. In this way, you can access the global object in a consistent manner without having to know which environment the code is being run in.To help you remember the name, just remember that in global scope the this value is globalThis.

    I think the C3 runtime will create globalThis if it doesn't exist. But it depends where you're reading it from I guess.

    If you're only doing this in the browser it makes sense to just use window/frame.contentWindow.

    Edge is being replaced with a Chromium based version very soon, so it will have support for it then.

  • You could use foreach (ordered) and local variables to keep track of the previous position.

  • That's great news, thanks for confirming boulerzzz

Nepeo's avatar

Nepeo

Member since 8 Mar, 2016

Twitter
Nepeo has 583,792 followers

Trophy Case

  • 8-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • x3
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

13/44
How to earn trophies

Blogs