From d0e7a8013ec15b9c3f1f3b89ba79dffc335cc49b Mon Sep 17 00:00:00 2001 From: Nick Date: Fri, 12 Apr 2019 14:16:26 -0600 Subject: [PATCH 01/17] fixed gen script --- generate.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/generate.sh b/generate.sh index 10a6973..fc7de42 100755 --- a/generate.sh +++ b/generate.sh @@ -1,6 +1,7 @@ #!/bin/bash -END=25 +START=25 +END=50 for ((I=0;I Date: Fri, 12 Apr 2019 14:22:06 -0600 Subject: [PATCH 02/17] fixed gen file --- generate.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generate.sh b/generate.sh index fc7de42..ecbc73f 100755 --- a/generate.sh +++ b/generate.sh @@ -1,7 +1,7 @@ #!/bin/bash START=25 END=50 -for ((I=0;I Date: Fri, 12 Apr 2019 14:45:42 -0600 Subject: [PATCH 03/17] changed support direct and added restart tab --- __pycache__/utils.cpython-37.pyc | Bin 2066 -> 2068 bytes generate.sh | 4 ++-- gpt2/src/__pycache__/encoder.cpython-37.pyc | Bin 4959 -> 4961 bytes templates/index.html | 3 ++- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/__pycache__/utils.cpython-37.pyc b/__pycache__/utils.cpython-37.pyc index 9adb104502ee0a398818eeb30e4fdb53a1a7202a..252863a7c967cc7012d185d51d0f7614196c9f88 100644 GIT binary patch delta 46 zcmbOvFhzjNiI{W_1EUff04t*o Ab^rhX delta 44 ycmbOtFiC*RiIiIFxU$FxU$ From dd135b9af17cbab3ffb6ff6b5c775e56c8a1d95e Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 15 Apr 2019 20:06:27 -0600 Subject: [PATCH 09/17] made sizing fixes --- static/style.css | 5 ++--- templates/about.html | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/style.css b/static/style.css index c263bdc..3b63b97 100644 --- a/static/style.css +++ b/static/style.css @@ -88,7 +88,7 @@ button { margin-bottom: 20px; background-color: #111; width: 18%; - height: 100px; + height: 60px; text-align: center; border-radius: 25px; font-size:30px; @@ -118,8 +118,7 @@ button:focus{ text-align: center; padding: 10px 5px; text-decoration: none; - font-size:calc(14px + 0.5vh ); - min-font-size: + font-size:18px; } /* Change the color of links on hover */ diff --git a/templates/about.html b/templates/about.html index 0c42a64..07534fd 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,4 +1,5 @@ + About @@ -18,7 +19,7 @@

As you can probably tell there's still a ways to go before AI will be your group's dungeon master, but even after running hundreds of adventures it still manages to surprise me in interesting ways. I've had a lot of fun making this and hope you enjoy it too. -


If you want to contact me about suggested improvements, comments, etc... feel free to email me about them. Nick Walton "nickwalton00@gmail.com". Also special thanks to Alan Walton and Max Robinson for their help and contributions. +


