Page 1 of 1

Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 11:55 am
by ebeneezergude
I'll put this query here under RTC, as I found this issue in RTC (although still haven't really chosen between DSB and RTC as of yet...!).

My query: are there predefined limits for bitmaps when displayed within the viewport?

The problem: I have started creating custom graphics for a project. I have made bitmaps for, and tested, a newly created custom monster, and am finding that in certain instances the bitmap for a particular action is being clipped.

For example, when the custom moster displays the 'attack' bitmap, the bitmap is being clipped slightly on one side, so the bitmap loses approximately 5-10 pixels from one edge, and a visible edge is apparent. Consequently, it appears that the attack bitmap is not as wide when displayed in the RTC engine as it is in the RTC graphic import manager in the editor. The bitmaps is definitely clipped, not deformed or scaled. These are 24-bit .png bitmaps with transparency. The bitmaps file itself is fine, it is just when the bitmap is displayed in the viewport within RTC.

[EDIT] I should note that the bitmap is not overly big or huge. Am just replacing bitmaps on a cloned medium sized flying creature, although the bitmaps I have made are slightly bigger than the original DM ones.

Any hints/comments from those who have been through this learning curve already? What do I need to know or to look out for? This query is for RTC, and I have not yet tested monsters with DSB, however, the question also goes for DSB I guess. (Gambit, sorry if this makes this post in the wrong section...!)

Thanks in advance :)

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 1:49 pm
by linflas
did you check that the actual size of your bitmap is the same in your RTC txt file ?

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 2:10 pm
by ebeneezergude
Yep, they match correctly. Since the original post, I have now also noticed this only happens in certain places - for example, when the monster is next to a wall. It's like the monster bitmap goes 'through' the wall. It does't happen in an open space, or if the monster is on the side of the tile where there is no wall adjacent. Looks like an RTC drawing issue?

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 2:39 pm
by linflas
it looks like there must be a maximum scale for monsters, yes. i never experimented that or hadn't noticed.

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 2:57 pm
by ebeneezergude
Having measured a screengrab, it looks to be set at 65 pixels in from the side of the viewport. Also have now managed to test this in DSB with the same .png files, it doesn't happen in DSB.

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 5:09 pm
by Gambit37
It's due to the order that RTC "layers" the display. Each "row" of tiles is drawn from the back of the dungeon to the front.
So the front most side walls (when looking down a long simple corridor) will be drawn "above" any creatures on the tile in front of the player.
If your creature is very wide then those front walls will appear to "clip" your creature. The creature is being drawn correctly, but the wall has been drawn over it -- this would match with your measurements, since those side walls right at the fron of the display are usually 64 pixels wide.

Basically, avoid any creatures really wide or really tall.

Tip: Monsters should never be wider than the DM red dragon, and never taller than the DM golem, if they are going to be found wandering in a corridor.

Also, I don't know if DSB does the same thing as I haven't tested wide monsters, but I guess it does.

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 5:43 pm
by Gambit37
Quick image to explain:

The dragon is drawn by the engine BEFORE the frontmost grey walls. If the dragon were wider than the tile (shown by the yellow line) then you would see the dragon "clipped".

If your clipped images are not as wide as the dragon, then you've probably mistakenly set an X offset on your bitmap. Monster's X offsets should usually be left at ZERO.

A good tip is to grab the FRONT1 wall from the basic wallset and use that as a template. It's 320x222 -- if your creature bitmap is bigger than that, you'll get problems.

Image

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 6:33 pm
by Sophia
Yes, DSB does the same thing. It's just a natural consequence of how the "fake 3D" rendering in DM works.

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 8:28 pm
by Seriously Unserious
Also, if your monster is really big, you could try setting it to a limit of 1 monster per tile. This should force it to be centered on the tile and give you more of a margin of error. For example, that dragon in gambit's post would appear clipped if gambit were to create a clone of the dragon that could have 4 monsters per tile, and it went to a corner position on the tile.

If the flying creature you cloned is the coutle, or something similar, then if you are allowing more 2 or 4 monsters per tile then this is probably your problem right there, as I believe the coutle can have only 1 per tile (ie no groups).

Re: Clipped custom bitmaps in viewport

Posted: Mon Mar 11, 2013 8:32 pm
by ebeneezergude
Thanks guys, and thanks to Gambit - that picture literally tells a thousands words, as they. Your post was very useufl indeed.

So the long and the short of it is, RTC appears to draw it's flying wasp creature slightly more to the left than DSB does, which is why I guess DSB doesn't exhibit the same problem with my creature (the creature being a cloned wasp with a slightly bigger bitmap).

In RTC my custom creature does indeed stray over the edge of FRONT1 - your dragon screen grab lines up exactly with the point where my creature gets clipped on my screen grab. In DSB, for whatever reason, the same creature graphic is located slightly nearer the centre of the viewport when doing its 'attack' phase, and therefore does not exhibit the issue, although from what Sofia has just said, I guess if I increased the width of the 'attack' bitmap some more, I'd see some clipping.

So what have I learned here today? Alot! Thanks. :)