Defold 1.2.147 has been released

Defold 1.2.147

In this sprint we’ve added support for building with the iPhone 12 SDK.
This is a required change for releasing apps on the Apple app store.
It also means the minimum os version has been increased to iOS 8.

There is a new way to change projection function in your game.
You can now send a message to change it directly, without having to copy resources around:

msg.post("@render:", "use_stretch_projection", { near = -1, far = 1 })
msg.post("@render:", "use_fixed_projection", { near = -1, far = 1, zoom = 2 })
msg.post("@render:", "use_fixed_fit_projection", { near = -1, far = 1 })

Another change which is part of our 3D track is that we’ve updated our shader compiler.
You may now get warning messages when using bob and when compiling shaders.
It may warn about incompatible naming of keywords in your shader script.
See more detail at the last section of this post.

We’ve also fixed two issues with the hot reloading, and made a few other fixes.

For native extensions, we’ve added the possibility to include C/C++ headers from another extension.
This opens up the possibility to have “base extensions” where the common libraries reside, and you can build your own
extension relying on the functionality provided in the base extension. This way extensions doesn’t have to duplicate
libraries between them.

In the editor, we’ve also updated the update process. It will no longer automatically download the editor in the background.
Instead it will present you with a dialog asking for confirmation before you manually update the editor.

EDIT 2019-02-20: Sorry, premature announcement on this, it’s part of the alpha version of the editor, and will be shipped in
1.2.148.

Engine

  • DEF-3524 - Added: Added iPhoneOS 12 SDK support.
  • DEF-3737 - Fixed: Added details around is_music_playing() api and Android.
  • DEF-3763 - Fixed: Hot-Reloading fonts now respects the new texture dimensions.
  • DEF-3712 - Fixed: Hot-Reloading atlas in GUI now works.
  • DEF-3714 - Fixed: Added additional logging to dmScript::PushTable.
  • DEF-3721 - Fixed: Render script messages to change projection.
  • DEF-2633 - Fixed: Documented list of supported cipher suites for https requests.
  • DEF-3774 - Fixed: Engine crash when using many particles in GUI.
  • DEF-3758 - Fixed: Spawned tilemap and collisions not working properly.
  • DEF-3507 - Added: Updated shader compiler

Editor

  • Updated the Editor updater
  • Fix for “duplicate app” icons

Shader compiler compatibility warnings:

When building your project with Bob or bundling a project from inside the editor you might get compatibility warnings regarding your shaders. This is because we now do shader cross-compilation and it requires the shaders to be GLSL3.1 compatible. We automate most of the migration from GLSL1.4 but we cannot automate all the required changes.

What we cannot automate is related to the reserved ‘texture’ keyword. If we were to automatically rename variables in your shader script it would only lead to confusion so that needs to be done manually by you.

We have changed all the builtin shaders in Defold to use a different name (usually ‘texture_sampler’) but if you use any custom shaders you need to update these yourself.

The warning messages start with “Warning! Compatibility issue:” and the warning text includes the word ‘error’, this is perfectly normal - this means that the cross-compilation attempt failed but the actual build of your project works just as before. Note that the actual cross-compiled shader is not yet used by Defold.

This change is needed since Apple has deprecated the use of OpenGL and we will need to support Metal on apple devices.

It will be important to update your shaders as we continue to work on our new rendering backend. Once we have the new rendering backend in place, the warning will change to a hard error, so better to update now rather than later.

21 Likes

Fixed projection and zoom :vulcan_salute: :space_invader:

3 Likes

Have a hard time uploading to Apple App Store now:

Package Summary:

1 package(s) were not uploaded because they had problems:
/var/folders/pm/lxscjxv16nl45dvw32z4_xs80000gn/T/31C5BEBE-65D3-473C-9859-32F5E032E906/1443751542.itmsp - Error Messages:
ERROR ITMS-90096: "Your binary is not optimized for iPhone 5 - New iPhone apps and app updates submitted must support the 4-inch display on iPhone 5 and must include a launch image referenced in the Info.plist under UILaunchImages with a UILaunchImageSize value set to {320, 568}. Launch images must be PNG files and located at the top-level of your bundle, or provided within each .lproj folder if you localize your launch images. Learn more about iPhone 5 support and app launch images by reviewing the ‘iOS Human Interface Guidelines’ at https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen."
ERROR ITMS-90474: “Invalid Bundle. iPad Multitasking support requires these orientations: ‘UIInterfaceOrientationPortrait,UIInterfaceOrientationPortraitUpsideDown,UIInterfaceOrientationLandscapeLeft,UIInterfaceOrientationLandscapeRight’. Found ‘UIInterfaceOrientationLandscapeRight’ in bundle ‘com.strangequest.blastlands’.”
ERROR ITMS-90475: “Invalid Bundle. Your app supports Multitasking on iPad, so you must include the UILaunchStoryboardName key in your bundle, 'com.strangequest.blastlands’. Learn more (https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW40).”

I use the latest bob.jar (5f1c6286a8bb1cfd8505517c1734f6d0666bf5df) and also the inbuilt Info.plist (/builtins/manifests/ios/Info.plist) from latest Editor.

Hmm, it seems we got some wires crossed after all.
What we used to upload successfully to apple was

  • All the iOS launch images set in the game.project
  • DTPlatformVersion set to 8.0 in Info.plist
        <key>DTPlatformVersion</key>
        <string>8.0</string>

It seems that we missed correcting the platform version before the release.
Please let us know if this works for you!

6 Likes

Got quite similar problem on attempt to upload the new build to Appstore:

Changing DTPlatformVersion was enough, even without adding landscape launch images (I have only portrait-oriented ones)

1 Like

On this build i have a problem. I can’t build iOS bundle with native extension

Error Output
Failed to build engine remotely: Error in ‘admob/ext.manifest’: Invalid lib - ‘libs’: ‘z’

ext.manifest:
name: “admob”

platforms:

arm64-ios:
    context:
        frameworks: ["AdSupport", "AVFoundation", "AVKit", "AudioToolbox", "CFNetwork", "CoreData", "CoreGraphics", "CoreLocation", "CoreMedia", "CoreMotion", "CoreTelephony", "EventKit", "EventKitUI", "Foundation", "GLKit", "ImageIO", "JavaScriptCore", "MapKit", "MediaPlayer", "MediaToolbox", "MessageUI", "MobileCoreServices", "PassKit", "QuartzCore", "SafariServices", "Security", "Social", "StoreKit", "SystemConfiguration", "Twitter", "UIKit", "WebKit"]
        flags:      ["-stdlib=libc++"]
        linkFlags:  ["-ObjC"]
        libs:       ["z", "c++", "sqlite3", "xml2"]

armv7-ios:
    context:
        frameworks: ["AdSupport", "AVFoundation", "AVKit", "AudioToolbox", "CFNetwork", "CoreData", "CoreGraphics", "CoreLocation", "CoreMedia", "CoreMotion", "CoreTelephony", "EventKit", "EventKitUI", "Foundation", "GLKit", "ImageIO", "JavaScriptCore", "MapKit", "MediaPlayer", "MediaToolbox", "MessageUI", "MobileCoreServices", "PassKit", "QuartzCore", "SafariServices", "Security", "Social", "StoreKit", "SystemConfiguration", "Twitter", "UIKit", "WebKit"]
        flags:      ["-stdlib=libc++"]
        linkFlags:  ["-ObjC"]
        libs:       ["z", "c++", "sqlite3", "xml2"]

How can i solve this issue? (on previous editor no problem with this)

Ah… the irony.
In an attempt to make the allowed libraries accept all library names, it seems I accidentally made it disallow any libraries that are only 1 character long (“z”).

I should be able to fix this server side tomorrow.
As a workaround for now you could try adding an custom zlib implementation (.a) in you library folder, and let it link against that instead.

EDIT: Btw, is this perhaps a public extensions? If so, I can add it to list of extensions we test build against to make sure we don’t accidentally break stuff.
I’m really sorry for this regression.

4 Likes

This release version means upgraded OpenGL ES to 3.0 ? Does it support dFdx/dFdy ?

Even though I read the patch notes I was still confused when our game’s sprites were suddenly blurry even though we didn’t change anything about them.

texture_sampler

Very glad that you unified this across all of the texture types!

2 Likes

No, it’s still the same version. The thing that has changed is that the shaders you write must be compatible with GLSL3.1, meaning that certain variable names that were previously accepted (like “texture”) are now reserved keywords that you are no longer allowed to use as variable names. This is the only difference.

Point taken, we will make a bigger effort next time to improve the notification around the larger changes.

Thank you. Can you consider support tangent and OpenGL ES 3.0 or Vulkan ?

Yes, this is a first step towards a more modern rendering api. In fact, this change is due to the fact that Apple deprecated the OpenGL implementation, and we need to support Metal. One way to do that is to use MoltenVK, and if that goes well, we’re one big step closer to Vulkan support. That’s the idea anyways, and it’s slowly progressing.

4 Likes

So, I think that 3d games need tangent, this is a simple thing, if it don’t provide tangent, we lose some graphics technology like normal mapping, parallax mapping and SSAO.

2 Likes

Thanks for answer.

We use public extension - https://www.defold.com/community/projects/93085/

How can I do this?

By simply prefixing the include:

#include  <extension_folder_name/include/foo/bar.h>

I mentioned it a little bit here

Thank you,I’ll try it out.

1 Like

The above fix for iOS deployment still didnt work. It removed the 2 last errors (90474 and 90475) but still there is the iPhone 5 launch image that I cannot set or even find in game.project. It still complains about that one:

ERROR ITMS-90096: "Your binary is not optimized for iPhone 5 - New iPhone apps and app updates submitted must support the 4-inch display on iPhone 5 and must include a launch image referenced in the Info.plist under UILaunchImages with a UILaunchImageSize value set to {320, 568}. Launch images must be PNG files and located at the top-level of your bundle, or provided within each .lproj folder if you localize your launch images. Learn more about iPhone 5 support and app launch images by reviewing the ‘iOS Human Interface Guidelines’ at https://developer.apple.com/ios/human-interface-guidelines/graphics/launch-screen."

1 Like

Here’s a screenshot from our test app we used to upload to iTunes Connect.

I’m guessing you haven’t specified all the required launch images?
Note that Apple uses “multiple of”-paradigm to sometimes specify the sizes.
E.g. 2@ (320x568) is in fact (640x1136)

And here’s a list of all the launch images we set:

app_icon_120x120 = /assets/app_icons/icon_120.png
app_icon_180x180 = /assets/app_icons/icon_180.png
app_icon_76x76 = /assets/app_icons/icon_76.png
app_icon_152x152 = /assets/app_icons/icon_152.png
app_icon_57x57 = /assets/app_icons/icon_57.png
app_icon_114x114 = /assets/app_icons/icon_114.png
app_icon_72x72 = /assets/app_icons/icon_72.png
app_icon_144x144 = /assets/app_icons/icon_144.png
app_icon_167x167 = /assets/app_icons/icon_167.png
launch_image_320x480 = /assets/launch_images/ios_launch_320x480.png
launch_image_640x960 = /assets/launch_images/ios_launch_640x960.png
launch_image_640x1136 = /assets/launch_images/ios_launch_640x1136.png
launch_image_750x1334 = /assets/launch_images/ios_launch_750x1334.png
launch_image_768x1024 = /assets/launch_images/ios_launch_768x1024.png
launch_image_1536x2048 = /assets/launch_images/ios_launch_1536x2048.png
launch_image_1024x768 = /assets/launch_images/ios_launch_1024x768.png
launch_image_1242x2208 = /assets/launch_images/ios_launch_1242x2208.png
launch_image_2208x1242 = /assets/launch_images/ios_launch_2208x1242.png
launch_image_2048x1536 = /assets/launch_images/ios_launch_2048x1536.png
launch_image_2048x2732 = /assets/launch_images/ios_launch_2048x2732.png
launch_image_2732x2048 = /assets/launch_images/ios_launch_2732x2048.png
launch_image_1334x750 = /assets/launch_images/ios_launch_1334x750.png
launch_image_1125x2436 = /assets/launch_images/ios_launch_1125x2436.png
launch_image_2436x1125 = /assets/launch_images/ios_launch_2436x1125.png
1 Like