If you want to contact me about suggested improvements, comments, etc... feel free to email me about them at aidungeon.io@gmail.com. From 5c666e0c82bf7a1529416d440c06deb91626f06e Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 15 Apr 2019 20:15:15 -0600 Subject: [PATCH 10/17] mobile update --- static/style.css | 3 ++- templates/about.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/static/style.css b/static/style.css index 3b63b97..40f8113 100644 --- a/static/style.css +++ b/static/style.css @@ -16,7 +16,8 @@ body { .about { font-family: courier, monospace; - width:750px; + max-width: 800px; + width:80%; margin-left:auto; margin-right:auto; margin-top:100px; diff --git a/templates/about.html b/templates/about.html index 07534fd..9dc6a14 100644 --- a/templates/about.html +++ b/templates/about.html @@ -5,7 +5,7 @@
From 87861fb7ad4692cb460694b5d14a5692a4beb1c4 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 15 Apr 2019 21:22:29 -0600 Subject: [PATCH 11/17] made buttons nicer for mobile --- static/style.css | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/static/style.css b/static/style.css index 40f8113..742c7e1 100644 --- a/static/style.css +++ b/static/style.css @@ -9,7 +9,7 @@ body { width:80%; margin-left:auto; margin-right:auto; - margin-top:calc(30px + 4.0vh);; + margin-top:calc(30px + 4.0vh); font-size:14px; background-color: #000; } @@ -29,7 +29,7 @@ body { } .about h2{ color: #0bc; - font-size:20px; + font-size:16px; } a { @@ -70,26 +70,26 @@ a { #buttons { position: relative; bottom: 0px; - height: 60px; - width: 100%; + height: calc(100px + 12.0vw); + max-width: 800px; + width:80%; color: 334; background-color:#000; - text-align: center; - display: flex; - justify-content: space-between; + margin-left:auto; + margin-right:auto; + display: flex; } button { border-color: #fff; - bottom: 40px; color: #fff; - margin-top: 40px; - margin-left: 4%; - margin-right: 4%; - margin-bottom: 20px; + margin-top: 60px; + margin-left: 3.0vw; + margin-right: 3.0vw; + margin-bottom: 30px; background-color: #111; - width: 18%; - height: 60px; + width: 14.0vw; + height: 12.0vw; text-align: center; border-radius: 25px; font-size:30px; From ee02002c27ea1b34941a93375779e1f0ff5ce5ad Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 16 Apr 2019 12:34:01 -0600 Subject: [PATCH 12/17] about update --- templates/about.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/about.html b/templates/about.html index 9dc6a14..37b879e 100644 --- a/templates/about.html +++ b/templates/about.html @@ -19,8 +19,9 @@

As you can probably tell there's still a ways to go before AI will be your group's dungeon master, but even after running hundreds of adventures it still manages to surprise me in interesting ways. I've had a lot of fun making this and hope you enjoy it too. -


If you want to contact me about suggested improvements, comments, etc... feel free to email me about them at aidungeon.io@gmail.com. - +

If you want to contact me about suggested improvements, comments, etc... feel free to email me about them at aidungeon.io@gmail.com. + +

AI Dungeon was created by Nick Walton with the support of the BYU Percepton Cognition and Control Lab, Alan Walton and Max Robinson.
From 0c38dc9ffe4db0448597293a3535577611dc3823 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 16 Apr 2019 14:19:05 -0600 Subject: [PATCH 13/17] removed blinking --- static/script.js | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/static/script.js b/static/script.js index d1a6e05..f198284 100644 --- a/static/script.js +++ b/static/script.js @@ -4,8 +4,6 @@ var acceptInput=false var action_waiting = false var inputStr = "" var typing = false -var should_blink = false -var blinkCounter = 0 var action_list = ["You attack", "You tell", "You use", "You go"] var prompt_num = 0 var seed_max = 100 @@ -155,13 +153,9 @@ var StoryTracker = { // Used to control the terminal like screen typing var Typer={ text: null, - accessBlinktimer:null, index:0, speed:2, - startBlinker: function(){ - accessBlinktimer=setInterval(function(){Typer.blinkCursor()},500) - }, - + content:function(){ return $("#console").html() }, @@ -195,26 +189,6 @@ var Typer={ } }, - - blinkCursor:function(){ - - if(should_blink == true){ - - if(blinkCounter > 10){ - var cont=this.content() - - if(cont.substring(cont.length-1,cont.length)=="|") - $("#console").html($("#console").html().substring(0,cont.length-1)) - - else - $("#console").append("|") - } - else{ - blinkCounter += 1 - } - - } - } } @@ -277,7 +251,6 @@ function start(){ StoryTracker.getFirstStory() startTyping() - Typer.startBlinker() console.log("Not mobile device"); document.getElementById('buttons').style.visibility='hidden'; From f16fd195be81c2c1136de5cacedac350c486a46b Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 16 Apr 2019 14:40:47 -0600 Subject: [PATCH 14/17] changed seed num, added warning --- main.py | 2 +- templates/about.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 9cb3e0d..bb8cfe7 100644 --- a/main.py +++ b/main.py @@ -160,7 +160,7 @@ def story_request(): prompt_num = int(request.form["prompt_num"]) gen_actions = request.form["actions"] - if int(seed) < 0 or int(seed) > 1000: + if int(seed) < 0 or int(seed) > 100: print("Invalid seed: " + seed) abort(404) diff --git a/templates/about.html b/templates/about.html index 37b879e..150a468 100644 --- a/templates/about.html +++ b/templates/about.html @@ -19,6 +19,8 @@

As you can probably tell there's still a ways to go before AI will be your group's dungeon master, but even after running hundreds of adventures it still manages to surprise me in interesting ways. I've had a lot of fun making this and hope you enjoy it too. +

Warning: The GPT-2 model was trained on a huge amount of internet text so there might be offensive content. +

If you want to contact me about suggested improvements, comments, etc... feel free to email me about them at aidungeon.io@gmail.com.

AI Dungeon was created by Nick Walton with the support of the BYU Percepton Cognition and Control Lab, Alan Walton and Max Robinson. From afdd1bb1671886588e7f7bcab75bb66562a663bd Mon Sep 17 00:00:00 2001 From: Nick Walton Date: Mon, 29 Apr 2019 17:30:22 -0600 Subject: [PATCH 15/17] added delete functionality, and incrased speed --- __pycache__/utils.cpython-37.pyc | Bin 2070 -> 2068 bytes generate.sh | 6 ++-- gpt2/src/__pycache__/encoder.cpython-37.pyc | Bin 4963 -> 4961 bytes static/script.js | 32 ++++++++++++++++++-- 4 files changed, 32 insertions(+), 6 deletions(-) diff --git a/__pycache__/utils.cpython-37.pyc b/__pycache__/utils.cpython-37.pyc index 837049a93a6e6d692bf4d12bcba82156599dbe18..252863a7c967cc7012d185d51d0f7614196c9f88 100644 GIT binary patch delta 41 vcmbOxFhzjViI1%*Sic9 delta 43 xcmbOtFin8diI^<<<+N delta 43 xcmaE;_E?S6iI&rQ|O%S_HLPs}OF&oeOC9LOTT4*&{h408Yg diff --git a/static/script.js b/static/script.js index f198284..ca7f587 100644 --- a/static/script.js +++ b/static/script.js @@ -161,10 +161,17 @@ var Typer={ }, appendToText:function(str){ - str = str.replace(".", "." + "") + str = str.replace(".", "." + "") typing = true Typer.text = Typer.text + str; }, + + removeChar:function(){ + var cont=Typer.content() + $("#console").html($("#console").html().substring(0,cont.length-1)) + Typer.text = Typer.text.substring(0, Typer.text.length-1) + Typer.index = Typer.index - 1 + }, addText:function(){ @@ -199,7 +206,7 @@ function writeAppend(str){ function startTyping(){ - addTextTimer = setInterval("typeWords()", 25) + addTextTimer = setInterval("typeWords()", 20) } @@ -207,11 +214,31 @@ function typeWords() { Typer.addText() } +document.addEventListener("keydown", KeyCheck); + +function KeyCheck(evt) { + evt = evt || window.event + var charCode = evt.keyCode || evt.which + if(charCode == 8){ + console.log("delete pressed") + if(inputStr.length > 0){ + console.log(inputStr) + inputStr = inputStr.substring(0, inputStr.length-1) + console.log(inputStr) + Typer.removeChar() + } + } +} + + document.onkeypress = function(evt) { if(acceptInput && !isMobileDevice()){ evt = evt || window.event var charCode = evt.keyCode || evt.which + + console.log(typeof charCode) + console.log("Char code is " + charCode) if(charCode == 13){ acceptInput = false @@ -219,7 +246,6 @@ document.onkeypress = function(evt) { StoryTracker.processInput(inputStr) } else{ - var charStr = String.fromCharCode(charCode) Typer.appendToText(charStr) inputStr = inputStr + charStr From 885bf0c47c2f1b7d3c1758b30a2ed2c009960b9f Mon Sep 17 00:00:00 2001 From: Nick Walton Date: Mon, 29 Apr 2019 17:32:29 -0600 Subject: [PATCH 16/17] removed logs --- static/script.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/static/script.js b/static/script.js index ca7f587..069d8f9 100644 --- a/static/script.js +++ b/static/script.js @@ -220,7 +220,6 @@ function KeyCheck(evt) { evt = evt || window.event var charCode = evt.keyCode || evt.which if(charCode == 8){ - console.log("delete pressed") if(inputStr.length > 0){ console.log(inputStr) inputStr = inputStr.substring(0, inputStr.length-1) @@ -236,9 +235,6 @@ document.onkeypress = function(evt) { if(acceptInput && !isMobileDevice()){ evt = evt || window.event var charCode = evt.keyCode || evt.which - - console.log(typeof charCode) - console.log("Char code is " + charCode) if(charCode == 13){ acceptInput = false From 934148940a77f9b04a1ec1a96720221112c8c93d Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 1 May 2019 20:32:29 -0600 Subject: [PATCH 17/17] added analytics tracking --- templates/about.html | 12 ++++++++++++ templates/index.html | 11 +++++++++++ 2 files changed, 23 insertions(+) diff --git a/templates/about.html b/templates/about.html index 150a468..abdcf28 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,6 +1,18 @@ + + + + About diff --git a/templates/index.html b/templates/index.html index cf58444..8800ab6 100644 --- a/templates/index.html +++ b/templates/index.html @@ -2,6 +2,17 @@ + + + Dungeon