The Mathematica Journal
Departments
Feature Articles
Columns
New Products
New Publications
Classifieds
Calendar
News Bulletins
Mailbox
Letters
Write Us
About the Journal
Staff and Contributors
Submissions
Subscriptions
Advertising
Back Issues
Home
Download this Issue

Further Testing

While developing the replacement rules, Barthelet needed to test them against the encyclopedia of graphic elements provided by the art department. Furthermore, he needed to make sure that they all actually worked in combination with each other. Manually testing all possible combinations would have been a nightmarish task. Mathematica was called into action to test the huge variety of possible combinations of elements. As the replacement rules were modified, the entire collection of possible combinations were tested and visualized, generating several hundred-page notebooks in the process. Relying on the outstanding pattern matching system available in the human eye and brain, the constructions could easily be checked for accuracy and conformance with the art department's wishes.

[Graphics:../Images/index_gr_10.gif]

[Graphics:../Images/index_gr_11.gif]

[Graphics:../Images/index_gr_12.gif]

[Graphics:../Images/index_gr_13.gif]

[Graphics:../Images/index_gr_14.gif]

[Graphics:../Images/index_gr_15.gif]

Rule Testing. Mathematica was used to test all of the possible replacement rules. These three rules are tested in the Mathematica code above. On the left, the rule instructs the present tile to show a terminus if there are no other road pieces connected. The middle rule places a "straight through" graphic, and the right-hand rule handles turns.

After all of the rules were tested, they were output to several text files that were readable by the game's executable. (If you happen to own the game and are feeling adventurous check out the tilingrules folder on the CD-ROM.) This data-driven solution makes a lot of sense by easing changes and simplifying cross-platform issues. SimCity simply loads them in at run-time and builds the table of replacement rules that it uses to solve the network problem at a relatively brisk pace, a necessity in the computer gaming world.

According to Barthelet, by using this system they were able to implement more rules more easily and even implement new features feared to be too difficult to program directly. If you have played the new 3000 version you already know that the visual richness is greatly improved. If you have not, it is well worth a look. Check out www.simcity.com. While you are there, give the SimCity Classic simulator a try--but be careful, you may become an addict.


Converted by Mathematica      April 24, 2000

[Editor's Pick Index] [Prev Page][Next Page]