Node.js Slot Machine

Posted onby

Full name : Visual-js GUI for windows Multiplatform 2d Game engine

creator : Nikola Lukic 2017

2018 open source

Visual-js project parts :

-2D PART :
This is JavaScript game engine (server part node.js / client part js)
Js framework with windows GUI editor and game instance creator.
( + server engine tools + server part of web apps )

The slots in the intent list. If we click on them, we can give them a specific type. For the city slot we choose ‘Amazon.DECity’ which is a predefined slot-type from Amazon that can handle. Play 30+ FREE 3-reel and 5-reel slots: Mountain Fox, Treasures of Egypt, Flaming Crates, Prosperous Fortune, Magic Wheel, Fruit Smoothie, Party Bonus, Video Poker and more! FREE Online Slot Machines! Win at least 500 credits and press the sweepstakes button to enter.

-3D PART :
webgl based on three.js engine

-3D PART :
webGL2 based on glmatrix 2.0

-2D PART (new):
This is TypeScript based game engine (client part ts).
With strong connection with webpack
Physics done with (matter.js) matter ts

This part is removed from this project. New link is : https://github.com/zlatnaspirala/visual-ts-game-engine

Basic licence rules :

1) Each file in this project has its own license , be careful , do not violate the basic rules.

2) You are free to use any version of Visual JS library in any other project (even commercial projects)
as long as the copyright header is left intact Except for plugins on sale and graphics that come with
them (they have special commercial licence).
3) Please read the following terms and conditions before using this application:
Disclaimer of warranty
'Visual js' is provided 'as-is' and without warranty of any kind, express, implied or otherwise,
including without limitation, any warranty of merchantability or fitness for a particular purpose.
In no event shall the author of this software be held liable for data loss,
damages, loss of profits or any other kind of loss while using or misusing this software.

External licences in this project :

  • Webcam NUI control is under : Created by Romuald Quantin. http://creativecommons.org/licenses/by-nc-sa/3.0/

    Download from : https://www.adobe.com/devnet/archive/html5/articles/javascript-motion-detection.html

  • WEBRTC - webcam communication is under :
    Creator Muaz Khan

    www.MuazKhan.com MIT License - www.WebRTC-Experiment.com/licence

  • Socket.io.js - http://socket.io/download/ ( also implemented intro build.js )

  • webgl2 based on : Copyright (C) 2014 Tappali Ekanathan Keestu (keestu@gmail.com) GNU General Public License

  • OBJ loader : https://github.com/frenchtoast747/webgl-obj-loader

  • Textures download from http://textures.com

  • More texture downloads http://www.textures4photoshop.com/

  • Female Body v3.blend this file has been released by AndresCuccaro under the following license: Creative Commons Attribution 3.0

About GUI for windows (canvas2d part only) :

windows GUI application version 1.0 (using visual-js 0.9 lib)
Important : you will need NET 4.5.2 minimum also redistribution pack for c++

How to start project ?

1) Click CREATE APPLICATION
2) Enter new application name in input prompt
3) Select folder for server part of application (important : www is not secure place)
4) Select folder for client part of application ( any path in www)
5) New app name will appear in project list , select and click OPEN APPLICATION

6) Open your server folder :

Install node.js modules

One way - Use windows bat-s file (in server root folder with prefix install_ )

Second way - open cmd terminal and enter next command :

  • npm install mysql
  • npm install delivery
  • npm install express
  • npm install mkdirp
  • npm install socket.io
  • npm install nodemailer@0.7.0

Very easy installation and project files generator .

Now you can use On-Page-Editor (nice for visual setup , checking positions and dimensions - not for logic ) . manual start from cmd : server_folder/node editor.js

After starting On-Page-Editor open browser icon to open internet browser in editor mode . See video explanation :

If you use editor.js to visual create game object method , you must start ***node build_from_editor_to_visual_js_file.js*** on the end of work.
This tool will create visual.js in folder starter/ with all your game object was created in editor style .

or you can use Visual-JS Source editor.

Visual-JS Source editor (2d part only)

is new and better way .In future visual staff will be better (real time simulator will be implemented).For now this place is good for coding .

