Learning Game AI Programming with Lua 1st Edition David Young - The latest ebook version is now available for instant access
Learning Game AI Programming with Lua 1st Edition David Young - The latest ebook version is now available for instant access
com
https://ebookgate.com/product/learning-game-ai-programming-
with-lua-1st-edition-david-young/
OR CLICK BUTTON
DOWLOAD EBOOK
https://ebookgate.com/product/cryengine-game-programming-with-c-c-and-
lua-1st-edition-lundgren/
ebookgate.com
https://ebookgate.com/product/programming-game-ai-by-example-1st-
edition-mat-buckland/
ebookgate.com
https://ebookgate.com/product/ai-game-engine-programming-2nd-ed-
edition-brian-schwab/
ebookgate.com
https://ebookgate.com/product/beginning-lua-programming-programmer-to-
programmer-1st-edition-kurt-jung/
ebookgate.com
GameMaker Game Programming with GML 1st Edition Edition
Matthew Delucas
https://ebookgate.com/product/gamemaker-game-programming-with-gml-1st-
edition-edition-matthew-delucas/
ebookgate.com
https://ebookgate.com/product/programming-an-rts-game-with-
direct3d-1st-edition-carl-granberg/
ebookgate.com
https://ebookgate.com/product/introduction-to-game-ai-1st-edition-
neil-kirby/
ebookgate.com
https://ebookgate.com/product/introduction-to-3d-game-programming-
with-directx-9-0-1st-edition-frank-d-luna/
ebookgate.com
https://ebookgate.com/product/php-game-programming-1st-edition-matt-
rutledge/
ebookgate.com
Learning Game AI Programming with
Lua
Table of Contents
Learning Game AI Programming with Lua
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Getting Started with AI Sandbox
Introduction to AI sandbox
Understanding the sandbox
The project layout
The Premake build
Compiling the sandbox with Visual Studio 2008/2010/2012/2013
Open source libraries
Open source tools
Lua IDE – Decoda
Running AI sandbox inside Decoda
Setting up a new Decoda project
Debugging Lua scripts
Decoda Watch window
Decoda Call Stack window
The Decoda Virtual Machines window
Simultaneous Lua and C++ debugging
Visual Studio – Attach to Process
Decoda – Attach to Process
Decoda – Attach System Debugger
Associating Lua scripts from code with Decoda
The Lua virtual machine
The Lua stack
Lua primitives
Metatables
Metamethods
Userdata
C/C++ calling Lua functions
Lua calling C/C++ functions
Function binding
Creating custom userdata
Looking at the vector data type
The demo framework
Ogre
Object-Oriented Input System
SandboxApplication
Sandbox
Agent
Utility classes
Lua binding
Summary
2. Creating and Moving Agents
Creating a new sandbox project
Setting up the file structure
Extending the SandboxApplication class
Running your sandbox for the first time
Creating a new Decoda project
Configuring Decoda’s run executable
Creating a sandbox Lua script
Creating a floor
Adding a light
Adding a skybox
Adding meshes to the sandbox
Creating sandbox objects
Shooting blocks
Creating an agent Lua script
Creating a visual representation
Updating an agent position
Updating an agent orientation
Agent properties
Orientation
The forward axis
The left axis
The up axis
Location
Position
Size
Height
Radius
Physics
Mass
The max force
The max speed
Speed
Velocity
Knowledge
Target
Target radius
Path
Agents’ movement
Mass
Speed
Velocity
Acceleration
Force
Agent-steering forces
Seeking
Applying steering forces to an agent
Clamping the horizontal speed of an agent
Creating a seeking agent
Pursuit
Fleeing
Evasion
Wandering
The target speed
Path following
Creating a path following agent
Avoidance
Collision avoidance
Obstacle avoidance
Avoiding blocks and agents
Group steering
Alignment
Cohesion
Separation
Creating a group of followers
Summing steering forces
Weighted sums
Priority-based forces
Summary
3. Character Animations
Skeletons and meshes
Mesh skeletons
Loading an animated mesh
Showing a skeleton
Attaching meshes to bones
Attaching a weapon to our soldier
Animation clips
Playing an animation on our soldier
Soldier animations
Crouching animations
Standing animations
Weapon animations
Soldier poses
Weapon poses
Manipulating animations
Enabling and disabling animations
Looping animations
The animation length
The animation time
Normalized time
Restarting an animation
Playing a non-looping animation
The animation rate
Animation blending
Animation weights
Blend window
Blend curves
Linear blending
Playing with blend weights
Animation state machine (ASM)
States
Transitions
Creating animation state machines
Creating helper functions
Adding states
Adding transitions
Adding external helper functions
Forcefully setting states
Requesting states
Updating the animation state machine
Handling state transitions and state requests
Updating running animations
Adding functions to animation state machine instances
Building a weapon animation state machine
Building a soldier animation state machine
Updating animation state machines
Playing with states
Summary
4. Mind Body Control
Creating a body
Creating a soldier
Attaching an animated mesh to an agent
Creating an obstacle course
Displaying the physics world
Adding callbacks to the animation state machine
Handling callbacks
Adding callbacks to the ASM
Updating the ASM to call callbacks
Getting our soldier to shoot
The bone position
The bone rotation
Creating particle effects
The particle direction
Object removal
The collision impact callback
Shooting a projectile
Handling projectile collision impacts
Shooting
Getting our soldier to run
Setting a path through the obstacle course
Running the obstacle course
Creating a brain
Approaches for mind body control
Direct animation control
The death state
The idle state
The falling state
The moving state
The shooting state
A simple, finite state machine
Initializing the agent
Agent FSM state handling
Indirect animation control
The animation controller
Commands
The command queue
Manipulating commands
The change stance command
The die command
The fall command
The idle command
The move command
The shoot command
Assigning member functions
Initializing the controller
Adding handlers for commands
Updating the controller
Running the obstacle course
Creating a direct control agent
Creating an indirect control agent
Indirect control agent initialization
Indirect control agent update
Indirect control agent control
Spawning an indirect control agent
Action latency
Summary
5. Navigation
Pathfinding
Creating a navigation mesh
Configuring navigation meshes
The walkable height
The walkable radius
The walkable climb height
The walkable slope angle
The minimum region area
Building the navigation mesh
Drawing the navigation mesh
Pathfinding on a navigation mesh
Path query
Query results
Random navigation points
The path information
Adding random pathfinding to our soldier
Updating agent paths
Drawing paths
Initializing the navmesh
Randomly running agents
Creating additional navigation meshes
Summary
6. Decision Making
Creating userdata
Agent actions
Adding data members
Initializing an action
Updating an action
Action cleanup
Action member functions
Creating actions
The idle action
The die action
The reload action
The shoot action
The random move action
The move action
The flee action
The pursue action
Evaluators
Creating evaluators
Constant evaluators
Has ammo evaluator
Has critical health evaluator
Has enemy evaluator
Has move position evaluator
Is alive evaluator
Can shoot enemy evaluator
50/50 chance evaluator
Decision structures
Decision trees
Branches
Decision leaves
Branch evaluation
Building a decision tree
Creating branches
Creating a decision tree agent
Strengths of decision trees
Pitfalls of decision trees
Finite state machines
States
Transitions
Finite state machine structure
Helper functions
Adding states and transitions
Updating the finite state machine
Adding instance functions
Building a finite state machine
The idle state
The movement state
The random movement state
The shoot state
The flee state
The die state
The pursue state
The reload state
Creating a finite state machine agent
Strengths of finite state machines
Pitfalls of finite state machines
Behavior trees
The behavior tree node
Helper functions
Updating the behavior tree node
Actions
Conditions
Selectors
Sequences
Creating a behavior tree object
Behavior tree helper functions
Selector evaluation
Sequence evaluation
Node evaluation
Continue behavior tree evaluation
The behavior tree update loop
Updating the behavior tree
Building a behavior tree
The death behavior
The flee behavior
Combat behaviors
The reload behavior
The shoot behavior
The pursue behavior
The move behavior
The random move behavior
The idle behavior
Creating a behavior tree agent
Strengths of behavior trees
Pitfalls of behavior trees
Summary
7. Knowledge Representation
Knowledge sources
Creating a knowledge source
Knowledge source evaluation
Blackboards
Creating a blackboard
Adding and removing knowledge sources
Evaluating knowledge sources
Setting and retrieving blackboard attributes
Blackboard member functions
Creating soldier knowledge sources
Enemy selection
Flee position selection
Constructing a soldier blackboard
Updating decision evaluators
Updating behavior actions
The die action
The flee action
The idle action
The move action
The pursue action
The reload action
The shoot action
Summary
8. Perception
Events
Attributes
Sending events
Receiving events
Managing events
Assigning agent teams
Handling agent communications
Event types
Creating agent senses
Initializing senses
Updating senses
Agent visibility
Detecting other visible agents
Agent sighting events
New enemy sighted event
New dead enemy body sighted event
New dead teammate body sighted event
Handling new agent sightings
Intermittent agent sightings
Throttling agent visibility updates
Creating event handlers
Adding event handlers
Agent auditory senses
Auditory events
The BulletShot event
The BulletImpact event
Handling auditory events
Decaying blackboard events
Decaying auditory events
Team communications
The EnemySelection event
The PositionUpdate event
The RetreatPosition event
Updating agent behaviors
Enemy selection
Scoring dangerous positions
Score danger from bullet impacts
Score danger from bullet shots
Score danger from enemies
Score danger from dead bodies
Calculating the best flee position
Summary
9. Tactics
Influence maps
The cell height
The cell width
Constructing an influence map
Configuration
Voxelizing a navigation mesh
Drawing influence maps
Accessing influences
Setting influences
Getting influences
Clearing influences
Spreading influences
Cell inertia
Cell falloff
Influence map layers
Updating the influence map
Soldier tactics
Initializing and updating tactics
Scoring team influences
Initializing team influences
Updating team influences
Configuring team influences
Scoring dangerous areas
Tapping into agent events
Adding event handlers
Initializing dangerous influences
Updating dangerous influences
Configuring team influences
Summary
Index
Learning Game AI Programming with
Lua
Learning Game AI Programming with
Lua
Copyright © 2014 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system,
or transmitted in any form or by any means, without the prior written permission of the
publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the author, nor Packt Publishing, and its
dealers and distributors will be held liable for any damages caused or alleged to be caused
directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
First published: November 2014
Production reference: 1241114
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78328-133-6
www.packtpub.com
Cover image by Aniket Sawant (<[email protected]>)
Credits
Author
David Young
Reviewers
Mitch Allen
Stanislav Costiuc
Predrag Končar
Bayard Randel
Ross Rothenstine
Jayant C Varma
Commissioning Editor
Aarthi Kumaraswamy
Acquisition Editor
Nikhil Karkal
Content Development Editor
Mohammed Fahad
Technical Editor
Veronica Fernandes
Copy Editor
Stuti Srivastava
Project Coordinator
Danuta Jones
Proofreaders
Paul Hindle
Julie Jackson
Clyde Jenkins
Indexer
Rekha Nair
Production Coordinator
Kyle Albuquerque
Cover Work
Kyle Albuquerque
About the Author
David Young is a professional software engineer who works within the game industry. He
started his career at NASA’s Deep Space Network and later moved to NASA’s Jet
Propulsion Laboratory for the Curiosity rover mission. After leaving NASA, he worked on
the platform that powers Riot Game’s League of Legends. David is pursuing a PhD at the
University of Southern California, focusing on graphics research in the field of real-time
hair rendering and simulation.
I would like to thank my wife; without her support, this book would not have been
possible.
About the Reviewers
Mitch Allen publishes video games for iOS and Android using Corona SDK and
Unity3D. You can find links to his apps at http://mitchallen.com. You can also follow him
on Twitter at @mitchallen.
He has worked on web and mobile projects for Lotus, IBM, the New York Times,
Caterpillar Inc., Dragon Systems, Dictaphone, Nuance Communications, Yahoo!, Intuit
Inc., and a number of startups.
He specializes in software development, automated testing, website performance testing,
SDK testing, API testing, and technical writing.
He has served as a technical reviewer for Corona SDK Mobile Game Development
Beginner’s Guide, Packt Publishing.
Predrag Končar is a game developer and multimedia researcher. His primary areas of
interest are games and combining technology and art. He is also into image and audio
processing and interactive design and likes to spend his free time painting. In the last 12
years, he has worked as a technical and creative director for many online projects,
published over 40 online games, participated in the production of several iOS apps, and
worked with Packt Publishing as a technical reviewer on Corona SDK Mobile Game
Development Beginner’s Guide and Corona SDK Application Design. He has a strong
background in Unity, C#, ActionScript, Lua, MEL script, Maya, and Python. He is a
member of MENSA and ACM SIGGRAPH.
Bayard Randel is a software engineer at Canonical and is working on the Ubuntu Linux
infrastructure. He lives in Dunedin, New Zealand. His technical interests include software
education with Lua, web development, distributed systems, and functional programming.
Jayant C Varma is an Australian author, developer, trainer, and consultant with a special
focus on mobile development and the use of mobile applications in businesses. He is the
author of Learn Lua for iOS Game Development and is in the process of authoring another
book for Packt Publishing on Xcode 6, apart from a few other books with other publishers.
He is the principal consultant at OZ Apps, which is a company he founded. It specializes
in mobile business solutions and development-related services.
Jayant has been in the IT Industry for quite a while and has seen things change from 8-bit
computers and apps on cassette tapes to present-day mobile devices and app stores. He has
always been drawn toward new technologies. He has worked in different domains during
his career—which have seen him travel to different countries—including as the IT
manager for BMW dealerships. He has also helped them set up wireless diagnostics in
their workshop and contactless key readers at service receptions, and he has also
automated the front office (including sales automation, ordering, prospecting, CRM, and
so on in the early 2000s). He has also worked as a lecturer at the James Cook University
and a trainer for the Apple University Consortium (AUC) and Australian Computer
Society (ACS), among others, actively conducting trainings and workshops. He has
created several mobile and desktop applications for clients, which are available on the
App Store.
He has been a reviewer on more than half a dozen books for Packt Publishing. He can be
contacted via his website at http://www.oz-apps.com.
www.PacktPub.com
Support files, eBooks, discount offers, and
more
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and
ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as
a print book customer, you are entitled to a discount on the eBook copy. Get in touch with
us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up
for a range of free newsletters and receive exclusive discounts and offers on Packt books
and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt’s online digital
book library. Here, you can search, access, and read Packt’s entire library of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to access
PacktLib today and view 9 entirely free books. Simply use your login credentials for
immediate access.
Preface
Game AI is a combination of decision making and animation playback. Although classic
or academic AI is focused solely on finding the right decision to make, game AI is
responsible for acting on numerous decisions over time. Treating game AI independent
from animation is a classic mistake that this book avoids by integrating animation and
locomotion systems immediately into the AI systems. This subtle difference of decision
making and execution changes many of the aspects that game AI programmers have to
focus on.
The other large issue with game AI is regarding the specific needs and implementation
strategies that are genre-specific. In order to prevent a watered-down approach, this book
focuses on one specific genre, which is the first- and third-person action genre. Limiting
the AI to this decision allows for an in-depth, tutorial-based approach of creating a full AI
system. The overall goal of this book is to create an AI sandbox composed of professional
level C and C++ open source libraries exposed to an AI system scripted in Lua.
What this book covers
Chapter 1, Getting Started with AI Sandbox, begins with learning the overview of how
projects are set up as well as how the Lua script interacts with C++ code. Here, the
beginnings of the AI sandbox are built from open source technologies, starting with a
framework that integrates Lua, Ogre3D, OpenSteer, and Bullet Physics.
Chapter 2, Creating and Moving Agents, starts off with examples of the lowest layer of AI
interaction with the world, local steering, and movement. Here, agent seeking, avoiding,
and group movement are introduced into the sandbox through the use of the OpenSteer
library.
Chapter 3, Character Animations, continues with the AI sandbox by exposing Ogre3D’s
animation playback and resource handling of Lua scripts. Low-level structures for
controlling animation clips, animation state machines, and layered animations are
integrated into the sandbox.
Chapter 4, Mind Body Control, combines animation handling with local steering and agent
movement. Two different approaches toward mind and body interactions will be
implemented. The first will focus on the latency between agent decisions and actions,
while the second approach will focus on the perceived quality of the agent’s actions.
Chapter 5, Navigation, builds up from local movement and moves on to long distance
movement and planning. Navigation mesh generation provided by the Recast library will
be integrated into the AI sandbox in order to allow A* pathfinding provided by the Detour
library.
Chapter 6, Decision Making, adds intelligence to the choices the AI agents make.
Different data structures and approaches to creating modular and reusable decision logic
are covered through Lua scripts. Decision trees, finite state machines, and behavior trees
are integrated into the sandbox.
Chapter 7, Knowledge Representation, adds the ability to store long-term and short-term
information for individual agents. A centralized approach to storing and propagating agent
knowledge about the world is exposed to Lua.
Chapter 8, Perception, exposes the services that are available to agents for them to query
information about the world. Approaches toward visual- and communication-based
information is integrated into the sandbox.
Chapter 9, Tactics, exposes a high-level spatial knowledge of the environment to the
sandbox. Through a grid-based representation of the world, different knowledge sources
are combined in order to give you an accurate tactical view of the environment for
decision making.
What you need for this book
The AI sandbox solution and project files are built automatically through Premake, which
is the utility program. Visual Studio 2008, 2010, 2012, and 2013 were tested for
compatibility with each of the included demos. With the large number of dependencies the
sandbox builds from the source, the project setup is only supported from Visual Studio.
The open source Lua IDE, which is Decoda, is used to write and debug Lua scripts within
the sandbox. While other Lua script editors can be used, the sandbox natively exposes
information that allows seamless Lua debugging within Decoda.
Who this book is for
This book is aimed at programmers who are looking to understand all the facets involved
with the creation of the game AI. You should be comfortable with C or C++ and the Lua
programming language. While no direct C or C++ knowledge is required, being able to
fully debug into the sandbox allows for extending the existing functionality. A
combination of both functional and object-oriented Lua will be used by the sandbox, and
both approaches will be explained. Additional understanding of modern game engines will
be useful but is not required.
Conventions
In this book, you will find a number of text styles that distinguish between different kinds
of information. Here are some examples of these styles and an explanation of their
meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows: “The
LuaScriptUtilities header defines the metatable name of the vector type.”
New terms and important words are shown in bold. Words that you see on the screen,
for example, in menus or dialog boxes, appear in the text like this: “Open the Settings
menu under the Project menu.”
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Another Random Scribd Document
with Unrelated Content
rotation, depositing its contents of the grates, cement, bricks, or
some material necessary to the completion. These were whisked up
by the workmen and borne in to their rightful places. A continuous
procession upstairs and downstairs which reminded one of an army
of ants building themselves a new home. All this time the women
with mops were waiting, lest a bit of something drop on the new
polished floors or splash against the walls. So carefully was the whole
affair planned, however, that not a thing was marred, and at 9 A.M.
the next morning Stanford White handed over to the committee a
finished building. He won his money from Mr. Goelet, but with his
customary generosity bought a beautiful piece of tapestry and
presented it to the club.
Stanford was accused of shamefully copying when he built the
Madison Square Garden. It was supposed to be an exact replica of
the Giralda, in Spain. I have never seen the Giralda, but I have seen
on the right and left of a page, in juxtaposition, a photograph of both
buildings. I do not see a resemblance striking enough to comment
upon. When one thinks of how Shakespeare and Dumas, and, in fact,
almost every great man, has borrowed, the question for the fair
minded is whether the thing borrowed has been changed by the
personality of the borrower, which, if he be of any value, must
overlay and extinguish that first personality and give an entirely new
impression. Remember the lines, “He winked at Omar down the
road....”
Mrs. Van Rensselaer wrote a long article somewhere about the
Madison Square building and gushed about that rare quality in the
architects who would go so far as even to vary the color of their
bricks in constructing the tower, so as to give it variance of tonality.
This seemed to me improbable, and one day I asked Meade about it.
He said it was “rot,” that if one of the brickmakers had not gone
bankrupt, the tower would have been the same color all the way up. I
commented upon the hideous color of the combination of brickwork
and terra cotta produced both in this building and in the Herald
Building at Thirty-fifth Street. Stanny told me not to be silly, but to
wait until they were twenty years old. Remembering it the other day,
I looked, and, behold! the tonality and color in the Madison Square
building had come together like smoothing velvet.
The first attempt at the statue on the top failed by reason of the
fact that the drapery which flew from the shoulder, and served as a
tail or rudder, did not accomplish its purpose of turning her arrow
into the eye of the wind. Saint-Gaudens (the sculptor) and Stanny
spent some thousands of dollars in taking it down and making a new
one. The second worked as a weathercock, but, alas! it was not half
so beautiful. To-day the drapery over which they spent so much time
and money is gone. So much does America care for its art and its
artists!
One should not judge Stanford White’s ability as an architect by
the Washington Arch which stands at the foot of Fifth Avenue. The
temporary arch which preceded this one was put up in lath and
plaster—staff—to celebrate a memorial occasion, and was rarely
beautiful in structure and proportion. The city fathers asked him to
reproduce it for permanence in marble. He told them it could not be
done, but after much argument he gave in. I suppose it was a
question of bearing power or stress, but he did not succeed. Very few
men have ever been able to alter—to their own satisfaction, or to that
of the public—their first inspiration. A “dub” can; an artist can’t. The
Washington Arch stands to-day, as many other buildings in America
do, a monument to the interference with an artist’s dream.
Trinity Church in Boston is another example of the same thing.
Richardson’s original idea might have been a masterpiece, but, long
after it was wise to change his plans, the city authorities decided,
either from economy or from some other good reason, that, as the
building was situated on made land, it would not stand the weight of
the tower. They made him cut out fifty feet in height. You might as
well cut out two inches from a woman’s neck. Also, it is not fair to
criticize our own Grant’s Tomb. The architect’s plans were, I am told,
that one should see a building of stone capped by a great mass of
bronze figures on the top and one group on each of the four corners.
The best modiste in Paris might plan a hat with four large bunches of
blue flowers. It is not fair to call the hat her creation if you remove
the bunches. Those in power, again probably from economy,
considered the tomb of the President good enough as it was and did
not add the bronzes.
Now in the days of the great men in art such things were generally
in the hands of a dictator—pope, king, or Mæcenas—and the people
had nothing to do with them—except like them. Whistler says that
the warriors, on returning from battle, did not care pro or con
whether the artist-man, who stayed at home, had carved their
goblets or not, as long as they were just as good to drink out of. I
suppose one worships in the Trinity Church just as well, but I do not
believe that Grant receives the honor that the building as it was
planned would have given him, in the mind of either laborer or lord.
This time was quite a social period in my life. Good plays, good
music and much of it—there was a spontaneity in the New York folk
that has never touched me at any other time in America. I was
strong, though never muscular, with the vitality of five men; and to
work all day, run to the club in the late afternoon, dine well, and then
be in the company of congenial friends most of the night, did not put
a dent in my surplus energy. Stanny was the great driving force of all
our entertainments, and as he was the type of man who always paid
for everything and shoved anyone aside who tried to get in first, my
lack of money did not make much difference. It was in 1893, I think,
that he made me a member of the Vaudeville Club. In those days,
that large space to the left, in the second tier of the Metropolitan
Opera House, was given up to men only, and behind was the bar, a
set of rooms, and a small stage. Here a member could meet a friend,
have a drink, go in and hear what he wished of the opera, and come
out when he felt bored. After the performance there would be a
supper and a show given by the leading vaudeville people from
Broadway. Relaxation after the music, good food and drink, and
much talk and fun. Such entertainers as Vesta Victoria would be on
the program, and once we were honored by the presence of Mr.
Sandow. The latter was quite a lion for a time. I remember him, in
evening clothes, coming into the box of a lady very highly placed
socially. He seemed to be paralyzed by the attention given him.
When he said good-by, and evidently wishing to return his social
obligations, he handed each feminine occupant of the box a ticket to
his private performances out at his quarters, where they “could see
more of him.”
I remember one dinner party which was much criticized, but in
reality how very moral and dignified it was! The guests, all men, were
socially and artistically of the best set of the town. We wanted a
“blowout” and we did not propose to be limited by New-Englandism,
politics, or anything else. There were fifty men; everything was in
perfect taste, arranged by the best artists in America. There was
remarkably good music, made by a colored orchestra, and—mirabile
dictu!—no talk, no speeches, and no toasts. Every man at that dinner
knew that his next-door neighbor would be a treat to talk to and a
man on his feet would be an interruption. Two girls—models—in
exquisite costumes, one blond and one brunette, poured the drinks,
each one serving the colored wine which corresponded to her
complexion. At the dessert, solemn servants came forward, bearing a
huge six-foot pasty which was placed in the center of the great
horseshoe table. The negro musicians began to sing, in that
inimitable manner and rhythm of their race.
“Sing a song of Sixpence, pocket full of rye,
Four and twenty blackbirds baked in a pie—”
one of the artists leaned forward and skillfully broke the crust, and
myriads of canary birds (blackbirds not being obtainable even by
Monte Cristo) outpoured and flew to every corner of the room, just
as a charming young figure of a girl, draped from head to foot in
black illusion, with a stuffed blackbird upon her head, arose from the
dish. It was so new, original, and pretty, that comment upon it is
absurd. The society of these men was so good, so envied, and so far
above the average “low-brow” that it was preyed upon (probably
more than other class at any other time in the social history of
America) by the jealous and the criminal, and blackmailed to an
extraordinary degree. It just naturally broke itself up; Beauty is
sensitive and would rather disappear than run the risk of unwelcome
publicity.
Referring to the character of Stanford White, his right hand never
knew what his left was doing. I think he more nearly fitted Emerson’s
definition of the word “gentleman” than anyone else I have ever
known. It runs something like this: “A gentleman is one who never
brings his mental or physical troubles from his bedroom; if he cannot
leave them behind, he stays with them.” If the word can be divided
into its two constituents—“gentle” and “man”—Stanny was certainly
both, and I think “gentleness” (the opposite of “weakness”) is
possibly one of the words which implies that we are now some
distance from our ancestors, the cave dwellers. He may have had
troubles of his own, but we never knew about them, for he was
always so busy doing something for some one else that he hadn’t
time to talk of himself.
He pulled me out of many a financial hole, doubtless sometimes
with much work for himself. It is not always easy, even for rich men,
to get sums of money on the spur of the moment. Once he lent me
three thousand dollars on an order I was carrying out, and when I
paid him, he returned me the interest money the next day, with the
words: “I give you this on one condition, that you use it to go over to
Europe and visit your family. You need a vacation.” Dear old Stanny,
it wasn’t the money help that he gave his friends that made him so
charming, but it was the little things that require so much delicate
thought. I do not think he spent ten minutes a week thinking about
himself.
One memorable Easter Sunday (the Ten were to open a show next
day, and we were hanging our work) Stanny appeared. I had two
marines which he liked, but he was greatly taken with a portrait of
my grandmother which was not yet framed and was leaning against
the wall in the corner. I had intended to get some inch-and-a-half
molding for it. He could never bear to have a work of art improperly
dressed. I can see now how he looked, beautifully groomed with top
hat, frock coat—evidently on his way to some smart affair. He looked
at me a moment, then grabbed the portrait and rushed from the
place. Needless to say I followed. Outside was a fine equipage, his
own, and, taking it, we ended at his office, where he had a floor
stored with all kinds of valuable antiques, draperies, frames, statues,
which he had chosen in Europe—not because they were old or only
one of a kind in existence, but because they were beautiful—and
brought over here. Keeping up his two characteristic gestures of
scratching his head and rumpling his hair with one hand, and
slapping his thigh with the other—his office force knew that if he ever
did the two together it was time to flee—he dove into dozens of
frames which were piled for at least fifteen feet away from the wall.
Ignoring his clothes, he dashed in and was covered with dust in two
seconds. In five minutes he had tried all the frames and found two
that fitted the portrait. Telling me to take my choice, he turned
around and was gone. I had barely made my selection and turned to
go when a flunky from his Gramercy Park home ran in, out of breath,
and grabbed the picture. When we got to the street there was no sign
of Stanny or his carriage, but a large hired vehicle was waiting, ready
to take me back to the gallery. He was doing that sort of thing all the
time, but would have been very cross if anyone had mentioned it in
public.
May I tell of a small matter which, until the death of both men, I
have kept to myself? Once Stanny came to me acting rather
strangely, and asked me if I would take a trip uptown with him.
When we alighted at a studio building where many of my friends
lived he asked me to show him the way to X’s rooms—an artist I
remembered leaving behind us at the club. It seemed strange that
Stanny intended calling upon a man he knew not to be at home, but I
kept still. Kneeling down on the floor, he shoved under the door a
roll of bills which looked big figured to me, and we fled. In the cab
outside, I inquired what it meant.
“You know he needs it. I have it. Why shouldn’t I give it to him?
But you must never tell.”
I asked how much it was.
“Oh, I don’t know.”
The next day I heard X telling a friend that he had gone home the
night before, ready to pack his things, as he was to be kicked out of
his studio in the morning, but a most miraculous thing had
happened. He had found a roll of bills under his door.
I never told, and he died without knowing who had helped him.
One could hardly tell about the work of Stanford White without
including something of Augustus Saint-Gaudens, for America is
richer by many works of art which are the combination of the genius
of these two men. Saint-Gaudens was the son of a cobbler. I believe
that if an exhaustive history of the clever people of the world were
written, it would be found that a large percentage had been sons of
cobblers. As a boy, I used to be fascinated by a certain cobbler of the
town, and while listening to his words of wisdom I learned to make,
entirely with my own hands, a pair of boots. He was a socialist and, I
suppose, an anarchist, but the joy of life was in his heart and I am
sure that fashioning a beautiful covering for the human foot is as
near making a statue as anything could be.
It was funny to watch the French or the Irish crop out in Gussy.
The French was always on the alert for something beautiful. I
remember being taken by him and several architects up to a place in
Cornish. They had found a charming view. After climbing away up to
the top of a hill—mulleins, granite stones, and not much else in the
foreground—I was told to look off over the landscape and rave. They
called it “Too Good to be True.” I can visualize a farmer, an old
resident of the place (call him Haskins), coming in with the wood
which he throws into the woodbox, saying to his wife:
“There, Mother, I bet you can’t guess where that wood come from.”
“No. Where did it, Jake?”
“From that piece o’ land yer uncle Ezra left yer that Mr. Saint-
Gawdeens and them dudes calls ‘Too Good to be True.’” Great laugh
from both.
But every year or two with Gussy the Irish would get on top. A day
would arrive when the work he was doing would disgust him too
much. Then he would fire his assistants, helpers, and everyone out
and smash everything in the studio. He would spend two or three
days loafing in the club and with his friends, then back again, clean it
all up, and begin work, saying, “Now we can get ahead.” The year
that he was forty-nine he came to me, feeling very blue.
“Simmy, I’m out of it. I caught the model we had to-day in class
winking at the fellows when I exclaimed a little too enthusiastically
about her charms. The same thing happened to my master in Italy
when I was a student, and I remember wondering how he could be so
silly at his age.” Then he told me how he had always jumped upon
the platforms of the cars while they were in motion. That day, as he
did this, the driver said, “Peart for yer age, ain’t yer?” In the future he
intended to wait until the car stopped and get on properly.
When he got these blue streaks he had the habit of coming down to
The Players, finding me, and saying: “Now, Simmy, you must help
me. Order anything you want, on me, but stay right here and talk to
me.” I suppose the sound of my voice was, for him, like Vergil’s bees
in the lime trees—a susurrus. The talk was anything and everything.
Sometimes a discussion about a college education—as to whether
Lincoln would have been the same if he had had one, etc., etc. I told
him once about my discovery that every man, secretly and in his own
soul, thought himself the ideal type of human being. An art class in
Boston had been given as a subject for Saturday afternoon an ideal
head of a young Greek. The results were placed on easels, and I easily
picked out the author of each drawing from its resemblance to
himself. Then Gussie remembered that in Italy there was a
humpback in the class with him who made everything deformed.
In Chicago, where I went at one time to consult Daniel Burnham, I
met Saint-Gaudens and McKim. To my astonishment, they had come
to collect money to start an academy at Rome. They raised about one
hundred thousand dollars, I believe, and this was the beginning. I
always have been and still am opposed to formal organizations, and
an academy seemed to me just another of the same kind. I couldn’t
see Gussie in this position and asked:
“Que fais tu donc dans cette galère?”
His reply was very logical.
“No, I don’t, but when I was a boy I wanted to learn sculpture. If
there had been an academy in Rome at that time, I could have gotten
studio, materials, models, and all that I wanted for nothing. Let
Chicago and everybody subscribe. Who are they, anyway? After one
hundred years, the money will have been well spent if only one artist
—say a Michael Angelo—is helped to get what he needs.” He was
willing to sacrifice the whole pig-killing town if one genius could be
helped.
All the oil wells of Texas would not be worth, to our descendants,
one poem like the “Ode to a Grecian Urn.”
If I had the task of taking to Europe one thing as the best work of
art of America, I should take the tomb from the Rock Creek
Cemetery in Washington, which was created by those three artists—
Saint-Gaudens, Stanford White, and Henry Adams. Nothing we have
made in this country as yet, whether paint, carving, or architecture,
can equal it. This figure, an expression of the idea of death, marks, I
am told, the last resting place of the wife of Henry Adams, but there
is no name and no commemoration to any individual, no signature of
artist or architect; it is universal and might belong to any one of us. A
pilgrimage to this monument of a man’s respect for the woman he
loved is, of necessity, a sacred rite. One cannot pass gayly by in a
motor car and give a careless nod of approbation, but one must alight
(let us hope from one of those old-fashioned rickety open barouches,
driven by the last of the negro coachmen) and proceed up the
narrowest, most delightful little path, overgrown with shrubs and
bushes, where at the top of a knoll and carefully concealed from
common gaze is the Sphinx. Like the pilgrims to the ancient shrines,
one wishes one had courage to go back and approach this beauty of
all time and no time, upon one’s bended knees. And her
surroundings! How wonderfully the loving architect has framed her;
no word and no talk about death. There she sits and speaks to
everyone, and the message is the secret of his innermost thoughts—
so much as he brings, so much does she tell, and no more.
One day in Paris the Figaro started a reporter out to get the
opinions of different intellectual men upon death. Some gave a
column, some a half column, but when it came to Alphonse Daudet,
he said:
“My idea of death?—la mort?—psutt!—”
There is nothing to say, and all I can think of when looking at the
Rock Creek Memorial, are the words of Shakespeare,
The Rest is Silence
Chapter XII: Fine Arts in Relation to “A
Number of Things”
I t was during this period of my life that I did my best work; I had a
good studio in Carnegie Hall, freedom from money worries, and
abounding spirit. Also, my imagination was still fresh from the
influence of Europe, and the Old World was enough in retrospect for
me to realize its worth. One of the most interesting orders I received
at this time was to decorate a room in the new part of the Waldorf
Hotel, that addition called the Astoria. It was a long, narrow hall, the
Astor Gallery, with boxes all around a dais at one end. The room was
an attempt at the French of Louis Seize—bastard architecture, I think
—fancy work and rococo with curves and bends everywhere. After my
work was all finished I had to get up and paint over again the ribbon
held by one of the Cupids. It was taut and I changed it to wavy, as it
proved to be the only straight line in the whole room.
After I had submitted my sketches and they were accepted by the
architect, I had to go and sign my contract at the offices of John
Downey & Son. There was a large room full of stenographers and
bookkeepers, with a glass place on one side for the boss. John
Downey came out to greet me. As we sat at a big table, he pushed
toward me a long document, saying:
“There’s your contract. If you’ll read it over and it is satisfactory,
you’ve only to sign it and get your first payment.”
I read it and reached for the pen to sign. He must have seen some
doubt upon my face.
“Is it satisfactory,” he asked.
“No, but I’ll sign.”
“Why, I drew that contract myself! What’s the matter with it?”
“There is not enough time,” I replied.
His eyes narrowed.
“Mr. Simmons, you have lived a long time across the water? Yes?
Let me tell you something about American business methods. Never
complain over here that you haven’t enough time. If the job suits you,
wade in and do it. If you can’t finish it yourself, put on more men and
work nights!”
“But there are things that can’t be done that way,” I insisted.
“Sir, I’ve been a contractor for twenty years in New York City and if
there is anything you cannot do that way, I should like to hear about
it.”
“Well,” I said, “I admit your business position, but I still believe
that if you wanted a son and heir you would have to respect the old
rule to wait nine months, and not put on more men and work
nights.”
Sensation among the blond typewriters!
The working of a business man’s mind can never be guessed at
beforehand. I painted two decorations for one of America’s foremost
financiers. In making the sketches I was mindful of the fact that he
was a pillar of an orthodox denomination of the strictest type, and,
while I suggested a group of dancing figures, I was very careful to
drape them sedately with several layers of chiffon. What was my
surprise when the criticism came:
“Mr. Simmons’s idea is very delightful, but the figures are not nude
enough!”
The late Andrew Carnegie was a good old-fashioned type of man
who thought the God-given power to amass a large fortune was
indication of an all-embracing good judgment and taste. I never met
him but once. It was in ’91, at a show of pictures of the Society of
American Artists. I was presented to this short, stout little man. “Mr.
Carnegie” meant nothing to me, as I had just come straight from
England, and his fame had not managed to penetrate the shores of
Cornwall. He was most indifferent, did not like the exhibition very
much, and announced that he has purchased the only good picture,
pointing to an unimportant landscape. Abbot Thayer’s “Madonna”
(which Clarence King said should have buckets under it to catch the
dripping sentiment), a charming Thomas Dewing, a beautiful thing
by Theodore Robinson, and others were all about him, so I ventured
to tell the doughty Scotsman that he must be deeply ignorant on the
subject of art. That naturally closed the interview.
For the Astor Gallery I chose as subjects women—which I like best
to paint—representing the twelve months of the year and the four
seasons, sixteen panels in all. How I labored over the color of the
room, changing the tone every three feet all the way up, until it
looked all the same! My idea was to make a background that would
seem to be white, but against which a woman’s complexion would be
beautiful and a man’s shirt front would tell. They have painted the
whole thing over now, of course. My decorations are untouched, but
it is no longer my room.
“JANUARY”
People do not realize what these little things mean. The architects
had given me the whole control, but even at the time I was doing the
work I was greatly restricted. There were four little panels that were
not in the contract, but sadly needed to be decorated. I offered to do
them at my own expense and also to change the terrible red-velvet
railing that ran around the balcony, but do you think the hotel
authorities would let me do it? No; the opening was on a certain day
and all the workmen must be out before then. Business before art
every time.
I had to insure the panels twice—once to the contractor and again
to John Jacob Astor, whose lawyer, by the way, demanded that all
the artists working in the building hand over their copyrights to him,
which they “had improperly taken out on Mr. Astor’s property.” We
had a meeting, and the others decided not to do anything to
antagonize him. I was furious and asked my friend, Luther Lincoln,
what to do about it. “Oh, come away and take a walking trip with me
to the Delaware Water Gap,” he said. I went and I still have my
copyright. To show that my rights in the matter are recognized by the
authorities, the architect once wrote to me and, saying that Mr. Boldt
had asked for permission to reproduce my panels in the Hotel Guide,
and commanded me to grant the same. I answered and gave him
permission to buy the photographs of my work from Curtis and
Cameron, relinquishing my royalties. Mr. Astor, therefore, paid for
the reproductions, so establishing my case.
This question of copyright is one that crops up all the time and
never will be really settled until some artist has money enough to
carry a case to the Supreme Court of the United States. Anyone who
writes a book, a play, or music, and even those who make etchings
and engravings, are protected, but the law does not apply to the
painter or the sculptor. I do not believe that the Supreme Court
would decide in our favor, for over here we are more apt to follow the
English law, where the buyer, unless otherwise stated, retains the
copyright, and not the French law, where the artist always has it.
After the decorators had been chosen for the work in the Appellate
Court, the chief justice asked me to bring in some of my former
contracts that he might see the form and make one for us to sign
more or less like them. Then, later, he asked me to make one which I
thought would serve. As the question was then vitally at issue about
the copyright, I slipped in a small clause—“artist to retain the
copyright.” It came back to me blue-penciled, so I saw it would be no
use. Later, the chief justice gave a talk at a lunch to which I was
invited, and remarked that Mr. Simmons was “not only an able
painter, but a keen lawyer.” If it had not been for an accident, he
would not have noticed a certain line that I had put into my contract,
and I would have obtained a decision of the Appellate Court for
nothing. That line would have established a precedent for the state of
New York, and from that time all artists would have had and owned
their copyrights.
James Lord was the architect of the Appellate Court. There was
great trouble because he signed out the triptych to three men when it
should have been given to one. He evidently wanted to give everyone
a chance, for in the other part of the building he gave one frieze to
five men. Our triptych was done by Blashfield, Walker, and myself.
We were to do Justice in three forms, and as the work of Blashfield
and myself was more nearly alike, we put Walker in the middle. I
waited until Blashfield had determined the composition, the color
scheme, and even until he had actually painted his background, and
then, as far as I could, I followed him. After the canvases were
completed and on the wall, I found that my two figures of small boys
in the foreground were not in the right place, so I painted them out
and moved them up four inches higher. Blashfield went even farther.
He took out a woman’s figure with her back turned and changed her
completely, because he did not think she agreed with the general
composition of the three. These changes were very difficult, as they
were done under a different light, in a different place from the
original work, and, of necessity (as the building was then in use),
without the assistance of models.
A remark of Richard Canfield’s on my panel is worth quoting. I
have, in the foreground, a symbolism of a child pushing away the
nose of a vulpine animal with his right hand, to protect a rabbit at his
left. The great gambler said:
“By George! Simmons, I did not know you had so much
intelligence as that. That symbolism of yours is very apt: Crime,
Ignorance, and Stupidity. Is that what the Appellate Court stands
for?”
At my first interview with Canfield I got a taste of the man I was to
deal with. Clarence Luce was the architect who made the gambling
house on Forty-fourth Street, next to Delmonico’s, and he came to
me with a proposition to decorate it, saying that I was to talk the
matter over with Mr. Canfield himself. I, of course, decided he would
know nothing of art and it would be rather trying. I was mistaken. A
short, fattish, powerful man greeted me and said, only:
“I want your best work. You know what that is and I shall know it
when I see it. We’ll talk the money over later.”
This did not seem extraordinary to me at the time. Sad experience
has since taught me to do nothing without a contract, but I have
always found that with men of the character of Richard Canfield,
nothing of the sort is necessary. In working for John Dunston,
proprietor of the famous “Jack’s” Restaurant, I would paint a panel
in my studio, take it down to the room, and put it upon the wall, go
directly to the office and get my money—no criticism of my work and
no arguments—just a man’s word, and as to the artistic part of it, he
considered my judgment better than his.
Like Napoleon, when Canfield wanted anything done, he employed
the best men and told them to go ahead. He became a great friend of
Whistler’s and has written one of the most interesting accounts of
the painter that I have read. Whistler painted Canfield’s portrait and
doubtless found him a congenial companion—as who would not? He
knew life, he knew human nature, he was an expert on guns and
firearms and had killed his man or I miss my guess; and yet I must
say that Richard Canfield was a man in every sense of the word and
as much a gentleman as one who lives outside the law can be. He was
the god of all the smaller gamblers and had helped more than one
over the rough spots.
The house where fortunes were made and lost is standing to-day,
and from the outside resembles nothing more than the ordinary,
narrow, three- or four-story, brownstone dwelling place. In
Canfield’s time, Clarence Luce had managed to transform the
interior until it was quite a gem in its way. Entering by the big swing
door, one stepped into a small vestibule done in Numidian marble.
In the ceiling were five rhomboidal panels of thin jade behind which
were lights casting a soft glow, Oriental in its effect (one might
imagine it to be Cleopatra’s bedroom), and giving a thrill of mystery
right at the start.
Before one was a solemn door and the usual grill with a bell. Upon
ringing, a huge negro peeked through, and one was admitted if one
were a friend. Behind this was a reception room, and here I painted
Pandora and her box with a great smoke, interspersed with figures,
coming out of it; while over the mantel of the room behind were
Hospitality and her attendants. The gambling room was on the next
floor, and on the newel post of the stairway was a charming little
reproduction of the “Bacchante” by Frederick MacMonnies, of which
Anders Zorn said to me:
“For the first time I see this lady where she should be—in a
gambling house.”
The architect had scaled everything down to undersize, so that in
this narrow house things might look large. There must have been
extra chambers in the walls, as in the daytime there was nothing to
be seen of the tables or the wheels, and for aught one knew, it was a
private home. The back room, where was served any kind of drink or
food (even to cold partridge) that human ingenuity could conjure,
was dark, of the dull colors of Spanish leather, and this formed a
contrast to the room where the playing went on. This was light, with
a carpet on the floor of terre-verte plush so thick that one’s feet sunk
into its depths without making the slightest sound. I saw that the
only color must come from the faces of the men, the red spots on the
table—and my decorations.
The spaces to be painted were two of those difficult cat-claw panels
(spandrels) at one end of the room, and these were also undersize. I
could not use a male figure, so made my “Night” and “Morning,”
taken from Swinburne’s lines,
When haughty Day represses
Night’s cold and faint caresses,
Panel by Edward
Simmons, Boston State
House
Copyright by Edward
Simmons; from a
Copley Print
ebookgate.com