ModEnc is currently in Maintenance Mode: Changes could occur at any given moment, without advance warning.

Game compass

From ModEnc
Revision as of 09:01, 27 November 2009 by EvilRenegade (talk | contribs) (Replacing Template:TTL with Template:F.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Yuri's Revenge and other games based on the TS engine have at least two distinct systems of direction: A simple, and a fine-grained system. The simple system(s) are used for SHPs, due to their practically limited facing, while the finer-grained system is used for voxel-based units.


Simple System

In the simple system, 8 facings of animation are used for the 8 facings of the compass, with 0/first signifying North, and North being at the top edge of the screen.
This system is used for Anim on WeaponTypes, as well as for animations used for fire ParticleSystems. (Although fire systems only use 4 facings and re-use them on the opposite direction.)

The author has the feeling that infantries have a counter-clockwise ordering; someone please check this and update this section.
Someone also double-check if anims go clockwise or counter-clockwise.


Fine-Grained System

This system is used on flags such as PoseDir, where the possible values range from 0-255, giving more control over where a unit should face. Internally, judging from one of the comments, this seems to be converted to a so-called "FacingType". 0 is North, North being the top right-hand corner of the screen. The resulting compass looks like this:

Yr compass.png

Please note that, while PoseDir is used when an aircraft is created, once it departed, returned, and connects to the landing pad, it will align with the building's facing, i.e. North.
Also note how the (original) usage instructions of 1=NE, 2=E on PoseDir are wrong.


Indicators for Top-Right being North

Despite contradicting compassing on SHPs, from the comments inside Rules(md).ini is is quite evident that top right is indeed North, not just for voxel purposes, but in general.

Several comments list 0 as North

WindDirection=1         ; Direction of wind (gets converted to a FacingType, so 0 is north
                        ; and increasing numbers rotate clockwise)
;GEF PoseDir, despite the comments, is actually ranged from 0 to 255. I fixed DeployDir, and it actually works as described.
PoseDir=2               ; aircraft landing facing (0=N, 1=NE, 2=E, etc)
DeployDir=2                             ; Units that SimpleDeploy (Siege Chopper) will face this direction before doing so (0=N, 1=NE, 2=E, etc)

Aircraft's facing

insert screenshot of Harriers on pad here

Aircraft built with PoseDir=0 point to the top-right corner of the screen. (Comments for PoseDir clearly identify 0 as North.)

CAPARK04 faces top-right and is commented...

;Park Bench North facing
[CAPARK04]

NumberImpassableRows

With Refineries and Repair Depots, it is evident that the count of impassable starts from the top left; NumberImpassableRows is commented:

NumberImpassableRows=3 ; This is the fix to the Repair depots are flat and RadioContact/Enter means I can drive on you assumption.  It counts from game west

If we know NumberImpassableRows counts from top left, and top left is designated as West, top right must be North.

See also