Cocos2d-x ProgressTimer not showing up on Android

I am using Cocos2d-x v3.13 (#define COCOS2D_VERSION 0x00031300)

For some reason, some of my ProgressTimer nodes are not showing up on Android devices. They show up perfectly fine on the Android emulator, but on a Samsung S7 Test device, they are not there. Completely invisible. On iOS everything works as intended.

Here is a sample code I use:

Sprite *border = Sprite::create("HPbarBorder.png");
this->addChild(border);

health = Sprite::create("HPbarInside.png");
progressTimer = ProgressTimer::create(health);
border->addChild(progressTimer);
progressTimer->setAnchorPoint(Vec2(0, 0));
progressTimer->setType(ProgressTimer::Type::BAR);
progressTimer->setBarChangeRate(Vec2(1, 0));
progressTimer->setMidpoint(Vec2(0, 1));
progressTimer->setPercentage(100.0f);

Where progressTimer has a pointer in this specific class. The bar is a green bar, and there is nothing shown on the android device, only the back border sprite shows. Again, on Android emulator, and on any iOS the healthbar shows.

Let me know if you need any additional information, or have any idea why this ProgressTimer is not showing at all on Android device.

Thanks

Any help? This is a serious blocker and has blocked progress on our android build completely. We have many instances of ProgressTimer nodes, and none of them show up. Again, on iOS and android emulator we have no issues at all with the nodes showing up.

I think that I need more information. Can you show any pictures? Have you looked in cpp-tests?

What android version?

It is a Samsung Galaxy S7, running Android 7.0.

Here are some links to pictures (they were too large to attach directly).
The first 2 images are iOS vs Android on the gaussian backboard.
I took a screenshot directly from my iPhone, and then took a picture of the Android.
I render the background to a RenderTexture and run a guass filter over it, then I convert the Texture to a Sprite, and pop the Sprite in a ProgressTimer Node that animates up and down with the menu backboard.
You can see in iOS the Sprite is there, but in Android it is nowhere to be seen,


Similar in battle, we have health bars above all game nodes. I took images from iOS and Android, notice how the green ProgressTimer node is nowhere to bee seen on the Android device.


I am not doing anything different. And when I run the Android build on an emulator it shows all the ProgressTimer nodes. There are other instances throughout the game where ProgressTimers do not show up on the device.

What makes it more strange to me is that in only 1 Layer in the entire game do ProgressTimer nodes work, and that is the first scene of the game showing our title screen and company logo.

Sorry, clarify a bit more, your iOS and Android look the same to me, I’ll download and zoom in

On the first set of images, the ui menu has a gauss ProgressTimer behind it that blocks the scene. This is not on the android, it is invisible and you can see through the menu. On the second set, the health bars have green ProgressTimers in them that go down with health. There is no green to be seen inside the android health bars, just the backboard sprite.

I see now, thank you. Is this game open source to where i could try building it and stepping through code?

It is not open source. But I can share snippets of code if it will help.

You can do it privately if you need to.

Here is the .h file for the Healthbar:

#ifndef BuildingHealthBarNode_hpp
#define BuildingHealthBarNode_hpp

#include <stdio.h>
#include "cocos2d.h"

USING_NS_CC;


class BuildingHealthBarNode : public Node {
public:
    BuildingHealthBarNode();
    ~BuildingHealthBarNode();

static BuildingHealthBarNode* create();
void setup();
Sprite *health;
ProgressTimer *progressTimer;
void configureForShield();

void setHealth(float healthPercentage);
};

#endif /* BuildingHealthBarNode_hpp */

Here is the C++ file for the healthbar:

#include "BuildingHealthBarNode.hpp"

BuildingHealthBarNode::BuildingHealthBarNode() {}
BuildingHealthBarNode::~BuildingHealthBarNode() {}

BuildingHealthBarNode* BuildingHealthBarNode::create() {
    BuildingHealthBarNode* node = new BuildingHealthBarNode();
    if (node->init()) {
        node->autorelease();
        node->setup();
        return node;
    }
    CC_SAFE_DELETE(node);
    return NULL;
}

void BuildingHealthBarNode::setup() {
    Sprite *border = Sprite::create("HPbarBorder.png");
    this->addChild(border);

    health = Sprite::create("HPbarInside.png");
    progressTimer = ProgressTimer::create(health);
    border->addChild(progressTimer);
    progressTimer->setAnchorPoint(Vec2(0, 0));
    progressTimer->setType(ProgressTimer::Type::BAR);
    progressTimer->setBarChangeRate(Vec2(1, 0));
    progressTimer->setMidpoint(Vec2(0, 1));
    progressTimer->setPercentage(100.0f);
}

void BuildingHealthBarNode::configureForShield() {
    health->initWithFile("ShieldbarInside.png");
    health->setAnchorPoint(Vec2(0, 0));
    health->setPosition(Vec2(0, 0));
}

void BuildingHealthBarNode::setHealth(float healthPercentage) {
    float trueScale = healthPercentage*80.0f + 10.0f;
    if (healthPercentage == 1.0f) {
        trueScale = 100.0f;
    }

    progressTimer->setPercentage(trueScale);
}

I’ll try and make an example. I think there is an example in cpp-tests I’ll try and compile that for Android and see how it works.

Like I said before, the device is showing ProgressTimer nodes on our title screen correctly. The title screen only has about 10 nodes drawn. So I am wondering if there is a bug in the render pipeline. There is so much going on in that screen with the gauss menu I posted, hundreds to thousands of nodes. Do ProgressTimers have some sort of index limit etc in the render pipeline on certain devices.

I have found someone report something similar before:

I can’t switch to UILoadingBar as I need radial timers and other benefits of using the ProgressTimer node.

I’m sad to write this, but it’s almost impossible to get solutions for advanced topics in this forum.
Topics like “How to move Sprite”, “How to rotate Sprite” or similar topics gets solved. Anything above this will not even be answered. (That’s my experince with this community)

Yeah it is getting harder too. Devs are using so many different devices or not using a device at all. Simply using an emulator to release their games.

Also devs aren’t willing to share code. It is hard without a case that is reproducible.

What are you having an issue with now?