雑用担当の備忘録

技術的な話のみになります。翻訳データそのものはありません。 カテゴリ>その他>注意事項を必ず参照してください

2016年05月

Par〇d〇x の S〇〇〇〇〇〇〇〇 を解析してた時の話で主題は DDS の見方について
(Sのフォントは BitMap フォントで BMFont 出力しただけで使えるというお手軽な構成です。)

オリジナルの DDS を見ます
PS01
0xC: height (画像の高さ)
0x10: width (画像の幅)
そして
0x50: PfFlags = 0x41
ここをまず見ます
DDPF_RGB: 0x00000040
DDPF_ALPHAPIXELS: 0x00000001
より ARGB フォーマットだと判明します。

0x58: RGBBitCount = 0x20(32)
したがってARGB32になる。
この時点ではARGBなのかRGBAなのか等はまだ確定してない。

つぎに
0x5C: RBitMask
0x60: GBitMask
0x64: BBitMask
0x68: AlphaBitMask
を見る。Little endian に注意
ここより ARGB が確定する。

0x80: ここからが実際の pixel データになる。ARGB32 になっています。

今後の version up 対応もあるし難解かもしれませんが書いておきます。
NGUI の部分は変わらないと思うので記述する部分はそう変わらないと思います。

UIlLabel ( : UIWidget : UIRect)
7D2D_04_01
lblActivateInGame
UILabel

UIRect 部分
7D2D_04_02
public abstract class UIRect : MonoBehaviour
{
    public AnchorPoint leftAnchor;
    public AnchorPoint rightAnchor;
    public AnchorPoint bottomAnchor;
    public AnchorPoint topAnchor;
    public AnchorUpdate updateAnchors;
}
public class AnchorPoint
{
    public Transform target;
    public float relative;
    public int absolute;
}
より
leftAnchor.target = null;
leftAnchor.relative = 0f;
leftAnchor.absolute = 0;
rightAnchor.target = null;
rightAnchor.relative = 1f;
rightAnchor.absolute = 0;
bottomAnchor.target = null;
bottomAnchor.relative = 0f;
bottomAnchor.absolute = 0;
topAnchor.target = null;
topAnchor.relative = 1f;
topAnchor.absolute = 0;
updateAnchors = AnchorUpdate.OnUpdate

UIWidget 部分
7D2D_04_03
public class UIWidget : UIRect
{
    protected Color mColor;
    protected Pivot mPivot;
    protected int mWidth;
    protected int mHeight;
    protected int mDepth;
    public bool autoResizeBoxCollider;
    public bool hideIfOffScreen;
    public AspectRatioSource keepAspectRatio;
    public float aspectRatio;
}
より
mColor = Color.white;
mPivot = Pivot.Center;
mWidth = 114;
mHeight = 30;
mDepth = -20;
autoResizeBoxCollider = false;
hideIfOffScreen = false;
keepAspectRatio = AspectRatioSource.Free;
aspectRatio = 3.736842

UILabel 部分
7D2D_04_04
public class UILabel : UIWidget
{
    public Crispness keepCrispWhenShrunk;
    Font mTrueTypeFont;
    UIFont mFont;
    string mText;
    int mFontSize;
    FontStyle mFontStyle;
    Alignment mAlignment;
    bool mEncoding;
    int mMaxLineCount;
    Effect mEffectStyle;
    Color mEffectColor;
    NGUIText.SymbolStyle mSymbols;
    Vector2 mEffectDistance;
    Overflow mOverflow;
    Material mMaterial;
    bool mApplyGradient;
    Color mGradientTop;
    Color mGradientBottom;
    int mSpacingX;
    int mSpacingY;
    bool mUseFloatSpacing;
    float mFloatSpacingX;
    float mFloatSpacingY;
    bool mOverflowEllipsis;
    int mOverflowWidth;
}
より
keepCrispWhenShrunk = Crispness.OnDesktop;
mTrueTypeFont = font_body.ttf;
mFont = resources_00002.-15; (UIFont)
mText = "Pick up Item";
mFontSize = 36;
mFontStyle = FontStyle.Normal;
mAlignment = Alignment.Automatic;
mEncoding = true;
mMaxLineCount = 0;
mEffectStyle = Effect.Outline;
mEffectColor = Color.black;
mSymbols = NGUIText.SymbolStyle.Normal;
mEffectDistance = Vector2.one;
mOverflow = Overflow.ResizeFreely;
mMaterial = null;
mApplyGradient = false;
mGradientTop = Color.white;
mGradientBottom = Color(0.7f, 0.7f, 0.7f);
mSpacingX = 0;
mSpacingY = 0;
mUseFloatSpacing = false;
mFloatSpacingX = 0;
mFloatSpacingY = 0;
mOverflowEllipsis = false;
mOverflowWidth = 1;

