Vanilla Doom secrets are always sectors with the sector special 9. Boom added a "secret flag" in the sector special allowing to combine it with other effects by adding the value 128 to said other effect. In UDMF and Hexen format, the secret flag for sectors is instead 1024, this change was required to support more sector special types.
More recently was added the ability to mark things as secret in UDMF by setting its "countsecret" spawn flag to true. It is also possible, but not advised, to give actors the COUNTSECRET flag, which will make them always secret wherever they are placed. Things marked as secret with either of these methods will be found when picked up; so only inventory actors should ever be flagged as secret.
Sector-based secrets are counted/triggered when the player is standing on the ground in the intended sector. Flying over the sector but not landing on the ground doesn't seem to trigger their discovery and give the player credit, so keep this in mind as you either build maps or play them.
A SECRETS lump can be provided in a mod to help find secrets. The secret console command will list the secrets declared for this level in this lump, if any, and will also color-code those found in green and in red those not found.
When discovering a secret, ZDoom will play the "misc/secret" sound. Strife provides a sound for this, DSYEAH, but the other classic games do not and ZDoom maps this sound to its own DSSECRET sound lump. This sound was created by Randi from .
The string displayed when a secret is found has the identifier SECRETMESSAGE. Its default value, "A secret is revealed!", comes from the game Blood.