Closed Fordi closed 3 years ago
Thank you! The blown-up spritesheet and naming scheme is a work of genius and we need to put this in some documentation somewhere :laughing:
I'm not kidding- I spent a half hour or so squinting at a zoomed, blurred image in a browser window trying to figure out what was what. And then trying to find something familiar to figure out which constant it was :grimacing:
I mean, me too. That's how I named most of them.
Then I realized I still hadn't figured all of 'em out, and I'd need to ask for help, and how can I make Sam not have to go through that for something they'd put out into the world and probably didn't want to look at anymore? Well, a zoomed table and row comments in the code would probably make that as easy as possible, right?
@Gadgetoid On the subject of asset prep - I see there's a python script to convert png's to 16bpp things, but what's the correct process for building a word array from that? I have a little node script I wrote for my own work (breaks the sprites out linearly in case you wanna tweak 'em), but I figure requiring users to have a C/C++ buildchain, python, and node is a bridge too far.
@Fordi
what's the correct process for building a word array from that
We're hoping to put together some more accessible web tools, but in the interim there are... uh... plenty of methods each about as correct as every other.
The 32blit Python tool supports converting arbitrary binary files to headers.
ld
does too, here's an example with the dingbads asset.
Build:
arm-none-eabi-ld -r -b binary -o dingbads.o s4m_ur4i-dingbads.16bpp
arm-none-eabi-objdump -t dingbads.o
dingbads.o: file format elf32-littlearm
SYMBOL TABLE:
00000000 l d .data 00000000 .data
00008000 g .data 00000000 _binary_s4m_ur4i_dingbads_16bpp_end
00000000 g .data 00000000 _binary_s4m_ur4i_dingbads_16bpp_start
00008000 g *ABS* 00000000 _binary_s4m_ur4i_dingbads_16bpp_size
Then add the file to your project sources and use in code with:
extern char _binary_s4m_ur4i_platformer_16bpp_start[];
buffer_t *platformer = buffer(128, 128, (void *)_binary_s4m_ur4i_platformer_16bpp_start);
void init() {
spritesheet(platformer);
}
Make it const ( I can't seem to get this to work ):
arm-none-eabi-objcopy --rename-section .data=.rodata,alloc,load,readonly,data,contents dingbads.o dingbads.o
arm-none-eabi-objdump -t dingbads.o
dingbads.o: file format elf32-littlearm
SYMBOL TABLE:
00000000 l d .rodata 00000000 .rodata
00008000 g .rodata 00000000 _binary_s4m_ur4i_dingbads_16bpp_end
00000000 g .rodata 00000000 _binary_s4m_ur4i_dingbads_16bpp_start
00008000 g *ABS* 00000000 _binary_s4m_ur4i_dingbads_16bpp_size
I tried to build all this into the PicoSystem SDK as "picosystem_asset" - https://github.com/pimoroni/picosystem/pull/29
This is lightyears better than what we have now, thank you, how do you feel about promoting it to a full-blown PR?
Sure, it's been near a week.
Boom! Thank you. Will have to carefully bring these over to MicroPython now.
In reply to: https://s4m-ur4i.itch.io/pixelart-items Here you go:
00 - cherry
01 - tomato
02 - banana
03 - orange
04 - eggplant
05 - carrot
06 - potato
07 - spinach
08 - ginger
09 - meat
0A - beans
0B - turnib
0C - strawberry
0D - pumpkin
0E - cucumber
0F - bowl of rice
10 - weapon: claw
11 - weapon: wood sword
12 - weapon: frost-sword
13 - weapon: axe
14 - weapon: sais
15 - weapon: morning star
16 - weapon: Hunters bow
17 - weapon: iron mallet
18 - fire arrow
19 - weapon: magic want - ice
1A - weapon: trident
1B - weapon: speer
1C - weapon: fire trident
1D - weapon: MG
1E - weapon: pistol
1F - weapon: shotgun
20 - green orb
21 - red orb
22 - yellow orb
23 - blue orb
24 - candy
25 - blue ruby
26 - button
27 - official letter
28 - coin A
29 - skull
2A - UI: check
2B - UI: cancel
2C - armor: wood
2D - armor: iron
2E - armor: gold
2F - armor: diamond
30 - corn
31 - broccoli
32 - cookie
33 - radishes
34 - weapon: magic mallet frost
35 - campfire
36 - weapon: automatic shotgun
37 - weapon: automatic pistol
38 - armor: body protector
39 - armor: wizard hat
3A - armor: iron helmet
3B - armor: viking helmet
3C - armor: leather boots
3D - armor: iron boots
3E - armor: gold boots
3F - armor: diamond boots
40 - UI: heart
41 - green slime
42 - coin B
43 - iron sword
44 - iron dagger
45 - leather vest
46 - dynamite
47 - health kit
48 - pilots googles
49 - demon king hat
4A - bomb
4B - watering can
4C - demons mask
4D - elven mask
4E - speech bubble A
4F - speech bubble B
50 - UI: half heart
51 - UI: heart empty
52 - UI: heart frozen
53 - butterfly
54 - torch
55 - stone piece
56 - playing card
57 - dize
58 - armor: high knight hat with decoration
59 - armor: high knight hat
5A - UI: arrow
5B - golden ring
5C - demons ring
5D - frost ring
5E - nature ring
5F - little pouch
60 - silver coin
61 - health potion
62 - magic potion
63 - Diamond ring
64 - emerald ring
65 - building block / materials: wood STACK
66 - building block / materials: stone STACK
67 - building block / materials: sand STACK
68 - building block / materials: biologic STACK
69 - building block / materials: lava STACK
6A - building block / materials: iron STACK
6B - building block / materials: ice STACK
6C - building block / materials: dark STACK
6D - building block / materials: gold STACK
6E - armor: knights shield
6F - large pouch
70 - golden coin
71 - empty health potion
72 - empty magic potion
73 - wings
74 - bone
75 - building block / materials: wood SINGLE
76 - building block / materials: stone SINGLE
77 - building block / materials: sand SINGLE
78 - building block / materials: biologic SINGLE
79 - building block / materials: lava SINGLE
7A - building block / materials: iron SINGLE
7B - building block / materials: ice SINGLE
7C - building block / materials: dark SINGLE
7D - building block / materials: gold SINGLE
7E - armor: mirror shield
7F - armor: normal shield
80 - dandelion
81 - red tulip
82 - grass
83 - blue tulip
84 - weapon: magic fire wand
85 - weapon: frost speer
86 - weapon: machete
87 - log
88 - mine
89 - weapon: reinforced large morning star
8A - weapon: double sided axe
8B - small stone
8C - weapon: silver sword
8D - weapon: silver greatsword
8E - weapon: diamond sword
8F - crown
90 - gold
91 - Diamond
92 - Ruby
93 - Emerald
94 - weapon: double sided great golden axe
95 - poison mushroom
96 - rope
97 - log with leaf
98 - empty speed potion
99 - speed potion
9A - emerald crystal
9B - seamonsters hat
9C - weapon: silver dagger
9D - weapon: rare silver dagger
9E - weapon: Diamond dagger
9F - kings crown
A0 - apple
A1 - small leaf
A2 - acorn leaf
A3 - large leaf
A4 - long leaf
A5 - mushroom
A6 - wood
A7 - UI: Star
A8 - bird
A9 - green ball
AA - iron key
AB - gold key
AC - gold worm key
AD - frost amulet
AE - fire amulet
AF - forest amulet
B0 - worm
B1 - small leaf eaten
B2 - acorn leaf eaten
B3 - large leaf eaten
B4 - long leaf eaten
B5 - small flower
B6 - medium flower
B7 - large flower
B8 - small iron totem
B9 - eyeball
BA - fish
BB - burger
BC - UI: sun
BD - note
BE - water
BF - ladle
C0 - avocado
C1 - white potion
C2 - yellow potion
C3 - green potion
C4 - red potion
C5 - candy cane
C6 - fried egg
C7 - weapon: iron sickle
C8 - climbing hook
C9 - cheese A
CA - cheese B
CC - UI: select
CD - UI: setting select
CE - spell: fire
CF - spell: fire missile
D0 - medical kit
D1 - deaths ring
D2 - blueberries
D3 - nice pink flower
D4 -
D5 - computer
D6 - headphones
D7 - stone tablet empty
D8 - stone tablet written half
D9 - stone tablet written full
DA - red demon (pupet)
DB - weapon: burning speer
DC - UI: Cursor
DD - spell: mana
DE - spell: mana rain
DF - spell: mana missile
E0 - large book
E1 - cabbage
E2 - container
E3 - rose
E4 - UI: spacer A
E5 - UI: spacer B
E6 - glass
E7 - UI: decrease
E8 - UI: increase
E9 - eagle
EA - green demon (pupet)
EB - blue demon (pupet)
EC - corpse
ED - UI: current
EE - spell: emerald splash
EF - spell: emerald thunder
F0 - UI: clock
F1 - UI: attention
F2 - battery cell
F3 - UI: Questionmark
F4 - UI: disabled A
F5 - UI: disabled B
F6 - weapon: bow
F7 - start marker
F8 - small start marker
F9 - Flag A
FA - Flag B
FB - Flag C
FC - Flag D
FD - UI: error
FE - spell: explosion
FF - spell: explosive missile
@samvieten oh wow, that's an exhaustive list! Thank you.
Haha. New PR incoming tonight.
I'm getting this done (PR #52) as fast as I can without messing things up, to avoid having people using main
start entering enums they'll have to change.
@samvieten thanks so much for doing this!
I couldn't really work out what all of 'em were supposed to be, but I did my best to guess.
Ref: #8
I pinged the creator on their twitter and itch page for this spritesheet. I'll keep this in draft a couple of days to give 'em a chance to have a look if they're interested. Though, even without Sam's help, "most names" is better than "half the names".
Reference img: