Skip to main content

Managing State

  • Chapter
  • First Online:
Book cover Beginning 3D Game Development with Unity 4:
  • 2607 Accesses

Abstract

In classic point-and-click adventure games, one of the most entertaining and challenging goals is to collect anything and everything that is not nailed down and then try to figure out where it needs to be used. To make things even more interesting, many games require you to combine inventory items before they will be able to perform the necessary task. It may be as mechanically logical as combining a hammerhead with a wooden handle to make a usable tool, or as challenging as adding the correct ingredients to a brew. In the former, you might consider the combination object a totally new object that needs to be activated in the scene. In the latter, however, you might need to change its virtual state each time an ingredient is added. Even something as simple as a door can have two states: open and closed. While some states, such as with the door, physically prevent access to a location or crucial object, others, such as a lock on the same door, have no physical manifestation. If the door’s state is locked, interaction with it might produce a rattle, but if its state is unlocked, it will open when picked, putting it into a third state, open. Once you consider adding save and restore functionality to the game, the need for a means to track state becomes even more important.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 69.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 89.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Sue Blackman

About this chapter

Cite this chapter

Blackman, S. (2013). Managing State. In: Beginning 3D Game Development with Unity 4:. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-4900-9_9

Download citation

Publish with us

Policies and ethics