Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Newest Fastest Macbook Pro has a serious Simulator display problem
Started by troylyndon Jun 27 2018 12:59 AM

- - - - -
88 replies to this topic
[TOPIC CONTROLS]
Page 1 of 4 1 2 3 »
This topic has been archived. This means that you cannot reply to this topic.
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

After researching my code, it seems that some FONT OBJECT DISPLAY code for displaying quickly on iOS will not work in the Mac Simulator. Has anyone else seen this problem?

 

I'm concerned that the same will be true on the fastest Android and iOS devices - I'll have to find out.

But in Simulator, this is a real problem that needs to be looked into.



[TOPIC: post.html]
#2

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,588 posts
  • Corona SDK

I'm not sure what you're asking / saying.  

 

Are you saying some fonts do not work in the simulator on your Mac?

 

Or are you saying they look different on iOS when you publish?



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

Can you find the Corona simulator icon in the /Applications/Corona-nnnn folder, right-click ( or ctrl-click ) and choose "Get Info" and let me know if "Open in Low Resolution" is checked or not?

 

Rob



[TOPIC: post.html]
#4

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@Rob, the "Open in Low Resolution" checkbox is NOT checked for Corona Simulator in the most recent build 3319.

 

I checked it and there was no apparent change in the Simulator's behavior that relates to my issue.



[TOPIC: post.html]
#5

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,588 posts
  • Corona SDK

I still don't understand the post.  What does this mean: "FONT OBJECT DISPLAY code for displaying quickly"?



[TOPIC: post.html]
#6

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

I have narrowed the issue down to display.capture - it's likely not related to the font, except that my code was merging numerous  images into a single group.

I'm creating a very small sample to show you the problem.



[TOPIC: post.html]
#7

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

Please take just a few moments to recreate this bug and see how it is fixed - but then, dive deeper to see that I've only uncovered one symptom of a larger issue.

A) The problem is definately display.capture. Do you have a way to thoroughly test it in Simulator to find the problem?

B) This next question is only related to the CoronaSplashControl plugin, which is NOT the problem, but disabling it does solve the problem in ONE case - in the example below. Read my full explaination in section 4. Is the CoronaSplashControl plugin deprecated? if not, I've only purchased it one time when it went into effect - but it says $99/year. And when I log in, it says it is Activated. It is really $99/one-time?

 

To recreate this bug, do the following:
1) Create a new project with NO config.lua
2) use this for a simple build.settings file:
settings = {
    splashScreen = { ios = { enable = false }, android = { enable = true, image = "Default-Landscape.png" } },
    orientation = { default = "landscapeRight", content = "landscapeRight", supported = { "landscapeLeft", "landscapeRight"}, },
    plugins = { ['plugin.CoronaSplashControl'] = { publisherId = 'com.coronalabs' }, },
}
3) make sure to create a Default-Landscape.png file
4) Here are the 36 lines of code for main.lua to recreate the problem - this should display 3 lines of text, but it only displays 2 lines. If you comment out the plugin, all 3 lines appear properly. What is strange, however, is that now when I go to my larger application and take out the plugin or splash code, the problem still exists. This tells me that in this sample, the display.capture is still defective on MacOS and even though it can be solved by taking out the plugin in this example, the underlying problem remains.
--=======================================================================================
local snapIdx=0
local img
local function toSnapObj(dispObj, x, y)
  if system.getInfo("platform")=="Android" then
    snapIdx=snapIdx + 1
    if snapIdx == 500 then snapIdx=1 end
    local fileName="tmp"..snapIdx..".png"
    display.save(dispObj,
      {
        filename=fileName,
        baseDir=system.CachesDirectory,
        captureOffscreenArea=false,
        backgroundColor={0,0,0,0}
      })
    img=display.newImage(fileName, system.CachesDirectory)
  else  -- iOS and Simulator on Mac OS
    img=display.capture(dispObj, {captureOffscreenArea=true})
  end
  img.x=x
  img.y=y
  display.remove(dispObj);dispObj=nil
  return img
