OAX6 Source Code Released, Instructions to create a game.

The source code for OAX6 can now be checked out by campaign backers as defined in their perk level.

It is still early, but even at this stage, a simple game could be created! I hope some of them get to play around with it and come back with suggestions. Of course, as development continues it will become easier (ultimately providing editing tools for this) and more complex games will be able to be created.

Below are the current, 0.1 instructions to create a game using OAX6:


How to Create a Game Using OAX6

Disclaimer

This guide applies for v0.1, first version publicly available to backers. We are in a very early stage still, the engine is limited both in what it can do and on how easy it can be used.

This build is provided for the following reasons:

  • So you can fulfill your curiosity on how the game works.
  • So you can start having an idea of the capabilities and format of the engine for your future projects using it.
  • So that more people (who cares about the project) has access to the source in case something terrible happens.

Setup

After cloning the repository

The default scenario should show up in the browser.

Maps

Tiled maps are saved on scenarios/wod6/maps.

Make sure you are using uncompressed JSON format.

The maps should have the following layers:

  • Solid Tiles: Any tile in this layer is considered as solid when loaded on the engine
  • Mobs: Tiles placed here should have at least an ‘id’ custom property, pointing to a valid MobType. It can additionally have a type, which can be ‘mob’ or ‘npc’, if the type is npc, then it should have a NPC id instead of a MobType id
  • Buildings: This and the following 4 layers don’t have any logical effect, use them to make cool maps.
  • Vegetation
  • Objects
  • Terrain

Scenario Data

Set your scenario data in scenarios/wod6/Info.js

startingState

  • minuteOfDay: Determines the stating time
  • map: Points to the list of maps below (name)
  • x: Starting player position
  • y: Starting player position
  • party: List of NPCs in the starting party, id, x and y
  • scene: Points to the list of scenes below

maps

  • name: Identifies the map
  • filename: Filename in scenario/wod6/maps/

scenes

Key is the scene key, each scene is a list of string which are shown in succession

Appearances

Defined in src/js/data/Appearances.js

  • The numbers refer to indexes on the tileset
  • The mob appearances include 4 frames for each direction

Items

Defined in src/js/data/Items.js Each item can have the following attributes:

  • id: Identifies the item
  • name: Description of the item
  • appearance: Referencing an item appearance on Appearances.js
  • flyAppearance: Used when the item is “flying” (for example when thrown)
  • throwable: Whether the item can be thrown
  • range: Max distance for throwing the item
  • flyType: ‘rotate’ or ‘straight’ animation to use when throwing the item
  • damage: Points of damage caused

MobTypes

Defined in src/js/data/MobTypes.js

  • id
  • name
  • appearance: Points to Appearances
  • hp
  • damage
  • defense
  • speed: Determines the order in the queue for combat mode
  • corpse: References Items.js, item placed on the floor when the mob dies
  • intent: ‘seekPlayer’, ‘waitCommand’, ‘wander’, ‘combat’

NPCs – Basic Data

Defined in src/js/data/NPCs.js

  • id
  • name
  • type: Points to MobTypes
  • alignment: ‘b’ for friendly, ‘a’ for enemy, ‘c’ for neutral. Likely to be revised
  • weapon: Points to Items
  • firstTalk: Number, will talk to player first if he gets closer than this.
  • intent: Same options as MobTypes

NPCs – Conversations

The conversation trees are defined in the “dialog” attribute of each NPC.

They are a list of objects, each object is a dialog fragment, tied to a keyword.

Each dialog fragment can have either

  • A list of dialog pieces (see below)
  • A list of dialog variants (see below)
  • A synonym keyword

A dialog variant contains a condition with a flag name and value, and a list of dialog pieces. If the condition is met the conversation will follow these dialog pieces.

A dialog piece can be either

  • A string of text
  • An object with the following types:
  • “event” is similar to a normal text, except it describes something happening instead of something the NPC is saying.
  • “dialogInterruption” is similar to a normal text, except another NPC is talking
  • “endConversation” finishes the current conversation
  • “joinParty” makes the NPC join the party
  • “setFlag” sets a global flag to a given value

There is a special dialog fragment marked as “unknown” which is used when the keyword input by the player doesn’t match any dialog fragment or variant.

Assembling a build

Once you have all data set, you can execute the build.sh script, then the game package will be available in the build directory (open the index.html file using a web server)

OpenArthurianX6 – Pushing dev for Milestone 1

Still not there but it’s been a lot of work. As I worked towards the goals for Milestone 1 I found quite a bit of work was needed on the dialogs and the mobs AI.

Screen Shot 2018-08-04 at 10.20.31 PM

Changes

  • “The Law of Virtue” scenario
    • New test map (Forest clearing)
    • Cutscenes
    • Asteroth conversation
    • Shamino conversation
  • Scenario setup
    • Read starting map, starting time of day and starting player position from Scenario Info
    • Allow placing NPCs and Mobs on the tiled map
  • Added support for simple “Cutscenes”, that is sequences of text dialogs to tell the story.
  • Dialogs
    • Support multiple fragments of dialog per keyword
    • Add variants per keyword based on player flags
    • Add support for “triggers” executed inside the conversation
    • Add triggers to join the party, end conversation and set player flag
    • Fall back to “unknown” dialog if no match on variant
    • Merge triggers into the dialog as objects so they happen sequentially
    • Add support for dialog qualifiers (in addition to normal dialog lines)
      • Dialog interruption: for other NPCs to participate in.
      • Event: For event descriptions
    • Add support for keyword synonyms
    • Allow NPCs to start a dialog when getting closer
  • AI
    • Make friendly mobs act differently than party members
    • Make unfriendly NPCs have a minimum range before chasing
    • Implement intents for mobs
      • seekPlayer: Do nothing waiting for the player to be on sight
      • waitCommand: Do nothing.
    • Implement subintent logic based on intent.
    • Use direct LOS to define if can track player.
  • Combat
    • Speed up combat
  •  Art
    • Added Shamino and Soldier Mob appearances

Source Code

Funders with early source access privileges will be given access to the source code repository on request starting now!

Dev Streams!

Note that some work was done offline, of course.

 

OpenArthurianX6 – Plans for the first public release

Almost one year ago, I lay down a general plan for the development of the engine, lots of things happened since the campaign was funded, and there has been progress, but not at the pace I expected.

But now, I have much greater control of my work schedule, and it’s time to get serious. I also spoke with my friend Exodus Destiny Dragon, and he’s up to continue pushing the development

I still believe the original model, based on “capabilities” and “engine aspects”, is the way to go to get to the first release. I will include an additional facet: a plotline, for a game using the engine.

You may wonder, why is this important? and I believe it comes down to… motivation. It is hard to keep a constant influx of motivation when working on an engine, it’s cool to see things come together, but it’s too easy to lose direction if there isn’t something tying everything together.

From that initial plan, we have covered the following:

Capabilities

World

  • Move around the map
  • Pick up an item from the map

Dialogs

  • Talk with a NPC

Inventory

  • Check the inventory of a party member (Some progress)
  • Drop an item on the map

Combat

  • Enter and leave combat mode
  • Attack an enemy within melee distance
  • Attack a far away enemy

Engine Aspects

Maps

  • Day and Night Cycle: Some progress

Mobs

  • Follow player

How does the plotline affect this plan? all the items will be steered towards the construction of the scenario supporting it.

When the game starts the intro is displayed as follows:

  • The Avatar has been summoned back into Britannia, arriving during the night in a forest near Yew.
  • He finds Shamino and talks with him, learning about what has happened on Britannia.
  • They decide to head back into a safe place but are suddenly attacked by a group of soldiers led by Lord Asteroth of Empath Abbey.

The game starts in a forest clearing at night in combat mode (Similar to Ultima VI)

  • The Day/Night skyline indicator is visible, showing night.
  • The party is the Avatar and Shamino, they take turns to attack the enemy.
  • While in combat, the party members can move around
  • The Avatar is armed with a sword so he can do melee attacks
  • Shamino is armed with a bow so he can do ranged attacks
  • The enemy soldiers attack the party members using melee and ranged attacks

After 2 turns, Shamino is shot by a magic bolt by Lord Asteroth and is taken out of combat. Cutscene unfolds:

  • Out of nowhere, Iolo appears along with a band of resistance members
  • He shots Lord Asteroth with his crossbow and forces the soldiers to flee.
  • Then they disband leaving the party alone.
  • Iolo says they must seek refuge on his hut to the west.
  • Party is transported to Iolo’s hut.

Inside Iolo’s hut, the Avatar can:

  • Save the Game, Exit and Restore
  • Examine Iolo
  • Talk to Iolo using keywords
  • Ask Iolo to join the party
  • Open and close its main door
  • Read a book containing Iolo’s notes during the Quest of the Avatar
  • Get a key and use it to open an inside door going into his workshop
  • Go to the second floor
  • Examine a wall finding a secret lever (Revealed by Iolo in conversation)
  • Use the lever to open a hidden door into a room with a mystic sword.
  • Switch main character to Iolo
  • Get Mystic Sword
  • Examine Mystic Sword (in Inventory)
  • Get Magic Axe
  • Get a bag
  • Switch main character to Avatar
  • Check Avatar’s inventory
  • Check Iolo’s inventory
  • Put Mystic Sword into bag
  • Put Magic Axe into bag
  • Take Mystic Sword out of bag
  • Give Mystic Sword to Avatar
  • Make Avatar Use Mystic Sword (Wear)
  • Get yellow and blue potion
  • Drink Yellow potion, recover 5 HP
  • Drink Blue potion, recover 5 MP
  • Get lute
  • Use lute (go into instrument mode, can play using numbers)
  • Exit instrument mode
  • Use torch in the wall (put it off)
  • Use torch again (light it)
  • Get torch

In the area surrounding the hut, the Avatar can

  • Move around, having the party members follow him.
  • Examine the trees around
  • Examine a rock laying around
  • Get the rock
  • Drop the rock
  • Examine crate (Has some corn inside)
  • Move rock into crate
  • Examine crate, pick corn from crate
  • Use corn, be less hungry
  • Read a gravestone
  • Check the status of Shamino
  • Talk with Shamino, ask him to leave the party.
  • Talk with Shamino, ask him to join the party.
  • Get bucket, drop next to cow.
  • Use Cow (bucket gets filled with milk)
  • Attack Cow (Switch to combat mode)
  • Cow flees (peaceful animal AI)
  • Switch off combat mode
  • There are two friendly NPCs around (resistance members). They are hiding at Iolo’s
  • The friendly NPCs sleep at night in the barn, go to the fields during the morning, and have lunch at home at noon.

The party travels south

  • Smooth transition into another map segment (forest)
  • Time goes on into dawn and morning.
  • Party attacked by headlesses group. (Switch into combat mode)
  • Cannot switch out of combat mode.
  • When a headless is killed, he drops a corpse
  • After killing all headless, combat mode is automatically turned off
  • Corpses of headless can be examined as containers, they can have a club or not.

Or the party can be defeated…

  • If the headlesses or the soldiers kill the party, it’s game over

While implementing this flow doesn’t ensure the engine is completed, I believe iterating over it making it progressively better and more flexible every time will push forward the development of the engine.

Now comes the question about the dates. The idea is to produce biweekly builds and the plan is to have a working version of this flow within 20 work weeks, as detailed here.

Tales of the Avatar: The Law of Virtue

It has been over four years since our Lord British’s expedition set forth into the underworld, never to be seen again. With our sovereign gone and The Avatar having returned triumphant to his home world, you, the people of Britannia, seems to have lost your way.

We were once proud of our town-states being places where you could conduct business safely and live a tranquil daily life, but now you steal and deceive each other continuously, seeking to build up your personal riches instead of striving for equality by giving to those in need. As this inequality grows, gangs of bandits roam the land, but you now cowardly refuse to join the ranks of the royal army to keep our cities safe from rogues and monsters.

Crime spreads throughout the land, and we have to double down in our efforts to upkeep the virtues as a way of living. But in our crusade for the good, we met with an unexpected reality: you are unwilling to contribute your resources to our difficult enterprise. You disgrace your taken oaths, challenging and distrusting the will of your superiors and following your own primal instincts instead.

Britannians have forgotten the sanctity of virtue. You now take pride in your self-imposed ideals as individuals, neglecting following the wisdom of your rulers.

It is in these dark times, when our Britannian society is on its direst need, that I have to proclaim the Law of Virtue. Under this law, Britannia will flourish again as the great virtuous society that it once was. We have gathered together a new council of the greatest thinkers and philosophers of the realm, who have contributed their experience and knowledge into a set of rules and actions that will bring us back to the way of the Avatar.

As a critical measure to put this new law into action, the current heads of our bastions will be removed from their post, replaced with three virtuous individuals of my utmost trust.

Lord Faulinei is to replace Lord Shalineth as the head of the Lycaeum and to act as the new Royal Chancellor. His main task will be ensuring our judiciary system can upkeep with the rising tide of crime, modernizing the laws and providing our inquisitorial prosecutors with all the tools they need to clean our lands from vices that corrupt it. Whoever opposes our law will be dealt with swift, relentless justice.

Lady Nosfentor will replace Lord Malone as commander of Serpent’s Hold, As Captain of the Army and Admiral of the Navy, she has been entrusted with bringing safety back to our realm. May the hordes of bandits and vicious rogues and outlaws fear our swords for they will soon perish along with their vices. Also, until noted otherwise, a curfew is in effect and all individuals roaming the cities during nighttime will be subject to being engaged in the name of the virtues by our royal knights and the newly created order of the Defenders of Virtue.

Finally, Lord Asteroth will replace Lord Michael as Empath Abbey. He will be given the daunting task of redistributing the riches of our land ensuring that no single individual owns more than he needs. You, people of Britannia, need to leave aside your greed and contribute to the work our institutions do to create and upkeep a better society. Eventually, all farmland will be redistributed and every Britannian family will have the means to strive through hard and loving work.

The mayors of all cities have also willingly removed themselves from their posts; their duties will be fulfilled by local committees of virtue, whose members will be revealed on each town as part of their re-educational programs.

Britannia counts with your submission into this new law. Help us make a better world for you and your children, or suffer our wrath.

Walk in the path of Virtue.

 

Always vigilant, your humble servant.

Lord Blackthorn
Regent of Britannia

OpenArthurianX6, kicking back dev

I pushed further with the projectiles, “directional” ones (like arrows and crossbow bolts) are working now, and “rotating” ones (like throwing axes) are almost there.

Next up is some logic for spending ammo, and stashes of items.

I also need to sync with the WIP on my secondary dev station, where I was fixing some bugs with NPC alignment.