Page 1 of 1

Remaking Adrift 5 in Unity

PostPosted: Thu Nov 02, 2017 7:40 pm
by Stardog
I'm working on a full remake of Adrift 5 in Unity. The main reasons are so I can use custom dialogue systems, allow for more detailed interactions with objects, and WebGL export. Also, future potential for multiplayer/co-op play.

It's an interesting project to try to design. :x . I'm trying to do most things the way Adrift would with General/Specific Tasks, etc. I'll put it on GitHub as soon as it becomes 'usable'.

Building a specific task in code would look something like this, but would be simplified more in the future with a custom editor, or just scan the name of the GameObject and generate it from there. "look {at} (oPainting)".
adrift Code: Select all
AddSentenceElement(new ElementVerbID("vLook"));
AddSentenceElement(new ElementTextOptional("at"));
AddSentenceElement(new ElementObjectID("oPainting"));


I've already had to redesign the structure a few times.

Have any of you thought about doing something like this? How would you design it, and what features would you expect to see?

Re: Remaking Adrift 5 in Unity

PostPosted: Fri Nov 03, 2017 6:32 am
by P/o Prune
Hi Stardog.
I believe that Campbell would be the right person to ask about this.
He hasn't been around for quite sometime but I'll forward your post to him and hopefully he'll reply.
Don't give up hope.
Cheers

Re: Remaking Adrift 5 in Unity

PostPosted: Fri Nov 03, 2017 11:38 am
by Lazzah
Stardog wrote:I'm working on a full remake of Adrift 5 in Unity.

adrift Code: Select all
AddSentenceElement(new ElementVerbID("vLook"));
AddSentenceElement(new ElementTextOptional("at"));
AddSentenceElement(new ElementObjectID("oPainting"));


Sorry to put a dampener on your efforts, but I would personally avoid anything that involved using commands such as the above like the plague! The whole point about ADRIFT is that it is so easy to use. There are those of us - mostly the older generation - who find "expressions" like the above totally baffling. One reason I have avoided using Inform7 is the need to use code to perform the simplest of tasks.

Re: Remaking Adrift 5 in Unity

PostPosted: Fri Nov 03, 2017 1:51 pm
by Stardog
Lazzah wrote:
Stardog wrote:I'm working on a full remake of Adrift 5 in Unity.

adrift Code: Select all
AddSentenceElement(new ElementVerbID("vLook"));
AddSentenceElement(new ElementTextOptional("at"));
AddSentenceElement(new ElementObjectID("oPainting"));


Sorry to put a dampener on your efforts, but I would personally avoid anything that involved using commands such as the above like the plague! The whole point about ADRIFT is that it is so easy to use. There are those of us - mostly the older generation - who find "expressions" like the above totally baffling. One reason I have avoided using Inform7 is the need to use code to perform the simplest of tasks.

Yes, but Unity has an Editor layer you can use to hide the raw code. It would be no more complex than writing adrift's "[look/l] {at} %object%".

So you would have 3 different ways of doing it. Raw code, expressions, or visual editor.

Image
Image

Re: Remaking Adrift 5 in Unity

PostPosted: Fri Nov 03, 2017 8:12 pm
by Denk
Stardog wrote:Have any of you thought about doing something like this? How would you design it, and what features would you expect to see?

A feature I think is important for a modern IF-tool is the ability to play online, including ability to save your game. I hope that is possible with Unity (perhaps that is what webGL means?).

Looking forward to try a "usable" version, once it becomes available!

Re: Remaking Adrift 5 in Unity

PostPosted: Sun Nov 05, 2017 9:12 pm
by DazaKiwi
This sounds interesting. I hope you can get it off the ground. Do keep us in the loop of your progress if you are able to go ahead with it with Campbell's blessing.

Re: Remaking Adrift 5 in Unity

PostPosted: Tue Nov 14, 2017 2:45 pm
by Lumin
Looks interesting, good luck and keep us updated. Maybe something like this would help kickstart the community a little.

Re: Remaking Adrift 5 in Unity

PostPosted: Fri Nov 24, 2017 12:08 am
by Stardog
Denk wrote:
Stardog wrote:Have any of you thought about doing something like this? How would you design it, and what features would you expect to see?

A feature I think is important for a modern IF-tool is the ability to play online, including ability to save your game. I hope that is possible with Unity (perhaps that is what webGL means?).

Looking forward to try a "usable" version, once it becomes available!

Yes, WebGL means the games will be playable in a browser without plugins/addons.

I'm still working on some of the interesting design problems for this. I have done the basic text parsing. It will take the "look {at} [item]" format, split the command up into pieces, and match it to the closest "Task".

The harder problem is supporting complex game ideas. I will have to use Reflection to do some of the more complex stuff Adrift does such as the Action/Restrictions editor that let you choose from a list of things.

Re: Remaking Adrift 5 in Unity

PostPosted: Mon Dec 25, 2017 6:40 pm
by Stardog
I've done some work testing different user interfaces. It's missing some stuff, but the layout seems like it would work ok.

Capture.PNG
Capture.PNG (141.46 KiB) Viewed 2250 times



