GithubHelp home page GithubHelp logo

anno-designer's Introduction

GitHub version presets version Discord

Anno Designer

A building layout designer for Ubisoft's Anno-series

This is a fork of the project created by JcBernack - https://github.com/JcBernack/anno-designer

Latest Releases

The presets update can also be downloaded automatically by the application.

Discord

Keep up to date the latest developments. If you have any ideas or questions that you want to share with us, or are running into an error with the designer, then the discord is the perfect place to join.

https://discord.gg/JJpHWRB

Summary

The Anno Designer is a standalone windows application that can be used for creating and exporting layouts. It uses a drag/drop system and is intuitive and easy to use.
The Anno Designer supports the following Anno versions: 1404, 2070, 2205, 1800.

How to use

Download the latest version from the here (select the .exe file). Run it, and use it to design layouts!

Anno Designer can also be started from the command line for advanced usages.
Please see this documentation for more information and examples.

Technology

This application is written in C# (.NET Framework 4.8) and uses WPF.
The .NET Framework is available via Windows Update and further information about installing is available on this site.

Game data and icons

The building presets and icons are extracted from game files using the RDA explorer and a custom script written by Peter Hozak.
See the development pages at wikia: http://anno2070.wikia.com/wiki/Development_Pages

StingMcRay has also done a lot of work on this, extracting icons from Anno 2205 and Anno 1800.

Included in this repo is a modified version of the PresetParser - which supports the extraction of data from all the different Anno versions. It is not required to run the app (and is not included in any release).

License

MIT

anno-designer's People

Contributors

agmasgold avatar atria1234 avatar froggiefrog avatar malrig avatar stingmcray avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anno-designer's Issues

Current Object doesn't clear on right click

Bug: Selections cannot be made and the currently selected object cannot be cleared.

Steps to reproduce:

  • Drag a selection rect so that the mouse moves out of the AnnoCanvas control.
  • Select another object from the tree view without mousing over the AnnoCanvas control again.
  • When the mouse enters the control again, the selection rectangle will stay. New objects can be placed, but the current selection will not be removed when right-clicking.

Workaround: Pressing both mouse buttons to enter DragAll mode clears this bug.

Unregister File Extension (Error message)

When Unregister File Extensions and the file extensions are not registered a double error will appear.

Workaround : You can click them away, and it will not close the application ad all.

Using Place Building with no building selected and building count on causes crash

Description
If using the place building button before first selecting a building from the menu, and the Building Count option is checked under "Manage Stats", the program crashes.

Steps to Reproduce:

  • open the program
  • click "Place Building"
  • click into the grid

Workaround:

  1. Make sure a building is selected (via double click) from the menu before using the place building button.
    or
  2. Disable the Building Count option under the "Manage Stats" menu

Following a bug report from a user, we know what is causing this bug and we should be able to fix for the next release.

add option to zip all log files

Maybe it is usefull to add an option to zip all log files.
This would make it easier for users to provide information for the developers if there is an issue.

Police station New World vs Old World

It seams, after report through Anno 1800 Wiki the police stations are not the same measurements, as the Old World Police station is 4x6 and the New World Police Station is 4x5

I will as soon as possible fixes this, that means that the "All World > Public Buildings" will be changed or it will removed and placed on the right groups

move statistics from canvas

I think it is better to move the statistics out of the canvas and display them on a separate panel beside the canvas.
The text for the statistics don't change at every frame and so there is no need to paint them on every frame.

Maybe a separate DockPanel like the other one. this Dockpanel could contain many TextBlocks in some GroupBoxes.
This should improve performance when simply moving the mouse.

use different way to localize the application

The widely adopted solution to localize a .NET applictaion is to use *.resx-files.

To further use the Goolge sheet there is a tool that can create *.resx-files from Google sheets: csvtrans.
This tool calls a Google API to get the sheet as CSV and creates the *.resx-files using a ResXResourceWriter.
All that needs to be done is to adjust some column names in the sheet.

Missing New World Fields

Somehow the Alpaca and the Cattle Farm Fields are missing
I will work on the solution of this, i hope i can manage this on the same time with the missing Radius for Anno 1800 buildings

Is there a more efficient way to draw the grid?

