Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning Game AI Programming with Lua

You're reading from  Learning Game AI Programming with Lua

Product type Book
Published in Nov 2014
Publisher Packt
ISBN-13 9781783281336
Pages 352 pages
Edition 1st Edition
Languages
Author (1):
David Young David Young
Profile icon David Young

Table of Contents (16) Chapters

Learning Game AI Programming with Lua
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with AI Sandbox 2. Creating and Moving Agents 3. Character Animations 4. Mind Body Control 5. Navigation 6. Decision Making 7. Knowledge Representation 8. Perception 9. Tactics Index

Physics


Even though agents are simulated with physics, not all of the agent's physics parameters are enforced at the physics simulation level. The mass of an agent, for example, is the identical mass used within the physics simulation itself, while the MaxForce and MaxSpeed functions of an agent are only enforced by the agent. These two properties represent the maximum amount of force an agent can exert on itself and the max speed the agent can reach without any outside influences.

An intuitive example of why this separation is desirable when dealing with agent physics is gravity. When an agent accelerates to its max speed, we still want gravity to accelerate the agents downward in the case of falls. This acceleration can force agents to have a speed larger than their max speed property.

Mass

To access and modify the mass of our agents we can use the agent's GetMass and SetMass helper functions.

local mass = agent:GetMass();
agent:SetMass(mass);

The max force

The maximum force of our agents can...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}