Git Product home page Git Product logo

trizbort's Introduction

Trizbort.io

Trizbort.io is a JavaScript implementation of Trizbort, the adventure game mapping and code generation software. It aims to provide all Trizbort features in the browser, so that no download is required to create and share Trizbort maps, and generate code for several adventure design systems.

Drawing a map in Trizbort.io

Code generation

At the moment, Trizbort.io supports code generation for the following design systems and formats:

Code generation is more complete for some systems than for others. Experts are very welcome to contribute to make code generation results more complete. Code generation for Ink and Hugo may be added in the future.

Contributing

Trizbort.io is written in TypeScript using the JAMstack. There is no server back-end and there are few dependencies. It is simple to get it to run locally so you can hack on it. To do so:

  • Install Node.js (even if you have Node.js, a recent version is recommended). It will come with npm, the Node.js package manager.
  • Fork the project to a local directory.
  • Run npm install to install all dependencies. This includes TypeScript, Grunt, Handlebars and Express.
  • Build the project by running grunt build.
  • Optionally run grunt watch. This will rebuild parts of the project whenever you make a change.
  • Start an Express development server with npm run start:dev. This server will listen on port 3000.
  • Open http://localhost:3000/index.html in your browser.

Public web application

The public end-user implementation of Trizbort runs at Trizbort.io. The implementation is updated regularly to reflect changes as these are built into this repository.

trizbort's People

Contributors

dependabot[bot] avatar dfabulich avatar floriancargoet avatar happy-ferret avatar henck avatar inventor200 avatar selsynn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

trizbort's Issues

Remove sample maps from code

Currently, the sample maps are part of the main code body. They should be moved to separate JSON files and downloaded by Trizbort.io as necessary.

i18n support

This isn't a bug report or a feature request. More of a general inquiry or an RFC (in fact, I'd love to debate some implementation details).

I was wondering what your stance on i18n (internationalization. In this instance, a focus on localization specifically) was.

Is this something you'd like to see supported in the foreseeable future?

I currently work on a set of simple i18n libraries for both Go and TypeScript (aptly dubbed Rosetta-Go and Rosetta-TS, respectively).

Both libraries follow the Chrome i18n API (just the basics, so far. No placeholder support, yet).

In its most basic incarnation there's a locales directory. Inside that locales directory are folders named for language shortcodes (en, fr, de, etc. So far, no support for country-specific shortcodes). Inside each of these folders is a messages.json file that adheres to the following basic pattern (where "new_map_title" and "new_map_text" are unique keys, and the contents of the "message" fields the language-specific display text):

{
    "new_map_title": {
        "message": "New map"
    },
    "new_map_text": {
        "message": "This will erase all editor contents. Proceed?"
    }
}

To quickly switch between languages in the browser, the user may provide a lang argument (i. e. www.trizbort.io/app/index.html?lang=fr — or www.trizbort.io/app/index.html?map=hobbit&lang=fr, to load a new map while also switching the language to French).

If a language code is not recognized, the application will launch with the default fallback language (English, for Trizbort) instead. Although here one may also consider checking the browser language (window.navigator.language) against the array of supported languages.

Both i18n libraries will provide a GetMessage(key: string) method to place a translation.

The translation specific code for the screenshots below looks as follows:

actionNewMap() {
    new Window(i18n.getMessage("new_map_title"), i18n.getMessage("new_map_text"), () => {
      // OK
      App.map = new Map();
      Dispatcher.notify(AppEvent.Load, null);
    }, () => {
      // Cancel
    });
  }

The beauty of utilizing Chrome i18n lies in its simplicity, as well as the compatibility with most online translation providers like Transifex or Crowdin.

Screenshots: A first WIP implementation running in my fork.

i18n
i18n-2

Keyboard shortcuts to select a room

Create a room. Use shift-up to create a room to the north.

Actual: The original room is selected. There's no way (that I can see) to use the keyboard to select the room you just created

Desired: At the very least, pressing the tab key should support selecting rooms. It would be nifty if there were a keyboard shortcut (tab + up?) to navigate to the room to the north.

Keyboard shortcut in room detail panel to close panel and select the room

Click on a room. Press Enter to open its detail panel, and type a new name for the room.

There's now no keyboard shortcut to close the detail panel and select the current room. I suggest that Esc could do that (though I see that Esc is currently used for "Unselect All").

This would be useful, together with #54, to allow you to create an entire map with just the keyboard.

Ink (Inky) export

Ink is a free platform to create interactive story.
The way to go is totally different than the one I knew before, as it has a philosophy of no graph of choice but more a multitude of choice with conditions.
It is exported in json. I don't have a json (as I am at work) but the understandable way (in Inky the editor)
PSEUDO CODE, I am not sure at all of what I write

CONST locationA = "Super Location A"
CONST locationB = "loc b"
VAR currentLocation = locationA
->locationA

===Map
The map is here: you can see you can go 
{ currentLocation:
- locationA: 
  + East (to {locationB}) ->locationBKnot
- locationB:
  + West (to {locationA}) ->locationAKnot
}
+ Stay at {currentLocation}

=== locationAKnot
~ currentLocation = locationA
Location A text and special feature that the writer can edit as he wants
+ See the map -> Map

=== locationBKnot
~ currentLocation = locationB
Location B text and special feature that the writer can edit as he wants
+ See the map -> Map

I will add the json directly responsible for seeing this in the editor when I will have time

It will display something like

Location A text and special feature that the writer can edit as he wants
CHOICE : See the map
Click
The map is here: you can see you can go
CHOICE: East (to loc b)
Click
Location B text and special feature that the writer can edit as he wants
CHOICE : See the map
Click
The map is here: you can see you can go
CHOICE: West (to Super Location A)
Click
Location A text and special feature that the writer can edit as he wants

PDF Export

The Trizbort App allows to export as PDF.
It would be very useful to have this option in trizbort.io
This creates a smaller file than png.
It also prevents the text from blurring when zooming in or printing

Backspace should delete a room

