A short detour
Today, let’s do something different. I’m going to describe in detail what I’m going to do, do it, then write up how I measured up. This is a good thing for two reasons:
- I’m going to learn how to estimate and manage my time, which is a Good Thing.
- In expertise theory, estimation is a seat-of-your-pants way to gain deep practice.
Furthermore, it is much easier to implement what’s been written down as opposed to doing what I call stream-of-consciousness programming.
To help me help myself, I’m going to base my articles on this template from now on:
[screenshot of build] [link to build] What I want to do today 1) Core mechanic 2) How to implement it (+ time estimates) 3) Potential difficulties What I was able to do 1) Checklist (+ time estimate discrepancy) 2) Explanation for the discrepancy (if any) Final thoughts 1) About game design 2) About me 3) What I might do tomorrow
Without further ado…
What I want to do today
I’m in the middle of a crunch time project so let’s work on that first.
Swappable in-game tools for doing various things via SteamVR controllers
How to implement it
- [6 minutes] Write a generic tool interface:
- Every tool has an input, a function, and an output. So the interface must have three methods: an input method that, when called, stores generic objects in a generic list, an apply method that is mapped over said list, and an output method that returns the mapped over list.
- [20 minutes] Write a Duplicate tool:
- Upon trigger press, take all GameObjects in its input region and store it in a list.
- Upon trigger press again, instantiate all GameObjects in said list at the same transform values relative to the tool before, but now relative to where the tool currently is[^1].
- [10 minutes] Write a Destroy tool:
- Upon trigger press, apply DestroyImmediate to all objects in the input region.
- [15 minutes] Write a tool container script based on VRTK. Make it a functor and attach it to the SteamVR controller GameObjects. Said container script must be able to switch between the Duplicate and Destroy tools.
- [30 minutes] Attach a radial menu to each controller. Write a script that calls the switching functionality found in (4).
Estimated time to completion: 1 h 21 m
I might not be able to preserve composability, especially when writing the tool functor.
What I was able to do
- [7.5 m] Done.
- [31 m] Done.
- [9 m] Done.
- [14 m] Failed.
- [57 m] Failed.
Time to completion: 1 h 58.5 m
Discrepancy: 37 m
I lost steam towards the end of (4) due to having been misled that interfaces cannot be obtained using GetComponent<T>() in Unity3D. Add to that fact that I haven’t read through the whole VR Toolkit library yet.
About game design
This is a technical issue so there ain’t much to be learned here in terms of design.
What I cannot (or did not) create I cannot understand.
What I might do tomorrow
Probably get this in order.
- Deliberate/deep practice
- the hokey-pokey but useful concept near the getting-a-coach-and-doing-optimised-drills idea in ideaspace
- Stream-of-consciousness programming
- a series of short but intense typing punctuated by grunts of “What next?”; see Markov chain