|
发表于 2013-1-4 10:39:21
|
显示全部楼层
Step by step guide to data editing
Part 2- Graphics continued
Frames and angles
Frame: A single static image of an slp is called a frame. Buildings generallycontain only one frame. Unit graphics on the other hand, contain dozens offrames. Eg., the slp gra00002 ( attacking archer ) has 50 frames.
Angle: This is a little confusing concept. An angle is a set of frames thatusually denotes a rotation. For example, the first 10 frames of slp gra00002form the first angle. However angles do not necessarily relate to rotation. Gaiaobjects ( the hay stack for example ) also contain multiple angles. The haystack has 3 angles. You can put down a haystack and change the angle using the'rotate' option on the units menu of the map editor.
A unit typically has 8 angles. However in an SLP only 5 angles need to bespecified. This is because the game engine recognizing the graphic as a unitgraphic will 'create' 3 angles - north eastern, eastern, south eastern. bymirroring the north western, western and south western frame sets.
Certain units have more than 8 angles eg. ships. Ships and their sailstypically have 16 angles. You can see the effect when they 'rotate intoposition'.
Buildings usually contain one angle. There are a few like the house which canbe rotated to give different views.
Now let's look at the data relating to frames and angles ingraphics_other.txt
graphic_627_numframes: 10
graphic_627_angles: 8
The value of numframes is the number of frames in a single angle. Remember,for a unit this number will be ( total number of frames / 5 ). This is becausealthough the unit has 8 angles, there are only 5 in the SLP and the other 3 arecreated by mirroring.
Now look up the number of frames of an attacking longbowman. It has 75.Therefore numframes should be changed to 15.
You can look up the resource for the attacking longbowman in DRS_Aok ( or MPS ) toconfirm ( resource 702 ).The 1st 15 frames will have the archer facing southwards, the next south westand so on.
So we should make the following change in patches.txt
graphic_627_numframes: 15
graphic_627_angles: 8
And our 'Archer to longbowman' mod is complete. This is exactly what oliverachieves with hex editing here, though this is a lot simpler.
Changing frames and angles can lead to a number of very interesting tricks.
Suppose the numframes is changed to x ( where x is the total number of frames) and angles to 1. Then it will go through the entire frame set and cannot berotated. In fact this is usually the case with flags.
Suppose I do this with a standing arbalest. Then he will appear to stand fora while in one angle, then rotate to the next and so on. In fact this is what Ihave done in the bombard tower's garrison graphic. ( look at patches.txt )
graphic_5258_slp: 2704
graphic_5258_numframes: 55
graphic_5258_angles: 1
( 5258 is the garrison tag graphic of the bombard tower and 2704 is the slpof the attacking arbalest. You can get these two values from Genied2 and the SLPlist )
In a similar way, if I use 1 frame and 100 angles. Then the unit will be'frozen' , but can be rotated to 100 different positions using the rotatecommand in the map editor. Eg.
graphic_1962_slp: 15014
graphic_1962_numframes: 1
graphic_1962_angles: 100
The graphic of SHALW is changed to the swamp terrain. 15014 refers to an slpin terrain.drs which contains the swamp terrain. This is used to create theimpression of 'shoreless shallows'. Btw you can use interface graphics as well.
The changeable cloud , changing trees etc. were all done using this. Try tofigure it out.
Delta values
One of the most important things, this allows you to combine severaldifferent graphic slots into one. Let's take another look at the ARCHR_AN andnote these lines..
graphic_627_delta_count: 3
graphic_627_delta_000: 625 0 0 0 0 0 -1 0
graphic_627_delta_001: -1 0 0 0 0 0 -1 0
graphic_627_delta_002: 626 0 0 0 0 0 -1 0
The value 625 refers to graphic slot 625. Look up the graphic slot 625. Youwill find that it references the slp 0. Similarly 626 references slp 1.
The value of -1 in delta_001 means no slot is used.
graphic_626_slp: 1
Of course slp 1 does not exist, you can look it up in MPS/DRS_Aok. It is notknown why ES chose to do things this way. However references to non existentslps will mean that no graphic will be displayed in it's place.
This notion of non existent slps abounds in the graphic slots. Consider thegalleon standing graphic.
graphic_3885_name1: WARGA_ANW
graphic_3885_name2: W
graphic_3885_slp: 2263
graphic_3885_unknown01a: 00 00 00 01 14
graphic_3885_unknown01b: -1
graphic_3885_replay: 1
graphic_3885_unknown01c: 00 00 00 00 00 00 00 00
graphic_3885_delta_count: 9
graphic_3885_sound: 428
graphic_3885_extras: 0
graphic_3885_numframes: 10
graphic_3885_angles: 16
graphic_3885_unknown02: 1 0.15 0
graphic_3885_unknown03: 3
graphic_3885_id: 3885
graphic_3885_type: 12
graphic_3885_delta_000: 3894 0 0 0 0 0 -1 0
graphic_3885_delta_001: 4065 0 0 0 0 0 -1 0
graphic_3885_delta_002: 4069 0 0 0 0 0 -1 0
graphic_3885_delta_003: 4073 0 0 0 0 0 -1 0
graphic_3885_delta_004: 4061 0 0 0 0 0 -1 0
graphic_3885_delta_005: 4077 0 0 0 0 0 -1 0
graphic_3885_delta_006: 4081 0 0 0 0 0 -1 0
graphic_3885_delta_007: 4085 0 0 0 0 0 -1 0
graphic_3885_delta_008: 1895 0 0 0 0 0 -1 0
This is the standing graphic for the west European ships. ( that is why it is_ANW , _ANE is for east European, _ANF for Asian , _ANM for middle eastern. Thisis seen in buildings too )
This graphic references the slp 2263, which does not exist. In factreferences to non existent slp 2263 abounds in graphics_other.txt ( and confusedme a lot ), it seems to be a favourite whipping boy :). So the galleon entirelydepends on its delta values for its graphics. These are no less than 8 separategraphics. The first one 3894 turns out to be the hull. The middle 6 are varioussails and the last one 1895 is the shadow.
The Juggernaut ship is made by copying the Arabic galleon and substitutingthe turtle ship's hull and shadow. Look up patches_graphics.txt
Displacement
It wouldn't be much good if you could combine various graphics if youcouldn't place them properly with respect to each other and got them all on topof each other. This is where the anchor displacement values come in. Take a lookat the new champion attack graphic from patches.txt
graphic_2896_delta_count: 4
graphic_2896_delta_000: 2896 0 0 0 0 25 -1 0
graphic_2896_delta_001: 2896 0 0 0 25 0 -1 0
graphic_2896_delta_002: 2896 0 0 0 0 -25 -1 0
graphic_2896_delta_003: 2896 0 0 0 -25 0 -1 0
The 2 values before the '-1' ( which I don't know what it stands for ) turnout to be the anchor displacements. They are in this form:
graphic_<slot number>_delta_<delta number>: <slot referredto> 0 0 0 x y -1 0
x is the distance from the left on which the new slot is placed. y is thedistance from the bottom . Thus if you want to place a flag 190 units on top ofyour unit, it should be like this
graphic_5258_delta_000: 4472 0 0 0 2 -190 -1 0
( bombard tower graphic )
A few more interesting things about delta values
1. Delta values can refer to themselves: See the champion example, itputs a copy of itself 25 units to the top, left, right and bottom of itself.However in this case, the original is not displayed ( there is no champion inthe middle )
2. Delta graphics do not inherit the number of frames and angles ofthe graphic slot. They behave independantly. Thus it is possible to combine abuilding with a unit ( see chu ko noi with wall )
3. Delta graphics reference to other deltas is ignored. Eg. if theelephant graphic slot referred to a boar standing next to it, and the boarreferred to a jaguar next to it , then the elephant will have only the boar, notthe jaguar. Had this been not so, 1. would have resulted in an infinite loop.
4. Delta graphics of higher index are superimposed on those of lowerindex. Eg. the sails of a ship are superimposed on its hull - not the other wayround!
Try aligning the sails/hull of the Renaissance gallease, oliver wasapparently too lazy to do it himself :)
Unknowns and otherthings
There are also several other useful things in the graphics data. Eg, the_replay value is 1 if it is meant to replay, 0 otherwise.
Some useful things also come packaged as unknowns. For example
graphic_627_unknown02: 0 0.07 0
The value in the middle is the amount of time in seconds to change from oneframe to another. If we change this to say 0.7, the archer will be really sloweddown in attacking. In my example I have slowed down the frame rate of thesamurai and the twohanded swordsman and speeded up the mill
graphic_2630_unknown02: 0 0.8 0
graphic_1083_unknown02: 0 1.06 0
graphic_380_unknown02: 0 0.0465 0
By the way, I do not randomly know which value contains what. It is a littlebit of intelligent guessing, looking at the corresponding numbers forprojectiles, which change frames extremely fast, and decaying graphics whichchange extremely slow. Then I change a value and test it to see if my guess isright.
There is a lot of other things in the graphics data which I haven'tdiscovered/forgotten to write just now. But that's all for now.
|
|