GAME: Weird black lines in scaled images
Moderator: George Gilbert
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
- 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
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.
I don't know if that helps at all.
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
- Ameena
- Wordweaver, Murafu Maker
- Posts: 7517
- Joined: Mon Mar 24, 2003 6:25 pm
- Location: Here, where I am sitting!
- Contact:
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!
Ameena, self-declared Wordweaver, Beastmaker, Thoughtbringer, and great smegger of dungeon editing!
- DragonsLover
- Craftsman
- Posts: 109
- Joined: Sat Jun 14, 2003 12:37 am
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
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]
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]
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
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
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.
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
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.
- Ameena
- Wordweaver, Murafu Maker
- Posts: 7517
- Joined: Mon Mar 24, 2003 6:25 pm
- Location: Here, where I am sitting!
- Contact:
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!
Ameena, self-declared Wordweaver, Beastmaker, Thoughtbringer, and great smegger of dungeon editing!
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
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.
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.
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
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.
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.
- Ameena
- Wordweaver, Murafu Maker
- Posts: 7517
- Joined: Mon Mar 24, 2003 6:25 pm
- Location: Here, where I am sitting!
- Contact:
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 .
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!
Ameena, self-declared Wordweaver, Beastmaker, Thoughtbringer, and great smegger of dungeon editing!
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
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!
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!
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!
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!
- DragonsLover
- Craftsman
- Posts: 109
- Joined: Sat Jun 14, 2003 12:37 am
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
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
- Gambit37
- Should eat more pies
- Posts: 13720
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
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.
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.
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
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)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.
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?
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
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
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!
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
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!
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
- Sophia
- Concise and Honest
- Posts: 4240
- Joined: Thu Sep 12, 2002 9:50 pm
- Location: Nowhere in particular
- Contact:
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
http://www.ojnk.net/dm/antialias.png
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
- DragonsLover
- Craftsman
- Posts: 109
- Joined: Sat Jun 14, 2003 12:37 am
- George Gilbert
- Dungeon Master
- Posts: 3022
- Joined: Mon Sep 25, 2000 11:04 am
- Location: London, England
- Contact:
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!