Antriel Posted September 17, 2018 Share Posted September 17, 2018 A short interactive story. Get equipment, go fight a dragon, talk with a princess. Epic adventure. Created using Phaser 3 and Haxe, with custom (and for now very simple) "narration engine story" language for writing the actual story in and compiling down to data the game uses to handle the interactions. Play the game here: http://nextrealmgames.com/games/3-min-adventure/ You can put the game on your portal using this url. The game is also available for licensing. Quote Link to comment Share on other sites More sharing options...
Milton Posted September 17, 2018 Share Posted September 17, 2018 Great fun. I think if our hero does not want to come out of the closet you shouldn't force him to. You have to be PC these days What externs are you using? (your own)? Quote Link to comment Share on other sites More sharing options...
Antriel Posted September 17, 2018 Author Share Posted September 17, 2018 4 minutes ago, Milton said: Great fun. I think if our hero does not want to come out of the closet you shouldn't force him to. You have to be PC these days Hah Just to be safe: it's a reference to Stanley's Parable. 6 minutes ago, Milton said: What externs are you using? (your own)? Actually none. It's a bit cumbersome with all the untyped code, but so far it hasn't slowed me down more than making good externs would. I always planned on doing them, but didn't get around it so far. The code I wrote for the TS definitions would be a good entry point though. Milton 1 Quote Link to comment Share on other sites More sharing options...
Umz Posted September 18, 2018 Share Posted September 18, 2018 This was really good.. I like the humour in the story and a nice different ending. Antriel 1 Quote Link to comment Share on other sites More sharing options...
Antriel Posted September 18, 2018 Author Share Posted September 18, 2018 41 minutes ago, Umz said: This was really good.. I like the humour in the story and a nice different ending. Thanks It was meant to be a very short game to test my engine, so I tried to make it a bit silly. Glad I hit the target. Quote Link to comment Share on other sites More sharing options...
totor Posted September 18, 2018 Share Posted September 18, 2018 you mean you don't use the haxe phaser3 bindings? so how do you bind your haxe code with phaser? Quote Link to comment Share on other sites More sharing options...
Antriel Posted September 18, 2018 Author Share Posted September 18, 2018 5 minutes ago, totor said: you mean you don't use the haxe phaser3 bindings? so how do you bind your haxe code with phaser? As soon as something is typed `Dynamic`, I can do whatever and Haxe won't complain (but won't autocomplete nor do any error checks). So if I got my `var scene:Dynamic`, I can do `scene.add.image(...)` without issues. For creating objects in the first place, I either make dummy empty extern class that `implements Dynamic` (so I can make an instance and it acts as if it was Dynamic) or I do something like `var game = untyped __js__("new Phaser.Game()")` It's not optimal as I said before, but given how little I actually access Phaser's API it's doable. If there would be a major interest in Haxe externs for Phaser 3, I could look into porting the typescript definitions code I wrote into making Haxe externs too. But I can't justify it just for me and I can't afford such work financially right now anyway. There's https://github.com/sebbernery/haxe-phaser3 but I'm not sure how good they are, and they don't have comments. Quote Link to comment Share on other sites More sharing options...
totor Posted September 19, 2018 Share Posted September 19, 2018 thanks for the clarification. it seems the sebbenery"s externs work fine and are up to date. i am curious about what a "narration story engine" looks like, is it like the ink language? Quote Link to comment Share on other sites More sharing options...
Antriel Posted September 19, 2018 Author Share Posted September 19, 2018 20 minutes ago, totor said: i am curious about what a "narration story engine" looks like, is it like the ink language? Never heard of ink language, looking at it, it does seem to have very similar concepts. I kind of went into it without doing any research (on purpose). Right now it's only a simple parser and compiler. The syntax looks like this: You are sitting in a local pub, thinking about what you just heard. "I repeat," says scared-looking peasant, "will you save our princess?" [choice] Yes => [goto yes] I will think about it => "Please sir knight! We are desperate!" [id choice] [choice] Yes => [goto yes] No => [goto no] No => [goto no] [id no] [if please=0] "Please!" [set please 1] [goto choice] [if please=1] "Pleasee!" [set please 2] [goto choice] [if please=2] "Pleaseee!" [goto choice] [id yes] "That's wonderful! Praise you good knight. The dragon isn't even that big..." It's supposed to be text first, with not too big emphasis on whitespace, although it does use tabs/offset to handle choice options and substories. Plan is to gradually improve this, right now I'm adding syntax highlighting, then error checking, etc. This gets compiled down to: [..., {"next":5,"type":0,"text":"You are sitting in a local pub, thinking about what you just heard."}, {"next":6,"type":0,"text":"\"I repeat,\" says scared-looking peasant, \"will you save our princess?\""}, {"type":1,"choices":[{"choice":"Yes","node":17}, {"choice":"I will think about it","node":7}, {"choice":"No","node":9}]}, {"next":8,"type":0,"text":"\"Please sir knight! We are desperate!\""}, {"type":1,"choices":[{"choice":"Yes","node":17}, {"choice":"No","node":9}]}, {"type":2,"condition":{"op":1,"left":{"op":5,"left":"please"},"right":{"op":0,"left":0}},"yes":10,"no":12}, {"next":11,"type":0,"text":"\"Please!\""}, {"next":8,"type":3,"id":"please","val":{"op":0,"left":1}}, {"type":2,"condition":{"op":1,"left":{"op":5,"left":"please"},"right":{"op":0,"left":1}},"yes":13,"no":15}, {"next":14,"type":0,"text":"\"Pleasee!\""}, {"next":8,"type":3,"id":"please","val":{"op":0,"left":2}}, {"type":2,"condition":{"op":1,"left":{"op":5,"left":"please"},"right":{"op":0,"left":2}},"yes":16,"no":17}, {"next":8,"type":0,"text":"\"Pleaseee!\""}, {"next":18,"type":0,"text":"\"That's wonderful! Praise you good knight. The dragon isn't even that big...\""}, ...] Quote Link to comment Share on other sites More sharing options...
totor Posted September 20, 2018 Share Posted September 20, 2018 nice and simple. I"d thought more of a visual story graph editor, things can get very messy when you have big stories with multiple narrative branches like in adventure gamebook as The Warlock of Firetop Mountain. Quote Link to comment Share on other sites More sharing options...
Antriel Posted September 20, 2018 Author Share Posted September 20, 2018 3 hours ago, totor said: nice and simple. I"d thought more of a visual story graph editor, things can get very messy when you have big stories with multiple narrative branches like in adventure gamebook as The Warlock of Firetop Mountain. Visual editor might come later, I'm finding things out as I go. Not sure it would be more clear with big stories though, maybe just easier to build and see how it connects, but the details itself would probably be of same difficulty. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.