Deep Kranzky

Kranzky's Dairy

2018-07-24

Long, busy day. Heaps to do at work. Skipped lunch with Wil, and cancelled meeting with Will tomorrow. Eliza off early due to parent-teacher meetings; she had a ball visiting her old primary school with her friends. Walked home with both kids, just like old times (sob).

Dzung out for Chang’s birthday, after rushing home to meet with Eliza’s maths teacher. She’s a great mum. I took the kids to the shops to buy ingredients for Eliza to make tomorrow night’s dinner. Then picked up a huge feast of fish and chips, which we ate while watching the beginning of “Spiderman: Homecoming”.

Still working into the evening. Will watch an episode of Handmaid soon, then crash. No time to even think about HackTile.

2018-07-23

Got some chores done once kids were at school. Lots of work-related chatter. Did three or four hours over the weekend so took it easy. Feeling less sore today, so did three circuits of the 7-minute workout while listening to a podcast. Eggs, toast and coffee for lunch while watching an episode of The West Wing (now that I’ve caught up on the podcasts I need to watch a few episodes again).

Thinking about rules. Lots of thought experiments, like having magnets that repell a ball. What happens when a ball-magnet pair face each other with a gap in-between? There are three possibilities.

  • One ball wins, which blocks the other ball from moving. This isn’t ideal, because it breaks the assumption that all rules are processed in parallel. Why would one win?
  • Neither ball wins (we detect there is a conflict, which causes both rules to fail). This isn’t ideal, because there’s an obvious gap for the balls to move into.
  • Both rules succeed, and the two balls begin moving towards each other. But then both rules are reverted (because of the conflict) and they move back to their original position.

I like this last solution, as it yields the intuitively correct behaviour; the balls will wobble back-and-forth. The magnets have an obvious and consistent effect on the world, and the world rule of one entity per cell is visually not violated. It implies rules having multiple states, and the engine updating between rule transitions. Things like sound effects could be triggered by the rule beginning to execute, by the rule succeeding, or by the rule being rolled back. That should give a lot of expressiveness to the engine.

Another thought experiment is an NPC that has four rules, each telling it to move in a different direction. In this case, only one rule can succeed, as they are all attempting to move the entity. Essentially the movement command requires exclusive access to the resource. It’s fairest to select one rule to win at random, meaning NPCs will get random (brownian) movement for free. Nice.

Apart from movement, there aren’t too many commands that require exclusive access to a resource. Really just movement and mutating a register.

Final thought experiment is back to the magnet-ball rule, where the balls are adjacent, with another rule that adjacent balls de-spawn (in a fiery explosion), with magnets strategically positioned to push the balls apart. What should happen here?

  • The rule to explode the balls beats the rule to move the balls, and so they explode.
  • The rule to move the balls beats the rule to explode the balls. and so they move.
  • Both rules fire, so the balls explode while they’re moving.

Again, this last case seems intuitively correct. The rule to explode the ball simply de-spawns both balls (which plays an explosion animation), and triggers an explosion sound effect. The rules to move the balls still fires, but the entity engine can handle moving an entity while it’s de-spawning, so there’s no conflict to rollback.

All of this comes naturally when we think of the 3x3 grid as providing context to decide if a rule should fire, and the rule itself then issuing a series of commands (such as move entity and so on), rather than the rule mutating the 3x3 grid (which is what the user may see when editing rules, but not what the engine works with when executing rules).

Anyway, that’s a bit of a thesis. Hopefully things will solidify somewhat over the next day or two so I can begin coding this up.

Jack had school photos today. I cooked bolognaise for dinner. Full from overeating! Dzung and Jack watched Australian Ninja Warrior. Eliza practising her viola. Just a regular Monday night.

2018-07-22

Jack to NorthShore. Eliza and I teamed up to play “Captain Toad’s Treasure Tracker”. Then to Van’s for lunch; Ba made steak and vegetables. Did some shopping in the afternoon, and made vegetable soup in the Thermomix for dinner. Still early, so Eliza cajoled us into playing Munchkin. She won, of course, but there was no backstabbing (so it was really just a race to the finish). Watched a few episodes of “Handmaid’s Tale” with Dzung once the kids were asleep. Again with the lack of HackTile.

2018-07-21

Kids to karate with Dzung. I did some housework. French onion soup and cheese on toast for lunch. Very tired in the afternoon; napped while listening to podcasts. Think I have a mild form of Eliza’s virus. Dzung made Ramen for dinner, and then she went to sleep early; I watched some game design videos on YouTube while crashing on the sofa. No HackTile at all. Waste of a day, really.

2018-07-20

Danny Goodman! Hours of reminiscing on the sofa in the sunshine. Wil visited too. Great to catch up. Like no time had passed. Then busy at work, and off to mum and dad’s for a lamb roast. Very tired, to bed with a book while it rains.

2018-07-19

Super busy at work. Got heaps done, but exhausted by the end of it. Fish for dinner. Eliza not feeling well and upset after a visit to the allergy doctor and finding out she cannot select drama in year 8, as she’s already a music student. Must find something she can do outside of school. Jack doing well with his maths and reading. Dzung working hard. I can’t slog on with HackTile tonight; I played around a bit but coding rules still feels premature; need to steep a bit longer and show it to Danny and Wil tomorrow. Will chill out with the TV before bed instead.

2018-07-18

Very sore today after overdoing it yesterday with three repeats of the seven-minute workout. Can barely lift my arms. Work very busy; Dzung and I made an effort to go out to Hayashi for lunch. Frozen lasagna for dinner though.

No HackTile work, but put together an animation to post to Twitter.

Animation Demoo

Have been playing around with the editor, thinking about rules.