OpenBOR Wiki Graphics Graphics Overview

Graphics Overview

Often one of the first questions asked about OpenBOR is what sorts of graphics can it produce. The answer is that it’s almost easier to list the things OpenBOR can’t do rather than what it can. One downside is the large array of options can be rather daunting to a new creator. Fortunately, the very basics are all that’s needed to get a great looking module going.

Graphics in OpenBOR are represented by a series of 8bit color “sprites” (don’t conflate 8bit color with the misnomer of “8bit graphics”), displayed on a 32bit screen. Supported formats are .png (recommended), .gif, and pcx. Optionally you may use 24bit color .png for background images. There are three default scrolling layers, but you may add an unlimited number of additional layers as needed. OpenBOR also supports most common special effects, including rotation, scaling, tinting, clipping, blending (transparency), affine transformations (“mode 7”), alpha masking, sine wave, and more.

Screen

As above, it’s easier to list what you can’t do than what you can. Almost all of the numerical limits to OpenBOR’s graphics suite far exceed the limits imposed on professional creators.

For comparison sake, the following chart includes the SNES, Neo-Geo, and Saturn systems due to their ubiquity in sprite based gaming, and in the Saturn’s case, being the most powerful 2D specialized console to date. Note, comparing OpenBOR to hardware system specs is more or less apples to oranges – OpenBOR is a software driven engine, not hardware or an emulator. This is just to convey a general concept of OpenBOR’s graphical capability.

Platform Colors On Screen Color Palette Resolution Notes
OpenBOR~16.7 millionRGB320×240, 480×272,
640×480, 720×480, 800×480, 800×600, 960×540,
User defined
Neo-Geo3,84065,536320×224
SNES25632,768256×224,
512×448
Sega Saturn32,768, ~16.7 million32,768,
~1 million,
RGB (background only)
320×448,
320×512,
320×480,
352×448,
320×480,
352×512,
640×448,
640×480,
640×512,
704×448,
704×480,
704×512
The apparent conflict of color data on the Saturn is due to its dual video processors and a complex relationship of performance capabilities and restrictions. In all cases, resolutions of 640×448 or more impose severe performance penalties and are rarely used.

Sprites

Since OpenBOR is software, it obviously doesn’t have traditional hardware sprites. Instead, OpenBOR uses an array of objects we refer to as entities. The concept is similar, but rather than being hardware defined display objects, OpenBOR entities are self contained game world objects. A character in the game world, Mario for example, would be a single entity. Each entity has an effectively limitless array of animations it may play depending upon game conditions, user inputs, and so on. Each animation frame is represented by a single image. OpenBOR does not support tiled graphic sets. Instead, images are kept as is in the game file. Trimming and optimization are then performed on the fly when sprites load into memory.

For sake of argument, it is technically possible to stack OpenBOR entities together into a single larger unit using binding just as hardware sprites are stacked together to form a larger meta-sprite. However, due to the abundance of available color and user defined aspect of OpenBOR images, this technique is regarded as unnecessary. It is useful for particle effects and motion trails, but to date has never been employed to assemble the primary sprites in an OpenBOR module.

Example – Traditional Sprite

Here we see a typical Neo-Geo sprite: Ricky from Mutation Nation. The visual element on screen (often erroneously called a sprite) is actually a meta-sprite assembled from multiple hardware sprites. Neo-Geo sprites in turn are comprised of up to 32 vertically stacked 16*16 pixel tiles. In this case, a total of four hardware sprites are needed to generate the on screen meta-sprite.

Example – OpenBOR Sprite

OpenBOR sprites are user defined with no hard coded size limits, allowing a mostly WYSIWYG approach to game building. The transparent areas are trimmed automatically on load, so there’s no need to manually trim images.

Sprite Limit Comparison

Platform Sprites on Screen Sprites on Line Sprite Dimensions Colors Per Sprite Notes
OpenBOR50005000User defined per image.8 bit (256)Any sprites exceeding the limit simply aren’t drawn at all until there is room for them.
Neo-Geo3819616×16 up to 16×512 in 16 pixel increments.4 bit (16)
SNES128328×8,
16×16,
32×32,
64×64,

Only two sprite sizes may be in use at any one time.
4 bit (16)
Sega Saturn16,384555User defined 8×1 up to 504×255.4 bit (16),
6 bit (64),
7 bit (128),
8 bit (256), 32,768 (no palette)

Background

OpenBOR backgrounds are similar to hardware tilemaps, except just like OpenBOR sprites, the images are WYSIWYG, with auto trimming performed on load. There is no need (and no support) for using traditional tiling techniques. Several motion effects are available, including auto scrolling, water rippling, and color cycling.

OpenBOR background layers do not natively support animation. Instead, the engine supports placing models into the background to act as animated layers or objects. This is analogous to using sprite generated backgrounds in Neo-Geo creation or adding detail to backgrounds with sprites in other consoles, except without the restrictive hardware limits imposed by these consoles. If desired, it is also possible to add background animation with script control.

Platform Scrolling Layers Tiles Per Level Tile Size Colors Per Tile
OpenBORAll of the following are optional unless noted, and all may be used in concert.

