BigAtom Overlay ModeWorried about large mob counts with BigAtom? Want to avoid the occasional image breakup that happens with SYNC_STEPS? Overlay mode in the BigAtom library removes these issues entirely. This article will explain how to use overlay mode and the advantages it has over the default mode.
If all you want is a simple multi-tile display, without any special targeting of collision considerations, you should check the "BigAtom - Keep It Simple, Shadowdarke" article. It's a very short read and gets you running with a single line of code.
This article builds on the information in "Go BIG in Existing Games". That article covers all the basic BigAtom concepts, in particular how to change your existing code to work with BigAtoms properly. If you haven't read that article, you should probably do so before continuing with this one.
- The display never breaks up as it sometimes does in No Overlay Mode. (Unless you extend the pixel offsets too far. See Disadvantage 1 below.)
- You can cull unneeded atoms from the BigAtom's parts list, freeing up resources and making the library perform faster. I'll cover this in more detail below in Less Is More.
- Overlay mode only works for BigAtoms that are 7 tiles or less wide and high. If the BigAtom is too large, it will automatically switch to No Overlay Mode. Technically BYOND can handle larger offsets, but you will see the icon tear if the overlay + atom + movement offsets go outside of the range from -128 to 127. If you plan to make use of pixel_x and pixel_y you may want to limit your bigatoms to an even smaller size.
- Overlay mode BigAtoms will not display on the map until the bigatom_src is within one tile of the displayed map space. This means that very large overlay mode BigAtoms might already be one or two tiles onto the edge of the map before a player sees them.
- At the time of this writing (BYOND 412.977), Overlay mode BigAtoms do not flick() properly. Hopefully this will be fixed in the BYOND client in the near future.
|If the code was...||Overlay Mode Equivelent|
obj bigatom_mode=BIGATOM_NOOVERLAYS | BIGATOM_MAYMOVENULL
If you want to change to OverlayMode at runtime, you need to remove the BIGATOM_NOOVERLAYS flag, then call the bigatom_src's bigatom_Icon() proc to rebuild the display.
You can delete any of the sub-parts of an Overlay Mode BigAtom. The sub-parts are only required to help with things like targeting, density checks, and tracking when a mob enters or exits a turf or area. If you aren't worried about these things you can delete all the sub-parts and use only the single bigatom_src, which is the core atom.
Even if you do want the extra BigAtom features, we don't need every sub-part to provide the features. For targeting and simple enter()/exit() tracking, you can make due with just the corner parts (for a total of 5 atoms per BigAtom). For detailed density tracking, you will want to at least have every sub-part along the edges of the dense region. There is one important pitfall to remember if you are using a hollow region for density. It is possible that a small dense atom could get inside the hollow. If that happens, the BigAtom and the atom inside the hollow will probably be unable to move.
If you know ahead of time which sub-parts of the BigAtom you want to keep, you can use special bigatom_mode flags to automatically generate only the sub-parts you want:
- No subparts are created. (A single tile atom with a larger icon attached, but no targeting or collision benefits.)
- Only the corners are created. (At most 5 atoms per BigAtom, very limitted targeting and collision detection.)
- Parts at the north edge are created.
- Parts at the south edge are created.
- Parts at the east edge are created.
- Parts at the west edge are created.
- Parts are created around all the edges. (Only saves atoms if the BigAtom is larger than 3x3 tiles. Provides pretty accurate targeting and collision detection, but you have to be careful that it doesn't get a smaller atom stuck inside the edges.)
If you want to generate a pattern that you can't produce with BIGATOM_PARTS flags, you can delete any sub-parts you wish after the display is generated by the bigatom_Icon() proc.For example:
If you use a particular pattern often and think it would make a good general purpose addition to the library, by all means let me know on my forum and I may add a new flag to the library in your honor. :)
If you have any problems or need clarification please leave a post on my forum.