GAME: Weird black lines in scaled images

Messages are moved here (should anyone ever want to see them again) once they are no longer applicable to the current version (e.g. suggestions that have been implemented or bugs that have been fixed).

Moderator: George Gilbert

Forum rules
Please read the Forum rules and policies before posting.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

GAME: Weird black lines in scaled images

Post by Sophia »

This bug is so obvious, it really doesn't need a report, but I thought I would share something I noticed while working with scaled images-- it seems to only come up when I'm using 24-bit bitmaps. 256-color paletted images don't produce it.

I don't know if that helps at all. :)
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Ahh - other people have reported this before, but not been able to reproduce it (see some other threads below in this forum).

Can you please send me one of the bitmaps that you're having a problem with and I'll take a look?
User avatar
Ameena
Wordweaver, Murafu Maker
Posts: 7517
Joined: Mon Mar 24, 2003 6:25 pm
Location: Here, where I am sitting!
Contact:

Post by Ameena »

If you mean black lines appearing on images (monsters, wallitems etc) at a distance, this happens to me too. Not just in custom dungeons, but even in normal DM or whatever so maybe it's a problem with that version of RTC on certain computers or something /shrug. It's a minur nuisance but it's not exactly interfering with gameplay...I dunno if I mentioned it before.
______________________________________________
Ameena, self-declared Wordweaver, Beastmaker, Thoughtbringer, and great smegger of dungeon editing!
User avatar
DragonsLover
Craftsman
Posts: 109
Joined: Sat Jun 14, 2003 12:37 am

Post by DragonsLover »

You just need to change the resolution and it should be ok. Set the resolution to 16 instead of 24 and see...
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Could be the graphics card...I know mine only supports 16 and 32 bit, so if RTC is on 24 bit colour (as it used to be defaultly), the graphics used to mess up
User avatar
Suule
On Master
Posts: 656
Joined: Tue Aug 09, 2005 11:42 pm
Location: Warsaw, Poland

Post by Suule »

32 bit colour = 24 bit colours + 8 bits alpha. So there should be no problems in 32 bit colour mode... while there could be with 16 bit one.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Ok, I've posted a screenshot of the problem here: http://www.ojnk.net/dm/glitch.png

This glitch shows up at a variety of graphics settings, including AUTO.

Setting 16 rather than 24 makes this go away, but the title screen becomes quite ugly, as the background areas around "DUNGEON" and "Master" no longer match the rest of the background.[/img]
User avatar
Suule
On Master
Posts: 656
Joined: Tue Aug 09, 2005 11:42 pm
Location: Warsaw, Poland

Post by Suule »

Hmrrr... GG, what kind of scaling code you use?
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Does this happen for you all the time, or just sometimes?

As for the scaling code, it's an algorithm I wrote, so i'm more than willing to accept that there's a problem with it :wink:

Having said that, it works for most people, so it does point to there being a problem with the API I'm using to the graphics card rather than a problem with the algorithm itself. There are separate algorithms for 15, 16, 24 and 32 palettes (for speed it does direct manipulation of the memory) so it should cope with most things you throw at it.
User avatar
Ameena
Wordweaver, Murafu Maker
Posts: 7517
Joined: Mon Mar 24, 2003 6:25 pm
Location: Here, where I am sitting!
Contact:

Post by Ameena »

I'm sure this didn't used to happen with me in RTC...I first noticed it ages ago (and 0.34 has been out about that long I think hehe) so maybe it's the latest version or something...
______________________________________________
Ameena, self-declared Wordweaver, Beastmaker, Thoughtbringer, and great smegger of dungeon editing!
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

It happens all the time.

I don't see how this would be a graphics card problem-- I'm assuming your scaling algorithm just manipulates main memory and the graphics card's only job is to display the results.

If you're doing anything that tries to read VRAM you're just asking for trouble. It's not at all portable and tends to be hideously slow.
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Hmmm - if it happens all the time for all the bitmaps (except the walls themselves and flooritems which aren't dynamically scaled) then I agree that it does point to there being a problem with the algorithm. What we need to do is find out why your machine is different to (nearly) everyone elses.

Given that setting the resolution to 16 bit works for you (and everyone else) then that algorithm seems OK. Perhaps your graphics card is reporting its 24 bit when it's actualy 32 bit and so RTC is using the wrong scaling function for the graphics? Can you try hard coding the resolution in the config.txt file to use 24 and then 32 and see if one works but the other doesn't?

As for direct manipulation of memory, I didn't mean that of the graphics card, I meant that of the bitmap. It loads the bitmap into memory, fiddles with it and then sends the changed memory off to DirectX APIs (and so to the graphics card) to be written to screen as is - so no problems with speed / portability etc.
User avatar
Ameena
Wordweaver, Murafu Maker
Posts: 7517
Joined: Mon Mar 24, 2003 6:25 pm
Location: Here, where I am sitting!
Contact:

Post by Ameena »

If I had any clue what you were talking about and how to go about doing it, I'd try that too but umm...
Well the black lines are kinda annoying but not exactly a major big huge game-destroying problem so I will just cope with them ;).
______________________________________________
Ameena, self-declared Wordweaver, Beastmaker, Thoughtbringer, and great smegger of dungeon editing!
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Both 24 and 32 bit modes show the black lines. :(

As I mentioned before, loading a 256-color bitmap and using it causes the black lines to not appear. It only happens when I use truecolor bitmaps, at least when I load my own graphics sets.

I don't know if that helps. :)
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Can you send me one of the bitmaps you're having a problem with? Perhaps there's something funny about them (or more accurately, my algorithm can't cope with them)???
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Even better - can you also send me a compiled *.RTC file which contains one of your new bitmaps that has black lines on it.

I can then see if it has black lines on it when I play the dungeon; if it does, then I'll be able to examine the drawing algorthm and find out why. If it doesn't then it points to there being a problem with the graphics card!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Oh, well I have two fun thigns for you

a) I get the lines too when using various resolutions and colour settigns (screen is on 1024x768x32). It's on wall items only, and not the first scale (so infront of wall objects/text and one staep removed from the side of them) but in all other positions see vertical blakc lines. I tried 800x600x32, 1024x768x32, 800x600x16 - in fullscreen on and off

b) If I tell the thing to do 'auto' in fullscreen on, I get a psychodelic four images rotating around my screen! (Note I can still see the vertical glitch line as I get seasick) If I do an auto with fullscreen no , then the RTC window is reduced to minimum size so can't see any of the game!
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Sorry, have various thigns keeping me busy until next week, so can't look into it further, but my graphics card is a Radeon 9600 series if that helps
User avatar
DragonsLover
Craftsman
Posts: 109
Joined: Sat Jun 14, 2003 12:37 am