I did some search and there seems to be a more efficient way to draw a 2 dimensional grid: [WPF]How to draw a grid on canvas?
Maybe it is useful to do some research and do some tests.
Also the zoom functionality should be tested.

Possible new approach:

You can just set Canvas.Background to some DrawingBrush. This brush can just need to render a Rectangle (by using some RectangleGeometry). Because of supporting for TileMode, we can repeat this rectangle along both horizontal and vertical axes and make the full grid for you:

<Canvas>
    <Canvas.Background>
       <DrawingBrush TileMode="Tile" Viewport="-10,-10,40,40" 
                                     ViewportUnits="Absolute">
          <DrawingBrush.Drawing>
             <GeometryDrawing>                 
                <GeometryDrawing.Geometry>
                   <RectangleGeometry Rect="0,0,50,50"/>
                </GeometryDrawing.Geometry>
                <GeometryDrawing.Pen>
                   <Pen Brush="Gray" Thickness="1"/>
                </GeometryDrawing.Pen>
             </GeometryDrawing>
          </DrawingBrush.Drawing>
       </DrawingBrush>
    </Canvas.Background>
 </Canvas>

Note that you can draw something outside the Canvas but its Background is always inside its region. So you need to set the Size for your Canvas correctly.

Filter building presets by selected game

