Skip to content

Instantly share code, notes, and snippets.

@jonathaningram
Created March 17, 2024 02:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathaningram/79fe2fdf331f6b98c2e4542c83e625e0 to your computer and use it in GitHub Desktop.
Save jonathaningram/79fe2fdf331f6b98c2e4542c83e625e0 to your computer and use it in GitHub Desktop.
Warhammer: Dark Omen .SPR Sprite x and y experiments

See comments

@jonathaningram
Copy link
Author

jonathaningram commented Mar 17, 2024

I took the BANNERS/HBGRUCAV.SPR sprite and I zeroed the x and y coords in it. This is what happens in-game:

image

image

For the on-screen banner: 32x32, x: -15, y: -31. x is one less than half the width. y is one less than the height.

See the unit’s directional arrow? Well in this screenshot, it is drawing the banner from that arrow to the right and down. You can tell the sprite is drawn exactly at the top of the arrow.

This arrow point is probably the unit position (because it's the exact point you can drag it from without the banner moving under click). So I think this banner's x, y says how to draw the banner from the unit's position. Anyway, I think.

For the off-screen banner, 16x24, x: -7, y: -23. x is one less than half the width. y is one less than the height.

I zeroed the x and y and it just disappears entirely. I thought maybe depending on if I got the off-screen banner to go to the north, east, south or west it might still show (just off by 7, 23) but it just seems to disappear.

@jonathaningram
Copy link
Author

Note: The off-screen banner image is also in the HUD and it also disappears:

image

@jonathaningram
Copy link
Author

I also tried to change the "battle message" buttons in SPRITES/MSG_ENG.SPR.

These are the 5 images in the sprite sheet:

image

These are the dimensions and x and y from those images:

0: 252x38, x: 0, y: 0
1: 252x38, x: 0, y: 0
2: 17x19, x: 4, y: 9
3: 19x21, x: 2, y: 9
4: 17x19, x: 2, y: 11

I zeroed the 3 buttons and there doesn't seem any obvious change in-game:

image

@jonathaningram
Copy link
Author

I didn't spend much time on the unit individual sprites, so still not really sure if/how they are used, but for the record here is SPRITES/BERNHD.SPR's dimensions and x and y data:

0: 23x57, x: -10, y: -56
1: 44x51, x: -24, y: -52
2: 59x41, x: -31, y: -50
3: 43x51, x: -22, y: -52
4: 24x56, x: -11, y: -55
5: 43x56, x: -19, y: -57
6: 59x48, x: -26, y: -57
7: 44x56, x: -18, y: -57
8: 28x57, x: -14, y: -56
9: 46x52, x: -25, y: -53
10: 59x43, x: -31, y: -51
11: 45x54, x: -24, y: -55
12: 26x60, x: -11, y: -59
13: 46x57, x: -19, y: -58
14: 59x49, x: -26, y: -58
15: 47x57, x: -19, y: -58
16: 29x58, x: -16, y: -57
17: 48x53, x: -27, y: -53
18: 59x43, x: -31, y: -52
19: 48x56, x: -26, y: -57
20: 28x60, x: -11, y: -59
21: 49x58, x: -20, y: -59
22: 59x49, x: -26, y: -58
23: 49x57, x: -19, y: -58
24: 28x58, x: -15, y: -57
25: 47x54, x: -26, y: -54
26: 59x43, x: -31, y: -52
27: 46x54, x: -24, y: -55
28: 26x58, x: -11, y: -57
29: 47x58, x: -20, y: -59
30: 59x50, x: -26, y: -59
31: 47x58, x: -19, y: -58
32: 23x58, x: -10, y: -57
33: 47x54, x: -26, y: -54
34: 59x43, x: -31, y: -52
35: 45x54, x: -23, y: -55
36: 24x56, x: -11, y: -55
37: 46x59, x: -20, y: -60
38: 59x50, x: -26, y: -59
39: 46x58, x: -19, y: -58
40: 23x59, x: -10, y: -58
41: 37x55, x: -19, y: -57
42: 48x44, x: -23, y: -53
43: 35x49, x: -16, y: -51
44: 24x52, x: -11, y: -51
45: 37x51, x: -17, y: -53
46: 48x48, x: -23, y: -57
47: 37x58, x: -16, y: -60
48: 27x58, x: -14, y: -57
49: 41x55, x: -22, y: -57
50: 49x44, x: -23, y: -52
51: 43x49, x: -23, y: -50
52: 25x51, x: -11, y: -50
53: 42x52, x: -18, y: -53
54: 49x49, x: -24, y: -58
55: 42x59, x: -17, y: -61
56: 29x62, x: -16, y: -61
57: 45x57, x: -25, y: -58
58: 53x43, x: -26, y: -52
59: 46x50, x: -25, y: -51
60: 27x52, x: -11, y: -51
61: 46x54, x: -19, y: -55
62: 53x50, x: -25, y: -59
63: 46x61, x: -18, y: -62
64: 27x62, x: -14, y: -61
65: 42x56, x: -23, y: -57
66: 50x43, x: -24, y: -52
67: 43x49, x: -23, y: -50
68: 26x51, x: -11, y: -50
69: 43x52, x: -18, y: -53
70: 50x50, x: -24, y: -59
71: 43x60, x: -17, y: -61
72: 22x59, x: -11, y: -58
73: 38x55, x: -17, y: -55
74: 53x46, x: -23, y: -54
75: 39x56, x: -16, y: -60
76: 22x64, x: -9, y: -63
77: 39x61, x: -21, y: -62
78: 53x52, x: -28, y: -60
79: 39x57, x: -19, y: -61
80: 27x58, x: -14, y: -57
81: 40x63, x: -21, y: -63
82: 48x52, x: -22, y: -59
83: 38x52, x: -18, y: -55
84: 25x52, x: -11, y: -51
85: 40x62, x: -18, y: -63
86: 48x55, x: -24, y: -63
87: 38x59, x: -17, y: -63
88: 28x63, x: -14, y: -62
89: 55x55, x: -24, y: -55
90: 55x43, x: -22, y: -52
91: 39x47, x: -20, y: -50
92: 26x52, x: -12, y: -51
93: 56x50, x: -31, y: -51
94: 54x44, x: -30, y: -51
95: 39x57, x: -16, y: -61
96: 47x32, x: -20, y: -31
97: 48x32, x: -27, y: -31
98: 48x32, x: -25, y: -31
99: 49x31, x: -23, y: -31
100: 48x32, x: -25, y: -31
101: 46x32, x: -18, y: -31
102: 49x28, x: -22, y: -31
103: 48x31, x: -24, y: -30

And a quick/partial screenshot hack of what his spritesheet looks like:

image

@jonathaningram
Copy link
Author

Also, following on from the banners test, we can zero all the outline sprites in SPRITES/HUD.SPR and show the same effect as the HBGRUCAV.SPR file. You can see Morgan's banner and outline start to be drawn from the unit position. The other 3 unit's outlines are also shifted (but I didn't change their banner hence why they are still correct).

So that solves the x and y as far as the on-screen unit banner, but not as a general solution to what x and y mean (at least that I can tell).

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment