Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs folder + updated docs #474

Merged
merged 7 commits into from
Aug 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<p align="center"><img src="https://user-images.githubusercontent.com/16494272/59316295-ee189d00-8c7a-11e9-93a2-266292b6f3e9.png" width="740" height="232" /></p>
<p align="center">A mod for <strong>Cities: Skylines</strong> that gives you more control over road and rail traffic in your city<br /><br /></p>
<p align="center"><a href="https://steamcommunity.com/sharedfiles/filedetails/?id=583429740">Steam Workshop</a> • <a href="https://discord.gg/faKUnST">Discord Guild</a> • <a href="https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/wiki/Installation">Installation Guide</a> • <a href="http://www.viathinksoft.de/tmpe/wiki">User Guide</a> • <a href="https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/issues">Issue Tracker</a> • <a href="https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/wiki/Report-a-Bug">Report a Bug</a><br /></p>
<p align="center"><a href="https://steamcommunity.com/sharedfiles/filedetails/?id=583429740"><img src="https://img.shields.io/endpoint.svg?url=https://shieldsio-steam-workshop.jross.me/583429740" /></a> <a href="https://store.steampowered.com/app/255710/Cities_Skylines/"><img src="https://img.shields.io/badge/Game%20Version-1.12.1--f1-brightgreen.svg"></a> <a href="https://discord.gg/faKUnST"><img src="https://img.shields.io/discord/545065285862948894.svg?logo=discord&logoColor=F5F5F5" /></a> <a href="https://ci.appveyor.com/project/krzychu124/cities-skylines-traffic-manager-president-edition/branch/master"><img src="https://ci.appveyor.com/api/projects/status/dehkvuxk8b3h66e7/branch/master?svg=true" /></a></p>
<p align="center"><a href="https://steamcommunity.com/sharedfiles/filedetails/?id=583429740"><img src="https://img.shields.io/endpoint.svg?url=https://shieldsio-steam-workshop.jross.me/583429740" /></a> <a href="https://store.steampowered.com/app/255710/Cities_Skylines/"><img src="https://img.shields.io/badge/Game%20Version-1.12.1--f2-brightgreen.svg"></a> <a href="https://discord.gg/faKUnST"><img src="https://img.shields.io/discord/545065285862948894.svg?logo=discord&logoColor=F5F5F5" /></a> <a href="https://crowdin.com/project/tmpe"><img src="https://badges.crowdin.net/tmpe/localized.svg"></a> <a href="https://ci.appveyor.com/project/krzychu124/cities-skylines-traffic-manager-president-edition/branch/master"><img src="https://ci.appveyor.com/api/projects/status/dehkvuxk8b3h66e7/branch/master?svg=true" /></a></p>

