MAV on command ImagesCollide

Archives Forums/Blitz3D Bug Reports/MAV on command ImagesCollide

Anthony Sherratt(Posted 2007) [#1]
I'm currently getting random MAV's with this command on my new system. I'm using the latest drivers for my graphics card and using on the latest Blitz3D. I've tried all the previous versions hosting on this site but still to no avail.

I am doing nothing special with my code just simply loading 2 AnimImages and checking for a collision. This will always randomly cause a MAV for no reason. All the parameters which have been passed are valid (frames are in range and coords have overlapped).

I have also noticed the images dont even have to overlap, as soon as their bounding boxes do also causes the error with this command.

As soon as I change the command to RectsOverlap (so that I dont check the images directly) the MAV's simply disappear.

Any help on this matter would be very grateful.

My system is as follows...
Core2 Duo 6700
Geforce 8800GTX
2Gig Ram
Windows XP SP2


skidracer(Posted 2007) [#2]
What are the dimensions of the source media and what parameters are you passing loadanimimage?


Anthony Sherratt(Posted 2007) [#3]
Details are as follows...

Image 1:
- PNG 24Bit
- 3170x176x24
LoadAnimImage("Image1.png", 66, 88, 0, 96)

Image 2:
- PNG 24Bit
- 468x240x24
LoadAnimImage("Image2.png", 52, 60, 0, 36)


GfK(Posted 2007) [#4]
Potential problem with your first image - 3170 is not equally divisible by 66.

Have you got debug off? That's usually the case when you get a non-descript MAV. Turn it on and it'll probably tell you you're trying to use an image frame that simply isn't there (or it would possibly even bomb out when you try to load the frames).


Anthony Sherratt(Posted 2007) [#5]
Yeah realised that actually, thanks anyway. So I changed the first sprite too 3168x176x24 (which is exactly 48*66/88*2) and I still get errors.

Ive always had debug on but unfortunately it makes no difference either, still gives me the MAV.

This is what I've noticed, the frame in which it crashes can be consistent if you run the code over and over but if you run some over code (such as a Direct x program or even something else in Blitz) this will cause the randomness of the crashes. I'm only guessing but could this be something todo with the way Blitz is checking graphics/system memory maybe?

I should also comment that I have also run my hardware through various scans for faults but all has come out fine.


big10p(Posted 2007) [#6]
I seem to remember an old bug that caused ImagesCollide to MAV ocassionally, on certain hardware, or something.


Gillissie(Posted 2007) [#7]
I don't have an answer, but I do have a clue. The 8800 series video cards have several issues. I've gotten a lot of graphical glitches on images created using CreateImage.

If I were you, I would rearrange that 3168x176 image so that it was narrrower and taller. In other words, put less frames on each row and make more rows. Try to keep your images smaller. Try 1056x528, with 16 per row, 6 rows.


Anthony Sherratt(Posted 2007) [#8]
Thanks Gillissie but I've tried this idea also with a 990 width (under 1024) and 462 (under 512) to see if its that helps. I've even tried using different images and sizes/frames but I still get random MAV errors.

Thing is I would also say this is a 8800 issue but I have sent the same code out to a few people I know. A good percentage are fine with the code (no errors) but 1 or 2 do still get the MAV errors and dont have these series of graphics cards.

Theres no definite answer but it seems to be steering towards more recent hardware/drivers which is causing it. Maybe a Direct X 9 issue ?


no nickname(Posted 2008) [#9]
Sorry for pushing this thread but I want to add something.

In my game I had also some random MAV's and it was definitivly the fault of the graphics card. I testet some NVidia and ATI cards and it seems to me like this bug is getting bigger and bigger. It's not only the 8800 series from NVidia which causes this crash.

Now I'm worried about ImagesCollide. How long is this command useable?
And is there any hope to fix this bug?

greetings, Christoph.


BIG BUG(Posted 2008) [#10]
Actually this command wasn't usable for the last few years(If you wanted your game to work on more than 65 % of PC configurations).
ImageRectCollide face the same issue btw.

I bet there won't be any fix ever, not by NVidia, not by ATI and certainly not by BRL.

So the only thing to do: NEVER EVER USE ImagesCollide AND ImageRectCollide!!!

There are other techniques like using Bounding Box and ReadPixelFast...
ImagesCollide is a simple solution, but not the best/fastest anyway.