CSV to Unity

Database Example

Village Generation

Opportunity and Choices

Effect Impact

Save and Serialization

STORM System


API Documentation


Contact

Introduction

The Village Framework is a tool created by Porcelaine Games, available on the Unity Asset Store.

It is a flexible engine made to act as a foundation for any type of game centered around the generation of data by day.

It’s been designed with the idea of separating data from the engine, to let designers adjust databases, create new elements, and balance the game with minimal need to go in the engine.

It uses .csv file for this, that can be generated from Notion, Google Sheet, Excel, or any similar database tools.


Features


How to install

Supported Version:

Unity 6.0 to Unity 6.3

Packages Depedencies :

Dependencies to Unity official packages. You can installe them from the package manager

For it to work, you need the Localization Package, from Unity, that you can install from the Package Manager. However, the Village package will still work even without it.

Installation:

  1. Create a new Unity project in a supported version of Unity

  2. Install Text Mesh Pro

    1. Go To “Windows > TextMeshPro > Import TMP Essentials Resoucres “ And “ Import TMP Examples and Extras” This is used for our demo scene

    image.png

  3. Install the package.

    1. Buy the asset on the asset store
    2. Click on “Add to My Assets” and then “ Open in Unity” when you have unity open
    3. Or Open the package manager and find “My Assets” and find “VillageFramework”
    4. Click on “Download” then “Import to project”. It may ask you to install depedencies.
  4. Check the Demo scene at “Plugin > Village > Demo > Scenes > VillageFrameworkDemo “. You will find an example on how to start the village and set up scenes. Or check the How to use Section bellow

image.png


How to use

Set up Database and Import

After installation, you will need to set up some database. You can use the tool of your choice, as long as it can export as csv, but you can use the template database that we use for our demo in Database Example.

Check CSV to Unity for how to set up your database and the settings in Unity.

Bootstrap

To make the VillageFramework, you need to have a prefab with all the components on it. You can instantiate it yourself, or create a bootstrap asset.

The bootstrap asset takes a list of gameobjects, and at the very start of the game, will instantiate all of them as “DontDestroyOnLoad” So they persist between scenes.

You can create a Bootstrap asset in a Resources folder with “Right Click > Create > Scriptable Objects > Village > Bootstrap Asset”

image.png

In it , you will be able to add all the prefabs you want to stay as persistent. Create one for your VillageManager and assign it (or copy the one from our demo scene)

image.png

Village Manager

The village manager is the driver of the Village Framework. From it, you will save, load , access the village, and generate new days.

The village is only made of data, and no visuals, so you can implement it following your needs.

Example VillageManager Prefab

image.png

<aside> 📌

On your VillageManager prefab, add the component VillageManager first.

</aside>

Village Loop - How to start the Village System

graph LR
  Start --> isNew{Is New Game ?}
  isNew -- No --> deserialize[Deserialize Json]
  isNew -- Yes --> initialize[Initialize Village]
  initialize --> generate[Generate a New Day]
  deserialize --> load[Load Village]
  generate --> load
  load --> play[Play game loop and update date]
  play  --> generate
  
 

To use the village, once the prefab is created and instanciated, with all its necessary component.