Visual-js works direct with project files , no need for build .

Add->New game object (form dialog for define type of new game object )
Add->Quick code (make your work faster - add usually code blocks)
Resources - explorer view for images and audios , you can drag or edit also need to execute node build_resources for creating resources object for engine.
Inserting new code will be always at current line selected intro editor .
Save on drop menu or better with ctrl+s before testing in browsers.

Software

Adding new script explanation :

After adding new script and save script if you have extra changes , open starter/run.js and you will found line :

ctrl+S

Use from menu Run->Choose browser for testing . - important safari not working at the moment

chrome , firefox , opera

Tutorial - Pencil (Animation path) :

Node

How to use Pencil tool to create PATH object . Path object can be saved intro localhost , you can collect object and put it direct source code .

File location : starter/templates/paths.js Templetes are made from visual-js core also . See source code : paths.js

See the Pen Visual js - Pencil by VisualJS game engine (@zlatnaspirala) on CodePen.

Online demo examples at :

Demo slot mashine basic demo at :

Help about new 2d part - implementation of matter.js based typescript .

I make strong relation with webpack and project . build folder is full vendor nature. Html css and resources come from dependency logic taken from source.

To make all dependency works in build proccess we need some plugins.

Features :

Tile's background draw for images (alias sprite - but for now there's no sprite and frame by frame animation methods).

Small engine config .

Some option in aspect view like

npm install
...

npm install typescript
npm i clean-webpack-plugin --save-dev
npm i html-webpack-plugin --save-dev

Possible fix :

npm i webpack --save-dev
npm i extract-text-webpack-plugin --save-dev
Fix code format :

tslint -c tslint.json 'src/**/*.ts' --fix

Download project link :

[NLPjs logo](screenshots/nlplogo.gif)

Slot

NLP.js

If you're looking for the version 3 docs, you can find them here [Version 3](docs/v3/README.md)

'NLP.js' is a general natural language utility for nodejs. Currently supporting:

  • Guess the language of a phrase
  • Fast Levenshtein distance of two strings
  • Search the best substring of a string with less Levenshtein distance to a given pattern.
  • Get stemmers and tokenizers for several languages.
  • Sentiment Analysis for phrases (with negation support).
  • Named Entity Recognition and management, multi-language support, and acceptance of similar strings, so the introduced text does not need to be exact.
  • Natural Language Processing Classifier, to classify an utterance into intents.
  • NLP Manager: a tool able to manage several languages, the Named Entities for each language, the utterances, and intents for the training of the classifier, and for a given utterance return the entity extraction, the intent classification and the sentiment analysis. Also, it is able to maintain a Natural Language Generation Manager for the answers.
  • 40 languages natively supported, 104 languages supported with BERT integration
  • Any other language is supported through tokenization, even fantasy languages

[Hybrid bot](screenshots/hybridbot.gif)

Node.js Slot Machine

New in version 4!

Version 4 is very different from previous versions. Before this version, NLP.js was a monolithic library. The big changes:

  • Now the library is split into small independent packages.
  • So every language has its own package
  • It provides a plugin system, so you can provide your own plugins or replace the existing ones.
  • It provides a container system for the plugins, settings for the plugins and also pipelines
  • A pipeline is code defining how the plugins interact. Usually it is linear: there is an input into the plugin, and this generates the input for the next one. As an example, the preparation of a utterance (the process to convert the utterance to a hashmap of stemmed features) is now a pipeline like this: normalize -> tokenize -> removeStopwords -> stem -> arrToObj
  • There is a simple compiler for the pipelines, but they can also be built using a modified version of javascript and python (compilers are also included as plugins, so other languages can be added as a plugin).
  • NLP.js now includes connectors, a connector is understood to be something that has at least 2 methods: hear and say. Examples of connectors included: Console Connector, Microsoft Bot Framework Connector and a Direct Line Offline Connector (this one allows you to build a web chatbot using the Microsoft Webchat, but without having to deploy anything in Azure).
  • Some plugins can be registered by language, so for different languages different plugins will be used. Also some plugins, like NLU, can be registered not only by language but also by domain (a functional set of intents that can be trained separately)
  • As an example of per-language/domain plugins, a Microsoft LUIS NLU plugin is provided. You can configure your chatbot to use the NLU from NLP.js for some languages/domains, and LUIS for other languages/domains.
  • Having plugins and pipelines makes it possible to write chatbots by only modifying the configuration and the pipelines file, without modifying the code.

TABLE OF CONTENTS

<!--ts-->

  • [QuickStart](docs/v4/quickstart.md)
    • [Install the library](docs/v4/quickstart.md#install-the-library)
    • [Create the code](docs/v4/quickstart.md#create-the-code)
    • [Extracting the corpus into a file](docs/v4/quickstart.md#extracting-the-corpus-into-a-file)
    • [Extracting the configuration into a file](docs/v4/quickstart.md#extracting-the-configuration-into-a-file)
    • [Creating your first pipeline](docs/v4/quickstart.md#creating-your-first-pipeline)
    • [Console Connector](docs/v4/quickstart.md#adding-your-first-connector)
    • [Extending your bot with the pipeline](docs/v4/quickstart.md#extending-your-bot-with-the-pipeline)
    • [Adding multiple languages](docs/v4/quickstart.md#adding-multilanguage)
    • [Adding API and WebChat](docs/v4/quickstart.md#adding-api-and-webchat)
    • [Using Microsoft Bot Framework](docs/v4/quickstart.md#using-microsoft-bot-framework)
    • [Recognizing the bot name and the channel](docs/v4/quickstart.md#recognizing-the-bot-name-and-the-channel)
    • [One bot per connector](docs/v4/quickstart.md#one-bot-per-connector)
    • [Different port for Microsoft Bot Framework and Webchat](docs/v4/quickstart.md#different-port-for-microsoft-bot-framework-and-webchat)
    • [Adding logic to an intent](docs/v4/quickstart.md#adding-logic-to-an-intent)
  • [Web and React Native](docs/v4/webandreact.md)
    • [Preparing to generate a bundle](docs/v4/webandreact.md#preparing-to-generate-a-bundle)
    • [Your first web NLP](docs/v4/webandreact.md#your-first-web-nlp)
    • [Creating a distributable version](docs/v4/webandreact.md#creating-a-distributable-version)
    • [Load corpus from URL](docs/v4/webandreact.md#load-corpus-from-url)
  • [QnA](docs/v4/qna.md)
    • [Install the library and the qna plugin](docs/v4/qna.md#install-the-library-and-the-qna-plugin)
    • [Train and test a QnA file](docs/v4/qna.md#train-and-test-a-qna-file)
    • [Extracting the configuration into a file](docs/v4/qna.md#extracting-the-configuration-into-a-file)
    • [Exposing the bot with a Web and API](docs/v4/qna.md#exposing-the-bot-with-a-web-and-api)
  • [NER Quickstart](docs/v4/ner-quickstart.md)
    • [Install the needed packages](docs/v4/ner-quickstart.md#install-the-needed-packages)
    • [Create the conf.json](docs/v4/ner-quickstart.md#create-the-confjson)
    • [Create the corpus.json](docs/v4/ner-quickstart.md#create-the-corpusjson)
    • [Create the heros.json](docs/v4/ner-quickstart.md#create-the-herosjson)
    • [Create the index.js](docs/v4/ner-quickstart.md#create-the-indexjs)
    • [Start the application](docs/v4/ner-quickstart.md#start-the-application)
    • [Stored context](docs/v4/ner-quickstart.md#stored-context)
  • [NeuralNetwork](docs/v4/neural.md)
    • [Introduction](docs/v4/neural.md#introduction)
    • [Installing](docs/v4/neural.md#installing)
    • [Corpus Format](docs/v4/neural.md#corpus-format)
    • [Example of use](docs/v4/neural.md#example-of-use)
    • [Exporting trained model to JSON and importing](docs/v4/neural.md#exporting-trained-model-to-json-and-importing)
    • [Options](docs/v4/neural.md#options)
  • [Logger](docs/v4/logger.md)
    • [Introduction](docs/v4/logger.md#introduction)
    • [Default logger in @nlpjs/core](docs/v4/logger.md#default-logger-in-nlpjscore)
    • [Default logger in @nlpjs/basic](docs/v4/logger.md#default-logger-in-nlpjsbasic)
    • [Adding your own logger to the container](docs/v4/logger.md#adding-your-own-logger-to-the-container)
  • [@nlpjs/emoji](docs/v4/emoji.md)
    • [Introduction](docs/v4/emoji.md#introduction)
    • [Installing](docs/v4/emoji.md#installing)
    • [Example of use](docs/v4/emoji.md#example-of-use)
  • [@nlpjs/console-connector](docs/v4/console-connector.md)
    • [Installation](docs/v4/console-connector.md#installation)
    • [Example of use inside NLP.js](docs/v4/console-connector.md#example-of-use-inside-nlpjs)
    • [Example of use of the package](docs/v4/console-connector.md#example-of-use-of-the-package)
    • [Example of use with @nlpjs/basic](docs/v4/console-connector.md#example-of-use-with-nlpjsbasic)
  • [@nlpjs/similarity](docs/v4/similarity.md)
    • [Installation](docs/v4/similarity.md#installation)
    • [leven](docs/v4/similarity.md#leven)
    • [similarity](docs/v4/similarity.md#similarity)
    • [SpellCheck](docs/v4/similarity.md#spellcheck)
    • [SpellCheck trained with words trained from a text](docs/v4/similarity.md#spellcheck-trained-with-words-trained-from-a-text)
  • [@nlpjs/nlu](docs/v4/nlu.md)
    • [Installation](docs/v4/nlu.md#installation)
    • [NluNeural](docs/v4/nlu.md#nluneural)
    • [DomainManager](docs/v4/nlu.md#domainmanager)
    • [NluManager](docs/v4/nlu.md#nlumanager)
  • [Benchmarking](docs/v3/benchmarking.md)
  • [Language Support](docs/v4/language-support.md)
    • [Supported languages](docs/v4/language-support.md#supported-languages)
    • [Sentiment Analysis](docs/v4/language-support.md#sentiment-analysis)
    • [Comparision with other NLP products](docs/v4/language-support.md#comparision-with-other-nlp-products)
    • [Example with several languages](docs/v4/language-support.md#example-with-several-languages)
  • [Language Guesser](docs/v3/language-guesser.md)
  • [Similar Search](docs/v3/similar-search.md)
  • [NLU](docs/v3/nlu-manager.md)
    • [NLU Manager](docs/v3/nlu-manager.md)
    • [Brain NLU](docs/v3/brain-nlu.md)
    • [Bayes NLU](docs/v3/bayes-nlu.md)
    • [Binary Relevance NLU](docs/v3/binary-relevance-nlu.md)
    • [Logistic Regression NLU](docs/v3/logistic-regression-nlu.md)
  • [NER Manager](docs/v3/ner-manager.md)
    • [Enum Named Entities](docs/v3/ner-manager.md#enum-named-entities)
    • [Regular Expression Named Entities](docs/v3/ner-manager.md#regular-expression-named-entities)
    • [Trim Named Entities](docs/v3/ner-manager.md#trim-named-entities)
    • [Utterances with duplicated Entities](docs/v3/ner-manager.md#utterances-with-duplicated-entities)
  • [Integration with Duckling](docs/v3/builtin-duckling.md)
    • [Language support](docs/v3/builtin-duckling.md#language-support)
    • [How to integrate with duckling](docs/v3/builtin-duckling.md#how-to-integrate-with-duckling)
    • [Email Extraction](docs/v3/builtin-duckling.md#email-extraction)
    • [Phone Number Extraction](docs/v3/builtin-duckling.md#phone-number-extraction)
    • [URL Extraction](docs/v3/builtin-duckling.md#url-extraction)
    • [Number Extraction](docs/v3/builtin-duckling.md#number-extraction)
    • [Ordinal Extraction](docs/v3/builtin-duckling.md#ordinal-extraction)
    • [Dimension Extraction](docs/v3/builtin-duckling.md#dimension-extraction)
    • [Quantity Extraction](docs/v3/builtin-duckling.md#quantity-extraction)
    • [Amount of Money Extraction](docs/v3/builtin-duckling.md#amount-of-money-extraction)
    • [Date Extraction](docs/v3/builtin-duckling.md#date-extraction)
  • [Builtin Entity Extraction](docs/v3/builtin-entity-extraction.md)
    • [Email Extraction](docs/v3/builtin-entity-extraction.md#email-extraction)
    • [IP Extraction](docs/v3/builtin-entity-extraction.md#ip-extraction)
    • [Hashtag Extraction](docs/v3/builtin-entity-extraction.md#hashtag-extraction)
    • [Phone Number Extraction](docs/v3/builtin-entity-extraction.md#phone-number-extraction)
    • [URL Extraction](docs/v3/builtin-entity-extraction.md#url-extraction)
    • [Number Extraction](docs/v3/builtin-entity-extraction.md#number-extraction)
    • [Ordinal Extraction](docs/v3/builtin-entity-extraction.md#ordinal-extraction)
    • [Percentage Extraction](docs/v3/builtin-entity-extraction.md#percentage-extraction)
    • [Age Extraction](docs/v3/builtin-entity-extraction.md#age-extraction)
    • [Currency Extraction](docs/v3/builtin-entity-extraction.md#currency-extraction)
    • [Date Extraction](docs/v3/builtin-entity-extraction.md#date-extraction)
    • [Duration Extraction](docs/v3/builtin-entity-extraction.md#duration-extraction)
  • [Sentiment Analysis](docs/v3/sentiment-analysis.md)
  • [NLP Manager](docs/v3/nlp-manager.md)
    • [Load/Save](docs/v3/nlp-manager.md#loadsave)
    • [Import/Export](docs/v3/nlp-manager.md#importexport)
    • [Context](docs/v3/nlp-manager.md#context)
  • [Slot Filling](docs/v3/slot-filling.md)
  • [Loading from Excel](docs/v3/loading-from-excel.md)
  • [Microsoft Bot Framework](docs/v3/microsoft-bot-framework.md)
    • [Introduction](docs/v3/microsoft-bot-framework.md#introduction)
    • [Example of use](docs/v3/microsoft-bot-framework.md#example-of-use)
    • [Recognizer and Slot filling](docs/v3/microsoft-bot-framework.md#recognizer-and-slot-filling)
  • Languages
  • License<!--te-->

Installation

If you're looking to use NLP.js in your Node application, you can install via NPM like so:

React Native

There is a version of NLP.js that works in React Native, so you can build chatbots that can be trained and executed on the mobile even without the internet. You can install it via NPM:

Some limitations:

Node Js Windows

  • No Chinese
  • The Japanese stemmer is not the complete one
  • No Excel import
  • No loading from a file, or saving to a file, but it can still import from JSON and export to JSON.

Example of use

You can see a great example of use in the folder /examples/02-qna-classic. This example is able to train the bot and save the model to a file, so when the bot is started again, the model is loaded instead of being trained again.

You can start to build your NLP from scratch with a few lines:

Node.js Slot Machine Software

This produces the following result in a console:

False Positives

By default, the neural network tries to avoid false positives. To achieve that, one of the internal processes is that words never seen by the network are represented as a feature that gives some weight to the None intent. So, if you try the previous example with 'I have to go' it will return the None intent because 2 of the 4 words have never been seen while training.If you don't want to avoid those false positives, and you feel more comfortable with classifications into the intents that you declare, then you can disable this behavior by setting the useNoneFeature to false:

Log Training Progress

You can also add a log progress, so you can trace what is happening during the training.You can log the progress to the console:

Or you can provide your own log function:

Contributing

You can read the guide for how to contribute at [Contributing](CONTRIBUTING.md).

Contributors

Made with contributors-img.

Code of Conduct

You can read the Code of Conduct at [Code of Conduct](CODE_OF_CONDUCT.md).

Who is behind it?

This project is developed by AXA Group Operations Spain S.A.

How To Use Node Js

If you need to contact us, you can do it at the email jesus.seijas@axa.com

License

Copyright (c) AXA Group Operations Spain S.A.

Node.js Slot Machines

Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the'Software'), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:

Node Js Update

The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.

Install Node Js

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BELIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTIONOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTIONWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.