Accomazzi

Archivi

Applicazioni
  Sogni & Spade 3D
  ZyXEL Genie

Altro


Mandami un commento

[Mage icon]Sword Dream technical note 14

About Sword Dream II

Q: I know the Sword Dream II project is on hold. Still, I'd like to know more about it. How is it supposed to enhance on Sword Dream 3D?

Dream II defines a "world". Everything in the game happens inside the world. The world consists of many entities, which interact with each other. The entities (also called "objects") comprise monsters, spells,characters and more.

So, Dream II is said to be an object-oriented game. Everything the Scenario designer creates and manipulates is an object.

Most objects are, of course, dynamic (that is, they can be born and die during game play; e.g.monsters). A few objects are born when game play commences and die when the game is stopped.

Object categories

Roughly speaking, there are three kind of Dream II Objects.

Game play objects

These are the objects which are part of the game itself. Examples include monsters, spells,characters, items, environments... (The list is not finalized)

Game play objects are dynamic.

Macintosh objects

These are part of the user interface, and still can be controlled by the Scenario Designer. Examples include windows, soundtrack music, speech, sounds, QuickTimes movies, cursors.

Macintosh objects are static.

Support objects

Support objects are special. Most support objects are unique (that is, there is only one of its kind) and static. They help define the environment.

One example is the date. The game stores the current date (game date, not real date) in an object, so that the Scenario designer can manipulate it.

Object messages

Objects receive messages from the Dream II Engine. The defined messages comprise:

  • BeBorn
  • Save;
  • Die;
  • Open;
  • Select;
  • LoseFocus;
  • Close;
  • PlaceChange;
  • Time
  • HitUse
  • ChangeOwner
  • Move
  • Draw
  • Control (Talk)

    When an object receives a message, it reacts. For example, an object receiving the "Draw" message shows itself on screen.

    The messages are sent at appropriate times by the Engine. For example, Dream II sends "PlaceChange" messages to everybody in the world every time the player moves from place to place.

    Some messages are very generic, and their meaning changes in relation to their intended target. For example, when "HitUse" reaches a monster, it means the monster was wounded; when the same message reaches an item, it means the item was used by someone.

    The Scenario Designer can send messages to the objects in the Dream II world. So if, for example, you send a "Move" message to a window, the window moves on screen. If you send the "Move" message to a monster, the monster walks accordingly to your dictates.

    DreamCode

    The Scenario Designer manipulates the Dream II worls via DreamCode, an object-oriented language based on AppleScript.

    DreamCode lets you attach routines to objects. For example, if you created a monster, you could state:

    on Talk (message)
    if (message = "Dragonspawn") then
    return "Why didn't you say before you are of the Dragon Society?"
    else
    return "I don't talk with invaders"
    end if
    end Talk

    And, if you mean to create an item which explodes when thrown away, you can simply write:

    on Die
    -- 12 hit points of damage!
    owner.hitUse (12)
    -- let the boom be heard
    -- 1000 is the resource id of the sampled boom
    -- SOUND is the DreamBasic name for the Mac speaker
    SOUND.talk ("1000")
    end Die

    (Warning: the syntax of DreamCode is not finalized yet. These examples might not work, in the current form, in a released version of the game engine. They are only intended as a generic example).

    DreamCode allows incredible freedom in designing a game scenario. The following example (our first working magic item for Dream II) will give you a glimpse of what can be done.

    This code is for a magic sword. It's a sentient sword, which, from time to time, says something. Notice how easy it is to program the talking sword.

    on Time (minutesPassed)
    -- Create a pool of phrases
    copy {"Nice weather we've been having, lately",
    "Why don't you buy me a leather scabbard? This one tickles me.",
    "Don't you think swords are way better than axes?",
    "I'm proud of my sharp remarks. Ha ha. You get it? "Sharp" remarks ",
    "Don't you think I'm a wonderful sword?"}
    to phrases
    -- choose one of those at random
    copy some item of phrases to onePhrase
    -- Put the chosen phrase in the same window player characters use
    to talk
    -- to each other. The format is usually:
    -- Galahad: Don't wake that red dragon!
    -- (where "Galahad" is the name of the player which said the
    phrase)
    -- So we format the phrase to look like the above. tell application "DreamII"
    transcribe "Magic sword: " & onePhrase & " " end tell
    end Time

    Network play

    Sword Dream II allows up to four players to play together, over any network. We are considering the feasibility of game play over the Internet.

    During exploration, the group leader takes the lead and moves the group. During combat, every player moves his or her own character. At any time, players can chat over the network.


    Back to theSword Dream main Web page