> ## Notice
> We are currently working on version 11, which uses Harmony library. If you had any existing pull requests, or repository forks, they will need rebasing to the heavily modified `master` branch. If you need any help, please contact us using the links above.
> ## Notices
> Users:
> * Having problems with traffic despawning after updating roads or rails? Try [Broken Node Detector](https://steamcommunity.com/sharedfiles/filedetails/?id=1777173984) which helps detect a game bug. Colossal Order are aware of the issue.
> * We are currently alpha-testing TM:PE Version 11. If you want to help test, please see [TM:PE V11 alpha test](https://steamcommunity.com/sharedfiles/filedetails/?id=1806963141) in the Steam Workshop.
> Developers:
> * We are currently working on version 11, which uses Harmony library. If you had any existing pull requests, or repository forks, they will need rebasing to the heavily modified `master` branch. If you need any help, please contact us using the links above.

## Current release

> Having problems with traffic despawning after updating roads or rails? Try [Broken Node Detector](https://steamcommunity.com/sharedfiles/filedetails/?id=1777173984) which helps detect a game bug. Collossal Order are aware of the issue.

### TM:PE [10.21.1 hotfix](https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/compare/10.21...10.21.1), 06/07/2019

- Fixed: Speed panel tanks fps if train tracks on screen (thanks rlas & DaEgi01!) (#411, #413)
- Meta: Main changelog refactored (#412)
- Meta: Main changelog refactored (#412)

### TM:PE [10.21](https://github.com/krzychu124/Cities-Skylines-Traffic-Manager-President-Edition/compare/10.20...10.21), 02/07/2019

Expand Down Expand Up @@ -75,4 +77,4 @@ We will not provide support if:
- You are using an older version of the mod.
- You are using an older version of Cities: Skylines.

TM:PE is only tested on and updated for the latest version of Cities: Skylines.
TM:PE is only tested on and updated for the latest version of Cities: Skylines.
104 changes: 0 additions & 104 deletions TLM/ATTACHING_DEBUGGER.md

This file was deleted.

50 changes: 0 additions & 50 deletions TLM/BUILDING_INSTRUCTIONS.md

This file was deleted.

23 changes: 0 additions & 23 deletions TLM/PR_REVIEW_INSTRUCTIONS.md

This file was deleted.

106 changes: 106 additions & 0 deletions docs/ATTACHING_DEBUGGER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Attaching Debugger to Cities.exe

This guide explains how to attach a debugger to Cities: Skylines.

> **Note:**
> * Attaching a debugger can significantly reduce frame rate and cause lots of lag.
> * This has only works on MS Windows. If you're on a Mac, set up a Boot Camp partition and use that.

## Setup

> You only need to follow these steps once

#### Download the files

Get these files from [`https://github.com/0xd4d/dnSpy/releases`](https://github.com/0xd4d/dnSpy/releases):

* `dnSpy-net472.zip` (or later)
* `Unity-debugging-5.x.zip`

#### Backup `mono.dll`:

* Navigate to `C:\Program Files (x86)\Steam\steamapps\common\Cities_Skylines\Cities_Data\Mono\`
* Change the folder if you installed game somewhere else
* Make a backup of `mono.dll` (you could just rename it `mono-backup.dll`)

#### Apply debug `mono.dll`:

* Make sure the game is **not** running
* Open `Unity-debugging-5.x.zip`:
* Navigate to `Unity-debugging\unity-5.6.7\win64\`
* You should check which version of Unity is being used - see first line of your `output_log.txt`
* Copy `mono.dll` to `C:\Program Files (x86)\Steam\steamapps\common\Cities_Skylines\Cities_Data\Mono\`
* Run the game to check if it's working:
* If not, delete the downloaded `mono.dll` then restore the original version
* You'll have to scour the internet to work out what went wrong, sorry.
* Close the game

#### Add environment variables:

* Press **Win+R** (_Run dialog appears_):
* Enter `sysdm.cpl`
* Choose **OK**
* On the **Advanced** tab, choose **Environment Variables...**
* The variables to add are shown below:

1. > **key:** `DNSPY_UNITY_DBG`
> **value:** `--debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555,defer=y,no-hide-debugger`
2. > **key:** `DNSPY_UNITY_DBG2`
> **value:** `--debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555,suspend=n,no-hide-debugger`

#### Unarchive `dnSpy`:

* Extract the downloaded `dnSpy-net472.zip` to a folder
* It can be anywhere, eg. `dnSpy/` on your desktop

## Debugging

> Do this each time you want to debug the game.

#### Launch `dnSpy`:

* Run `dnSpy.exe`
* On the left, in **Assembly Explorer**, remove any `.dll` files that are listed
* Tip: Select one, press **Ctrl+A** then **Delete**

#### Attach `dnSpy` to game:

* Start `Cities.exe`
* **Alt+Tab** to **dnSpy** app
* Press **F5** (or choose **Start**) and select:
* **Debug Engine:** `Unity (Connect)`
* **Port:** `55555`
* Click **OK**:
* You should see an **orange status bar** at the bottom of application with text: `Running...`
* From the **Debug** menu, choose **Windows -> Modules** _(Ctrl+Shift+A)_
* You should see lots of `.dll` files and some `data-00...` entries
* **Right-click** on any of them, select **Open All Modules**, then * Click **OK**
* The game may hang for few seconds
* On the left, in **Assembly Explorer**, you should see all `.dll` files loaded in-game
* There will be some duplicates
* **Right-click** on any of them, then **Sort Assemblies** to make the list easier to work with

That's it, you are debugging. Now your mods are sure to be bugless :P

## Reverting

If you want to return the game back to normal (and greatly improve in-game performance):

* Exit the game
* Replace the downloaded `mono.dll` with your backup of the original `mono.dll`
* Start the game

I'm sure you can work out how to simplify or automate toggling between the two `mono.dll` files :)

## Tips

* Use **Search** tab _(Ctrl+Shift+K)_ for to find class, property, field, method, etc...
* You can right-click a method definition then select **Analyze** to see where it's used

## Notes

* I have no idea why there are duplicated libraries (some sort of protection?)
* Only one copy of each library will have working breakpoints
* After sorting assemblies, it's usually the first instance of a listed file
* Once you know which one it is, you can safely remove the other from Assembly Explorer
* Don't rebuild your mod library with game running, otherwise you'll have to clear Assembly Explorer and open the modules again, which means the duplicates come back
Loading