Open Source / Source Code for the Tile System

plockhartt17
New Member
Registered: 2017-09-13
Posts: 3

Topic

Hi,

We have been using Rotorz extensively for our current project and hope to continue using it in future projects. I have seen whispers on this forum about an open source version of the tile system. Is that still in development? If it is, is there an estimate of when it might be available?

Thanks

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 1

Keep an eye on the following thread for news:

http://forum.rotorz.com/viewtopic.php?id=415

plockhartt17
New Member
Registered: 2017-09-13
Posts: 3

Response 2

Ok, thanks!

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 3

Please consider this a pre-release... make sure that you backup all of your files before using.

The current open source release should work for most existing projects with minimal (if any) changes. For existing projects there is a download on the release page which includes .dll builds similar to the ones from the original asset store releases:

https://github.com/rotorz/unity3d-tile- … tag/v1.0.0

For new projects the `npm` package manager should be used to install the package. Refer to the following page to learn how to setup npm for a Unity project: https://github.com/rotorz/unity3d-package-syncer

Having followed those instructions; the package can be installed using:

npm install --save rotorz/unity3d-tile-system
npm run sync

I will try and get information for things like "how to build the legacy dlls", "updating language template", and "setting up a CLI (on windows; since MSBuild is used to produce the DLLs at this time) added soon.

Useful links:

License: https://raw.githubusercontent.com/rotor … er/LICENSE
Repository: https://github.com/rotorz/unity3d-tile-system
Releases: https://github.com/rotorz/unity3d-tile-system/releases
Issues / Questions: https://github.com/rotorz/unity3d-tile-system/issues
Wiki (User Guide): https://github.com/rotorz/unity3d-tile-system/wiki
Docs (Wiki source): https://github.com/rotorz/unity3d-tile- … aster/docs

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 4

In the future breaking changes will be pushed onto "develop" and "master" releases; the legacy maintained release would go onto its own "legacy" branch.

There are a bunch of things that I would like to be doing differently. With asset store releases the asset became committed to it's ways since it is very hard to refactor and upgrade data structures.

plockhartt17
New Member
Registered: 2017-09-13
Posts: 3

Response 5

Ace, thank you so much!

pixellore
Member
Registered: 2014-05-29
Posts: 69

Response 6

I am not sure if I need to post it here, but for 2017 version, there is this error :

MissingFieldException: Field 'UnityEditor.PreviewRenderUtility.cameraFieldOfView' not found.
Rotorz.Tile.Editor.BrushPreviewRenderUtility.BeginPreviewScene ()
Rotorz.Tile.Editor.BrushPreviewRenderUtility.CreateStaticTexture (Rotorz.Tile.Brush brush, Int32 width, Int32 height)
Rotorz.Tile.Editor.BrushUtility.CreateBrushPreview (Rotorz.Tile.Brush brush, Int32 width, Int32 height)
Rotorz.Tile.Editor.BrushEditor.RenderStaticPreview (System.String assetPath, UnityEngine.Object[] subAssets, Int32 width, Int32 height)
Rotorz.Tile.Editor.AssetPreviewCache.GenerateAssetPreview (UnityEngine.Object targetObject)
Rotorz.Tile.Editor.AssetPreviewCache.GetAssetPreview (UnityEngine.Object targetObject)
Rotorz.Tile.Editor.RotorzEditorGUI.DrawBrushPreviewHelper (Rect output, Rotorz.Tile.Editor.BrushAssetRecord record, Boolean selected)
Rotorz.Tile.Editor.RotorzEditorGUI.DrawBrushPreviewWithoutFallbackLabel (Rect output, Rotorz.Tile.Editor.BrushAssetRecord record, Boolean selected)
Rotorz.Tile.Editor.BrushListControl.DrawList (UnityEngine.Event e, Rect position, Rotorz.Tile.Brush selectedBrush)
Rotorz.Tile.Editor.BrushListControl.Draw (Rect position)
Rotorz.Tile.Editor.BrushListControl.Draw (Boolean showTabs)
Rotorz.Tile.Editor.BrushPaletteWindow.DrawBrushesGUI ()
Rotorz.Tile.Editor.BrushPaletteWindow.DoGUI ()
Rotorz.Tile.Editor.RotorzWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:285)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:278)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:245)

otherwise it seems to work ok.

I would contribute the fix (if I can even) but I am not sure how to build dll from the source file...

Any idea?

pixellore
Member
Registered: 2014-05-29
Posts: 69

Response 7

Also, when I tried to use loose source, it says I am missing name space Game...

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 8

Please use the issue tracker on the repository to report and track issues.

pixellore wrote:

Also, when I tried to use loose source, it says I am missing name space Game...

You have to use the npm package manager so that the dependencies are also imported. Each of the packages that the package uses are maintained as separate git repositories since they are separate projects.

As always backup your project first. The directory structure of Rotorz Tile System is slightly different.

For further information regarding the unity3d-package-syncer tool see: https://github.com/rotorz/unity3d-package-syncer

For existing projects; use the DLL build from the "Releases" section of the repository:

Unfortunately you cannot switch an existing project to use the non-DLL release since Unity is for some reason unable to maintain script/asset references.

  1. Close Unity.

  2. Backup your files.

  3. Remove the original "YourProject/Assets/Rotorz/Common" and "YourProject/Assets/Rotorz/Tile System" directories using explorer (or finder).

  4. Download the latest DLL build from the "Releases" section of the repository:

    https://github.com/rotorz/unity3d-tile-system/releases

For new projects:
  1. Close Unity.

  2. Use the npm package manager to install the open source version of the tile system.

    If you are not already using npm for your project you can do this simply by adding the following "package.json" file at the root of your project "YourUnityProject/package.json"  (NOT "YourUnityProject/Assets/package.json").

    Put the name of your project into the "name" field of the "package.json" file. The name should be lower case, a-z where hyphens are used as spaces.

    {
      "name": "change-to-name-of-your-project",
      "version": "1.0.0",
      "scripts": {
        "sync": "unity3d--sync"
      },
      "private": true,
      "dependencies": {
        "@rotorz/unity3d-tile-system": "github:rotorz/unity3d-tile-system#semver:^1.0.1",
        "unity3d-package-syncer": "^1.0.6"
      }
    }
  3. Using the command line:

    npm install
    npm run sync

    npm-install-rts.gif

Building the Legacy DLLs

To build the legacy DLLs you must be on Windows with MSBuild and node/npm and Mingw-w64 installed.

Here is how I have my command line setup:

Run terminal.bat

@echo off
echo Tools: Git for Windows, Mingw-w64, MSBuild

rem Add "Git for Windows" and "Mingw-w64" tools to PATH.
set PATH=C:\Program Files\mingw-w64\x86_64-7.1.0-posix-seh-rt_v5-rev2\mingw64\bin;C:\Program Files\Git\usr\bin;%PATH%

rem Create alias for 'make' command
doskey make=mingw32-make.exe $*

rem Start 'Developer Command Prompt for VS2015' 
cd "C:\"
%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat""

For convenience you can use the "build-legacy-dlls" target of the makefile:
https://github.com/rotorz/unity3d-tile- … r/Makefile

When working on bug fixes I would suggest creating a blank project that you can use to work on the tile system itself using the new non-DLL approach. You can then create a pull request. When modifying the source you should keep the coding style consistent with the existing source base; if in doubt you can take a look at some of the existing code.

Refer to the contribution agreement of the README.md file before making any contributions to the project. v1.0.0 of "rotorz/unity3d-tile-system" is feature complete; only bug fixes are acceptable. v2.0.0 of "rotorz/unity3d-tile-system" will likely be completely incompatible with existing projects.

If you aren't sure how to fix a bug but have a rough idea; provide as much information as possible in your issue on the repository's issue tracker.

TrentSterling
Member
Registered: 2014-04-07
Posts: 28

Response 9

Glad to see this project should survive the jump to 2017. 2D Tilemaps in Unity 2017.2 became official today.

But my game is 3D so........yeah.

pixellore
Member
Registered: 2014-05-29
Posts: 69

Response 10

The only issue I can see from 2017.2 is that "MissingFieldException: Field 'UnityEditor.PreviewRenderUtility.cameraFieldOfView' not found." error. Otherwise, everything still seems to work well!

So if this can be fixed anytime soon, I can hold on to the annoying error message spams for a while... I wish I have time to take a look at the code and figure out where the error is .. (and how to fix it)

pixellore
Member
Registered: 2014-05-29
Posts: 69

Response 11

I tried to install through npm but I got this error :

Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/rotorz/unity3d-tile-system.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128


Edit ---

After trying to solve the verification error , now I have this issue :

git@github.com: Permission denied (publickey).

So I think verification issue has been solved.. (checked by going through few identifying steps from git help site) but now I have this permission issue .. humm

Last edited by pixellore (2017-10-24 05:58:49)

Lea Hayes
Rotorz Limited
From: United Kingdom
Registered: 2014-03-04
Posts: 638

Response 12

This seems like a problem with the latest version of npm.

Try using npm v5.4.0 instead:

npm install -g npm@5.4.0