Git Product home page Git Product logo

tiny_rogue's Introduction

Tiny Rogue

A simple roguelike made to explore Unity Tiny and ECS style programming. Play it here

Requirements

UnityEditor: Version 2019.2.x I'm using 0b5 (e3a10156d6de).

(and it's using Unity Tiny 0.15.3-preview but this should get setup automatically for you via the Package Manager).

Running the Project

If you open the project and press play you should get a player in a big room.

Release

  1. Set the project to build in Web (ASM JS) under release.
  2. Do a build.
  3. Delete the data in the ./docs directory.
  4. Copy the data from [Library/DotsRuntimeBuild/build/tiny_rogue/tiny_rogue-asmjs-release] to [./docs]
  5. Rename tiny_rogue.html to index.html

2d Graphics and Project Setup Details

Character size:

  • 9 x 16 pixels
  • 0.09 x 0.16 world space units

Resolution:

  • 80 x 25 characters
  • 720 x 400 pixels

Camera half vertical height:

  • 2 world units

Graphic Setup Details

The character set included in this project is from an IBM PC and contains ASCII and a number of extended characters.

The glyphs in the texture are width:9 x height:16 in pixels.

Console terminals can display width:80 x height:25 in characters.

Giving a pixel resolution of 720 x 400 pixels.

Unity has a Pixels Per Unity setting that maps the size of a single pixel to world units. By default it's 100. This means 100 pixels would fit in a single unit in Unity. Some internal systems consider a world unit to be 1 meter but for this game it can just be considered to be a arbitary unit.

The size of a single ASCII character in Unity units can worked out by dividing it's pixel size by the PPU.

width:	9  / 100 = 0.09
height: 16 / 100 = 0.16

If there's a character at 0,0 and you want a tile to sit flush next to it then you set that tiles position to 0.09, 0.

Contributors

Add your name here to confirm you can push to this repository.

@danielsc
@jimmy-jam
@chris-addison
@leonhardp
@sophiaaar
@unity-cwells
@vwillyams

tiny_rogue's People

Contributors

balaam avatar chris-addison avatar mdiluz avatar nespit avatar obsessivenerd avatar remarriott avatar sambickley avatar sophiaaar avatar unity-cwells avatar unitydavid avatar vwillyams avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tiny_rogue's Issues

Inventory System

Inventory System

For the representation seems like inventory items should be entities. Maybe everything with a “CanBePickedUp” component.

  • Decide on a simple item, let’s say a sword
  • Items need a “name and description” component.
  • Put the sword into the world on a tile
  • Add a log line “There’s a sword here” when the player walks over it
  • Pressing z (interact) removes it from the world while the player is over it
  • The sword should be placed in the player inventory. How to represent that. Perhaps another tag? ends up as a dynamic buffer on inventoryEntity in inventorySysytem
  • When the player opens the inventory they should see they have a sword

Items in the world should be removed when the level is destroyed.

Start Scene doesn't work

The buttons in the Start Scene both have scripts to load into either the ASCII or Graphical version of Tiny Rogue.. unfortunately they don't work, and instead throw the following error:

EntityManager.AddComponent/RemoveComponent/CreateEntity/DestroyEntity are not allowed during Entities.ForEach. Please use PostUpdateCommandBuffer to delay applying those changes until after ForEach.
   at Unity.Entities.EntityManager.BeforeStructuralChange() in C:\UnityDev\hw19-tiny_rogue\Library\PackageCache\[email protected]\Unity.Entities\EntityManagerSync.cs:line 33
   at Unity.Entities.EntityManager.CreateEntity() in C:\UnityDev\hw19-tiny_rogue\Library\PackageCache\[email protected]\Unity.Entities\EntityManagerCreateDestroyEntities.cs:line 57
   at Unity.Tiny.Scenes.SceneService.LoadSceneAsync(SceneGuid sceneGuid) in C:\UnityDev\hw19-tiny_rogue\Library\PackageCache\[email protected]\DotsModules\Unity.Tiny.Scenes\SceneStreamingSystem.cs:line 69
   at ButtonLoadSceneSystem.<OnUpdate>b__0_0(Entity entity, PointerInteraction& pointerInteraction) in C:\UnityDev\hw19-tiny_rogue\Assets\tiny_rogue\Scripts\Systems\UI\ButtonLoadSceneSystem.cs:line 15
   at Unity.Entities.EntityQueryBuilder.ForEach[T0](F_ED`1 action) in C:\UnityDev\hw19-tiny_rogue\Library\PackageCache\[email protected]\Unity.Entities\EntityQueryBuilder_ForEach.gen.cs:line 82
   at ButtonLoadSceneSystem.OnUpdate() in C:\UnityDev\hw19-tiny_rogue\Assets\tiny_rogue\Scripts\Systems\UI\ButtonLoadSceneSystem.cs:line 13
   at Unity.Entities.ComponentSystem.InternalUpdate() in C:\UnityDev\hw19-tiny_rogue\Library\PackageCache\[email protected]\Unity.Entities\ComponentSystem.cs:line 818
   at Unity.Entities.ComponentSystemGroup.OnUpdate() in C:\UnityDev\hw19-tiny_rogue\Library\PackageCache\[email protected]\Unity.Entities\ComponentSystemGroup.cs:line 451

I think this can be fixed by pushing the call to LoadSceneAsync in ButtonLoadSceneSystem.cs out to a command buffer.. but I'm not technically knowledgeable enough to investigate/implement this myself.

Audio System

Lots of different things in the game could be made better with an audio cue! I foresee the design like this:

  • Audio Manager has a public function to play audio
  • Audio Manager has a hard-coded set of "events" that can be played, each linked to a specific AudioClip
  • Different systems/entities can call in to the Audio Manager when they want to do something

Example: Player successfully moves, and calls AudioManager.PlaySound(Footsteps)

Note all the CC0 audio assets are available in the /Audio/Effects folder.

Level Tracking and Win Condition

  • Have a system that can tell what level of the dungeon the player is on (Let's start a 1 instead of 0 :))
  • Add a decision about when a given level will be the last level. Hard coded - level 3 for instance would be fine.
  • Add winning item to final level (currently a crown)
  • The end tile should be reachable from the players starting position
  • The player should always be able to walk from their starting position to the down staircase (otherwise they're trapped and the game is unwinnable!)

Note: Unless you want to don't bother with up-staircases. It makes things simpler if we don't have to worry about the state of previous levels

Score System

  • Assign the player a score when the die
  • Design some kind of formula Gold + Dungeon Level*10
  • Store previous runs (no need to write to a file, just in memory)
  • Have a leaderboard screen that can be entered from the title screen

The Dungeon Generator task has a subtask to record what level of the dungeon you're on.

Active Examine System

  • Pressing l should put you in an examine/look state
  • In this state cursor can be moved around the world and the log will display a brief message about what's there.

Collectibles

Items exist in the level and you can pick them up

Add stairs

  • Add a Z tile to indicate a downstair case
  • Listen for the Z key
  • If the player presses the key when on a stair case, regenerate the level

Robert Marriott

Loot drops

When enemies die, they give up items that you can then collect

Text Rendering is broken

Fonts throughout the game do not render correctly. I think this is down to the font generation config in TextMesh Pro.

Improve the log system

I don't think the current log system is how they normally work in roguelikes and if a lot of things happen in a single turn then it will be hard to track.

Adding paging to the Log

Log messages probably should be queued up and sent over a couple of frames.

  • Check an existing roguelike to see how log events are handled
  • Show all logs that occur on a single frame one after the other

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.