Searching (#31) a specific building (e.g. fire station) results in multiple results for all Anno versions.
It would be nice to preselect a version (e.g. 1800) and see only those buildings (also removing the upper level "(A7) 1800").
Preselection by tabs (preferred), radio, combobox or multiple buttons in a row.
Then also save the selection in the .ad file.

rotate buildings without creating a copy of it

After discussing issue #135 on discord there was the feature request to rotate selected buildings without creating a copy. So the buildings will be rotated in place.

I would propose the following workflow:

  • middle mouse button (or R key) is pressed: copy and rotate the building
  • CTRL key and middle mouse button (or R key) is pressed: rotate the building

Open tasks:

  1. What should happen if there is not enough space to rotate a building?
  2. What should happen if there is not enough space to rotate a building and there are multiple buildings selected?

area-place for farm fields

Add a feature that allows fields to be placed in the same way they can be placed within 1800.

A click/drag box placement mode.

optimize bundled images with zopfliPng

If we optimize the bundled *.png files with zopfliPng we could reduce the overall download size by ~2MB.
The binary I used

The parameters I tested with:
zopflipng.exe -m -y --iterations=500 "path\to\AnnoDesigner\icons\*.png"

Additional information:
The png format uses a DEFLATE algorithm and zopfli is a new/better implementation.
No data is lost. All applications that support png files can still view the optimized files because it is still the DEFLATE algorithm.
So just a smaller bundle to download. 🎉

Counting/Selected Buildings Police and Fire Stations

The Police Station and the Fire Station are marked as 'Unknown Building' when selected,
and thus will not showed in the building statics (not selected)
This is only affecting the New world Police and Fire Station

(Un)Register File Extension

When using this options a message will appear that windows need reboot or relo. sins windows 7 is that not a case anymore.

Rotation -> Copy function keeping object on mouse

According different tests i have pinpoint the copy/rotation bug (i hope)
When you selecting multiple objects and copy that (with the middle mouse button) the objects will be acting as intending, copy -> rotate & place -> cancel selection

When you have only 1 object selected to rotate (middle mouse button), it will copy the object and keep it on the mouse, and will not clear when canceling, This should only be the function Rotate, as when we double click on an single object we copy that object.
afbeelding

Hope we can tackle this one

(Edit : On further tests is was the Move Function and trying to rotate)

[1800] InfluenceRadius differs

In Anno 1800 there is no influence radius but a distance.

Distances on paved streets:

  • 49 Marketplace
  • 41 Pub
  • 32 Police
  • 56 Church
  • 49 School
  • 48 Fire Station
  • 56 Variety Theatre
  • ? Bank
  • ? Boxing Arena
  • ? Hospital
  • ? Members Club
  • ? University

There are still some buildings with radius:

  • Town Hall
  • Trade Union
  • Harbour buildings like Harbourmaster's, Cannons and Guns
  • and more

Here is a example building with an InfluenceDistance of 10:
InfluenceDistance

The building (e.g. residence) you want to be supported by the other building (e.g. marketplace) must overlap at least with one last tile of the influenced street. Lights colored houses are ok, dark is out of range.
house-example

Localize message boxes

MessageBox.Show only shows values in English, which will be inconsistent with the rest of the UI if the user has selected a different language.

I think the solution for this is to roll our own message box (use something other than the built in one). We can use MVVM to bind to the localized text.

French traduction

Would be nice to have the french traduction in the anno designer. I could help for it if you need to!

Selecting objects and change icons or sizes

When selecting an object, and first changes settings, like icons or sizes before placing, will save the 'unknown' object as the object you selected and will counted as that in the building count

use localization of icons

There are already some translations of icons, but only the english one is used.

Either use the available translations or remove the functionality. I would prefer the first and would like to see it extended on more icons.

Zoom to point

Can we change a bit on the zoom section, like when a object is selected that the zoom goes from there and not from the gird starting point (left upper hand) unless there is nothing selected

NullReference exception on search and language change

Steps to reproduce:

  • App has language english
  • Type "potato" in search field
  • Change language to german
  • Try to delete the search term -> exception

This also applies if you clear the search field before the language change.

  • App has language english
  • Type "potato" in search field
  • Clear search field
  • Change language to german
  • Try to search for "Kartoffel" -> exception on first character

add filter/search box for presets

It would be nice to add a search box above the tree with the presets.
Then one could enter e.g. "ware" and the treeview is displaying all buildings which contain the search string e.g. "Warehouse".
This eliminates some clicking in the treeview.

Strict differentiation of predefined and custom buildings

This issue emerged after a private discussion with @StingMcRay on discord according to issue #105.

We came to the conclusion that there is a need for a strict(er) differentiation of buildings from the presets file and custom buildings created by the user that are not in the presets file.

The intention of the logic used in issue #105 was to check if a building with the same settings that the user made (icon and size) is found in the presets file and "map" the custom building to a predefined one.
This is somewhat hacky and not very transparent to the user.

So the following idea emerged:
If a building from the presets file is selected (via TreeView) then there will be a green border around the building settings.
If the user "created" a custom building then there will be an orange border.
Maybe a checkbox or something where the user "accepts" the automatic conversion.

The use of different borders would make it more transparent to the user that the building configuration is not in the presets file.
Also to avoid countless "Unknown Building" entries in the statistics the label entered by the user could be used.

This is a quick mockup:
unknown

So the next thing is to define which setting should be used to find a building in the presets file.
Continue to use the current logic of same icon and same size (rotation doesn't matter) or use some other logic?

Please share your opinions! It is an open discusison.

How to Fix this Crash

Does not start, shows this error

error

error-log
`*** TreeView SetTreeViewState Error *** 2019-05-07

Message: El índice estaba fuera del intervalo. Debe ser un valor no negativo e inferior al tamaño de la colección.
Nombre del parámetro: index
Stack Trace:
en System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
en AnnoDesigner.TreeViewExtensions.SetState(TreeViewItem t, List1 nodeStateList, Int32 currentIndex) en AnnoDesigner.TreeViewExtensions.SetState(TreeViewItem t, List1 nodeStateList, Int32 currentIndex)
en AnnoDesigner.TreeViewExtensions.SetTreeViewState(TreeView t, List`1 nodeStateList)
en AnnoDesigner.MainWindow.WindowLoaded(Object sender, RoutedEventArgs e)

*** Application Unhandled Error *** 2019-05-07

Message: El valor de la propiedad 'MaxTextHeight' debe ser mayor que cero.
Nombre del parámetro: value
Stack Trace:
en System.Windows.Media.FormattedText.set_MaxTextHeight(Double value)
en AnnoDesigner.AnnoCanvas.RenderStatistics(DrawingContext drawingContext)
en AnnoDesigner.AnnoCanvas.OnRender(DrawingContext drawingContext)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
en System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Documents.AdornerDecorator.ArrangeOverride(Size finalSize)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Window.ArrangeOverride(Size arrangeBounds)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Interop.HwndSource.SetLayoutSize()
en System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
en System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
en System.Windows.Window.SetRootVisual()
en System.Windows.Window.SetRootVisualAndUpdateSTC()
en System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
en System.Windows.Window.CreateSourceWindow(Boolean duringShow)
en System.Windows.Window.CreateSourceWindowDuringShow()
en System.Windows.Window.SafeCreateWindowDuringShow()
en System.Windows.Window.ShowHelper(Object booleanBox)
en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
en System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

*** Application Unhandled Error *** 2019-05-07

Message: El valor de la propiedad 'MaxTextHeight' debe ser mayor que cero.
Nombre del parámetro: value
Stack Trace:
en System.Windows.Media.FormattedText.set_MaxTextHeight(Double value)
en AnnoDesigner.AnnoCanvas.RenderStatistics(DrawingContext drawingContext)
en AnnoDesigner.AnnoCanvas.OnRender(DrawingContext drawingContext)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
en System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Documents.AdornerDecorator.ArrangeOverride(Size finalSize)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Window.ArrangeOverride(Size arrangeBounds)
en System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
en System.Windows.UIElement.Arrange(Rect finalRect)
en System.Windows.Interop.HwndSource.SetLayoutSize()
en System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
en System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
en System.Windows.Window.SetRootVisual()
en System.Windows.Window.SetRootVisualAndUpdateSTC()
en System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
en System.Windows.Window.CreateSourceWindow(Boolean duringShow)
en System.Windows.Window.CreateSourceWindowDuringShow()
en System.Windows.Window.SafeCreateWindowDuringShow()
en System.Windows.Window.ShowHelper(Object booleanBox)
en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
en System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
en System.Windows.Threading.DispatcherOperation.InvokeImpl()
en System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
en MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
en System.Windows.Threading.DispatcherOperation.Invoke()
en System.Windows.Threading.Dispatcher.ProcessQueue()
en System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
en System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
en System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
en MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
en MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
en System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
en System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
en System.Windows.Application.RunDispatcher(Object ignore)
en System.Windows.Application.RunInternal(Window window)
en System.Windows.Application.Run(Window window)
en AnnoDesigner.App.Main()

`

Fix wrong structure sizes

Please check the structure sizes, some of them are wrong. For example here are the correct sizes, that i found till now:

Big Betty: 7x4
Depot: 10x4
Small Trading Post: 7x11
Pier: 7x8
Sailing Shipyard: 7x15

Add frequently used road bar into default set.

as one of user of Anno Designer,
i want you to add some road bar into default set into "Road tile" category.

Below are my (and peoples) most frequently used items.
・Small Road bar = 1x3.
・Medium Road bar = 1x6.

・Small Road bar with intersection = 1x4
・Medium Road bar with intersection = 1x7
i Hope, someone read this request from an Anno Designer user.

Request : French translation

Would be nice to have the french traduction in the anno designer. I could help for it if you need too!

My discord : Schwartzy#3217

add default color to buildings

I think it would be beneficial to add some default colors to the buildings.
So right from the get go all roads could be gray and all warehouses could be blue and so on.

This would add some continuity to the exported screenshots and remove some hassle from the user.

No Mouse : Mousepads and Hot-Key's

Text from Gretel_Grausam:

Suggestions: I was using this on my laptop while travelling - so only had a touchpad and no mouse. Would you make it possible to change hotkeys or provide an alternative set of controls without a mouse?

(Original message from Reddit : https://www.reddit.com/r/anno/comments/bkczot/anno_designer_for_annos_1404_2070_2205_and_1800/)

Answer : We set it down as an issue on the Github and we will look in to that, but it will come after the 8.3 where we are atm very busy with

Localize "Items on clipboard" string

The "Items on clipboard" string (that appears along the status bar section of the window when the user has items on their clipboard) is currently not localized.

add proper solution for logging

I think it would be helpful to add some kind of logging framework to the application.
This would be much more robust and feature rich than the current implementation and will help to find and fix bugs quicker.
Also there could be the possibility to add log files to an issue if the user has a problem.

Since I only worked with NLog I would propose this framework 😬

An implementation could be:

  • log to a file with specfic format (e.g. "TimeStamp||Level||Logger||Message")
  • create a new log file on each day
  • save the last 7 days (as zip files) in an "archive" directory
  • each application (e.g. Designer, TemplateExporter) has its own log file
  • in case of an error, try to create a zip file with all logs for the user as attachment for an issue

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.