となる。
今回いじっているのは UILabel.mTrueTypeFont と UILabel.mFont なのでこのアドレスが理解できると良いです。

7D2D_02_10
この Item pick up 部分は
level1_00504.-15 の UIFont mFont 指定部分を削除する。Font mTrueTypeFont; は記述があるので書き換える必要はない。
スキルアップとか下のアイテム欄の上に表示される lblTooltipLine 部分は level1_00167.-15 を同じように mFont 部分の指定を削除し mTrueTypeFont は記述がないので記述する。値は level1_00504.-15 と同じで良い。

ここまで書いて何のこと?と思われると思うのでどうしたら良いのか書きます。
UnityEx 等で各ファイルを抽出して修正後リパックしても良いのですがたぶん面倒だと思うので
バイナリエディタで修正する方法で書きます。
ファイルは 7DaysToDie_Data/level1 が編集対象(Ver146時点の情報)
バイナリエディタで開きます。
まず、lblTooltipLine 部分
7D2D_03_01
下の level1org がオリジナルのファイルで上が変更内容です。
つまり
E66A0:00 -> 02
E66A4:00 -> CC
E66A5:00 -> 19
E66AC:02 -> 00
E66B0:2A -> 00
E66B1:AA -> 00
と編集します。
次に Item pick up 部分
7D2D_03_02
1366AC:02 -> 00
1366B0:2A -> 00
1366B1:AA -> 00
7D2D_03_03
lblStealthIndicator
level1_00009.-15
7D2D_03_04
C2F60:00 -> 02
C2F64:00 -> CC
C2F65:00 -> 19
C2F6C:02 -> 00
C2F70:2A -> 00
C2F71:AA -> 00

クリティカルヒット部分
lblCriticalHitText
level1_00143.-15
7D2D_03_05
E09C0:00 -> 02
E09C4:00 -> CC
E09C5:00 -> 19
E09CC:02 -> 00
E09D0:2A -> 00
E09D1:AA -> 00

あとローカライズをリリースするときはゾンビ名は今のままでお願いします!w
----------------------------------------------------------------------------------
と編集すると良いです。
配布は差分パッチの形式にすると良いと思います。

以上なんですが、質問あればコメントしてください。
メニュー画面の話は 7x 解析(1) に書いてる通り可能ではあるんですけど
自分的にはそこは english のままでいいような気もするんですが。
ゲーム内の致命的な部分は対応しないと駄目なんでしょうが。

AntiCheat について書かれてる人が居ますが。まぁそこは、公式に Style.xml で上記の変更できない部分も変更できるように要望するしか無いように思います…

NGUI 解析用メモ たぶん意味不明です。
UIFont
7D2D_02_01
0x0: (0: 同じファイル)
0x4: (GameObject AgencyB_32)
0xC: 不明
0x10: (1: globalgamemanagers.assets)
0x14: (138: UIFont)
0x1C: 不明

