fheroes2
fheroes2 copied to clipboard
Editor preparations
Preliminary checks
- [X] I've checked that there aren't other open issues on the same topic.
Describe the problem requiring a solution
The next major goal of the project is deliver an in-game editor. This issue serves as a collection of tasks related to the main task.
Describe the possible solution
This is a list of tasks we have to complete in order to deliver a base version of the Editor:
- [x] remove usage of quantity1 and quantity2 in the code. Make them more readable without the calculation magic present in the code.
- [x] Tiles class should just have a stack of all TilesAddon. Move the same members of the Tiles class away from the class. This will make the code much cleaner and easier to maintain
- [x] Move all auxiliary methods outside of the Tiles class. Tiles class is designed just to store information about a tile in general, not about specific objects
- [x] Create an information table for each object in the game: which images are used to determine the object, its properties, passabilities
- [x] Remove unused structures in mp2.h file and expand the code with necessary explanations within comments where we actually read data for these structures
- [x] add a shortcut key (E) to open an Editor main menu and add there needed buttons like it is done in the original Editor (for now only for debug mode). The main menu image must be resizable
- [x] add a new mode within interface_area to enable Editor mode (something similar what we did for view world
- [x] add UI elements to handle terrain types and change cursor type based on a chosen type
- [x] change terrain type using terrain brush (enable support for keeping objects on terrain as well as selecting an area for terrain)
- [x] add historical changes support: undo and redo functionality
- [x] propose a map format which stores objects as whole and their data. For example, a castle must have only 1 main tile while in the editor and the game it will populate the needed number of tiles.
- [x] add required helper functions into the code to load new map format. These functions should be shared among the Editor and the game
- [x] add a UI toolset to handle objects within the Editor. It should be a different way than in the original game
- [x] display passabilities for objects on the map
- [x] figure out text encoding support for maps
- [x] investigate whether it is required to have a separate format for campaign scenarios
- [x] change
MapObjectType
type to uint16_t to support new objects - [x] add a window to change Hero properties
- [x] add a window to change Castle / Town properties
- [x] add a window to change Sphinx properties
- [x] add a window to change Bottle / Sign properties
- [x] add a window to change Jail properties
- [x] add a window to change Random Hero properties
- [x] add a window to change Random Town properties
- [ ] add a window to change Event properties
- [x] add a window to change Monster properties
- [x] add a window for map properties
- [x] add a window for saving a map
- [x] add a a structure to store Event properties
- [x] add a a structure to store Bottle / Sign properties
- [x] add a a structure to store Sphinx properties
- [x] add a a structure to store Random Hero properties
- [x] add a a structure to store Random Town properties
- [x] handle all original map winning and loosing conditions
- [x] add code to load every object properties
- [x] update the conditions for object placement
- [x] update object layers, mostly for background layer
- [x] fix cursor rendering in File Options window when Animation is stopped
- [x] implement the main menu button for the Editor
- [x] properly connect roads and castles
- [x] fix radar rendering for heroes and castles
- [x] remove beta Editor tag
- [x] add zlib compression to the map format
- [x] fix river delta placement
- [x] add a shortcut to go to Main Menu from the Editor
- [x] add daily event support
- [x] add logic to place random ultimate artifact
- [x] add a window to modify random ultimate artifact radius
- [x] update objects while changing terrains under them
- [x] add rumours into the map format
The above list is going to be expanded based on the progress and discoveries.
Additional info
No response
Moved this from this closed issue: https://github.com/ihhub/fheroes2/issues/8232 Changing the game resolution in the Editor gives unexpected behavior of the side panel and map area.
Open the editor and change the resolution via the settings. Different unexpected behavior happens depending on how you are changing the resolution, whether you're going up or down in resolution.
For example, here is what happens when going from 940x540 (2.0x) to 640x480:
Note that the panel on the side is absent.
Changing resolution when in the editor can be useful, like having a larger viewing area when making maps, or zooming in on areas.
I'm putting here a quote of @Branikolog's comment not to forget to fix it in future:
Here are few issues I've found. Could you, please, look if they are valid and could be fixed?
I believe, that we should always place "no objects" like ground cracks under roads, streams and all other objects.
The hole, though, looks well placed both under or above roads/streams, but while placing some streams over it we should preserve the overlay of the existing stream nearby:
Cracks and holes shouldn't be allowed to be placed on a water:
Originally posted by @Branikolog in https://github.com/ihhub/fheroes2/issues/8280#issuecomment-1894668603
I've found an application crash when selecting mines in the map editor:
https://github.com/ihhub/fheroes2/assets/55348946/6a732edf-f4da-4172-be0b-02ef779025c1
@Districh-ru , could you, please, look into this issue? It is reproduceable in both master branch and your latest PR(#8395).
Hi, @ihhub ! I think we also need to add windows to adjust monsters, treasures, artifacts, graveyards, mines/sawmills/alchemist labs, shipwrecks, derelict ships, shrines. I also suggest to make it possible to adjust even dwellings, trees of knowledge, genies lamps, campfires, flotsams, shipwreck survivors, skeletons.
Hi @Branikolog , we aren't going to add windows to objects in the first version of the Editor that are not modifiable in the original Editor.
Hi @Branikolog , we aren't going to add windows to objects in the first version of the Editor that are not modifiable in the original Editor.
So at least monster window requires adjustment fields then.
Hi @Branikolog , we aren't going to add windows to objects in the first version of the Editor that are not modifiable in the original Editor.
So at least monster window requires adjustment fields then.
What do you mean by adjustment? The number of creatures? It is going to be present as it is in the original Editor.
What do you mean by adjustment? The number of creatures? It is going to be present as it is in the original Editor.
This item is missed in the list in the header of the thread.
Hi, @ihhub, we can also expand the TODO list by the next items. What do you think?
- Implement the main menu button tor the Editor;
- Allow to place heroes over the passable parts of the objects;
- Place roads and streams directly to Editor's
Map_Format
, notworld.tiles
; - Properly connect roads and castles;
- Expand road tiles by combining some of existing tiles to cover more road connection cases;
- Display some object's metadata in the quick info (by the right mouse button);
- Show the selected object's passability while placing it (e.g. like in original editor);
- Fix radar rendering for heroes and castles;
- Implement the alternative "Kingdom Overview" (maybe we can call it "Map Summary") for Editor to show all castles, heroes, mines (and maybe some other objects) on the map with ability to edit these object's details.
Hi @Branikolog and @Districh-ru , thank you for your insights! I've updated the list. Now we have a clear picture what to do.
Just found a few issues with scrolls. Artifact-scroll does not save the spell on map loading. Artifact also couldn't be adjusted once placed on the map with a "detail" brush. Artifact-scroll placed in hero inventory disappears each time I close hero window.
https://github.com/ihhub/fheroes2/assets/55348946/25ab71b4-203a-4d57-a164-05410f4560a8
Undo function is not working, when I switch "show passability" mode:
https://github.com/ihhub/fheroes2/assets/55348946/ecb2acb3-61e7-4b93-9b9c-2f25da347521
Any random spell scroll, placed in hero adjustment window in editor, appears to be generated instantly. It should be indicated as "random" and generated on each map start.
@Branikolog , we will address it in post 1.1 release.
Encountered a crash: we allow placing Magic Books on the adventure map, and trying to pick it up with the hero crashes the engine.
Found a bug: Restrict mode for towns/castle doesn't actually restrict buildings. Is it wip for after 1.1? If so, should we add a dialog popup explaining that?
Latest snapshot on Android.
I've encountered a small passability difference with the original game. Sorry, if it was mentioned somewhere before.
OG:
fheroes2:
This results in allowing to place the object in slightly unnatural place for it:
Hi @Branikolog , we mentioned that mountains are going to have unified passability. Therefore, we have a difference with the OG.
@ihhub
It is sadly to admit, that the idea of changing the passability for a consistency with similar (but still different) object was not that good. 😅
While this similar object looks nice, while placing it close to the water...
The problem object looks kind of out of the logic:
I am closing this issue as all major tasks have been completed.