* 1 panel layer comprised of three overlapped tiles (see tiles). This layer determines basic level layout and is required.

* 1 bitmap foreground layer. Appears in front of tile layer and scrolls at 1.5 speed.

* 1 bitmap “water” layer. Auto scrolls with landscape perspective or applies sine wave effect.

* 1 bitmap background layer. Scrolls at 0.5 speed. Required, but may be blank or of any size.

* Unlimited number of additional user defined bitmap layers. All attributes are definable and may be adjusted at any time (scroll speed, water effects, transparency, layer position, palettes, etc.).
100 panels, selected from up to 26 unique definitions. Panels are comprised of 3 overlapped tiles each, as follows:

* 1 primary, required (image may be blank if needed).

* 1 with alpha blending applied.

* 1 with neon effect (color table entries 128 – 135 are cycled by 2 every 3 seconds).

Neon layer must apply same color table as primary layer.
User defined. Tiles in a single panel must be the same size, but each panel size may be independent of the others.256,
~16.7 million (no palette)
Neo-GeoNone. The Neo-Geo possesses a single non-scrolling tile layer for text and HUD graphics. Backgrounds are generated by using sprites. Depending on other needs, there are typically enough to simulate 2 scrolling layers.NANANA
SNESThe SNES allows developers to choose between eight 0 indexed background modes each with unique layer and color caveats.

* 0: 4 with 4 colors each.

* 1: 2 with 16 colors each, 1 with 4 colors.

* 2: 2 with 16 colors each and independent tile offsetting.

* 3: 1 with 256 colors, 1 with 16 colors.

* 4: 1 256 color and independent tile offsetting, 1 with 16 colors.

* 5: 1 with 16 colors, 1 with 4 colors. Double resolution on either X or Y plane, may switch freely between.

* 6: 1 with 16 colors and independent tile offsetting at double resolution.

* 7: 1 with 256 colors, may be scaled or rotated. Setting scaling parameters by scan-line can be used to create perspective landscape effects.
32×32,
32×64,
64×32,
64×64
16×1616
Sega Saturn6 tile layers and up to 4 bitmap layers.User defined within 512KB work space. In most cases, enough for ~200 tiles.16×1616, ~16.7 million (no palette)

Special Effects

Platform Scaling Rotation Clipping Tint Transparency Distortion Sine Wave Shading Neon
OpenBORYesYesYesRBG channel adjust

RGB blended overlay

May use available tint effects in concert.
* Alpha Negative

* Alpha

* Overlay

* Hard light

* Dodge

* 50% Average blend

* User defined blend

* Alpha mask

User defined blend may used in concert with preset transparency modes.

Alpha mask overrides all other transparency modes.
YesYesNoPalette swapping

Palette entry rotation (background only)
Neo-GeoReduction onlyNoNo (Can approximate clipping with tile assembly)NoNoNoNoNoPalette swapping
SNESMode 7 background plane onlyMode 7 background plane onlyNo (Can approximate clipping with tile assembly) No* Alpha Negative alpha

* Hard light

* 50% Average blend
Transparencies must be applied to a layer, not individual objects. Only one transparency may be active on screen at any time.
Mode 7 background plane onlyNoNoPalette swapping
Sega SaturnYesYesNo (Can approximate clipping with tile assembly) No32 levels of average blendYesNoFlat GouraudPalette swapping

Other

Screens

World Heroes Timeless, illustrating the use of screens to create a picture in picture effect. The floating airship’s marquee is a screen duplicating all elements of the main display (including the screen itself) at 20% size. As the airship moves, the screen re-positions to follow.

OpenBOR allows creators to define any number of virtual sub windows within the main display called screens. Screens may be duplicates of all or part of the default display (which may include the screen itself or other screens), in addition to whatever additional content the author specifies. Screens may be moved and resized in real time to any desired dimension. You may also apply any combination of special effects directly to a screen, in addition to special effects applied to individual items within the screen. Screens are an extremely powerful tool – essentially any video effect you may have seen or imagined can be replicated with judicious use of screens. A few examples of screens in use:

  • Picture in Picture, such as an arena marque displaying all the action.
  • Full screen zooming (in or out) and rotation.
  • Adding full animation to title screens or backgrounds.
  • Applying a special effect to all or parts of the main display.
  • Storyboards with text and image overlays.
  • Fully interactive cut scenes.
  • Recoloring or adding other effects to smaller portions of layers and sprites.
  • Three dimensional landscape warping (SNES “mode 7” raster effects). Think Axelay, but with unlimited layers and no scrolling limitations.
  • Perspective Z axis scrolling (Space Harrier, After Burner, Super Hang-On). Again, without the layer and scrolling limitations these titles were bound to.
  • Any combination of the above, and many, many more…

Lucia’s Run prototype, demonstrating screens to build 3D effects. The ground and sky are vertically scrolling layers captured and drawn by screens with affine transformation.

Vector

OpenBOR includes a basic vector graphics suite. Scripted commands allow drawing lines, shapes, text, and images directly to the main display or a screen. All available special effects may be applied to vector graphics.

In the example below, the red line is drawn directly to screen by calculating a sine wave at runtime.

Related Post