Code Monkey home page Code Monkey logo

unityrunner's Introduction

What is a Runner?

The Pixel Vision 8 SDK was designed to be a self-contained, platform agnostic C# library. With that in mind, it will need a runner. The PV8 Runner is any code harness that bridges the core engine to a host platform. The Runner performs the following tasks:

  • Facilitates displaying Bitmap Data for rendering the display as well as the assets importers.

  • Provides an Application wrapper so that PV8 can run on a computer as an executable.

  • Calls the engine's Init() on startup and the Update(), and Draw() methods during each frame.

  • Feeds the engine input data such as the mouse, keyboard and controller data.

  • Provides a wrapper for playing sounds.

  • Allows loading and playing of games.

Runners are relatively easy to build. There is even an example of how to create a simple Unity runner in the demo section. Before you look at that, it's important to take a moment to understand how the runner should be architected and what you'll need to build to get Pixel Vision 8 running correctly.

What is Pixel Vision 8

PV8's core philosophy is to teach retro game development with streamlined workflows. It enables designing games around limited resolutions, colors, sprites, sound and memory. It is ideal for game jams, prototyping ideas or having fun.

Pixel Vision 8 is also a platform that standardizes 8-bit fantasy console limitations. Developers can customize these restrictions to match actual legacy hardware or create something new. The challenge of working within these confines forces creativity and limits scope. Pixel Vision 8 creations are expressions of ingenuity that rise above their limitations.

Features

Pixel Vision 8โ€™s SDK contains a collection of components called Chips. Each Chip shares an API and base class to standardize their lifecycle. A central ChipManager handles activating, updating and rendering them. Here is a list of the standard chips included with the SDK:

  • ColorChip - Manages system colors

  • Display - Renders pixel data.

  • Font - Renders sprite based fonts.

  • GameChip - A game's base class.

  • MusicChip - A sequencer for playing back music.

  • ScreenBufferChip - Caches sprites for tilemaps and fonts.

  • SoundChip - A sound effect manager.

  • SpriteChip - Manages sprites in memory.

  • TileMap - Drawing sprites into the ScreenBufferChip.

The engine is completely modular allowing you to extend these Chips to add new functionality or create your own from the base classes and interfaces provided.

Documentation

Pixel Vision 8 SDK is cleanly architected and well commented. Along with a straightforward set of APIs, there is extensive documentation on how to get started, deep dives into the engine's code and how to build each of the demos from scratch. More documentation is on the way to cover how to extend the core system, create custom Chips and create runners for different platforms.

Demo Resources

The Demo project contains examples of how to use the Pixel Vision 8 SDK APIs. Each demo highlights a specific aspect of the engine and shows off use cases for drawing sprites, capturing input, working with tilemaps and more. These demos are in both the Unity and MonoGame Runner example projects as git submodules. In addition to the pure C# code examples inside of the Scripts folder, there are also Lua examples inside of the Resources/LuaScripts folder. Lua games can be loaded at runtime and offer an alternative way to write PV8 games. These games require a special Lua Bridge included in both Runner projects.

The last thing to mention is that you may need to configure the included artwork based on the platform you are using. The Unity and MonoGame Runner projects readme files explain how to do this.

Credits

Pixel Vision 8 was created by Jesse Freeman (@jessefreeman) in collaboration with Pedro Medeiros (@saint11) for art and Christer Kaitila (@McFunkypants) for music. With additional coding contributions by Shawn Rakowski (@shwany).

License

Licensed under the Microsoft Public License (MS-PL) License. See LICENSE file in the project root for full license information.

Pixel Vision 8 is Copyright (c) 2017 Jesse Freeman. All rights reserved.

unityrunner's People

Contributors

jessefreeman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

unityrunner's Issues

Runner should use boot and load tools

Need to bundle the boot and load into the resources and have them part of the build so they can be displayed when embedding the runner in the browser.

Unable to point Lua Runner to .pv8 file

Throws error that data.json file can't be found:

Exception: Can't find 'data.json' file
PixelVisionRunner.Services.LoadService.LoadSystem (System.Collections.Generic.Dictionary`2 files) (at Assets/PixelVisionSDK/Runner/Services/LoadService.cs:405)
PixelVisionRunner.Services.LoadService.ParseFiles (System.Collections.Generic.Dictionary`2 files, IEngine engine, SaveFlags saveFlags) (at Assets/PixelVisionSDK/Runner/Services/LoadService.cs:103)
PixelVisionRunner.Runner.ParseFiles (System.Collections.Generic.Dictionary`2 files, Nullable`1 flags) (at Assets/PixelVisionSDK/Runner/Runner.cs:151)
PixelVisionRunner.Runner.ProcessFiles (IEngine tmpEngine, System.Collections.Generic.Dictionary`2 files, Boolean displayProgress) (at Assets/PixelVisionSDK/Runner/Runner.cs:91)
BaseRunner.ProcessFiles (System.Collections.Generic.Dictionary`2 files) (at Assets/Scripts/BaseRunner.cs:195)
BaseRunner.LoadFromDir (System.String path) (at Assets/Scripts/BaseRunner.cs:290)
PixelVisionRunner.Demos.LuaDemoRunner.RestartGame () (at Assets/Demos/Scripts/LuaDemoRunner.cs:66)
PixelVisionRunner.Demos.LuaDemoRunner.Start () (at Assets/Demos/Scripts/LuaDemoRunner.cs:45)

Need to convert mask color to background color

When the DisplayTarget caches the colors it needs to make sure that any colors in the ColorChip that equal the mask color is set to the background color. In smaller colors palettes like black and white, shifting the color offset renders magenta to the display when it should default to the background color.

image

The final image rendered to the display shouldn't show the mask color or transparent.

Unity to be unable to persist setting changes

Symptoms:
Unity shows multiple warnings on project load "Ignoring asset refresh of [each setting file] because that file or it's directory couldn't be found"
Settings do not persist when you click save project
Settings to not persist when you exit Unity

Reproduce:
Change project settings, such as package name for Android.
Exit Unity.
Reload the project, observe that the original setting value is back.

A build and play works fine but the original settings still return after reloading the project.

This occurs on multiple Unity versions and multiple PCs

Resolution:
This can be resolved by deleting all .meta files from the /ProjectSettings directory

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.