Create a room, click on it, and press backspace. (On macOS keyboards, this key is labeled "delete," but it's still keyCode 8, not the delete keyCode 46, which you can type by holding the "fn" key while you press "delete".)

Desired: Backspace should delete the selected room

Actual: On Firefox 76 for macOS Catalina 10.15.4, the backspace key navigates back; you see the beforeunload popup. (On Chrome 81, nothing happens when you press backspace.)

GUI help for objects in rooms

It is not likely that users are aware that it is actually possible to create a hierarchy of objects inside a room. A container can contain other objects, which can in turn be containers with objects inside, and so on. Whenever more than one object is created, any object box can be dragged and positioned in the object tree. Some of the code generators actually use the object tree to export code for complex object hierarchies.

There should be a mini help system in the "Objects" tab that explains this, or users will never know about this functionality.

GUI help for new users

New users are confronted with a blank map and no idea what to do. There should be a little toast at the bottom of the screen that suggests that they click the room icon to create their first room. Or even a more elaborate tutorial system.

Advanced users should be able to turn off the tutorial system, and their preference should be saved in the browser session.

Can't connect rooms on mobile

In Chrome 81 for Android 10 and in Safari for iOS 13.4, there's no way to get the room connector circles to appear. They appear on hover, but mobile doesn't have hover.

When you tap on a room, you see the resize squares, but not the room connectors.

I can think of two ways to address this.

  1. Clicking on an already selected room should toggle between "resize mode" and "room connector" mode.
  2. Perhaps there should be a "connector" tool in the tool bar; when selected, all rooms would show connectors by default

No way to scroll the map with the mouse wheel

To reproduce:
Zoom out a few times. Create a room near the edge of the screen. Zoom in a few times, so your room is no longer visible. Scroll with your touch pad or mouse wheel.

Expected:
The canvas should scroll.

Actual:
Scrolling with a touch pad or mouse wheel zooms in and out.

Add YAML code generator

To make it easier for other applications to consume Trizbort.io map data, a YAML export is useful (beyond the default JSON format used to save maps).

Big gap in side-bar appears & breaks positioning

Hi,

I've just stumbled across Trizbort and it's great - I really wanna use it to map out my next game.
However, it seems the current build has an issue where, after opening the properties side-bar pane - an additional "gap" appears.

CORRECTION: This only happens if you Double-Click an item (using the ellipse [...] button is ok)

Unfortunately, it's not just aesthetically annoying - as this gap also throws off the mouse position for clicking and using the editor (making it effectively unusable). 😥
(It's fine when it first loads - it only seems to happen after opening the properties pane)

Tested in: Brave, Edge "Chromium"

GIF

On macOS, use Cmd instead of Ctrl for keyboard shortcuts

Trizbort has a few "standard" keyboard shortcuts with the Ctrl key:

  • Ctrl A: Select All
  • Ctrl C: Copy
  • Ctrl V: Paste
  • Ctrl Z: Undo

On macOS, these keyboard shortcuts are normally bound to the Cmd key ⌘; it would be great if I could use those there instead.

MiniZyll export

I have been thinking about developing an adventuring system based on the 1984 game Zyll's user interface. Zyll requires no typing, and still delivers a fun adventuring experience, albeit with some D&D features added:

minizyll

It's a WIP called "MiniZyll" as it would offer "mini" adventures that could be dropped into a larger website. On the other hand, it might also be a full-screen thing. There would be multiple adventures implemented as resources to be loaded into the base system.

Trizbort may be a nice tool to create resources files for "MiniZyll": It allows map creation, connections, and objects. The original Zyll is heavy on locked doors, so these will need to be added to Trizbort. There are also several monsters, so Trizbort would have to add features for that. The idea here is not to change Trizbort too much - it should not be a tool geared towards use with MiniZyll - but to add a couple of extra fields in the .trizbort files that MiniZyll could interpret in its own way.

I also thought that I'd like to make MiniZyll reminiscent of the first text adventures with static graphics, like Level 9's "Jewels of Darkness" or Interplay's "Mindshadow" and "Tracer Saunction". For MiniZyll, screens would be drawn in SVG, with as few polygons as possible. I considered making an SVG draw routine that would draw the images as slowly as the original games, and visibly color them in, but that will probably get old fast. Still, to draw room images for a 100-room adventure would require keeping to images simple anyway. I thought about keeping a CGA color palette, but again, probably a bad idea. It turns out SVG files get big fast, so for detailed graphics, it would be better to convert them to PNG format after all.

Since Zyll requires no typing, just button-clicking, it is also a good candidate for localizable games. Making a text parser in anything beyond English is hard; translating room descriptions is simple.

Github link broken

https://github.com/henck%2Ftrizbort

Your social.html escapes the /, breaking your setting. Needs to be just your username, or drop the escaping from social.html

github_username: henck/trizbort

Really great project, btw. I helped test Informer for OmniGraffle back in the 00s, and have recently been thinking about a project just like this.

Room popup doesn't show up if you drag slightly

To reproduce:

  1. Create a room
  2. With the pointer selected, mousedown on the room, but drag your mouse just one pixel, not enough to drag the room, and mouseup

Actual:
The popup appears on mousedown, but disappears on drag.

Expected:

  1. Small drags that don't move the room should not hide the popup
  2. Even for large drags, when I'm done dragging the room, the popup should re-appear.

Tested on Chrome 81 and Firefox 76 on macOS Catalina 10.15.4

TextAdventure.js exporter must export items and scenery

TextAdventure.js cartridges allow for (portable) items and fixed scenery. Trizbort.io has a switch for actors, items and scenery. The TextAdventure.js code generator must export objects as appropriate. At the moment, all objects are exported as portable items.

Furthermore, the TextAdventure.js code generator only exports the top-level items in the object hierarchy in each room. TextAdventure.js appears to allow for multiple levels of items, and the code generator should export accordingly.

Cannot reopen saved map

"[...] saving a map gives me a .json file that won’t open again. It shows up in the load dialog but is not selectable. I’m on Mac btw." See forum thread.

Room popup remains when you delete a room with delete key

Create a room and click on it. The room popup will appear. Press the delete key to delete it, and the room will go away.

Actual:
The room popup remains on screen; you have to click something else to make it go away

Expected:
Deleting a room should hide its popup

Support for gridborder path ? [Quest export]

Hello,
I just found this tools and I think its fantastic. The only downside to use it (with quest) is that it will not support gridborder orientation (or I didnt found how to create them)
Should I create it in quest after ? And if I do that it will be quite impossible to change the map after having made the change (because I don't want to use all my time to redo the same modification)
I'm quite new with quest and trizbort, so maybe it's very basic information.

If I'm not missing an existing functionnality, do you want that I research how to implement it ?

Support for Up/Down direction [Quest export]

Like for the gridborder parameter, I would like the up and down direction to be exported to Quest.
I saw how to specify it in trizbord, but when I exported, the cardinal indication was the thing exported (east / north / west / south)

Like for the other option, I could dig in the code to alter it and push a merge request, if you're interested.

Trizbort importer inoperable beyond first (successful) import

Here's an odd bug I spotted last weekend and have been unable to resolve thus far.

After successfully importing a Trizbort map for the first time, the Trizbort import option essentially becomes a no-op. The import dialog still pops up but upon confirming the import, nothing happens. No error is being logged either.

Given I call the same importMap(text: string) method in my desktop app specific implementation, I don't think the method itself is where the issue originates from.

It remotely feels as if the inputImport event listener is silently removed, but I cannot figure out why that would be the case. No such issue arises with inputLoad.

Deploying to local [local resources blocked]

Hello, I'm not familiar at all with JAMstack, but when I run grunt watch, and I open local index.html, it can't load any ressources. (svg, css, js/ts)
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///mnt/myfilePath/trizbort/app. (Reason: CORS request not http).

  1. Is it normal there is no use of jamstack (nothing to install in the dev machine ?)
  2. When you said to open index.html, you mean to really open index.html from the base folder ? Or is there a localhost we could go ? (and if so, at which port ?)

Thanks !

Code generation must export dark rooms

The dark room flag is exported for:

  • Inform 7

Dark room flag is not exported for:

  • TADS
  • Alan 2
  • Alan 3
  • Quest
  • Textadventure.js

Dark rooms must be exported for all languages.

Font selection

Users should be able to select a custom font from a pre-built list. This is especially important for maps in the hand-drawn style.

Undo

I wish there were a way to undo changes, e.g. deleting a room.

adding label for the map [Quest export]

In quest, we can let the player see the map. But with the current export, it does not show sufficient information
<attr name="grid_label">Toaddaz</attr>
put the name of the room to display to the player.

(Like the other two, i create separated issue to keep clear between functionnality, and I would be glad to do the functionnality, if it is not something I overlooked)

Better main menu organization

With new code generators added, the main menu is threatening to get quite long. It would be better to add expandable groups.

Alternate "create room in dir" shortcut for users without numeric keypad

You can use shift-arrow to create a room in the north/south/east/west directions, and you can use PgUp PgDn Home End to create rooms northeast/southeast/northwest/southwest.

My macOS keyboard doesn't have PgUp PgDn Home End keys; I can type Fn-Up for PgUp, Fn-Down for PgDn, Fn-Left for Home and Fn-Right for End.

But Shift-Fn-Right for Southwest is, uh, very confusing.

It would be great if there were an alternate keyboard shortcut for this. I suggest shift-N = north, shift-N-E = northeast, etc.

But even just using the numbers as they appear on a numeric keypad would be an improvement, e.g. shift-8 = north, shift-9 = northeast.

Save current map state in IndexedDB or local storage

If you refresh or navigate away, the current map is lost. (There's a beforeunload handler to protect you, which helps somewhat.)

It would be better if the current map state were stored in IndexedDB or local storage. Then you could refresh the page or navigate away and come back later, and the map would still be there waiting for you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.