Pete Welter

School
Platt CHOICE, BVSD, coordinating with a 7th grade math teacher there, possibly other schools

How will I introduce Scalable Game Design in my school?
Not sure yet. Possibly include as a gateway to science simulation, as an adjunct to math (Pre-Algebra or Algebra) or as an after-school program

Computational Thinking videos
 There are a bunch of patterns here - move, collision, push, scripting, depending on what section you choose

 Formula 1 racing, pretty clear transportation

 collision or push, and one could make a possible argument about a diffusion of gravity

Project Journal
Week 1, Tuesday:

Had Frogger done coming in, which wasn't too hard as I had done practicum with Burke Taft at Centennial for several classes of 6th graders doing the same game. I spent most of my day trying to figure out how to make Frogger solve the maze himself. There was a specific way of doing it which wasn't too difficult - basically a scripted version of what to do. The minus was that there were a few situations where it didn't work, at least the limited version I had created. At that point I started experimenting with diffusion and hill-climbing, which turned out to be a lot more complex than I anticipated. The idea of the grotto being the generator and diffusing from there was clear, but it was made more difficult because 1) there wasn't necessarily a clear chain to the grotto depending where elements were in the river and 2) the moving trucks required a lookhead, and I had lots of problems (never really solved) of getting the frog to turn back if it couldn't make it to try again. Still doable this way, but I need more experience with the the diffusion/hill-climbing pattern.

Week 1, Wednesday: Great talk by Clayton Lewis, something I've been thinking about explaining to my kids about why numerical and computational thinking is important was made very clear by Clayton's vocabulary and examples using the representational domain and the target domain. This

His talk gets to the essence of a big question, especially with math education but many other fields also. If we take our computational and informational tools as extensions of our own minds (as they are increasingly becoming more integrated), analytical solutions and factual knowledge mean much less than they did only a a few decades ago. If that is the case, how do we adjust what our kids learn for this new reality? For example, most math teachers approach the Monty Hall problem as an exercise in analysis of probability. In Clayton's example, he used computational tools to simulate what happened. If one had to choose, is it more important to know how to use a tool to figure out a solution, or how to analyze the solution? Obviously, both would be best, and that's certainly true for very foundational concepts, but as we get to the edges of what are truly core concepts, the ability to use tools provides a general purpose toolkit for people's thinking, while having students learn each individual analytical technique only provides and an answer for *that* class of questions.

Got basic Sokoban done early today (actually, had it done before). I got multiple levels in early so that it chained between levels.

My initial stab at the step counter turned out to be a very different design than the one in the tutorial, although they worked the same. The tutorial works on an increment (like an odometer); on every increment, the digit either upcounts or if it is 9 it adds a digit to the left and rolls back to one. In my design each counter agent (a digit from 0 to 9) knew it's place value and the score was broadcast to each. The formula: (@myvalue/placevalue) % 10 gives a result of 0-9 that can be used to index into the digits. Design tradeoffs: the Increment can accommodate an arbitrarily large number and has relatively simple logic. My design requires that each digit agent exists, but it can change itself to any number at any time, rather than counting up.

I also got multi-box pushing working, which was a good exercise communicating among non-adjacent agents, which is something that is not simple in Agentsheets. There is the Broadcast mechanism, but when trying to coordinate a subset of agents this isn't quite as helpful (although there may be a pattern I haven't seen yet that would make this easier).

Week 1, Thursday:

Although I stayed up late Wednesday night getting the basic Pac-man done (I was just jazzed to get started on it) and got it mostly working, I spent much of Thursday trying to really figure out diffusion, especially as it relates to power pills. The diffusion made sense, and I found that the Set Color action to be invaluable in understanding how it spread - by setting the Set Color 0 to .1 on the Path object, it was easy to see how the diffusion spread through the maze.