public class UIFont : MonoBehaviour
{
    [HideInInspector][SerializeField] Material mMat;
    [HideInInspector][SerializeField] Rect mUVRect;
    [HideInInspector][SerializeField] BMFont mFont;
    [HideInInspector][SerializeField] UIAtlas mAtlas;
    [HideInInspector][SerializeField] UIFont mReplacement;
    [HideInInspector][SerializeField] List<BMSymbol> mSymbols;
    [HideInInspector][SerializeField] Font mDynamicFont;
    [HideInInspector][SerializeField] int mDynamicFontSize;
    [HideInInspector][SerializeField] FontStyle mDynamicFontStyle;
}

mMat = 0x20: (0: 同じファイル) 0x24: (7: Font Atlas.mat)
mUVRect = 0x2C-0x38: 0f, 0f, 0.5f, 1.0f
7D2D_02_02
public class BMFont
{
    [HideInInspector][SerializeField] int mSize;
    [HideInInspector][SerializeField] int mBase;
    [HideInInspector][SerializeField] int mWidth;
    [HideInInspector][SerializeField] int mHeight
    [HideInInspector][SerializeField] string mSpriteName;
    [HideInInspector][SerializeField] List<BMGlyph> mSaved;
}

mSize = 0x27 (39)
mBase = 0x20 (32)
mWidth = 0x100 (256)
mHeight = 0x100 (256)
mSpriteName = "AgencyB_32p"
7D2D_02_03
mSaved.count = 0xBF (191)

public class BMGlyph
{
    public int index;
    public int x;
    public int y;
    public int width;
    public int height;
    public int offsetX;
    public int offsetY;
    public int advance;
    public int channel;
    public List<int> kerning;
}
index = 0x20 ' '
x = 9
y = 32
width = 3
height = 1
offsetX = -1
offsetY = 38
advance = 7
channel = 15 (RGBA 1+2+4+8)
kerning = null
7D2D_02_04
0x1E38~
mAtlas = resources_00002.-16
mReplacement = null
mSymbols = null
mDynamicFont = null
mDynamicFontSize = 16
mDynamicFontStyle = FontStyle.Normal

UIAtlas
7D2D_02_05
0x0: (0: 同じファイル)
0x4: (GameObject.Font Atlas)
0xC: 不明
0x10: (1: globalgamemanagers.assets)
0x14: (646: UIAtlas)
0x1C: 不明

public class UIAtlas : MonoBehaviour
{
    [HideInInspector][SerializeField] Material material;
    [HideInInspector][SerializeField] List<UISpriteData> mSprites;
    [HideInInspector][SerializeField] float mPixelSize;
    [HideInInspector][SerializeField] UIAtlas mReplacement;
    [HideInInspector][SerializeField] Coordinates mCoordinates;
    [HideInInspector][SerializeField] List<Sprite> sprites;
}

material = Font Atlas.mat
7D2D_02_06
mSprites.count = 2

public class UISpriteData
{
    public string name;
    public int x;
    public int y;
    public int width;
    public int height;
    public int borderLeft;
    public int borderRight;
    public int borderTop;
    public int borderBottom;
    public int paddingLeft;
    public int paddingRight;
    public int paddingTop;
    public int paddingBottom;
}

name = 'Agency_32p'
x = 256
y = 0
width = 256
height = 256
borderLeft = 0
borderRight = 0
borderTop = 0
borderBottom = 0
paddingLeft = 0
paddingRight = 0
paddingTop = 0
paddingBottom = 0

0xB0~
mPixelSize = 1.0f
mReplacement = null
mCoordinates = null
sprites = null
7D2D_02_07
7D2D_02_08
7D2D_02_09
level1_00504.-15
7D2D_02_10
良さそう
最後の部分は styles.xml の修正だけでは pick up item はフォント変更が出来ないのですが level1_00504.-15 をいじれば変更できますという話です。
他にフォント変更できない致命的な部分があれば教えてください。

下のスキルアップ等が表示される部分
lblTooltipLine
00167.-15

↑このページのトップヘ