intfiction.org

The Interactive Fiction Community Forum
It is currently Sun Dec 17, 2017 10:43 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Thu May 25, 2017 3:45 pm 
Offline

Joined: Thu May 18, 2017 8:29 pm
Posts: 19
I'm proud to announce that Ramscript now has user defined functions, loops (for, while, dowhile), variables, and many math functions. I'm now starting on Storyscript, which will be required to get this to do what I want. Here is an example of how Ramscript and Storyscript will (hopefully) eventually work together to make awesome games.

https://pastebin.com/hDYhCv8q


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu May 25, 2017 4:33 pm 
Offline

Joined: Sun Apr 18, 2010 3:58 pm
Posts: 773
I think you may have overlooked my earlier question: what's uniquely good about your engine? Is your engine good at something that nothing else is? For example, you compare it to TADS. How is your thing better than TADS?

_________________
At Choice of Games, we sell long-form choice-based interactive fiction games. We're looking for writers, paid in advance.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu May 25, 2017 5:06 pm 
Offline
User avatar

Joined: Sat Jun 25, 2016 12:13 pm
Posts: 159
The script language looks interesting. What's not clear though, is whether this is a custom language for writing games OR is it a general purpose language that can be customised for games. The latter would be interesting.

For example `def Thing(Room, "X")` is this a hard-coded construct, or is it a general way to define and construct class `Thing` as a subclass of Room.

Can i write `def Wibble(Thing, "Larry")` for example? I think more explanation on the language is needed.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri May 26, 2017 6:41 am 
Offline

Joined: Thu May 18, 2017 8:29 pm
Posts: 19
This engine is so new, its not better than tads3, at least yet. Its too early to talk about it like that. I don't even know yet how far I'm willing to go with it.

Well, the idea behind that syntax, is for all objects and rooms, you go def Thing(type, "name"){}, and for all verbs and other grammar related stuff, you go def Grammar(type, "name"){}. I do plan on making it so you can design your own types of things, but the basis of thing cannot be edited. This doesn't really matter, because you still have a lot of customization. I plan on making it so you can go like this to make a template, which can later be used as a type from then on out:

def Thing(template(inheritedtemplates), templatename){}

Note that this is just a concept. I might change how it works as I go along.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon May 29, 2017 1:25 pm 
Offline

Joined: Thu May 18, 2017 8:29 pm
Posts: 19
Alright I am completely changing how this is going to work. Its going to be in golang.

Code:
package main

import "goifp"

func main() {
    game := goifp.NewGame()
    mainRoom := NewRoom("Main Room", &game)
    mike := NewPerson("Mike", &game)
    mike.AddString("Description", "He is a young man in his early twenties.")
    mainRoom.AddToList("contents", mike)
    SetPlayer(mike, &game)
    game.Run()
}


Top
 Profile Send private message  
Reply with quote  
PostPosted: Mon May 29, 2017 3:45 pm 
Offline
User avatar

Joined: Sat Jun 25, 2016 12:13 pm
Posts: 159
right. this way you don't have to design _both_ a game system _and_ a language.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Wed May 31, 2017 9:09 pm 
Offline

Joined: Thu May 18, 2017 8:29 pm
Posts: 19
Well, designing the input interpreter was REALLY hard. But, I managed to get it working. I had no clue initially of how to do this, and there were no guides online that explained it thoroughly enough. So, I was forced to brainstorm an algorithm entirely by myself. I wrote a document full of my ideas:

https://docs.google.com/document/d/1WDu ... sp=sharing

I spent the last two days writing code, patching bugs, and getting really frusterated. Eventually, this is what I got:

https://pastebin.com/wdTxT5bu

And this is the result:
https://i.gyazo.com/f176d1654f632fb2d98 ... d92bdf.png

Success!

EDIT: I'd like to mention for those who are watching this thread, I changed the first post.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jun 01, 2017 7:25 am 
Offline

Joined: Wed Aug 26, 2015 11:18 am
Posts: 88
Location: The Netherlands
I’ve been there. Writing an interpreter (parser) for text is not easy. Mine is based on an old skool state machine and state transition diagram. It parses the sentence word by word from left to right.
So, in the initial state, 0, it only accepts a verb or a noun. Anything else throws a “I don’t understand…” error. State 0 and noun goes to state 1, state 0 and verb goes to state 2.
In state 1 it only accepts a comma. In state 2 it accepts an article, adjective, adverb, noun or end of sentence. Etc, etc. The state machine has over 50 states.

Like you, I ran into the issue that a word can have different meanings (types). E.g. light can be a verb, an adjective or a noun. I solved it by implementing a recursive parser function. It calls itself for each next word in the sentence. If the state machine detects an error because of an illegal word type for the current state, it will check if the word has another type that goes with the current state. If not, the parser function will return to the previous word and will check for that word if there is another type that leads to a valid state and then continue from there. If not, it will go back yet another level etc.

Here’s an example for sentence “light light light” (meaning ignite the not so heavy lamp)

Light has 3 types: verb, adjective and noun. It parses as follows:

Code:
verb -> verb -> error
verb -> noun -> verb -> error
verb -> noun -> noun -> error
verb -> noun -> adjective -> error
verb -> adjective -> verb -> error
verb -> adjective -> noun -> OK


During the parsing process, it fills a struct with the correct actor, action, subject, etc so the interpreter knows what it has to do.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Jun 01, 2017 8:01 am 
Offline

Joined: Thu May 18, 2017 8:29 pm
Posts: 19
Marnix wrote:
I’ve been there. Writing an interpreter (parser) for text is not easy. Mine is based on an old skool state machine and state transition diagram. It parses the sentence word by word from left to right.
So, in the initial state, 0, it only accepts a verb or a noun. Anything else throws a “I don’t understand…” error. State 0 and noun goes to state 1, state 0 and verb goes to state 2.
In state 1 it only accepts a comma. In state 2 it accepts an article, adjective, adverb, noun or end of sentence. Etc, etc. The state machine has over 50 states.

Like you, I ran into the issue that a word can have different meanings (types). E.g. light can be a verb, an adjective or a noun. I solved it by implementing a recursive parser function. It calls itself for each next word in the sentence. If the state machine detects an error because of an illegal word type for the current state, it will check if the word has another type that goes with the current state. If not, the parser function will return to the previous word and will check for that word if there is another type that leads to a valid state and then continue from there. If not, it will go back yet another level etc.

Here’s an example for sentence “light light light” (meaning ignite the not so heavy lamp)

Light has 3 types: verb, adjective and noun. It parses as follows:

Code:
verb -> verb -> error
verb -> noun -> verb -> error
verb -> noun -> noun -> error
verb -> noun -> adjective -> error
verb -> adjective -> verb -> error
verb -> adjective -> noun -> OK


During the parsing process, it fills a struct with the correct actor, action, subject, etc so the interpreter knows what it has to do.


Cool! I'll keep this in mind, thanks for the ideas!


Top
 Profile Send private message  
Reply with quote  
 Post subject: Re: [closed]
PostPosted: Sun Jun 11, 2017 3:03 pm 
Offline

Joined: Tue Nov 03, 2015 2:05 pm
Posts: 9
Why did you stop development of this project? I understand there was some pressure to add this or that feature and/or explain why your ideas are better than what is out there. Seriously though this was a breath of fresh air and different than the mega development environments out there. This was sort of a grass roots, do your own thing and it's gonna be missed.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group