Compiler Integration into Computer Science Learning Games Amanda Chaffin Advisor: Dr. Tiffany Barnes
Chaffin - G2L platform October 29, Outline Background Game2Learn EleMental : The Recurrence Implementation The Study Conclusion Future Work Motivation Solution Game Creation Learning Games Goal Hypotheses
Chaffin - G2L platform October 29, Motivation Rising demand for CS majors (Vesco, 2007) But enrollments are falling! And many enrolled students leave after CS1-2 Why? (Beaubouef, 2005) Lack of problem solving skills Miscommunication Homework, lecture, code
Chaffin - G2L platform October 29, Solution Games for learning computer science Less abstract, more familiar Proven results – Students creating games Students learning from games
Chaffin - G2L platform October 29, Game Creation MineSweeper and Asteroids (Becker, 2001) ASCII based graphics Turn Based Strategy Excellent Learning Payoffs Game Programming in CS1 (Bayliss, 2006) RAPT Summer Course (Rochester Institute of tech) Capstone Course - Colby College (Jones, 2000) Design and create their own game Capstone Course - North Texas (Parberry, 2005) Parallels with an art course Design and create their own games
Chaffin - G2L platform October 29, Learning Games Revolution (Jenkins 2003) Teaches the American Revolution MUPPETS (Bierre, 2004) Developed at Rochester Institute of Technology Written in Java Allows students to program 3D game objects Tactical Iraqi (Losh, 2006) Teaches soldiers Culture Language proficiency
Learning Games Con’t Alice (Mullins, 2008) Created at Carnegie Mellon University 3D programming environment Story telling animations and game playing Teaching tool for introductory computing Scratch (Maloney, 2008) Programming language - allows for stories, animations, games, Teaches design, mathematical and computational ideas Wu’s Castle (Eagle, 2008) Teaches arrays and loops
Chaffin - G2L platform October 29, Goal To have students learn computer science While playing games With maximal skill transfer Without breaking the sense of being in game In other words, students should write code, if at all, inside the game
Chaffin - G2L platform October 29, Hypotheses Students who play a learning game where The main game mechanic is a direct metaphor for how programs work, and Students can write and compile code inside the game Will effectively learn computing concepts Students who make a learning game where other students write code will Learn the coding concepts better Be able to teach the concepts
Chaffin - G2L platform October 29, Outline Background Game2Learn (G2L) EleMental : The Recurrence Implementation The Study Conclusion Future Work History of G2L Saving Sera The Catacombs Squee StormHaven3 Limitations
Chaffin - G2L platform October 29, History
Chaffin - G2L platform October 29, Saving Sera/The Catacombs Rapid prototyping Saving Sera RPG Maker 3 ways of writing code Multiple concepts The Catacombs Neverwinter Nights (NWN) Code through dialogue For loops 1 st Study Students receptive,but No learning gains 2 nd Study Learning gains
Chaffin - G2L platform October 29, Squee/StormHaven3 Squee! – Methods RPGMaker Maybe a little overcomplicated for the engine StormHaven 3 – Parameter passing NeverWinter Nights Interactive lecture Study showed learning gains
Chaffin - G2L platform October 29, Limitations Neverwinter Nights Limitations Cannot change the GUI Compiler integration possible but limited to NWN Script RPG Maker 2D platform; not modular enough for robust development Compiler integration might be possible but would be limited to Ruby
Chaffin - G2L platform October 29, Outline Background Game2Learn (G2L) EleMental : The Recurrence Implementation The Study Conclusion Future Work Video Designing G2L Games DarkWynter Code Design Game Design : Recursion Pre/Post Test Interface Interfaces Instructions Compiler Heads Up Display (HUD)
Video Chaffin - G2L platform October 29,
Designing G2L Games (Barnes, 2007) Choose target concept Design code to illustrate concept Get players to construct target code Might need to provide scaffolding code Need instructions How to use interface About learning concepts Chaffin - G2L platform October 29,
DarkWynter Code Design Methods needed in-game coding GetScaffolding() Support code to get students started CompileCode & RunCode() Explained with CompilerController ValidateStudentCode() Parsing Output RunVizualization() Updates game events Chaffin - G2L platform October 29,
Game Design – Recursion Designed by Wicked Fly Games Goal: Teach recursion, leverage engine Uses Depth First Search Walkthroughs Build bridges (edges between nodes) Collect thoughts to motivate traversal Watch visual walkthrough Stacks and Dialogues Explain how recursion is handled Chaffin - G2L platform October 29,
Chaffin - G2L platform October 29, Pre and Post Test
Game GUI - Overview
Chaffin - G2L platform October 29, Outline Background Game2Learn (G2L) EleMental : The Recurrence Implementation The Study Conclusion Future Work DarkWynter Engine Modifications Nuclex Game Control Architecture In-Game Compilation CompilerControls Challenge Objects Event System HUD Redevelopment Custom Game Objects AI Modifications Survey Controller Instructions Control
Chaffin - G2L platform October 29, XNA Microsoft’s hobbyist game development platform using C# and.Net Allows development with Visual Studio Used to develop DarkWynter In UNCC’s Game Studio Class (2007) More of an engine than a game Allowed for procedural terrain modification
Chaffin - G2L platform October 29, DarkWynter Modifications Goal Build games that allow for writing and running code within them DarkWynter allows complete control Modified to allow addition of Editing window & other forms needed Compiling and running code in the game
Chaffin - G2L platform October 29, Forms: Nuclex Game Control Open source XNA modification Allows multiple form use in XNA This is not built in; XNA games run in a single form Controls multiple forms through Forms User Control XNA runs in one form, allowing others to be made Disconnects code window from game update() Overrides onPaint() and controller methods
Chaffin - G2L platform October 29, In-Game Compilation Runtime compilation with.Net CodeDom Code Document Object Model Graph (tree) representation of code CSharpCodeProvider Implements the ICodeCompiler Compiles a CodeDom Tree with C# CompilerParameters.GenerateInMemory Allows in-game code to run from memory CompilerParameters.ReferencedAssemblies.Add() Allows in-game code to access engine Reference:
Chaffin - G2L platform October 29, CompilerControls Architecture
Chaffin - G2L platform October 29, Challenge Objects Objects that represent educational activites XML will determine activities CompilerControl will read XML -> Challenges Methods GetScaffolding() Gets the preset scaffolding code ValidateStudentCode() Parses the code RunVisualization() Changes the CurrentGameConditions in the Event System
Challenge Objects Code
Chaffin - G2L platform October 29, Event System Created by WickedFly Games ( Katelyn Doran, UNCC and Drew Hicks, Marietta College ) and modified by DarkWynter Turned the Engine from a FPS to an RPG Loads from Engine.cs using XML Events triggered by changing CurrentGameConditions (CGC) CGC changes from Collision with objects Challenges (runVisualization()) CGC change calls update() in GameEventHandler.cs If CGC matches GameEvent’s trigger conditions – FireEvent()
Event System Architecture Chaffin - G2L platform October 29,
Events : XML Settings Each Event has TypeID Parameters Triggers
HUD Redevelopment DarkWynter was a 4-player game 4 Humans each had own HUD Did not have an update() For G2L Decoupled from Human, coupled with Renderer Changed to Public Static Added an update loop Changed all add methods to return list location Changed all graphics and text Chaffin - G2L platform October 29,
HUD Updates Con’t Redesigned for Dialogue Events Update() with a timer that controls the rest ShowDialogue() RemoveDialogue() Dialogue Events redesigned To accept textures from XML Chaffin - G2L platform October 29,
Chaffin - G2L platform October 29, Custom Game Objects Thoughts() Collectible items Models created by Wicked Fly Games Arrows() Indicators of location Created by Wicked Fly Games WaterPlane() Water plane to keep students on island Custom built Shader Blends two textures
AI Modifications ThoughtAI() Walk in a straight line algorithm Had problems with Rotation XML position loading Walk speed
Chaffin - G2L platform October 29, Survey Controller Integrates pre and post test into game What it does – Creates a new Form Loads data from XML into the Form Validates answers Writes results to a log
Instructions Control Educational instructions for the student’s use to guide through code development What it does – Creates a new Form Loads the InstructionSet for the Level from XML into Form Can be used to prevent students from compiling code until read Chaffin - G2L platform October 29,
Chaffin - G2L platform October 29, Outline Background Game2Learn (G2L) EleMental : The Recurrence The Study Conclusion Future Work Design Results Pre and Post Test Compiler Errors Qualitative Comparisons to other G2L Games
Chaffin - G2L platform October 29, Pilot Study Design Pilot Study Current CS 2214 and 2215 students recruited via the professor Study consists of – Demographic survey & pre-test Play game Post test & survey Data logged by game and automatically (non secure) FTPed
Chaffin - G2L platform October 29, Study Results 31 total participants 27 took incorrect pretest 16 took valid pre and post test 1 non computing major 1 freshman, 1 sophomore, 10 juniors, 3 seniors, and 1 post Baccalaureate 13 men, 3 women 5 casual gamers, 4 hardcore, 7 neither
Chaffin - G2L platform October 29, PreTest/PostTest
Chaffin - G2L platform October 29, Pre/Post/Compilation Attempts
Chaffin - G2L platform October 29, Qualitative Comparisons
Favorite Aspects of EleMental?
Suggested Game Improvements
Traditional Vs. Game Assignments
Chaffin - G2L platform October 29, Conclusion What we learned Code concepts – abstraction, recursion, Forms, polymorphism, CodeDom, Compilers Agile development – rapid iterations through software cycle Teamwork Communication Self organization Accountability Good code no substitute for proper design! Parsing is HARD! Limitations Needs Shader 3.0 graphics support Cannot run on laptops Is downloadable through SVN If XNA and DirectX installed, can immediately run
Future Study Hypothesis – students who play EleMental: The Recurrence with access to the in game compiler will show significantly higher learning gains than a comparison group that plays without the compiler. Crossover study – Half play the game with compiler Half play without Swap Chaffin - G2L platform October 29,
Future Engine Work Level Creation currently at 5 hours for 2 people – want to drop that to 2 XML loading of Challenge Data DarkWynter level editor to create XML Can add new levels through mostly XML edits, plus minor code changes (code parsing) Maps already easy (greyscale image) Database MySQL connect Design finished More robust Chaffin - G2L platform October 29,
Chaffin - G2L platform October 29, Works Cited 1.Barnes, T., A. Chaffin, E. Powell, H.Lipford. Improving the motivation of CS1 students through games for learning. Submitted to the Journal of Game Development. Boston, MA. January Barnes, T., H. Richter, A. Chaffin, A. Godwin, E. Powell. (2007). Game2Learn: Building CS1 Learning Games for Retention. ITiCSE2007: Barnes, T., H. Richter, A. Chaffin, A. Godwin, E. Powell, T. Ralph, P. Matthews, and H. Jordan. (2006). Game2Learn: A study of games as tools for learning introductory programming. Submitted to SIGCSE2007, Kentucky, USA, March Barnes, T., H. Richter, A. Chaffin, A. Godwin, E. Powell. (2006). The role of feedback in Game2Learn. Submitted to CHI2007, San Jose, CA, April Vegso, J. Continued Drop in CS Bachelor's Degree Production and Enrollments as the Number of New Majors Stabilizes. Computing Research News, Vol. 19, No. 2, March Beaubouef, T., & Mason, J, Why the high attrition rate for computer science students: Some thoughts and observations. ACM SIGCSE Inroads Bulletin, 37(2), 2005, Becker, Katrin. Teaching with games: the Minesweeper and Asteroids experience, Journal of Computing Sciences in Colleges, v.17 n.2, p.23-33, December Bayliss, Jessica D and Sean Strout, Games as a "flavor" of CS1, Proceedings of the 37th SIGCSE technical symposium on Computer science education, March 03-05, 2006, Houston, Texas, USA
Works Cited Con’t 1.Jones, Randolph M. "Design and Implementation of Computer Games: A Capstone Course for Undergraduate Computer Science Education", Proceedings of the 31st SIGSCE Symposium in Computer Science Education, March 2000, Austin, TX. p Ian Parberry, Timothy Roden, Max B. Kazemzadeh, Experience with an industry-driven capstone course on game programming: extended abstract, Proceedings of the 36th SIGCSE technical symposium on Computer science education, February 23-27, 2005, St. Louis, Missouri, USA 3.Jenkins, Henry, Eric Klopfer, Kurt Squire, and Philip Tan. "Entering the Education Arcade." Source Computers in Entertainment, Volume 1, Issue 1. (October 2003): August 27, Kevin J. Bierre, Andrew M. Phelps, The use of MUPPETS in an introductory java programming course, Proceedings of the 5th conference on Information technology education, October 28-30, 2004, Salt Lake City, UT, USA 5.Losh, Elizabeth. "In Country with Tactical Iraqi: Trust, Identity, and Language Learning in a Military Video Game." Virtualpolitik August 3, Mullins, P, Whitfield, D., and Conlon, M Using Alice 2.0 as a First Language. To appear in CCSC 24th Annual Eastern Conference 2008 (Hood College, Frederick, Maryland, October 10 and 11, 2008). 7.Maloney, J. H., Peppler, K., Kafai, Y., Resnick, M., and Rusk, N Programming by choice: urban youth learning programming with scratch. In Proceedings of the 39th SIGCSE Technical Symposium on Computer Science Education. Portland, OR, USA, March , SIGCSE '08. ACM, New York, NY, Eagle, M. Barnes T. (2008) Wu’s Castle: Teaching Arrays and Loops in a Game. Proceedings of ACM’s Innovation and Technology in Computer Science Education (ITiCSE 2008), Madrid, Spain, June 30 –July 2, 2008
DarkWynter Architecture