kiigame / kged

A game editor for the KiiGame Adventure Engine
https://kged.netlify.com
BSD 3-Clause "New" or "Revised" License
1 stars 6 forks source link

Add interaction #30

Open evktalo opened 4 years ago

evktalo commented 4 years ago

As a game designer, I want to add interactions, so that I can create interactive events in my game.

Acceptance criteria:

Technical notes:

Notes: Make sure to get familiar with https://github.com/kiigame/adventure_engine/wiki/Adventure-creation-guide before starting the implementation. The interaction system in the engine is quite flexible and generic.

It is very important to consider UX before starting to implement this feature. Generic view to edit all/any kind of interactions the engine supports is probably quite difficult to design.

Consider slicing this feature. For example, certain interaction commands (monologue, inventory_add, etc) could be sliced into separate tasks. Not everything needs to be implemented at once.

Also, it is a good idea to consider separate features to add in "build-in" or "macro" interactions. There are already two examples in the editor:

From engine point of view, they both are flexible, generic interactions that just happen to combine "click" ui interaction with "add_monologue" interaction command (examine texts) and "do_transition" interaction command (door), but in the editor, it is good that these can be quickly added to furniture.

Related to #29

Svenskapojkarna commented 4 years ago

I think this feature could be implemented by adding new tab to the left panel called interactions. In this tab, user could add interactions to items or furnitures. The options for interactions would be click and drag-and-drop. For both of these options, user could chain together different actions that happen when click or drag-and-drop occurs. This implementation could be similar to interactions.json.

When user opens the interactions tab from the left panel, inspector would show a list of already defined interactions. User could then select one interaction to be modified or deleted.

Here are few mock-ups to visualize my suggestion:

interactionMockUp1 interactionMockUp2 interactionMockUp3

evktalo commented 4 years ago

This looks pretty good!

One thing I notice from mock-ups, is that timeouts have not been mentioned in this ticket yet. They're (in LZ) only used for room transitions and triggering the ending after the cutscene (search "timeout" in interaction.json for examples). Maybe both of these cases shouldn't need manually set timeout in the data. But for now I suppose it needs to be handled in the editor in some way.. just a heads-up.

Svenskapojkarna commented 4 years ago

Currently the user is unable to configure the transition timeout, for example when setting furniture to be a door, the user is only able to select to which room the door leads. I think we should keep to this way in interactions-tab to maintain consistency.

Although if the user sets an interaction "do_transition", he/she will also be able to set "room arrival text". Basically this way we can implement the timeout-option of monologue without need of user configuration. This timeout will be something like transitionTime + 1s. The user would see that he/she is just configuring the interaction of moving from one room to another, but under the hood there will be two interactions created and chained together:

{
    "comand": "do_transition",
    "destination": "someRoom"
},
{
    "command": "monologue",
    "textkey": {"object": "someObject", "string": "someText"},
    "timeout": "transitionTime + 1000"
}