620 likes | 775 Views
Compiler Integration into Computer Science Learning Games. Amanda Chaffin katla@wulfkub.com Advisor: Dr. Tiffany Barnes tbarnes2@uncc.edu. Background Game2Learn Ele Mental : The Recurrence Implementation The Study Conclusion Future Work. Motivation Solution Game Creation
E N D
Compiler Integration into Computer Science Learning Games Amanda Chaffin katla@wulfkub.com Advisor: Dr. Tiffany Barnes tbarnes2@uncc.edu
Background Game2Learn EleMental : The Recurrence Implementation The Study Conclusion Future Work Motivation Solution Game Creation Learning Games Goal Hypotheses Outline Chaffin - G2L platform October 29, 2008
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, 2008
Solution • Games for learning computer science • Less abstract, more familiar • Proven results – • Students creating games • Students learning from games Chaffin - G2L platform October 29, 2008
Game Creation • MineSweeper and Asteroids (Becker, 2001) • University of Calgary • Game Programming in CS1 (Bayliss, 2006) • Rochester Institute of Technology • Capstone Courses (Jones, 2000) • Colby College Chaffin - G2L platform October 29, 2008
Learning Games • Revolution (Jenkins 2003) • Neverwinter Nights • MUPPETS (Bierre, et al. 2006) • TankBrain • Tactical Iraqi (Johnson, et al. 2007) • Marine Corps • Alice (Mullins, 2008) Chaffin - G2L platform October 29, 2008
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, 2008
Hypotheses • Students who play a learning game where • 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, 2008
Background Game2Learn (G2L) EleMental : The Recurrence Implementation The Study Conclusion Future Work History of G2L Saving Sera The Catacombs Squee StormHaven3 Wu’s Castle Limitations Outline Chaffin - G2L platform October 29, 2008
History Chaffin - G2L platform October 29, 2008
Rapid prototyping Saving Sera The Catacombs Squee! The Tournament Wu’s Castle What we learned Fun != learning It’s all about the motivation Design of concept most important Game2Learn Games Chaffin - G2L platform October 29, 2008
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, 2008
Background Game2Learn (G2L) EleMental : The Recurrence Implementation The Study Conclusion Future Work Designing G2L Games DarkWynter Code Design Game Design : Recursion Video Interfaces Pre/Post Test Outline Chaffin - G2L platform October 29, 2008
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 Chaffin - G2L platform October 29, 2008
DarkWynter Code Design • Using previous pedagogy, why? • Obvious data structure (tree) • Standard algorithm (DFS) • Engine supported (real time terrain mods) • Scaffolding code Chaffin - G2L platform October 29, 2008 15
Game Design – Recursion re·cur·sion (rĭ-kûr'zhən) –noun Mathematics,Computers See recursion Chaffin - G2L platform October 29, 2008
Game Design – con’t • Designed by Wicked Fly Games • Uses Depth First Search Walkthroughs • Build bridges • Collect thoughts Chaffin - G2L platform October 29, 2008 17
Video Chaffin - G2L platform October 29, 2008
Pre & Post Test public int getProduct(int num) { int result; if (num == 1) { result = 1; } else { result = num * getProduct(num - 1); } return result; } What is the value passed to getProduct() in step 2? Answer = 2 What is the value of 'result' at step 6?Answer = 6 What is the value passed to getProduct() in step 2? What is the value of 'result' at step 6? MAIN 6) result = getProduct() 1) getProduct(3) 5) result = 2 4) result = getProduct() 2) getProduct() getProduct() 3) getProduct()
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, 2008 20
XNA • Microsoft’s hobbyist game development platform using C# and .Net • Allows development with Visual Studio • Used to develop DarkWynter • UNCC’s Game Studio Class (2007) Chaffin - G2L platform October 29, 2008
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, 2008
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 http://www.nuclex.org/news/2007/05/14/xna-windows-forms-usercontrol Chaffin - G2L platform October 29, 2008
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: http://support.microsoft.com/kb/304655 Chaffin - G2L platform October 29, 2008
CompilerControls Architecture Chaffin - G2L platform October 29, 2008
Challenge Objects Chaffin - G2L platform October 29, 2008
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 Chaffin - G2L platform October 29, 2008
Event System Architecture Chaffin - G2L platform October 29, 2008
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, 2008
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, 2008
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 Custom Game Objects Chaffin - G2L platform October 29, 2008
AI Modifications • ThoughtAI() • Walk in a straight line algorithm • Had problems with • Rotation • XML position loading • Walk speed
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 Chaffin - G2L platform October 29, 2008
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 Instructions Control Chaffin - G2L platform October 29, 2008
Background Game2Learn (G2L) EleMental : The Recurrence The Study Conclusion Future Work Design Results Pre and Post Test Compiler Errors Qualitative Comparisons Outline Chaffin - G2L platform October 29, 2008
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, 2008
43 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 Study Results Chaffin - G2L platform October 29, 2008
PreTest/PostTest Chaffin - G2L platform October 29, 2008
Pre/Post/Compilation Attempts Chaffin - G2L platform October 29, 2008
Qualitative Comparisons Chaffin - G2L platform October 29, 2008
Study Quotes “The fact that I write my own code to make the game work.” “Gaming assignments are better because a lot of people enter computer science wanting to do things like gaming, and are disappointed because all they get to do in the first few assignments is write code to calculate tax on different stuff.” “I liked the whole experience of walking through the paths and then typing the code and then doing it again for repetition.” “Finding C# is very similar to Java.”
Conclusion • What we learned • Code concepts • Agile development • Good code no substitute for proper design! • Parsing is HARD! • Limitations • Needs Shader 3.0 graphics support • Cannot run on laptops • Downloadable through SVN Chaffin - G2L platform October 29, 2008
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, 2008
Future Engine Work • Level Creation currently at 5 hours for 2 people • Database • Address Engine Concerns • Direction Indicators • Reconnect XP to HUD • Bug Fixes • Expansions into other data structures • Heaps • Lists • Stacks Chaffin - G2L platform October 29, 2008
Thank You! Amanda Chaffin & Dr. Tiffany Barnes katla@wulfkub.com unc Charlotte This work was partially supported by the National Science Foundation GrantsNo. CNS-0552631 and CNS-0540523, IIS-0757521, and the UNC Charlotte Diversity in Information Technology Institute.
Works Cited • 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 2008. • Barnes, T., H. Richter, A. Chaffin, A. Godwin, E. Powell. (2007). Game2Learn: Building CS1 Learning Games for Retention. ITiCSE2007: 121-125 • 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 2006. • Barnes, T., H. Richter, A. Chaffin, A. Godwin, E. Powell. (2006). The role of feedback in Game2Learn. Submitted to CHI2007, San Jose, CA, April 2006. • 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 2007. • Beaubouef, T., & Mason, J, 2005. Why the high attrition rate for computer science students: Some thoughts and observations. ACM SIGCSE Inroads Bulletin, 37(2), 2005, 103-106. • Becker, Katrin. Teaching with games: the Minesweeper and Asteroids experience, Journal of Computing Sciences in Colleges, v.17 n.2, p.23-33, December 2001. • 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 Chaffin - G2L platform October 29, 2008
Works Cited Con’t • 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. p260-264 • 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 • Jenkins, Henry, Eric Klopfer, Kurt Squire, and Philip Tan. "Entering the Education Arcade." Source Computers in Entertainment, Volume 1, Issue 1. (October 2003): 17-17. August 27, 2006. • Bierre, K., Venture, P., Phelps, A. & Egert, C. (2006). Motivating OOP by blowing things up: An exercise in cooperation and competition in an introductory javaprogramming course. ACM SIGCSE Bulletin, Proceedings of the 37th SIGCSE technical symposium on Computer science education SIGCSE '06, 38(1). • Losh, Elizabeth. "In Country with Tactical Iraqi: Trust, Identity, and Language Learning in a Military Video Game." Virtualpolitik. 2006. August 3, 2006. http://virtualpolitik.org/DAC2005.pdf • Mullins, P, Whitfield, D., and Conlon, M. 2008. 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). • 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 • Johnson, W. L., Wang, N., and S. Wu, "Experience with serious games for learning foreign languages and cultures," in SimTecT Conference., Australia, 2007.