Nepeo's Forum Posts

  • As bibirez suggests it's quite easy to produce an AAB by using the Android Studio export, but Ashley is correct that other than silencing that warning in the Play Store console there is little reason to do so at the moment. We can add additional notes to the tutorials and manual in this regard, and we probably should. However, I'm sure people will still be confused. Not everyone reads the manuals and it's easy to miss a small comment about the format. It also doesn't help that the warning on the Play Store console can appear to be preventing release to the untrained eye.

    We are aware of the update. It's technically cordova-android 8.1, we're already using the latest cordova-cli 9.0 (which uses cordova-android 8.0 by default). We are planning to update to use the latest version of cordova-android. However, we have a blocking issue to resolve prior to updating. We will have to do additional work to add support for the new format as well, so it will likely be available after we've updated to the latest cordova-android version.

  • I've made some tweaks for this in the next beta release:

    • TotalRotation expression
    • TotalAbsoluteRotation expression
    • ResetTotalRotation expression

    The difference between the absolute and non-absolute variants is that for non-absolute CCW rotation will decrease the total value, but for absolute it will always increase. Reset just clears these counters and has no effect on the behaviour otherwise.

  • jobel in the case of passing angles in the values are immediately clamped to a valid range, which is why they behave correctly. Orbit does this as well. In this case your extracting an angle from the plugin, the internal values are already clamped so you can't get this reverse effect. As far as I'm aware this is standard across the runtime code.

  • I'm not sure what would be happening with the scroll/ moving the sprite. One thing that occurs to me is your not clipping the space outside of the distortion, I'm not sure what sort of result you would be getting without the clip but it could be quite odd. I included the clipping test in my second example.

    The distortion mapping function reduces the size of the image when the value is positive, and increases it if the value is negative. I would expect this sort of behaviour, with a curved image you either have to lose part of the image or have blank space.

  • Maybe use the delta between the srcStart and srcEnd to calculate the position? Manual: Configuring Effects

    Something like:

    	vec2 srcDelta = srcEnd - srcStart;
    	vec2 position = (vTex - srcStart) / srcDelta;
    

    I'm not sure that's quite right, but I think they are all in the same texture space.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • DavidA13 If your not crashing in test mode then it's not caused by the application ID. There have been a couple of reports of crashes on iOS when test mode is disabled since the last stable release, I need to look into it. We did make some changes around test mode in iOS recently, so it might be a bug on our part. If there does turn out to be an issue I can probably update it without us needing to do a Construct release.

    Yes the application ID will include your publisher ID, translating keyword terms like that can be very confusing for users unfortunately. I don't know if Admob has any particular rules against test flight, just that you should avoid looking at your own adverts. I would generally advise to only use test mode, and then briefly checking if the adverts work on your local device before publishing a release.

  • I haven't written any effects for Construct in the past so I'm probably not the one to ask. I just happen to know some GLSL so I thought I'd chime in.

    I pared the example down a bit further for you, I can't really do anymore on it without reading up on how to make effects for Construct!

    // Author: Florian Morel
    // Adapted by: Iain Shorter
    // Title: glsl-barrel-pincushion example
    
    #ifdef GL_ES
    precision mediump float;
    #endif
    
    uniform vec2 u_resolution;
    
    vec2 barrelPincushion(vec2 uv, float k) {
     vec2 st = uv - 0.5;
     float theta = atan(st.x, st.y);
     float radius = sqrt(dot(st, st));
     radius *= 1.0 + k * pow(radius, 2.0);
    
     return 0.5 + vec2(sin(theta), cos(theta)) * radius;
    }
    
    void main() {
     // constant value for level of distortion ( negative for "pincushion" )
     const float k = 1.;
     // the position of the input texture (0...1)
     vec2 uv = gl_FragCoord.xy/u_resolution.xy;
     // convert input position to distorted co-ordinate
     vec2 st = barrelPincushion(uv, k);
     // normally you would sample your texture here, but I'm just converting the position to a colour
     vec3 colour = vec3(uv, 0.0);
     
     // filter out any pixels that are outside the distortion ( set them to blue)
     if (st.x < 0. || st.x > 1. || st.y < 0. || st.y > 1.) {
     colour.r = colour.g = 0.0;
     colour.b = 1.;
     }
     
     // output colour
     gl_FragColor = vec4(colour, 1.0);
    }
  • I have found this but cannot get it to not not effect Y shift.

    https://thebookofshaders.com/edit.php?log=180726191628

    Hope this helps.

    Thanks

    You mean like this?

    	// Author: Florian Morel
    // Title: glsl-barrel-pincushion example
    
    #ifdef GL_ES
    precision mediump float;
    #endif
    
    uniform vec2 u_resolution;
    uniform vec2 u_mouse;
    uniform float u_time;
    
    float rectangle(vec2 st, vec2 size, vec2 aastep) {
     size = vec2(0.5) - size * 0.5;
     vec2 uv = vec2(smoothstep(size.x - aastep.x, size.x, st.x), smoothstep(size.y - aastep.y, size.y, st.y));
     uv *= vec2(smoothstep(size.x - aastep.x, size.x, 1.0 - st.x), smoothstep(size.y - aastep.y, size.y, 1.0 - st.y));
    
     return uv.x * uv.y;
    }
    
    float lines(vec2 pos, vec2 axis, float gridSize, vec2 aastep) {
     float lineWidth = 1.0;
     vec2 gridPos = pos / gridSize;
     vec2 gridFrac = abs(fract(gridPos) - 0.5);
     vec2 g = clamp((gridFrac - aastep * (lineWidth - 1.0)) / aastep, 0.0, 1.0);
     float c = g.x * g.y;
     return 1.0 - c;
    }
    
    vec2 barrelPincushion(vec2 uv, float k) {
     vec2 st = uv - 0.5;
     float theta = atan(st.x, st.y);
     float radius = sqrt(dot(st, st));
     radius *= 1.0 + k * pow(radius, 2.0);
    
     // return 0.5 + vec2(sin(theta), cos(theta)) * radius;
     
     return vec2(
     0.5 + sin(theta) * radius,
     uv.y
     
     );
    }
    
    void main() {
     vec2 st = gl_FragCoord.xy/u_resolution.xy;
     st.x *= u_resolution.x/u_resolution.y;
    
     vec2 aastep = 2.0 / u_resolution;
     float k = sin(u_time);
     st = barrelPincushion(st, k);
     
     float shape = rectangle(st, vec2(0.5), aastep);
     shape -= rectangle(st, vec2(0.49), aastep);
    
     vec3 color = vec3(1.0);
     float mask = rectangle(st, vec2(0.5), aastep);
    	color += -mask * lines(st, vec2(0.0), 0.05, aastep * 10.0);
     
     gl_FragColor = vec4(color, 1.0 - shape);
    }
    

    The magic is in the barrelPincushion function, the rest is basically for generating and drawing the rectangle. Previously it was taking an input co-ord, transforming it and returning the result. I modified the output to return the new co-ordinate for the X position, and the old for the Y.

  • Couple of pointers for Android studio. First is that due to a Gradle change projects won't build out of the box. Find the error message that mentions "minSDK", when you select it a link appears in the description to "refactor" it. Which resolves the problem.

    Second thing is you can find the versionCode in the AndroidManifest.xml file. Good luck!

  • dop2000 I guess they are kinda equivalent, but by maintaining the fractional part it can be useful in more ways. If we're working in fractional values of a rotation then it makes sense to use degrees instead.

    One thing I wondered is if the value should continue to increase if the rotation is reversed, or if it should decrease. I can see both values being useful for different things, but you cannot convert between them. Reversing would be the easier to implement, as we would just need to move where we clamp the value. The absolute value would be prone to minor divergence due to cumulative floating point error in 2 separate counters.

  • Yeah its unfortunate, and an unpleasant gotcha to experience after a large number of revisions. The reasoning behind this is Android is the only platform with 2 separate fields for a version number, Cordova also hit this problem and just added a thing that generates the versionCode automatically from the version number. We just copied their behaviour. Instead of adding a property to the project that is only used on Android.

    Another thing you could do is to treat the right hand side as a build number, that doesn't reset when you change the major version. So your next version would be 1.1000.

    It's not uncommon to have a behaviour like this, I used to work on an application where we had a 3 digit build value at the end, and used even values for Android and odd for Android.

    I'll have a chat with the others what we think the best solution for this is, I think we should be able to provide an override for the versionCode value somewhere and an associated warning about the sum we use for the default value.

  • DavidA13 It's likely the crash with the Mobile Advert is caused by having a missing or incorrect application identifier in the plugin properties. The Admob SDK will force your application to crash if the value is incorrect ( for some reason ). Take a look at the Mobile Advert documentation it has instructions on how to find your application ID, as well as what it should look like.

  • Out of interest what "other rotations" are you comparing it to? The rotate behaviour doesn't have a custom angle expression, and the instance angle expression is clamped the same way that the orbit behaviour is.

    If this is something people think is useful we could potentially add a "orbit count" expression and a "clear orbit count" action. Modifying the angle clamping behaviour at this point would be a breaking change, and inconsistent with other expressions.

  • The version code is calculated from the version number. It will take the following formats:

    • MAJOR
    • MAJOR.MINOR
    • MAJOR.MINOR.MAINTENANCE
    • MAJOR.MINOR.MAINTENANCE.BUILD

    We then use the sum BUILD + (MINOR * 100) + (MINOR* 10000) + (MAJOR * 1000000) to create the version code. So in practise it's not advisable to increase any of those values higher than 99. Obviously with your naming variation this is not ideal. 0.998 is the same as 9.98 which is why your having problems going to 1.0.

    You can work around this by going straight to version 10.0 or if your building via android studio/cordova you can edit the version code.

  • I don't believe we have a C3 specific one. You can still get the C2 bundle from scirra.com/freebundle.zip.

    If your looking for something new I would heavily recommend Kenney's Assets which I believe are all Creative Commons license. I've used these for demos in the past and they are pretty high quality.