Making an asset pipeline the hard way, using Python to generate C code
NCOT Technology
In this video I will be showing how I use data driven programming by creating tools in Python. These tools generate C code from JSON that is created by the sprite editor I am using. The idea is that by generating C code automatically, I can more easily incorporate sprites into my code without needing to hard code anything relating to them.
Data driven design is a good way to think about your code, it makes you less likely to put "magic" numbers in your source, and also forces you to think about how to handle multiple pieces of data, rather than just single items. For example once this tool has been created, I can load as many sprites as I like into my engine and it takes no more effort than doing a single sprite. It is also repeatable meaning I can automate the process of incorporating sprite data into the build process, creating an asset pipeline.
Chapters
00:29:58 Intro
02:02:50 how sprites are created
03:39:31 TODO list
05:57:31 Creating C using Python
09:54:57 defining enums for sprite state
10:27:19 Animation Definitions
12:19:24 Bug fixing part 1
13:41:18 Bug fixing part 2
13:56:46 Generating code using tools
14:49:20 Data driven design
15:26:30 Creating sprite animation definitions
18:18:46 Dodgy Python code!
19:31:29 Tidying up the Python
20:36:07 Next TODO list
21:02:42 Bug fixing part 3
22:19:47 Coping with multiple sprites
26:15:57 Broken code
26:35:55 Back to the beginning
26:46:55 Summary of what the code now does
28:11:23 The point of all of this
30:21:52 How I will use this code
31:05:58 Test animation code
32:32:19 Animation!
32:51:50 Plan for next time
34:05:40 Final summary
...
https://www.youtube.com/watch?v=SU4R0eKpZCE
312206737 Bytes