Posts

Showing posts from November, 2015

Generated code

When two months ago I created generator for RTTI code I didn't realize how this one script will change so much in my programming style. Right now I have already four of generators in my code base: RTTI - Generate part of my RTTI code. SID - Generate CStringID with already calculated hash Pimpl - Generate interface class. Enum - Generate toStringID, fromStringID functions. So what changed for me after writing this one generator that make difference ? I try not to do monkey job . To show you how this improve my workflow let's look on generator I wrote today: Generator of Enumerator functions: toStringID, fromStringID. This is simple problem where for some enumerators we want to have conversion from value to some verbose type. Some people may claim that this is not issue. You write functions once and they work. Later you just need to modify them when you do some changes in enum. This take like about half minute work  ... if we don't do mistake there. Then thi...

Tools Design

Image
Variable Set Editor - Main view Continuation of previous post :] this time with real examples :D Real tools design  This may look like joke but this one window took me ~3 days to do. This include all it's features and communication: Editor Engine. But this is reality. Creating good tools require time and I wasn't joking in  Summary  from previous post: "As you can see creating of good tools is not easy. You often need go back and forth to create something really useful. You don't want to modify everything by scripts in which you can make easily mistake. Good tool will for sure save you a lot of work and return effort that you spend on it." 

Few words about tools design

Image
Once again I will return to topic of tools. Mostly because right now this is the part of code I spend most of my time in.  I will focus in this post on one dialog: Variables Set Editor This one dialog may sound simple but if you start thinking more about it it's really complex tool.  So let's start with short description what Variables Sets are then lets move what we want achieve and in the end look on real implementation of this problem. Variables Set This is really simple system which allow you to specify some kind of properties. Right now I support only values of types:  StringID Float Vec4. Whole system may be use to store values like: life, attacks parameters, movement speed etc. In my case to this data have also access animation system which may request some kind of information which later may be use to control blends and generally its behavior. Because this is simple list of variables you want to be able to have some kind of hierarchy. i...