Sprite display a black box instead of the sprite

0 favourites
  • 4 posts
From the Asset Store
Make a displayed number gradually increase or decrease, making an impression of a real-time counting.
  • Hi all,

    First, I know there is a special procedure to report a bug however I already found the problem and can solve it. The problem is the solution prevents me from adding more sprites. Moreover, the capx is 60Mo and my connection is just crap and keeps failing the upload. I'll keep trying to upload it but meanwhile, I was hoping somebody might already have an answer to this.

    Let me explain the problem because it is quite simple.

    I'm working on the Spooky Heroes project :

    scirra.com/forum/plateformerspooky-heroes_topic78999.html

    I have a lot of different characters (~20) with many animations (~20 per characters). I created a layout which is not used where I put all my sprites to be able to load them in the other stages layouts.

    The problem is that since I added the 2 latest characters sprites, some other sprites display a black box the size of the sprite instead of the sprite itself. Here is an example :

    <img src="http://www.spooky-heroes.com/images/bug1.png" border="0" />

    And here is the panel in the software :

    <img src="http://www.spooky-heroes.com/images/bug2.png" border="0" />

    As you can see, a torch should be displayed in place of the black box.

    My two latest characters are the elementalWater and elementalAir you can see in the second screen. When I delete them, the black box bug doesn't appear. Morever, I used a crystal ball Webgl effect on the characters before and the bug even happened to the UI (top left panel) displaying black box too. I removed the effect and there were less black boxes.

    There are only 3 lines of code related to those 2 new characters so I don't think this is a code problem.

    I'm guessing the bug comes from the way I use or call images. Is it ok to create a not used layout and just put everything there to be able to load them elsewhere ? I do that because players can choose heroes so I need all of them available, and some heroes are able to summon some other characters... I want to avoid copying all characters in all layouts each time since there will be a lot of stages (only 7 for the moment) Moreover each time I create a new hero or character, I'd need to add it to all layouts again...

    Once more, I'll try to upload the capx but if anybody could help without it, that's be very nice of them.

    Browsers affected:

    All

    Operating system & service pack:

    Window 8

    Construct 2 version:

    152

    Thanks !

  • There is really nothing we can do without a .capx. Have you checked if your graphics card drivers are up to date, or tested on different systems?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Finally uploaded, here is the link :

    spooky-heroes.com/Spooky_Heroes.capx

    I have not been able to check if the problem occurs on another computer, only have one.

    I just updated my graphics drivers and tried again but still, same problem.

    The preload layout contains all needed sprites.

    In the init sheet at the end, you can change the starting hero by changing "player1character" in the states dictionary.

    To reproduce the bug, open the mountain1 layout and load the game. Some sprites should not display properly.

    If you delete the elementalAir and the elementalWater from the project and change the player character to another existing, the problem does not occur.

    Also, since it's my first C2 project, there must be a lot of errors or optimization to do. Since the game runs quite well for the moment, just let me know if there are really huge mistakes in it.

    Thanks !

  • Can't reproduce, runs OK for me. I noticed Construct 2 is showing the estimated memory use at around 440mb. This is an extraordinary amount. The problem probably originates from extremely inefficient use of images and your computer is running out of memory so cannot display some images.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)