Project Overview Sidebar

There will be a constant left sidebar. You can click-drag objects from here into different windows/slots. Each category in the left bar would expand to its own editor so you have more space. Also, maybe the Objects category will be removed because having all objects in a list won't be useful when you have 20+. Instead, you can just parent them to Rooms directly.


Types

Types are things like Lookable/Container/Supporter/Wearable/etc. They are click-dragged onto an Object from the sidebar, or added with the + button. You can add as many Types as you want to an Object.

They are a list of properties grouped together. Compared to Adrift, they act like a 'Location Group' with properties that are "Private to group".

For advanced behaviour, you will have to build your own types from scratch. You will be able to add many types of variables/properties such as character/object/int/float/string/bool/enum/fsm, and also list/array versions. It should allow you to build complex objects.


Command Responses

This area replaces 'Specific Tasks' and would be done on the object itself, instead of listed separately.

You click-drag a Command (General Command) onto the object. If you add the "Read (object)" command onto the Note object, it would automatically assume you wanted to read this specific note, so you don't have to insert the object manually.

Then you would need to add your list of Conditions/Actions as in Adrift. A Condition might be "Referenced Object must be of type Readable". This is where you would need to have the correct Type added to the Note, also.

Re: Remaking Adrift 5 in Unity

PostPosted: Tue Dec 26, 2017 1:08 pm
by Lumin
Looks great so far! I really like that bit about dragging commands. Would there be away to set conditions universally, such as making all 'read' commands have the same requirements?

Re: Remaking Adrift 5 in Unity

PostPosted: Tue Dec 26, 2017 11:17 pm
by Stardog
Lumin wrote:Looks great so far! I really like that bit about dragging commands. Would there be away to set conditions universally, such as making all 'read' commands have the same requirements?

Thanks! For universal conditions, you would put them in the "read (object)" command like with Adrift's General Task. My example image above does it wrong, so the conditions you see there would actually be in a "fire (object)" base command. I also forgot to put those commands in the sidebar.

Also, Types should automatically add themselves when you drag a command into Command Responses. So adding a "read (object)" command to a Note, it would automatically add the "Readable" Type, which contains the variables that store what is typed on the note.

Re: Remaking Adrift 5 in Unity

PostPosted: Sat Feb 17, 2018 1:38 am
by DazaKiwi
Hello Stardog, How is your Unity/Adrift project going? any update info you can share with us on your progress? its been a few months.

Re: Remaking Adrift 5 in Unity

PostPosted: Thu Feb 22, 2018 6:42 pm
by Stardog
I haven't worked on it in February, but in January I added the idea of a 'Quest' and a 'Story'.

Quests will give players optional goals, and will be structured like Skyrims where each quest has multiple 'Stages'. When you switch stages, an event will fire which can affect the world in any way you wish, such as spawning/hiding objects. It could be used for storing puzzle variables, so you don't have to have variables in one big list. Multiple quests can be running at the same time.


The Story editor can help organise the different states the world can be in. It is split into stages too. For example:

Chapter 1 - Stage 1 (Enabled on game start. Player is inside house. When player types 'look at family photo', the 'Family Photo' object will check a condition (IF Story IS Chapter 1 Stage 1... Set Stage to 2)
Chapter 1 - Stage 2 (Activated by Family Photo. Makes a new character 'Jenny' appear in the room. Maybe now the game will not let you exit the room.)
Chapter 2 - Stage 1 (Activated by something in Chapter 1. Sets up objects/characters in different rooms.)

Now you can use this info as a condition. For example, if you type 'speak to jenny', it will start a different conversation when you are in different Chapters/Stages. I think only one Chapter/Stage will be active at any time.


I was also reading a bit about the structure of other engines too, and decided to use "Thing" as the base class of all objects.

Also, I wanted to support visual novels and other games, but it seems like it's better to focus on text adventures first, and then do a seperate editor for the others. I was playing Danganronpa and it seems too complex to create with the same editor.

Re: Remaking Adrift 5 in Unity

PostPosted: Fri Apr 20, 2018 8:43 pm
by Stardog
I'm still working on this of and on.

Expressions

One problem I had is visible in the "WRITE TEXT 'You fire the shotgun...'" action in the picture above. This is just a string (some text). If you changed the shotgun into a handgun, it wouldn't update the name automatically.

The only way to solve that is the same way ADRIFT does, by writing an expression such as 'You fire the objectID.Name' which will be converted to text at runtime, but I don't want anyone to write expressions. I want users to click-drag everything using building blocks. So that means I needed a new expression builder type concept.

To make this easier, I have decided to split everything out into its raw data, so it can be referenced from anywhere. Even the value of a variable is now a standalone object in the scene. This will also allow the GUI to display any data it wants, without knowing where it's from, so it's completely decoupled.

1.PNG
1.PNG (11.65 KiB) Viewed 1169 times

2.PNG
2.PNG (7.79 KiB) Viewed 1169 times


So, the 'WRITE TEXT' action's output will now be built from a list of multiple values that have been click-dragged in, loop through them, and then print out the final string.