

Horizon zero dawn map editor upgrade#
Later on, if it becomes a bottleneck we can upgrade it, there are some simple and effective optimizations in line. Since we don’t have tight RAM limits and snapshot approach proved itself trustworthy with KaM Editor we can start with it.
Horizon zero dawn map editor code#
This method is also more prone to implementation errors since it requires a whole lot of code for actions manager, actions data holders and stuff. you will need to invent containers versatile enough to store all the water tile rotations changed. It may be simple with an object added (the opposite would be to remove it), but it quickly gets out of hand when you want to invert a brushstroke or a “magic water” action. However there are downsides: the method imposes extra complications with making a reverse action to each normal action. If we rotate one tile only that rotation info is stored. Upside is the efficiency – only the relevant info is being stored, the map size does not matters. This is especially wasteful when we are dealing with extra-large 256 x 256 tiles maps.Īctions method records only the actions and their inverses instead. Even the tiniest change, a single tile rotation requires a whole map copy. Downside is the sheer amount of memory required for all these copies. The method is very simple to implement, you just need a buffer large enough to hold the copies of relevant data. Pros are that having a list of such snapshots / checkpoints you can easily pick one and revert to it without any worries. States method keeps snapshots of maps whole state between changes. Knowing current state and action that lead to it, we can revert that action and get an earlier state. Second approach is to store only the actions that made the change between the states and be able to apply them in reverse. First one is to store snapshots of the states, so that the matter of undoing something is just taking an old state from the memory. There are two major methods for undo/redo here. When we need an undo/redo solution we basically need a way to travel back in time to revert previous states. In mapmaking that means that map rests in states between mapmakers edits (changes): Between each two states there’s a certain change that brought one state to another. At each given moment the map rests in a certain state. The process of editing the map can be represented as a timeline. But how hard is it to design a proper undo/redo solution? Let’s see inside: They allow to correct sudden mistakes and revert wrong decisions.

When working with a map editor undo and redo are one of the most useful tools.
