Sprite display a black box instead of the sprite

Bugs will be moved here once resolved.

Post » Sat Dec 14, 2013 3:55 pm

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 :
http://www.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 :



And here is the panel in the software :



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 !
B
10
S
2
Posts: 67
Reputation: 690

Post » Sat Dec 14, 2013 5:37 pm

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?
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,226

Post » Sun Dec 15, 2013 2:28 am

Finally uploaded, here is the link :
http://www.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 !
B
10
S
2
Posts: 67
Reputation: 690

Post » Sun Dec 15, 2013 9:50 am

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.
Scirra Founder
B
387
S
230
G
87
Posts: 24,248
Reputation: 192,226


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 1 guest