Lovers of text quests. Constructor.

    December 31, I proposed the idea of ​​creating a site on which any user can create and place their own text quest. Then there was a rather long New Year, and here I am again in service.

    In this topic, I want to share with you my thoughts on the quest designer - the most important element of the project. I would like to hear both your comments on the planned functionality, and on the architecture as a whole.



    For the main structural element, I decided to take the location. The location will be described by the name, description and picture. Between locations it will be possible to move. The following elements can be placed on the location :

    1. Action
    Which will be represented as a text link (with an icon?) And will lead to the execution of the next element - an event. Actions can be of several standard types - so far it only occurred to take / give a thing, or just output an event.

    2. Event (Event)
    The result of the action. The event is also described by its name, description and picture. Each event can be associated with an unlimited number of actions that are displayed in the list when the event is loaded. Example - when going to a location, the default action is loaded - index, which triggers an event that displays a description of the location.

    3. NPC
    Game character. It is described again by name, description and picture. When you click on a character’s link in a location, a window opens with available dialogs. Dialogs, by the way, are made in a separate constructor module and are the same actions and events, only presented in a slightly different form.

    Also, when creating a dialogue, it will be possible to indicate what things are needed to continue one or another of its branches or to obtain another thing (exchange).

    Things (Item)

    I already mentioned the possibility of receiving / giving things back. In my opinion, this greatly expands the possibilities of text quests. Those who played quests such as “Petka and Vasily Ivanovich”, I think, remember the eternal problem “who needs to give the candelabra to get a condom, which in the future needs to be used to go to the prostitute, which has important information”. Was it interesting?

    In an amicable way, an array with player items must be stored in the cache by the key associated with the user id - but for such a thing you need to take at least vps. We will launch the project by March and will take a server for it - but do not wait for us until March? Therefore, I think that for starters you can store an array with things in a session.

    Saving the results of dialogs and actions

    First, an example. I "rude" the NPC and he refuses to give me the key-item. If you do not save the result of the dialogue, then it will be possible to go through again - i.e. everything stupidly rests in the search for options. And so the result of the dialogue will remain in the same session, and if the authors do not provide for other options for the development of events, then the quest is inundated. We should still think about this point, because with illiterate use in quests, dead ends will appear.

    I think this functionality is more than enough for a start. Then it will be possible to add more interesting things. I already planned to spend more time than several days.

    Also popular now: