Tuesday, July 17, 2018

17th July Update - Dialoguesmith

Dialoguesmith

A simple dialogue tree editor developed generally for unity. Now available at https://github.com/code51/dialoguesmith under license MIT. It'll mainly be used for Bad Pirates, while keeping the feature open for most kind of games.

Features


dialogue tree editor

Edit your dialogue tree through editor. access through Window/Dialoguesmith menu.

multi-texts

- A dialogue can have more than one text reserves which can be used for
  - a complete runthrough. a convenience without needing to create many dialogues for a single actor.
  - a single randomly picked text

actor

- a tree can have many dialogue actor
- it's not necessarily a name of the actor. it can be an id as a reference to your game actor.

variables

- automatically list the variables found inside the texts/option texts under format {variable_name}

implementation through factory and builder

- a factory/builder to help with the creation of the dialogue runtime. sample can be found in  samples/sample1/DialogueUIController.cs

tons of listeners

- listeners to listen on number of dialogue events
  - a factory only have a basic listeners for tree begin, finished, dialogue ready etc. this is used to help with UI building.
  - while a builder can have more dialogue specific listeners. this can be used for more sophisticated dialogue building.

So far, there's no planning for the variable usage other than being in text. So, there'll be no conditional implementation, at least for now, unless there's a necessity for bad pirates.

Monday, July 9, 2018

10 July Updates - Ship menu UI, crew design and structure, database for crew skill to performance rates, etc

Hi there.

It's been a while since the last update. So, here we go.

Ship Management Menu

Menu to manage ship wellbeing and performances

Inventory UI


Well, we need a basic inventory management, where we can see the items that a ship currently have, as well as being able to drag those item into ballistic menu.

Ballistic UI


Among features of Bad Pirates are, each side of a ship will have a different ballistic inventory management, and ballistic setup. 

Ballistic Setup

Ballistic setup is basically the cannons configuration you may have, and ammunition choice, as a ballistic strategy is usually affected by reload timing, cannon range efficiency and so on. later you'll be able to configure different ammunition usage, switch setup anytime by 1-10 hotkeys and many other things yet to be figured out. this is to encourage tactical gameplay by unlimited preferences. I was thinking about having something up to gun powder configuration for each cannons, some kind of boost to penetration power, while sacrificing accuracy. but well, this will require another item usage, called gunpowder. Just wondering if it might complicate the gameplay. 

Crew Design And Structure

So, this is the first time I actually gone through a thorough design on our crew management feature. One of the main core of the gameplay is crew management, and how they affect performance of the ship. So a crew will have their own class, with each class have specific skills that contributes to performance of the ship. For example :

Basic class
A sailor class, they'll have skills such as :
- ship handling
- repair
- gunnery

Class specific like :
A navigator class, will have a skills such as :
- sail master (improves ship acceleration_rate, and general sailing speed) 
- steering (improves turn_rate)
- cartography (island discovery, and so on)

A doctor, will have skills such as :
- first aid (improves crews general healing rate)
- medicine expert (improves medicine usage efficiency)

then we'll have chef, fisherman, shipsmith, cannoneer, tactician, and countless of classes if you want. in fact, a generic class design is probably underway, to give more way for a custom crew class. I was thinking about having a school or trainer to 

Crew collective statuses

So, a ship will have crew collective related statuses like health, energy (as having an individual statuses may decrease game performance at one point, and managing them all having hundreds of them later will be cumbersome to gameplay.) such statuses will affect the ship performance at one point, so it's best to have them at the full when approaching a skirmish. and this is where doctor or chef come to play.

Crew skill rates database

so, while i was at it, i managed to develop a simple web app feature to manage the database (remember the web app that i mentioned in the previous update?)

Summary

The ship management ui development is kinda slow for me, as UI design and look is totally not my forte. I am looking forward to developing a standardized dialogue mechanic later (and modal dialog, of course). This will hopefully open more development path such as story system, trading, crew dialogue, npc interaction and many others.

The ballistic design is yet to be finalized, as right now it's depending on range value of a cannon to determine the gameplay strategy (at 3 degree angle). But so far, it's all working as intended.

There're many other features I would like to share which is being actively drafted such as :
- fame system (honor / notoriety)
- end game design
- monouver (or skills in other games)

But I'll keep that for later maybe, and until next time. ;)

Saturday, June 30, 2018

30 June Updates - Item Definition / Database, Inventory, Ballistic, Camera Movement

Hi!

So, these are the updates so far since the last blog post. As of now, there isn't much UI design, but more to code design and development. That includes a simple event registry pattern for number of things in this update.

Inventory Design

This design is being abstract as possible so it share the same traits for other use, like island merchant inventory, ship inventory, ship side inventory (to store cannons). No UI to show yet, but it's done so far. 

Technically, an inventory only stores ItemEntity, a generic bag for quantity for specific item. At first, I had a dilemma on designing such thing, as different category has different structure of design. Like a Cannon category items have damage value, foods have consumption value and so on. 

This problem was tackled by having the definition (next subtopic) separately, as those values are item specific, and does not change over time. Plus, the inventory now only store a single object per item, as the only purpose is to store the quantity of the item. Which i am happy so far with the design.

Item Definition Design

Basically, this one became major prerequisite to most of the latest updates i've been doing (inventory design, ballistic [which consume cannon balls], side shooting mechanic and so on).

So far I managed to categorize the definition of the item to 7 at least that being :
- food
- livestock
- medicine
- firearm
- ammunition
- resource
- cannon

Bad Pirates is a singleplayer game that revolves around distance based trading. Most of the unique item will be marked as luxury. Luxury item only available at one place at a time (by which the location will be procedurally decided at the beginning of the game). Other than that food, medicine, ammunition are also a big part of your surviving adventure at the sea.

The game is generally inspired by uncharterd waters online. so you can see similar item categorization design there.

Item Database Management Web App

Not sure if this worthy of mention, but in order to cope or scale with the soon ever growing item database, i made a simple web app to add an items. Because doing so in json or plain is totally not fun at all, having different item structures.

Ballistic

The side shooting mechanic of a pirate game. My favorite development so far. So far what has been drafted and developed are like
- independent ballistic side design (so far there's only two sides, left and right. there'll be one more later like front for stern chaser cannons)
- shoot rate
- primary targeting (so your crews know where to shoot)
- accuracy 
  -  to be based on the angle of the side facing the opponent ship(s)). Bigger angle will cause your sailor to stray a lot.
  - the cannoneer type crew will increase this rate
- independent inventory
- rigidbody based projectile.

there'll more, as later we'll incorporate crews mechanic into this design. I am happy with this design so far.

Video is available at

Camera Movement

Was honestly afraid of this development as movement in quaternion, degrees, and angle, is totally not my forte. Tried to look for a youtube help, and some early tutorials, but mostly don't fit with the game. The idea is to be able to move the camera around, and to focus both you and your opponent (or target). Somehow today i managed to tackle the problem by having a basic understanding on how to get the vector of a direction, or apply angle etc. So far what've been developed are like :
- movement around the ship (by holding mouse 2)
- 2 kind of camera locking (focus both on player and target)
  - soft locking, but moving the camera (or using the hotkey) will break the lock
  - hard locking, by tapping the camera focusing hotkey. only allow height movement. pressing the hotkey to break the lock

this movement incorporate a reusable target design (a TargetEntity which is also used by the ballistic mechanic), and as later we'll have more kind of camera focusing. (like questing, island direction focusing and so on).

Video is available at

Event Registry Design Pattern (is there even such pattern?)

Not sure what to call it, maybe event delegation/handling design pattern.

By default most framework of language doesn't really show you a proper direction over how to do things, because I believe that things are mostly business/problem specific.

So far, i've been using such pattern for number of problem i've been facing. Especially in dealing with common events like trigger event and collision event. 

These are kind of registries (or delegator) i managed to design :
- ShipInteractionEventRegistry, to validate / handle the collision events like ballistic (cannon hits), and ship/objects collision, and trigger events like island/npc/etc interaction events.
- MouseSelectionEvent, to validate and handle mouse selection.
  - first event managed to be developed is ship selection event for ballistic primary targeting.
- ButtonPressEventRegistry. To handle numerous hotkey press event.
  - first implementation is the camera focus hotkey

Of course, we can just add a new method and do an if check on every kind of collision / trigger object event that the controller/script component gets, but the code will grow unmanageable, and maintenance will be so damn boring.

As you can see, we have two major methods for every registered event namely
- bool Validate(context), to validate the event (the if checking to be placed here)
- void Perform(context), to handle the event 

The only thing the controller needs to concern now is the registry(s), which only does one thing everytime there's an event (collision/trigger/mouse click/button press etc) by validating all handler. I first used such pattern for my php microframework, which you can find here :
https://github.com/Rosengate/exedra/blob/master/Exedra/Contracts/Routing/GroupHandler.php

=================================================

More progress information can be found by the public trello
https://trello.com/b/8aeV4DXA/bad-pirates

Until next time.
Thanks for anyone who actually read this lol :p

Tuesday, June 26, 2018

26 June Updates - AI Behavior

Hello,


I've been working with number of initial feature aspects, like daytime cycle, simple clouds generation (along with object pooling mechanic), ship interaction events registry, AI ship movements (AI behavior design incorporation) but mostly revolves around codes design and so on. What i would like to highlight here is, the AI behavior which I find challenging so far, due to the level of continuity needed to be designed.

AI Behavior design

The design isn't not using any plugin, or unity animator controller tools, to give more freedom on codes, due to how procedural the gameplay really is. What I find challenging is, the need to classify the kind of behaviour an AI may have.

Passive Behaviors

This behavior will be called all the time. It can be used for features like discovery behavior , surrounding AI interaction behavior and so on. The integral between active and intermediate behavior can happen here.

The current design can have more than one (1) passive behavior at a time.

Active Behavior

The design can have one active behavior at a time. Such behaviors are like
- go to behavior
- patrol behavior
- following behavior

Intermediate Behavior

This behavior overrides active one in term of priority, on which the termination ends this behavior, and continue to active level of behavior (if there's any). Such behavior is like
- attacking behavior
- escape behavior

Others

Ship interaction event registry

A registry made to easily handle or classify the kind of interaction that happened ship collision. It can be :
- ship collision
- cannon ball collision
- island interaction


Object pooling mechanic

Handles game object pooling for performance on continuous instantiation

Daytime cycle

Basic day time cycle and sky appearance


Fake island name implementation

For island naming sake. Credit :
http://fantasynames.org/island-name-generator/

=================================

That's all. More information about the progress can be found here :

Until next time. :)

Sunday, June 24, 2018

Bad Pirates The Game

Hello everyone,

This blog will officially be covering all the development updates for the game. So, this post will highlight what the game will be about, along with tons of initially drafted features.

Overview

A not so accurate single player pirate adventure game in a procedurally and seamlessly generated world (connected). In this game you get the chance to be a pirate, good guy, or a super trader.

The game is generally inspired by the such as uncharted water online (except that this is an offline game), sid meier pirates and well, because i love sailing, adventure, and enjoying the survival nature of the sea, the rpg mechanic and so on.

Features

- world is procedurally generated based on seed
- weather system, day/night cycle, and datetime (maybe like 1 day to 24 minutes ratio)
- islands interaction
  - crews hunting
  - trading system
  - tavern system
  - economy
- regional trading system
  - luxury item prices increases the further you go
  - to encourage player to travel further
- proper goods implementation for trading system
- fame/notoriety system
  - attacking neutral, empire, merchants increases notorierity and fame
  - doing good things like helping neutral, or empire increases fame
- ship interaction
  - crews management
  - inventory
  - upgrade
  - repair
- crews system, and in how how it helps your ship performance
  - classes
    - navigator
      - navigation
      - increase ship turning rate
      - island discovery
    - sailor
      - ship operation
      - repairing
    - chef
      - provides cooking
    - shipsmith
      - much faster ship repair
    - cannoneer
      - faster shoot rate
    - fisherman
      - fishing rate
    - merchant specialist
      - helps buying goods (negotiating) at lower discount
- world events
  - merchant, pirate, empire movements
  - AI skirmishes events
- sailing system
  - wind driven speed
- survival feature
- skirmish gameplay
  - realtime (time slowed down to 1X, if we have game-speed change mechanic
  - ballistic and gunnery
  - repair system
  - defense penetration system
- crews dialogue system
- AI aggression level
  - level of aggression affect how they interact with in in sea

==============================================

I think there's more, maybe we'll save for later. Hopefully planning to release it by the end of this year as an early access.

The trello the much frequent progress can be seen here.
https://trello.com/b/8aeV4DXA/bad-pirates

And, I am Rahimie Ahmad, see you next time.