tapestry's Forum Posts

  • Your question is mostly incomprehensible to be, but try taking your two objects and effects and pasting them to a drawing canvas to combine into a single object.

    oosyrag This can't be achieved by a blending function between two layers. I need a single shader to make calculations based on two incoming textures.

    Yeah it sounds like you want to add a normal map to a texture without having to add the map.

    newt I'm not trying to add a normal map, traditionally that refers to lighting information. But you're correct that I am trying to add an extra texture to serve as a map of some kind. I'm not attempting to do this "without adding the map". I want to add the map, but when I look at Construct's shader code, I don't see a way of providing a second text.

    If you do know how to add a second texture, please tell me!

    Shaders in construct are limited in what you can access. So you can't access additional textures currently unless they update it in the future. Best bet would be to add the idea to the suggestion platform and hope it's picked up.

    R0J0hound Interesting! Thanks for the detailed response. Indeed you are understanding my request correctly. Your suggestion to access additional textures via a 'gl.getUniformLocation()' and 'gl.uniform1i()' is interesting but some of my concerns are:

    • My project will have many, many sprite objects that will include this shader (usually only 1 or 2 on-screen at a time, don't worry). And each sprite object will need an accompanying additional texture for the shader.
    • If it always needs to be loaded programmatically like this, I'd probably need to make the path to the additional texture a variable on the effect that is passed through.
    • Which sounds a bit messy/complicated and presumably this will create quite a lot of work in preparing the textures in the project.

    If the above works, it'd be a doable solution. But I don't know if that technique does work – i.e. loading extra textures via the shader through an additional file path request. I also wonder if that stalls the initial load of the shader or anything like that.

    I'd love if Ashley weighed in with any thoughts on this!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Anyone have any ideas?

    I hope there is a way to do this and we don't have to place two textures inside a single texture and access the coordinates with an offset or something like that.

  • I have a use case where I could really benefit from accessing an additional sprite/texture in a WebGL shader. The reason is that I have visual information in one texture and in the other texture I extra information I want accessible to my shader algorithm.

    Is there any way to do this? Can I access an additional animation on the Sprite via the shader?

  • Huh. I never would've expected something so magical to exist and that it would take care of the conversion for me. So I didn't even bother just trying mouse.x and mouse.y as the create coords. But you're right, that works.

    I personally feel that's a bit "too magical" in my mind. I'd personally prefer that touch.x and touch.y or mouse.x and mouse.y were always in screen coordinates and that we had to convert them to the 3D plane when necessary. But thanks for pointing me in the right direction.

  • Hrmm. Why do you think two layers of translation would be needed?

    I tried what you suggested but it didn't work. It also seems like your suggestion would've needed to be calling the functions on a 3dCamera object, not with the system functions. Right? I tried that too but it also didn't work.

    Honestly I feel like the most logical way to do this would just be to use these for the x and the y coordinates of the tile I'm trying to create:

    For x:

    3DCamera.CanvasToLayerX("3dLayer", Touch.X, Touch.Y, 0)

    For y:

    3DCamera.CanvasToLayerY("3dLayer", Touch.X, Touch.Y, 0)

    But unfortunately this doesn't work. If you have more suggestions I'm all ears. Or Ashley might know?

  • No ideas/suggestions? I feel like a built-in function to calculate this would be very helpful.

  • Basically I have a 3d camera facing down on the world and I've given the camera a 45 degree twist on its perspective. Using the "Move along Layout Axis" I can have a very nice/smooth translation of the touch/mouse coordinates for scrolling the camera/world.

    However, I now want to add some game mechanics. I want to know where in the X and Y of the world I've clicked when I click on the screen. In other words, if I click at any point on the 3D plane in front of me I want to create a tile at that location: translating the touch/mouse x and y to the world space x and y.

    Imagine wherever I click on the screen, a blue tile should be created at that position.

    Any advice?

  • So far I don't believe I've been able to reproduce the problem myself.

    Ok, that's more understandable then. I assume you've attempted to recreate though?

    If someone prepares a sample which triggers the problem, you would take a look?

    Getting us to reproduce the problem is just an unnecessary extra step anyway ...

    I respectfully disagree with this. I think tarek2 highlighted well several reasons why you should be establishing a relationship with Apple and representing the Construct community.

    > Does Scirra have a contact at Apple or relationship they can follow up on?

    Absolutely not. Apple are notoriously secretive to the point of absurdity, e.g. they mark bugs as fixed but can't tell us when the fix will ship, only saying "Apple does not comment on future releases" as a standard response. If Apple made anyone available to us, we'd definitely talk to them about such issues, but they do not make any such person available nor do they appear to have a culture that would be open to such an idea.

    Maybe you could reach out to Jen Simmons? She joined Apple within the last couple of years and I've heard she's fairly responsive/helpful:

    twitter.com/jensimmons

    I understand when Construct started out that Apple was extremely difficult to communicate with. But over the last 10 years they've changed a fair bit. Their developer relations teams are more responsive than before.

  • > tarek2

    I googled the issues and it seems that many people reported already the bug to Apple as most HTML games are affected though it has been around 3 months now since iOS 15 and they didn't make any progress, too bad.

    Would you be able to share links to those other cases of developers encountering the problem?

    It seems games are still loading fine in Safari itself. Suggesting that the problem is even in WKWebView or in the way that Cordova delivers the local files to WKWebView.

    Either way, I do agree with Ashley that this problem is the result of a change by Apple but I want to share a few thoughts:

    • Yes, we all could file bugs/reports to Apple ourselves. But has Scirra/Construct filed or notified Apple of this problem as an engine developer? Does Scirra have a contact at Apple or relationship they can follow up on?
    • Even though Apple is an insanely large and profitable company, that doesn't always mean every team is well resourced. They may be aware of this issue but haven't had time to truly investigate it. If we are able to find more clues to the cause of the issue and provide that context to Apple, it might speed up the solving of the bug.
    • Ignoring the issue and hoping Apple will fix it soon isn't really a strategy for success. If what

      Ashley says is true, that Apple change things regularly and this type of situation is common (e.g. once every 2 years, with the issues persisting for months) then that suggests it's worth spending time thinking of a new strategy to handle this scenario. By that I mean, having better processes for alerting, communicating and resolving the problem with Apple.

  • I was running an older version of Construct 2 from before the Cordova export would export the entire Cordova project prepared for the developer.

    I updated and decided to try the new export feature. It breaks for my project.

    To verify whether it was my project or Construct. I created a project with just a single sprite, no events. Default config on the rest of the project and did a Cordova export. The export also fails to load or show any visuals.

    It looks like "Error in Success callbackId: File32975700 : ReferenceError: Can't find variable: jQuery" is the first error which starts the project to breakdown?

    The errors are below:

    2020-07-03 19:22:15.531436+0200 Test[582:16274] Apache Cordova native platform version 5.1.1 is starting. 2020-07-03 19:22:15.531547+0200 Test[582:16274] Multi-tasking -> Device: YES, App: YES 2020-07-03 19:22:15.542069+0200 Test[582:16274] Started backup to iCloud! Please be careful. Your application might be rejected by Apple if you store too much data. For more information please read "iOS Data Storage Guidelines" at: https://developer.apple.com/icloud/documentation/data-storage/ To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file 2020-07-03 19:22:15.793089+0200 Test[582:16274] WF: === Starting WebFilter logging for process Test 2020-07-03 19:22:15.793204+0200 Test[582:16274] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2020-07-03 19:22:15.793285+0200 Test[582:16274] WF: _WebFilterIsActive returning: NO 2020-07-03 19:22:15.827514+0200 Test[582:16274] WF: _userSettingsForUser mobile: { filterBlacklist = ( ); filterWhitelist = ( ); restrictWeb = 1; useContentFilter = 0; useContentFilterOverrides = 0; whitelistEnabled = 0; } 2020-07-03 19:22:15.827587+0200 Test[582:16274] WF: _WebFilterIsActive returning: NO 2020-07-03 19:22:15.829434+0200 Test[582:16274] CDVWKWebViewEngine will reload WKWebView if required on resume 2020-07-03 19:22:15.829532+0200 Test[582:16274] Using WKWebView 2020-07-03 19:22:15.829830+0200 Test[582:16274] [CDVTimer][console] 0.069022ms 2020-07-03 19:22:15.830004+0200 Test[582:16274] [CDVTimer][handleopenurl] 0.084043ms 2020-07-03 19:22:15.830701+0200 Test[582:16274] [CDVTimer][intentandnavigationfilter] 0.627995ms 2020-07-03 19:22:15.830782+0200 Test[582:16274] [CDVTimer][gesturehandler] 0.032902ms 2020-07-03 19:22:15.833486+0200 Test[582:16274] [CDVTimer][file] 2.651095ms 2020-07-03 19:22:15.834565+0200 Test[582:16274] [CDVTimer][statusbar] 1.007080ms 2020-07-03 19:22:15.834625+0200 Test[582:16274] [CDVTimer][TotalPluginStartup] 4.920006ms 2020-07-03 19:22:15.997162+0200 Test[582:16274] Error in Success callbackId: File1044093589 : ReferenceError: Can't find variable: jQuery 2020-07-03 19:22:15.997256+0200 Test[582:16274] file:///private/var/containers/Bundle/Application/10120D53-9F87-454B-8C9F-3405E19F5EB5/Test.app/www/c2runtime.js:16853:10 file:///private/var/containers/Bundle/Application/10120D53-9F87-454B-8C9F-3405E19F5EB5/Test.app/www/c2runtime.js:4461:22 file:///private/var/containers/Bundle/Application/10120D53-9F87-454B-8C9F-3405E19F5EB5/Test.app/www/c2runtime.js:3618:21 file:///private/var/containers/Bundle/Application/10120D53-9F87-454B-8C9F-3405E19F5EB5/Test.app/www/c2runtime.js:7692:20 readSuccessCallback@file:///private/var/containers/Bundle/Application/10120D53-9F87-454B-8C9F-3405E19F5EB5/Test.app/www/plugins/cordova-plugin-file/www/FileReader.js:160:24 readSuccessCallback@[native code] callbackFromNative@file:///private/var/containers/Bundle/Application/10120D53-9F87-454B-8C9F-3405E19F5EB5/Test.app/www/cordova.js:295:63 file:///private/var/containers/Bundle/Application/10120D53-9F87-454B-8C9F-3405E19F5EB5/Test.app/www/plugins/cordova-plugin-wkwebview-engine/src/www/ios/ios-wkwebview-exec.js:129:35 promiseReactionJob@[native code]

  • Hey LaurenceBedford. Awesome, I wasn't familiar with that feature request tool.

    I've submitted a more detailed explanation of the feature there:

    construct3.ideas.aha.io/ideas/C3-I-1410

    I hope others find this proposal interesting.

    In summary, the use cases I can think of for others looking at this thread:

    • Stitching together a random set of scenarios for an endless game. Useful for hyper casual games.
    • Loading an pre-orchestrated battle experience "event" into a larger game. Useful loading a complex boss fight or battle scenario into a Metroidvania or any big game.
    • Fading in and out preconfigured cinematic scenes in a continuously running main game layout. Useful for treating each layout as a cinematic to be loaded.
  • Hey dop2000

    Thanks for your suggestions. Here are my thoughts.

    Regarding the first proposal:

    That's a nice idea but like you said, it wouldn't really scale and it'd become pretty impractical/messy quickly I think. Also I believe it'd be very prone to bugs as you're effectively storing all the possible scenarios/content arrangements you want to load in areas off screen.

    Regarding the snapshot approach:

    I did consider this but again I think it's messy and introduces an "over the top" process into the development cycle in which we'd need to be regularly loading the layout up, grabbing the JSON, possibly altering it in some way and then adding it back into the project. Any small iteration of any scenario or layout would require this re-generation process.

    More thoughts:

    Considering we have the existing layout system that can compartmentalise the content that we would want to load, it seems like we'd be reinventing the wheel with the above approaches.

    I am wondering what Ashley thinks about this. Some kind of support for this feature would be really useful for a variety of games I think.

    Also, in case anyone is wondering, here is how the hacky C2 plugin I made previously worked. These were its methods:

    LoadLayoutLayer

    Description: Load layer {1} from layout {0} into layer {2} with offsets {3} and {4}.

    LoadWholeLayout

    Description: Load all layers with matching names from layout {0} with offsets {1} and {2}.

    The latter automatically mapped the layer names from one layout to another.

  • Does building for Android with Construct 3 export the APK directly?

    Or does it provide the gradle and build files for you to build the project?

    If it's the former, then it sounds like inspecting the manifest will help. You can learn about extracting the manifest from an APK here:

    stackoverflow.com/a/4191807

    If it's the latter, you should be able to view the manifest from the Android project.

  • Just to be extra clear about this. The reason why "set animation 'stand'" didn't work is because that's just affecting the animation of the character, which is purely visual. It has no bearing on the platform/movement behaviour of the object.

  • I haven't used the new beta, but are you sure this function is meant to get an argument?

    From the look of it, these functions are all mapped from regular JavaScript:

    developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getMonth

    Unfortunately Dates in Javascript are pretty complex and bizarre. There are a lot of different ways of achieving the same thing and the API has a fair bit of legacy.

    Maybe you can experiment with the regular JavaScript API in the Chrome console (or browser equivalent) and then try and apply those learnings to C3's API.

    And I'd recommend double checking that it really takes an argument, as I mentioned at the start.