This page illustrates how to modify sprite placement values on the DGRP tab panel.
Sprite placement:
A given object tile may use one or more sprites, which are collectively referred
to as a draw group. For example a computer object usually has separate sprites
for the computer monitor and the screen display, as well as a hard disk light.
The position for each of these sprites relative to the tile is defined in the
DGRP resource. For multi-tile objects the situation becomes more complicated,
since the different tiles have to be placed correctly on the lot grid. This
discussion is mainly concerned with single-tile objects since the default
interface shows one tile at a time, although tiles can also be viewed in
context as of version 1.1.8. The selected sprite can be changed with the sprite
pop-up menu if necessary.
An object on its tile can be imagined to sit inside an invisible grid box formed by a base of tiles. This grid box is one wall panel in height and outlined in red in the tab panel graphic view. The X, Y coordinates as specified in the DGRP resource correspond to the lower left hand corner of the p-sprite bounding box. Note that in this particular coordinate system the centre of the tile is coordinate (0,0), the top of the screen is negative Y territory and the bottom is positive Y territory.
Example of an object on its tile.
Birdhouse image courtesy of PJ at
SimFreaks
This screenshot shows an earlier version of IFFSnooper. There are more settings
in the current versions.
Editing the sprite ID reference
If you enable this checkbox option, then you can edit the sprite ID. This will
replace all instances of the old sprite ID in the current resource with the new
sprite ID, and the old sprite image on screen will be replaced by the new sprite
image.
Editing the X and Y coordinates
The X and Y coordinates can be altered directly by typing in new values, and the
sprite will move accordingly. Values outside the range -999 to + 999 are ignored.
Editing the flip state
There is a check box which allows you to flip the sprite image if desired. If an
SPR2 resource only contains six frames, you can generate twelve views in game by
flipping the frames. This is frequently done for objects like chairs which have a
plane of symmetry.
Editing the glow state
There is a check box which allows you to set the sprite image glow flag if
desired. This was called the flicker state in earlier versions of IFFSnooper,
since one of the main uses in game is to make fire sprites glow, and flicker when
animated. Further investigation reveals that a sprite with this flag set will
stay lit after dark, as if it were daytime. This can be used for mood lighting
effects.
Are all DGRP resources organized the same way?
No. Most of the DGRP resources have version code 20004, but there are a few older
versions which have fewer and/or shorter data fields. IFFSnooper is capable of
displaying resource versions 20001, 20003 and 20004 correctly. The multisprite
display for version 20000 (found in the original Maxis Computers.iff file) is
still under investigation, as the PixelX and PixelY values seem to be handled
differently than in later versions.
What is the bounding box?
This bounding box is defined in the SPR2 resource as part of a larger sprite
frame, for reasons best known to Maxis. The SPR2 tab panel display shows the
sprite position relative to the top left corner of this larger frame.
TMog does not
show the bounding box in its drawgroup view.
Why is the computer/lamp/etc. sitting on the ground?
The final position of the object in game can be altered by the BHAV resources.
This includes changing the position relative to the floor tile for objects that
go on tables.
Object position in game can also be influenced by the drawgroup Z offset, as is the case for the Maxis fire alarm and the Maxis fireworks rocket.
What about animated objects?
Some drawgroups are part of an animation sequence. The length of this sequence is
defined in the same OBJD resource which assigns the
initial DGRP to a given tile. The animation is controlled by SimAntics code in
the object's BHAV resources.
What about dynamic sprites?
Some of the sprites in a drawgroup may be defined as dynamic in the same OBJD resource which assigns the DGRP to a given tile.
Dynamic sprites can be turned on and off in BHAV code to allow for further visual
effects (such as removing pillows from the bed) or to allow for multiple visual
states within one drawgroup (such as the snowman in Vacation).
What are the other values in the DGRP table?
A DGRP resource normally contains twelve sections, each defining the sprites used
for a given view.
The X and Y offset modifiers are not currently editable. This should not affect placement of a cloned object in game.
Starting with version 1.1.6 there is a Show Tiles button which identifies a second set of coordinates used to assemble multi-tile objects. These tile coordinates are defined by the OBJD subindex field. Dark blue coordinate values are used for tiles that are part of the object, while unused tiles have light blue coordinate values. Tiles are not shown if their coordinates are less than zero.
Example of a drawgroup with added tile coordinates.
File StairsSweepingReverse.iff by Maxis
New since 1.1.7 : multisprite display
The default DGRP display on the IFFSnooper tab panel is one sprite at a time.
Nevertheless it may be useful to see all available sprites at once. The View
-- DGRP resource submenus can modify how the DGRP sprites are displayed.
Example of a drawgroup image with multiple sprites (using IFFSnooper 1.1.7, MacOS X 10.2.8).
see here for more details
There is more information about sprites here