Project Overview Team: Ben Smith, Avrum Tilman, Josh Weinberg, Ron Weiss Mapwad: A Maze Generation language.

Slides:



Advertisements
Similar presentations
7 Copyright © 2005, Oracle. All rights reserved. Creating Classes and Objects.
Advertisements

CPSC 388 – Compiler Design and Construction
Introducing JavaScript
Semantic Analysis Chapter 6. Two Flavors  Static (done during compile time) –C –Ada  Dynamic (done during run time) –LISP –Smalltalk  Optimization.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Road Map Introduction to object oriented programming. Classes
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
BROOM: A Matrix Language Chris Tobin Michael Weiss Gabe Glaser Brian Pellegrini.
WPSM Programming Language A simple language that transform simple data structure into complex xML format Wai Y. Wong Peter Chen Seema Gupta Miqdad Mohammed.
Crash Language1 Crash. A Graphical Animation Tool By: Mikhail Litvin Vadim Belobrovka Michael Anikin Daniel Burdeinick.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
Outline Java program structure Basic program elements
Chapter 6. 2 Objectives You should be able to describe: Function and Parameter Declarations Returning a Single Value Pass by Reference Variable Scope.
Terms and Rules Professor Evan Korth New York University (All rights reserved)
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Guide To UNIX Using Linux Third Edition
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Language Evaluation Criteria
CIS Computer Programming Logic
Boardr The Racing Board Game Creation Language. Project Manager: Eric Leung Language and Tools Guru: Shensi Ding System Architect: Seong Jin Park System.
A First Book of C++: From Here To There, Third Edition2 Objectives You should be able to describe: Function and Parameter Declarations Returning a Single.
Chapter 6: Modularity Using Functions. In this chapter, you will learn about: – Function and parameter declarations – Returning a single value – Returning.
{ Graphite Grigory Arashkovich, Anuj Khanna, Anirban Gangopadhyay, Michael D’Egidio, Laura Willson.
The Java Programming Language
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 6 Functions.
1 JavaScript in Context. Server-Side Programming.
Chapter 6: User-Defined Functions
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
1 © 2002, Cisco Systems, Inc. All rights reserved. Arrays Chapter 7.
 2005 Pearson Education, Inc. All rights reserved. 1 Methods Called functions or procedures in other languages Modularize programs by separating its tasks.
SE: CHAPTER 7 Writing The Program
CIS-165 C++ Programming I CIS-165 C++ Programming I Bergen Community College Prof. Faisal Aljamal.
1 5 Nov 2002 Risto Pohjonen, Juha-Pekka Tolvanen MetaCase Consulting AUTOMATED PRODUCTION OF FAMILY MEMBERS: LESSONS LEARNED.
FIRST JAVA PROGRAM. JAVA PROGRAMS Every program may consist of 1 or more classes. Syntax of a class: Each class can contain 1 or more methods. public.
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
Java™ How to Program, 10/e © Copyright by Pearson Education, Inc. All Rights Reserved.
Documentation Dr. Andrew Wallace PhD BEng(hons) EurIng
PLT Final Project---COLOGO Lixing Dong, Zhou Ma, Chao Song, Siyuan Lu, Dongyang Jiang.
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Celluloid An interactive media sequencing language.
The Functions and Purposes of Translators Syntax (& Semantic) Analysis.
CS105 Computer Programming PYTHON (based on CS 11 Python track: lecture 1, CALTECH)
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 26 - Java Object-Based Programming Outline 26.1Introduction.
CS101: Introduction to Computer Science Slides adapted from Sedgewick and Wayne Copyright © Your First Java.
1 Brief Version of Starting Out with C++, 4th Brief Edition Chapter 6 Functions.
Chapter 5 Classes and Methods II Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
Basic Scheme February 8, 2007 Compound expressions Rules of evaluation Creating procedures by capturing common patterns.
1 JavaScript in Context. Server-Side Programming.
Semantic Analysis II. Messages Please check lecturer notices in the Moodle Appeals  Legitimate: “I don’t have the bug you mentioned…”  Illegitimate:
Controlling Program Flow with Decision Structures.
© 2006 Pearson Addison-Wesley. All rights reserved 1-1 Chapter 1 Review of Java Fundamentals.
UMass Lowell Computer Science Java and Distributed Computing Prof. Karen Daniels Fall, 2000 Lecture 10 Java Fundamentals Objects/ClassesMethods.
Presentation By :- Nikhil R. Anande ( ) Electronic & Communication Engineering. 3 nd Year / 5 th Semester FACULTY GUIDE : RAHIUL PATEL SIR MICROCONTROLLER.
Functional Programming
Fundamentals of Programming I Overview of Programming
Basic Scheme February 8, 2007 Compound expressions Rules of evaluation
Learning to Program D is for Digital.
Objectives You should be able to describe: Interactive Keyboard Input
Java Primer 1: Types, Classes and Operators
Chapter 3: Using Methods, Classes, and Objects
Topic: Functions – Part 2
Polynomial Manipulation Language
Starting JavaProgramming
The Metacircular Evaluator
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
The Metacircular Evaluator (Continued)
Defining Classes and Methods
Presentation transcript:

Project Overview Team: Ben Smith, Avrum Tilman, Josh Weinberg, Ron Weiss Mapwad: A Maze Generation language

Overview and Summary A high level language for creating mazes rendered in 3 dimensions using Quake. Built in data structures and functions to naturally express a map. Ability to define custom functions to ease implementation of maps Java/C style syntax and semantics

Motivation

Motivation Designing mazes by hand is tedious and error prone Build large, complex mazes algorithmically

Goals Easy to use - intuitive syntax, simple language constructs Flexible - few constraints on maze - walls can be at any angle to each other, etc. Concise - able to generate complex maze with few lines of code

Language Design The language is designed around high- level data types that offer an intuitive description of a map Instead of dealing with planes you deal with rooms Mapwad eliminates the need to specify coordinates –All objects are positioned relative to each other

Mapwad syntax Java/C –Whitespace ignored –Comments /**/ and // –Blocks enclosed in {} –Function default parameters: MyFunc(int a,int b=3,int c=4) {…} MyFunc(1,,10); MyFunc(1,2); –“dot” operator (built-in types only): myRoom.Walls[0].Length = 10;

Reserved Words Control Flow –if, else, for, while, break, continue, return Primitive Data Types –int, float, boolean, string Values –true, false, null

Object Data Types Room –Walls - Super Data Structure Wall Location Thing

Built in Functions –boolean Add(Room r, Wall newWall) –boolean AddAfter(Wall w, Wall newWall) –Remove(Wall w) –boolean Attach(Wall a, Wall b, string connectpoint) –boolean Close(Room r) –boolean IsClosed(Room r) –Math Functions Variables –MapStart –MapHeight –CeilingTexture –FloorTexture

Semantics Scoping rules –Global scope –{} blocks have own scope –Rooms and Things automatically added to map Primitive Types –Passed by value –Instantiated when variable is created int x; //creates a variable and instantiates an int Object types – Passed by reference –Object-typed variables are references –Must be explicitly instantiated Room r;//creates a reference to a Room r = Room(); //instantiates a Room object

Compiler Components Lexer/Parser Tree Walker –Walks the AST generated by the parser –Checks types, resolves symbols, etc. –Executes the code Internal package –Contains code called by the tree walker to manipulate Mapwad structures Code generator –Creates Quake.map file - text file containing information about contents of map. QBSP –Compiles.map file into Quake.bsp map file that the game understands.

MapwadParser MapwadLexer MapwadWalker Mapwad Builtin Functions Block Diagram MWMap qbspMWGui

Sample Code //creates a regular polygon shaped room Room regularRoom(int walls, float length, string texture="BRICKA2_2") { Room newRoom = Room(); float angle = 180*(walls-2)/walls; int i; for(i=0;i < walls;i++) { Wall w = Wall(length,angle,"",texture); Add(newRoom, w); } Close(newRoom); return newRoom; } Map() { Room r = regularRoom(10, 15, "BRICKA2_4"); Room start = regularRoom(4, 5); Attach(r.Walls[0], start.Walls[0]); Thing t = Thing("monster_army", Location(r.Walls[5], "center", 10)); MapStart = Location(start.Walls[3], "center", 2); CeilingTexture = "sky1"; }

Compiler Output "sounds" "1" "classname" "worldspawn" "wad" "quake101.wad" "worldtype" "0" { ( ) ( ) ( ) BRICKA2_ ( ) ( ) ( ) BRICKA2_ ( ) ( ) ( ) BRICKA2_ ( ) ( ) ( ) BRICKA2_ ( ) ( ) ( ) BRICKA2_ ( ) ( ) ( ) BRICKA2_ } { ( ) ( ) ( ) BRICKA2_ ( ) ( ) ( ) BRICKA2_ …

What does it look like?

Error Checking There are three types of error checking in Mapwad Syntax Error –Caught by the lexer/parser Semantic Error –Caught by the tree walker Incorrect types, wrong arguments, etc… Runtime Error/Warning –Caught during code generation Invalid Geometry Locations outside of map

Testing Modular Testing –Each module was tested independently Regression Testing –Basic test cases were reused as code evolved Integration Testing –Modules were combined slowly and tested at every stage

Lessons Learned Don’t overextend yourself –Our initial design was too ambitious for a one semester project Fully define interfaces early –We had to modify all our methods late in development Generalize your code –When we found problems we they were resolved without major code revisions

Future Work Support more generalized 3D structures More sophisticated error checking Support for more interactive objects –Doors, Elevators, Moving platforms Integrate into a graphical level editor