The power pill diffusion logic seemed like it should have been simple - either a reversal of the values or a reversal of the actions by the ghosts. However, each approach I tried along these lines got the ghosts stuck on the walls or somewhere else in the maze. The naturalness of the walls being 0 values for diffusion when ghosts were in pursuit made them highly attractive when fleeing. The breakthrough was finally throwing away the movement logic I had from before, and replacing it with logic that looked like: What is the most (or least, if fleeing) value next to me that is NOT a wall (making explicit the logic that the basic diffusion technique allowed implicitly), and which direction is it? Now that I know that direction, check for the Pac-man, other ghost and if possible, move that way (possibly extension - order the directions, so that if one direction isn't possible, move the second-best way)

The big lesson from this that I discussed with both Fred and Alex was knowing when you have reached a local maxima in the solution space, and knowing when it's time to take the leap to find a more global maxima. That is, when do you know your current design can't be tweaked and you need to try something quite different. It's a difficult step, because the most logical way to design is step-wise incremental development. If someone else happens to know the next step, they are a great resource to help you know where you might go design-wise, as as teachers, we can provide that. However, how can we help students learn to do this on their own? What happens when no-one in the room knows an alternative design? When the student is working on their own? There are techniques to helping with this, such as learning skills to decouple parts of the system so that you can try a new implementation without tossing the old one (the essence of software engineering).

Week 1, Friday:

Added to my diffusion test app to follow Alex's suggestion about the derivative of the diffusion equation. See [] for info on how to do that in Agentsheets. As he had mentioned, it indeed sends out a wave of diffusion in front the moving object, something that seems very handy in game AI - I need to figure out a way to use it. Also experimented with the 2nd derivative, but I'm not clever enough to know how that might be useful yet. The Set Color action is a terrific debugging/understanding tool.

Worked most of the day and beyond on Tetris, which I chose because the game is simple enough, but it is a challenge in Agentsheets because most of coordination occurs among multiple agents, unlike Frogger or Sokoban.

The design I took in this project was to not use as many agents but to allow myself to have a more complex interaction of methods. It also makes use of a lot of Broadcasting, which is possible because the number of agents is relatively small and each agent can quickly check whether the message applies to them or not. One addition to an environment like Agentsheets that would be really helpful (and may exist and I don't know about it yet) a visualization of the calling tree and of the agent that is currently executing. The latter happens if the agent doesn't understand a message - the agent is highlighted every time the error message is displayed.

I finally figured out how to do a NOT logic - not sure how I missed it earlier (that's how hindsight is I guess). You just need a method with two rules: the first true is the condition you want to NOT, but no action, the second rule has the action but no condition. To use that also take a willingness to increase the number of methods, because you can't stack multiple NOTs in the same method.

I'm not sure if this a full Computation Thinking Pattern or not, but I found a technique that I needed for Tetris that didn't seem to fit the others: Undo. In the case of Tetris, rather than put lots of logic in to see if a piece can be rotated so that it doesn't end up in a wall or inside another piece after the rotation, I had it do the rotation, then test for collision (easier) and then Undo itself if there was a collision. It works because in Agentsheets, if you do the action and then reverse it immediately it appears as if the agents never move. This pattern requires actions that have an "unaction": for example, move right is undone by move left, rotate right is undone by rotate left. This seems like it's computationally specific (or at least specific to virtual worlds), because as we know, you don't get to undo the real world, but it's a perfectly acceptable option in a virtual representation.

The other technique I used, probably not a pattern, was recursion. In order to determine if there was a complete line of blocks, I had each Border agent on the left wall send a message to a Block agent to it's right. This Block agent would forward that message to the Block agent to ITS right, and so on, and if a Border agent on the right wall received the message, it knew that there was a continuous chain of blocks. I also used this to mark blocks as "dead", so that once the right Border knew there was a continuous chain of blocks, it send a "mark_dead" message to the Block to it's left, and then the Blocks chained that message along until it got to the left Border, which did nothing. At this point the whole recursive chain unwound.

I used the Tetris standard scoring, so that if you get more points for 1,2,3 or 4 lines at the same time. Oddly enough, my (@myvalue/placevalue) % 10 counter technique failed, because when the place value was 1000 or more, the mod was not an integer. I fixed this by making the digits look for a range (for 3, look for a mod of >=3 and < 4). The end game was easier than I had thought: check for a collision right after the piece is created, and if there is a collision, it means the pieces are stacked too high and the game is over. Added a background graphic, which is an easy way to make a game much more attractive.

Week 2

Week 2, Monday: Finished up Tetris tonight, see writeup from Friday Week 1 for more info.

We discussed and worked on simulations today. Like Clayton Lewis on representations last week, Alex and his team have been thinking about this field in breadth and in depth. It shows in his message, which is a clear and concise statement of the problem and the opportunities of computational thinking in education.

"Computation cycles are cheaper than cognitive cycles" This is a deeper concept of our technological age that has been barely touched on in most educational settings yet. Those of us who integrate computing tools into our thinking/discovery process are used to it, but in general, most computing that I've witnessed in schools uses the computer as a very minor player in the thinking process. Often, this is because the technology isn't always available to students (where handheld devices like iPods and Android come in IMHO). However, without computational thinking happening in the classroom (teachers and students), we can't involve the computer in the thinking cycle. This also goes back to my specific question of Clayton: what does mathematical thinking look like when computation is an integral part of doing (and learning) math? It's much different than a typical math classroom today.

The Forest Fire simulation was, like the mudslide and the virus sims, an excellent example of visualizing/experimenting with emergent phenomena, which are so difficult to understand using other methods. I can definitely see using a form of this simulation in a science class or math class. I will need to talk to the Platt CHOICE math/science teachers to see where one of these might slot into their units. Using the simulations to cover statistical concepts seems like a widely applicable use that could easily be inserted in various places during the year.

Week 2, Tuesday: Fred is talking about some advanced topics today. New stuff I learned:
 * about the Import Agent - it was sitting there in the menu all along and I could have used it, but glad he talked about explicitly. To think about: what about a set of reusable agents that students to add into their game/sim, that would let them focus on the major game/sim task and add in other behavior/agents as needed.
 * timing on the keyboard buffer: about 1 second of keys are in the queue, so if you have an agent that dies (for example) and respawned, if you don't wait about a second that new agent will take the keys in the queue.

Implemented the 2-D bubblesort that Alex talked about, which was super slick and easy to do. Combined with my diffusion tester, makes me really think about the use of Agentsheets for doing data visualization. The main barrier there is getting the data in, but I wonder if an external data reader might help there - this will be worth checking out. I branched off of the sort to try and build a Benford's Law visualizer, but I generated the data with random numbers, and they don't follow Benford's Law (although supposedly the ratio of two random numbers does follow Benford's). This would be a great application of importing real data to visualize a phenomena.

Week 2, Wednesday: Tried to get my Flocking simulator working today. I say "tried" because I ended up not being able to make it work. The key problem is sensing state of remote agents, and determining distance. Flocks of birds follow 3 pretty simple rules: don't get too close to birds that are very near, try and stay on the heading of neighbors, and try and steer in the direction of other neighbors. As long as we define "near" as "next to" in Agentsheets, the first rule will be pretty easy. However, finding the n nearest neighbors isn't. If there were just a single bird, could use a version of diffusion (although the research says that the distance of neighbor birds don't matter very much, just that they are neighbors).

I eventually tried a search agent, which is a pattern that may come in useful later. The pattern is to create a temporary agent whose sole role is to move and gather state from other agents, then return to the spawning agent with the result. The good thing is that this search agent can hold status internally so there aren't a bunch of global floating around, and if the creation, movement and erasure is handled inside of a single method the user never sees the agent appear. This seemed to be a promising avenue, and I was able to determine not only the nearest birds but the quadrant those birds were in in relation to the searching bird. However, the search relied on recursion, and with a large enough map, I started getting stack overflows. With a more narrow search (and thus less levels of recursion) this would be a viable option, but not in this case. At the point I found this out, I had spent about 4 hours working on it, and just needed to go a different direction. Such is programming sometimes.

After that, I decided to take borrow an idea from Tetris and work on a simulation that used parts fitting together, and came up with the Chemical Bonds sim. Basically, instead of shape, it uses valences to bring together elements into molecules randomly using the rule that molecules will try to reach a neutral charge. The main problem here was how to program "stickiness" - how to model elements bonding and thus sticking together as one unit. Like Tetris, this is a variant on the agent choreography pattern. Unlike Tetris, where only one piece was moving at a time, this was multiple multi-agents. To do this, I had to implement an ID system so that molecules had unique identifiers and could then model being bound together. It now works in a basic fashion, the elements bounce around and bond in a realistic fashion. To do: better display which elements are bound into molecules, and better display of what the valences are of each element.

Week 2, Thursday: Thinking about when to implement this. The CHOICE curriculum will be doing physical science next year: physics and chemistry. There is also the possibility of using it in math, especially for data and stats units. I haven't talked to the social science teachers about their units. Given that Kent will be doing this in some of his tech classes, I don't know that starting the standard Frogger route would be useful, although personally I think that any math class would have time well spent doing this activity, especially for emergent phenomena. Therefore I'm looking at a lesson plan of a week that involves a simple game at first, and then into simulation. For physics the mudslide might be a really relevant, and I could see a sequence where they try and build a real mudslide and see what makes that difficult, and then move into the digital simulation and see how the variables can be varied. The challenging part is getting them to the point where they could build mudslide while learning Agentsheets.

Asked to demo Tetris and the Chemical Sim today, and people seemed to like them, which made me feel like I'm on the right track.

Week 2, Friday:

Contact Information
[mailto:pete@thewelters.com Email]

&lt;a _fcknotitle="true" href="Category:Teacher"&gt;Teacher&lt;/&gt;