Multiple special land types in mask.png

2 replies [Last post]
Wuzzy
Wuzzy's picture
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 2012-06-20
Posts: 1301

In mask.png, you can use red to make a pixel indestructible, and you can use green to make a pixel bouncy.

But what do I do if I want a pixel to be both indestructible and bouncy?

I fear this is not possible with mask.png at the moment. If this is the case, I suggest the following:

Introduce 4 new colors for the possible combinations of bouncy, ice and indestructible.

  • Bouncy+Indestructible: RGB(255, 255, 0)
  • Bouncy+Ice: RGB(0, 255, 255)
  • Indestructible+Ice: RGB(255, 0, 255)
  • Bouncy+Indestructible+Ice: RGB(127, 127, 127)

Note that you can't use RGB(255, 255, 255) for the last one, because this color is already occupied.

Hi, I am a Hedgewars developer. Smile

nemo
nemo's picture
User offline. Last seen 3 weeks 21 hours ago. Offline
Joined: 2009-01-28
Posts: 1861

I was chatting w/ sheepluva about this last week.
Right now we use one byte for land flags

lfBasic = $8000; // black
lfIndestructible = $4000; // red
lfObject = $2000; // white
lfDamaged = $1000; //
lfIce = $0800; // blue
lfBouncy = $0400; // green

There's still room for 2 more flags in the future, if we wanted to add some new land ability to the engine (like, dunno, land that heals or damages or erodes or glows or spawns water particles or represents water or mud or something...)

The current colour system gets a little clunky then, but is handy for people who don't need to mix flags.
I was thinking that maybe we could support a fancy_mask.png where all those types get mapped to greyscale. So you could set an indestructible bouncy ice (0x40 + 0x08 + 0x04 = 0x4C) using the grey 4C4C4C.
Alpha would work the same as ever. People doing sophisticated stuff like this could keep track of their bit masks however they liked (layers, colour selections) but probably would only be doing it to small parts of the map anyway.

You could even flag parts of map as "damaged" which can have amusing effects with despeckling of thin lines when shot with a deagle. I have no idea what flagging something as both "lfBasic and lfObject" would do. probably nothing sensible.

We could possibly even support overlaying "fancy_mask.png" on top of a regular mask.

Heck, overlaying multiple mask_X.png files as a way to support overlaying multiple bitmasks would be an option too, although it would slow down loading.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

KoBeWi
KoBeWi's picture
User offline. Last seen 1 week 2 days ago. Offline
Joined: 2010-12-25
Posts: 564

How about the current limitation, but actual colors defined in config file? There could be default colors, but in map/theme config file, you can make something like: red = lfIndestructibleIce. I don't think that all the colors at once were used that often.

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]