end
--=======================================================================================
W=display.viewableContentWidth; H=display.viewableContentHeight
local font=native.systemFont
local fontSize=H*0.08
local x=W*0.50; local y=H*0.25
local text_D=display.newText("This is a test",x,y,font,fontSize)
text_D=toSnapObj(text_D,text_D.x,text_D.y)
local text2_D=display.newText("This is another test",x,text_D.y+fontSize,font,fontSize)
text2_D=toSnapObj(text2_D,text2_D.x,text2_D.y)
local text3_D=display.newText("This is YET another test",x,text2_D.y+fontSize,font,fontSize)
text3_D=toSnapObj(text3_D,text3_D.x,text3_D.y)
 

-- if you are wondering why I am doing this with these text objects, it's because my code actually does this with a group of numerous text shadows to create a single shadow object. In this sample, no shadow is necessary to see the missing object.

-- I am also converting hundreds of tiles into a single game board object using this technique, which significantly improves performance for my game board which is dynamically generated.



[TOPIC: post.html]
#8

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

This would be much more helpful if you put it together and put it in a .zip file and provide a download link to the file. I really can't take this to Engineering like this.

 

The splash screen control is $99/year and has to be renewed each year. It is not deprecated. Also keep in mind, deprecated means "it works for now, but may not work in the future", but even with that definition, it should be working and not deprecated.  The splash screen control plugin should have no effect on the simulator. It's interesting that it has any effect at all.

 

Why don't you have a config.lua? Does having a config.lua change the behavior?

 

Thanks

Rob



[TOPIC: post.html]
#9

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

Hi Rob,

1) Download the zip from www.mrgreatlife.com/Archive.zip
2) If you want, you can use the HelloWorld config.lua - no change in behavior.

3) I really do appreciate you getting the team on this right away. I cannot reliably test/check my game code in many places where display.capture is used on simulator - I use it in more than half a dozen places.

4) when do I have to renew the $99/yr? Will I get a notice before it is shut off? I thought it has already been a year.



[TOPIC: post.html]
#10

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

Is there a reason you are not using a config.lua?

 

As for the splash screen, you would probably get a message during building that you're not subscribed to the plugin. I can't look that information up, you will need to email support AT coronalabs.com and ask them to look it up for you.

 

Rob



[TOPIC: post.html]
#11

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

I wish you had not re-written your top post. What are your MBP specs again?

 

And can you provide a description or screenshot of what you're seeing vs. what you should be seeing? 

 

I see three lines of text. I need to tell the engineers what a failure looks like.

 

Rob



[TOPIC: post.html]
#12

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@Rob, I'm running:
macOS High Sierra, Version 10.13.4

MacBook Pro (13-inch, 2017, Four Thunderbolt 3 Ports)

Processor 3.3 GHz Intel Core i5

Memory 16GB 2133 MHz LPDDR3

Graphics Intel Iris Plus Graphics 650 1536 MB

 

  Model Name:    MacBook Pro
  Model Identifier:    MacBookPro14,2
  Processor Name:    Intel Core i5
  Processor Speed:    3.3 GHz
  Number of Processors:    1
  Total Number of Cores:    2
  L2 Cache (per Core):    256 KB
  L3 Cache:    4 MB
  Memory:    16 GB
  Boot ROM Version:    MBP142.0173.B00
  SMC Version (system):    2.44f1



[TOPIC: post.html]
#13

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

This was purchased on June 1, 2018 directly from Apple. It is their latest model.



[TOPIC: post.html]
#14

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

Can you provide a screenshot of what you're seeing?



[TOPIC: post.html]
#15

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

In this screenshot, you can see 2 lines of text. If you comment-out the plugin in build.settings, you will see 3 lines of text.

Attached Thumbnails

  • Screen Shot 2018-06-28 at 6.05.50 PM.png


[TOPIC: post.html]
#16

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,588 posts
  • Corona SDK

Troy,

 

I'm looking at your code and was wondering.  Can you try this for me:

local function toSnapObj(dispObj, x, y)
  if system.getInfo("platform")=="Android" then
    snapIdx=snapIdx + 1
    if snapIdx == 500 then snapIdx=1 end
    local fileName="tmp"..snapIdx..".png"
    display.save(dispObj,
      {
        filename=fileName,
        baseDir=system.CachesDirectory,
        captureOffscreenArea=false,
        backgroundColor={0,0,0,0}
      })
    img=display.newImage(fileName, system.CachesDirectory)
  else  -- iOS and Simulator on Mac OS
    img=display.capture(dispObj, {captureOffscreenArea=true})
  end
  img.x=x
  img.y=y

  -- CHANGE BEGINS
  timer.performWithDelay(60, function() display.remove(dispObj) end )
  -- CHANGE ENDS

  return img
end

I have found that deleting the the same frame as a display.save() or capture() sometimes causes issues.  Waiting one or two frames usually does the trick.

 

 

Also, FYI, this is unnecessary:

dispObj=nil 

That variable is temporary so you don't need to clear it.  It will go away and clear its reference to the object as soon as the function ends.



[TOPIC: post.html]
#17

roaminggamer

[GLOBAL: userInfoPane.html]
roaminggamer
  • Corona Geek

  • 7,588 posts
  • Corona SDK

You may be wondering, yeah, "but why does the behavior change when I comment out plugin".  Probably a timing change is all. i.e. Just random luck that helped you encounter the issue.

 

I seriously doubt the plugin itself has any effect on the rendering of text, especially since it doesn't run or do anything in the simulator.  Its possible, but ... well let's see what the delay I suggested does for you.



[TOPIC: post.html]
#18

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@roaminggamer, thanks for your time on this. I had already ruled out the delay, but I tested your recommended change anyway. No luck. I also changed it to a higher value, too - nothing different.

 

@Rob, I commented out the display.remove line just to see what would happen - please notice that you can see the corruption of the original text of the first line.
 

 

Attached Thumbnails

  • Screen Shot 2018-06-29 at 12.47.17 AM.png


[TOPIC: post.html]
#19

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@Corona, what's up with this issue? Can't you duplicate it? Although my example is simple, this happens all over my app and it looks as if it is poking into random memory - as I said, even once caused a hard crash on my Mac. Something in how the graphics are being displayed - its very serious. Sometimes, Corona just sits for 5-10 seconds with the wheel spinning in simulator, too. Please help.



[TOPIC: post.html]
#20

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

And nearly every button has its edges corrupted in my game, even the game title is corrupted.



[TOPIC: post.html]
#21

dodi_games

[GLOBAL: userInfoPane.html]
dodi_games
  • Contributor

  • 387 posts
  • Corona SDK

With great respect I want to comment and say that I have run the code without any problem with the hello world config lua in a $499 Mac Mini. I also wanted to say that the "screenshot" of the error seems like a child is playing with Windows paint, from the point of view of a graphic artist.

[TOPIC: post.html]
#22

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 26,072 posts
  • Enterprise

I'll have to check with the team again. I don't know that we have access to a Mac that can reproduce what you're seeing, but let me re-ask. 

 

Rob



[TOPIC: post.html]
#23

bc_new_theway

[GLOBAL: userInfoPane.html]
bc_new_theway
  • Observer

  • 11 posts
  • Corona SDK

@troylyndon
Can you try this code and see what you got?
I got an oval in my mac mini. But I got a blackscreen in my macbook pro (13 inch 2017  with no touch bar).

Attached Files



[TOPIC: post.html]
#24

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

Yes, I also have a black screen.



[TOPIC: post.html]
#25

troylyndon

[GLOBAL: userInfoPane.html]
troylyndon
  • Contributor

  • 617 posts
  • Corona SDK

@Rob and @CoronaLabs,

The example code attached above by @bc_new_theway is a great example of what doesn't work for both of us, and it's as simple as trying to fill an oval with a gradient color.

 

My MacBook Pro 2012 displays the oval with a nice soft blue gradient. But both of our MacBook Pro 2017 (latest editions) FAIL and show nothing but a BLACK SCREEN.

 

Until CoronaLabs fixes this, I am UNABLE to update my game. THIS IS SERIOUS, don't you think?




[topic_controls]
Page 1 of 4 1 2 3 »
 
[/topic_controls]