Main      Site Guide    
Smash Tutorial

Coding Standards For Games On "Adventure Games Live"


It is important that Smash games look professional and maintain some kind of a consistent "look and feel." The following guidelines help accomplish that. They are requirements for any game appearing on Adventure Games Live, but they're probably a good idea anyway, for any Smash game.

  1. Correct spelling, grammar, capitalization, and punctuation should be used for all text that ever gets displayed to the user.
  2. Options should be imperative sentences with a capital letter and a period (or, in very rare cases, an exclamation mark) at the end.

    Wrong:

    • go north.
    • Go north
    • Go North.
    • North.
    • I'll go north.
    • You go north.

    Right:

    • Go north.
  3. The ordering of movement options should start with north and proceed clockwise around the compass. Then an "up" option may be provided, and then a "down" option may be provided. Anything else should come at the end. These ordering rules help players find where they want to go more easily and intuitively. So supposing you could go in all conceivable directions from somewhere, the correct ordering would be this:

    • Go north.
    • Go northeast.
    • Go east.
    • Go southeast.
    • Go south.
    • Go southwest.
    • Go west.
    • Go northwest.
    • Go up.
    • Go down.
    • Enter the house.
    • Go through the sixth dimension.
  4. Object names should be capitalized (unless there's some special reason why they shouldn't be). Note that this applies only for the object names as they appear in the inventory. In description texts and option texts, normal capitalization rules apply. These are all correct object names:

    • Coin
    • Silver Key
    • Battle Axe of Doom
  5. Although the Smash engine will accept any number of spaces or tabs between a command and its first argument, games for Adventure Games Live must only ever use one space character between a command and its argument, as illustrated in the examples given in this tutorial.
  6. Avoid recursive functions wherever possible! Recursive functions are functions that, under certain circumstances, call themselves. While there is nothing inherent in the Smash language that should discourage the use of recursive functions, the particular engine used on Adventure Games Live does not handle them efficiently. Use loops (the "L" command) to achieve repetition wherever possible.
  7. Although Smash permits the ability for any number of actions occurring when you select one of the inventory choices, this does not mean you should necessarily take advantage of this feature. A prime, unbreakable rule for not just Adventure Games Live games but any adventure game is that an instruction from the human player to the in-game player should not cause the in-game player to do something the human player did not expect. For example, if you select an option that says, "Shoot the three-eyed cobra," the game should not come back and say, "You take careful aim at the one-eyed bunny rabbit and fire." It would be acceptable to say, "You aim at the three-eyed cobra and fire, but you miss and hit the one-eyed bunny rabbit," because at least then the instructions of the human player were not ignored or countermanded.

    Along the same lines, if the player selects an inventory item with the misconception that all he's going to do is examine it, but instead he use it or stabs it or drops it or gives it away, this same rule is being broken. The rule of thumb is, have inventory selection do simple examination unless the context of your game makes it clear that something else will happen instead.

  8. Although Smash permits the ability to g to any .sma file, making that the player's current location, Adventure Games Live games should not ever g to start.sma, copts.sma, objectactions.sma, eobjectactions.sma, or admin.sma. Additionally, admin.sma may not contain any functions that are called from the game, although the reverse is permitted. It is bad coding practice to use special .sma files as regular locations, and in the case of admin.sma, it makes it impossible to supply a production game with a new admin.sma file without potentially breaking the game for current players.