Code Monkey home page Code Monkey logo

agsfastwfc's Introduction

agsfastwfc

🚨THIS IS VERY EXPERIMENTAL🚨 | Build Status

AGS Fast Wave Function Collapse Plugin

Using the fast-wfc library code from Mathieu Fehr and Nathanaël Courant. I just made a simple interface with Adventure Game Studio. Read more on Wafe Function Collapse here.

AgsFastWFC Script API usage

agsfastwfc can generate sprites that are locally similar to the input bitmap.

Overlapping

bool AgsFastWFC.Overlapping(
                   int destination, int sprite,
				   int seed,
				   bool periodic_input, bool periodic_output,
				   int N=3, int ground=0)
  • int destination The Graphic property of a Dynamic Sprite you have created to draw the result.
  • int sprite The source sprite you want to feed FastWFC Overlapping algorithm.
  • int seed An integer number, will provide the randomness of the output.
  • bool periodic_input Should be true if the input is periodic.
  • bool periodic_output Should be true if the desired output is periodic.
  • int N A NxN pattern of pixels in the output should occur at least once in the input. Default is 3x3 pixels.
  • int ground Default is 0.

Example:

  dynspr_dest = DynamicSprite.Create(60, 120, true);  
  int result = AgsFastWFC.Overlapping(
					dynspr_dest.Graphic, obj_source.Graphic,
					Random(100000),
					true, true, 3,  0);
  obj_destination.Graphic = dynspr_dest.Graphic;

Building agsfastwfc plugin

first you need to clone this repository to the folder you clone your repos (ex: ~/git).

If you haven't already, also clone AGS and set the branch for ags3.

git clone https://github.com/ericoporto/agsfastwfc.git
git clone https://github.com/adventuregamestudio/ags.git
pushd ags
git checkout ags3
popd

Windows

Just load the solution on Visual Studio 2019 or 2017, and hit build.

Linux

You need gcc that supports C++17. Load a terminal and do the below after cloning.

cd agsfastwfc/agsfastwfc/
make

MacOS

MacOS build is untested, but should work the same way as Linux.

Image samples

The image samples come from https://github.com/mxgmn/WaveFunctionCollapse

Licence

This plugin interface is made with MIT License Copyright (c) 2019 Érico Vieira Porto.

fast-wfc Copyright (c) 2018-2019 Mathieu Fehr and Nathanaël Courant.

MIT License, see LICENSE for further details.

agsfastwfc's People

Contributors

ericoporto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

agsfastwfc's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.