Closed CarterG81 closed 6 years ago
Thanks for sharing this. Just starting having a play with Ink and interesting to see how other people are using it
Currently I am restructuring Traveler's Tale to be a highly moddable, nearly completely Ink based game.
To do this, I am creating my own game engine using Unity & Ink. Basically, I ak creating an Ink parser, interpreted by C# code (the engine) and then rendered/output using Unity.
I wanted a way to write my game within Ink. So I am using my own set of API commands. What cant / shouldnt be in INK will likely be done in JSON (maybe procedural generation logic or tilemap data).
The Unity side will handle input, but assisted by Ink tag commands. "#DELAY:1" "#AUTOCONTINUE", "#RenderGUI:Backpack", etc.
Same for Rendering
"Some story text written here. #Background:Spaceship12.png #AddCharacter(Clown2.png, Position, Flipped) #AddProp(Barrel.png, Position, Flipped) #PlayAudio:Music7.ogg
Etc. Etc.
Unity side would include GameModes, which do more than just display Text & Images, but a WorldMap travel & movement, inventory system, combat positioning system, and a Polyhedral Dice mechanic.
Eventually I would like to sell my game not just as a full game experience, but (as a bonus) also as a Command-Filled, fully featured Ink engine for gamers to write theit own fan-fiction or make their own games. Editing everything, choosing any systems, or replacing them entirely if distributed as a unity C# project alongside the game build.
Right now I am part time gamedev... so I need some way to generate revenue to go full time. I'd prefer to make a custom engine for Ink (maybe even using SDL or Godot instead of Unity) and have it be free & open source...to give back and grow Ink & gamedev - maybe adding lots of requested commands / features, but I need to finish my game first to afford making a fully featured engine for ppl to make games in.
With my second project Away Mission, since it requires animation in scenes, I hope to update this engine idea to a 2.0 version which adds animation and a lot of AI commands (for animation or story). But done using Ink writing. Commands like #AI.Pathfind(Engineer, Scientist) #AI.Interact(Scientist, ScienceConsole) which begin animating inbetween or alongside text. To tell a more animated, interactive, procedural story
But clearly those are rough draft plans for much later. I will just be creating Traveler's Tales with this in mind. Write a story in a text editor using Ink & then just have the engine parse the text and tags into an actual game.
Maintaining updates here along with the devlog (if I can even maintain that) is a bit too much for me. I'll close this for now. The devblog is here https://forum.unity.com/threads/travelers-tale-a-party-based-procedural-storytelling-travel-game.505682/
In here I'd like to post some my Ink code, if it will be of any help to anyone as an example.'' The number 1 thing for me when learning a new language or trying to implement something awesome like INK, is seeing some examples of how other people are handling their game logic. It's sparse pickins in some areas (I'm making a lot more than just a purely text based game), so I really hope this helps others feel more comfortable with how they're doing things.
I am still trying to find out how to get as much of the Game Logic / Game Code into INK as possible. Preferably, I'd use Unity only for Rendering/Input, and maybe the Dice System (Conflict Resolution).
THE GAME: Traveler's Tale.
Type of Game: It basically plays as a mixture of a Board Game, a Choose your own Adventure, and a Dice Game. In other words: I'd really like to make a game that gives off the feel of a singleplayer "PnP" experience. One of my favorite aspects of PnP is the interactive on-the-fly storytelling, which INK is quite amazing it. The other aspect is the dice rolling. I love rolling those dice for conflict resolution. I'm also a big fan of board games, so the WorldMap travel/exploration like a board game is also awesome.
I am reminded heavily of some of my favorite interactive fiction games of old:
Curious Expedition's gorgeous scene art & complete lack of animation, really inspired me to create a modern day 2017 version of the above style of games.
Goal: Have as much of the Game Logic / Code in INK as possible, to allow Traveler's Tale to become so moddable it can be a sort of "Create your own Adventure" game. Write your own stories, create your own Items, use our art or your own, etc. What can't be done in Ink, hopefully will be done in exposing JSON. Moddability may vary in final product.
I have separate .ink files which I include in my game. These are my game's variables. Separating everything into their own .ink files. Each LOCATION is its own file, each playthrough is a single questline/storyline, and all of it is linked together with CORE.ink & lots of INCLUDE Locations/LocationName.ink
First, I have a "PARTY" .ink file called "PartyVariables.ink".
A "Party" in my game can have a maximum of 5 characters. One is always the player's hero, and the remaining 4 are crew members. This holds any relevant variables, such as how much GOLD the player has, the current MORALE of their entire party, and any other party-centric variables. (All characters are in a separate file).
The most important part of this class is actually the functions. This is where you can get knowledge of whether or not a PartyMember exists, as well as get a RandomPartyMember (including or excluding the HeroCharacter). This is paired with
bool PartyMember#_Exists
in the character file.Since Characters have a lot of VARiables, I put them in a different file called "CharacterData.ink"
A PartyMember has a Name, Race, Class, Gender, 3 inventory slots for items, and an IMAGE (Texture name) so Unity knows what to render. One of the most important parts here is PartyMember#_Exists = false . This tells whether or not a Character is still residing in their party slot. If set to false, there is no party member, so they will not be returned when using Party functions like GetRandomPartyMember().
Since we don't have Classes or Arrays/Containers, I simply have a different VAR for each variable, and copy-paste this with a different name, keeping with the convention PartyMember#.
SetPartyMember() is an important function. This creates a new character based on the parameters, and sets Exists = true.
Inventory has Getter/Setters for all 3 slots per character. The rest of the functions are just Getters which use a Switch.
When creating a new story, I set up all the characters, locations, starting gold/items, etc in a main file.
I hope that helps. If you think there's a better way to do any of this, I am all ears. I don't pretend to be an expert. It's very difficult for me to engineer this without the use of Classes/Objects/Arrays.