2014-10-17

System in action

This is a little preview of the current working state of my system Fate.

I'm starting with some source code put together from the last example. I use Sublime Text for writing since it allows for syntax highlights and code snippets and other nice things.



The source is saved inside a resource folder in a Unity project. I can open the visual editor to make sure that everything compiles, then I'm ready to build an executable.



Unity does its thing and then the game is ready to play.



When the game starts up the first thing that the system does is copy the source code from the project into a folder on the local drive. This copy contains the exact same source text files, and it is what will be read into the game in place of the original. In other words this makes the source of the game available to be modded if the player wants.



Next the system reads the files from this directory and compiles the source code into a game. If this process fails there will be an ugly error like this.



As you can see, these warning messages aren't always very specific, so I have a lot of work to do to make debugging reasonable. Generally though, the default game source *should* be bug free. One challenge here is that a lot of the source is compiled up front, but some things can obviously only be evaluated during the game, so run time issues may pop up with the same error.

If all goes well we are taken to the game's title screen. All of the values here (author, title, brief description) are exposed in the source code via content functions. This makes the system pretty flexible and generic, but right now it's a little too generic visually.



I can exit out of the game and modify the source code with this line:
content("sensitiveContent", "true")
This marks the game as containing restricted material. Now when we start the game we will get a disclaimer with a rating and content details that we set.



Back on the title page we can navigate to the about page that shows other data we can specify about the game. One cool thing that I'm not showing here is that the number of contributions by a contributor are counted, and under the credits contributors are sorted by most contributions to least.



Anyway onto the game itself. Once we press New Game from the main menu, we enter the first passage, Start.



There are a good amount of options available to adjust the text for readability.



A game could be entirely choice based, world based or a mixture of the two. When mixing the two (which is pretty much what I'm doing) you make choices until you reach end points where you are then free to explore the world. World exploration/interaction is done with a horizontal infinitely scrollable list of nouns and then actions on those nouns.



Once items are picked up they get held in a separate list just for inventory. This was an important addition I made during the rewrite since it helps to keep the main list of nouns less crowded while playing.



We can save our progress and the save goes into a saves directory beside the source folder. I currently don't have undo/redo exposed in the interface, but the history system is able to go from wherever you are all the way to back Start. All choices are included in game saves.



If we quit and reload, we automatically return to where we left off by loading the most recent save. Otherwise saves are accessible via a simple menu from within the game.



And finally once we reach an end point specified with control("end") our game is auto-saved and we can return to the home screen when ready. (ignore that bit about the world menu still being displayed >_>)



So there you have a quick run down of the system. I can't even really measure all the work that has gone into this, but I really think it was worth it. I still have some important things to do before I can release a playable demo for desktop platforms. Android is quite a headache due to resolution issues and iOS is a pie in the sky. My current focus is on writing Something, so I guess my next post will be about that.

3 comments:

  1. Interesting. I think the most promising thing about this system is the formatting options. I don't know much about Unity, but I presume that it's a little more capable than i6 when it comes to formatting text and such. i6 is surprisingly weak at that.

    When you're done with it, it would be a cool thing to play around with.

    ReplyDelete
  2. NOPE

    Unity has always had a horrible interface system. I'm pretty sure that is the main reason that few people (if any) are using Unity for purely text based games. The most upsetting issue for me is the lack of access for people who need screen readers/tts device thingys with Unity games.

    The only workaround to make this possible at all is to use 3rd party gui assets from Unity's asset store. The most popular is NGUI, it's what I'm using for the interface here. NGUI is so good that they hired the guy who built it to help rebuild Unity's default interface system. The new uGUI system as they call it is promising but still in testing.

    NGUI is the best option right now, but it is around 95$ and closed source, so I can't release it as part of Fate. That would leave anyone wanting to use Fate to need to roll their own GUI in Unity (not likely anyone would find it worth the effort) or purchase a copy of NGUI. My plan has been to switch Fate over to the new system so that all you need is the free version of Unity to get started. I've made two attempts at making the switch to uGUI, but got frustrated for one reason or another and gave up.

    ReplyDelete