Post by DragonsLover »

Here's a suggestion:

Dungeon Master uses 3 images for representing an element. One where the party is near of it, one where the party is one square back and one where the party is 2 squares back, and more when the party is looking the object by side.

Why not keeping this in RTC?

Well... the bad thing is that when creating a new object, it requires to create the other ones too when they're far from the party.

Also, why not creating a new command in the RTC Configuration file:
SCALING_OBJECTS 1/0
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

As far as I remember RTC does let you choose when to scale, whether there are the six images for each or whether the engine does it itself...at least there used to be that option you nominated (scale=number) way back when I still paid attention to the graphics side!
User avatar
Gambit37
Should eat more pies
Posts: 13720
Joined: Wed May 31, 2000 1:57 pm
Location: Location, Location
Contact:

Post by Gambit37 »

Yes, you specify how many scalings are required for dynamically scaled images. These are things like monsters, items on the floor, wall decorations, etc.

The objects that Dungeon Master is talking about are things like floor grates, puddles, firepits etc -- thse require different views for when they are straight ahead comapred to when they are to one side. Those items are not scaled by the engine -- you are required to draw them all yourself.

RTC works exactly the same as DM in both regards.
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

George Gilbert wrote:Even better - can you also send me a compiled *.RTC file which contains one of your new bitmaps that has black lines on it.
I'll do one better than that, even, and send you the whole works. (Well, no .RTC, but there's a .txt and all needed bitmaps, so it's easy enough to compile it up)

It's just a small test dungeon that shows how (at least for me, anyway) 256-color paletted images don't cause the black lines, and 24-bit truecolor images do. For example:

http://www.ojnk.net/dm/blacklines.png

Anyway, the stuff is at: http://www.ojnk.net/dm/bugtest.zip

While making this quick little dungeon I noticed another bug that I wasn't sure if it had already been addressed-- it seems that the monsters flicker back and forth between my custom bitmap and the default slime devil bitmap. (Which is what I cloned them from) I wonder if it does this for anyone else, too?
User avatar
beowuuf
Archmastiff
Posts: 20687
Joined: Sat Sep 16, 2000 2:00 pm
Location: Basingstoke, UK

Post by beowuuf »

Someone reported seeing gigglers not their cloned montser, don't know if that stemmed from the same place, as it was a generation bug thingie
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Thats great thankyou. Sadly, it works for me (i.e. no black lines at all) - I'll keep looking. A couple of observations though:

1) The flicking back and forth is because you haven't changed the side (or attack) bitmaps for your cloned monsters. When they're facing directly forwards or away from you the new bitmaps are shown, but when they turn sideways they use the old bitmaps. If you change your txt file to use your new bitmap for all the orientations then it will work as you expect :wink:

2) From your png image, its interesting that it's only the background (rather than the monster itself) that has black lines on it. This shows that there isn't something fundamentally wrong with the scaling algorithm, but possibly something wrong with the transparaency code. I'll take a closer look at this!
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Hmmm - It looks like you've got the anti-alias option turned off in the config.txt file; does the problem still occur when you turn it on?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

Unfortnately, the problem becomes even worse with anti-aliasing on! Now, even the masked portions of non-scaled bitmaps get black lines.

http://www.ojnk.net/dm/antialias.png
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Interesting...that's given me a few more leads to chase up!

How about caching turned on / off. I presume that this makes no difference whatsoever?
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

It makes a difference... it makes my framerate awful! :wink:

Seriously, though, no, the lines are there with caching off as well.
User avatar
DragonsLover
Craftsman
Posts: 109
Joined: Sat Jun 14, 2003 12:37 am

Post by DragonsLover »

Just a little question: Is the background of the character portrait is grey or pink?
User avatar
George Gilbert
Dungeon Master
Posts: 3022
Joined: Mon Sep 25, 2000 11:04 am
Location: London, England
Contact:

Post by George Gilbert »

Sophia, can you let me have an email address that I can send you a test program I've just written on? Bascially it will run RTC and dump out some diagnostics about how the graphics are being drawn - you can then send me the output and hopfully this will help narrow down what the source of the problem is!
Post Reply