Commit graph

78 commits

Author SHA1 Message Date
Victor
e30bd72865
fix: stabilize client box overlay and selection outline (#195)
Bug Fixes:
- Fixed in-game map box positioning and viewport clamping so the map centers reliably during pan/zoom.
- Selection box now clamps to the visible viewport, supports reverse-dragging, and normalizes rectangle coordinates.
- Selection outline rendering scales with zoom so line width and dash pattern remain consistent.
- Improved player marker, visible-region highlighting, and overlay styling for clearer map visualization.
2026-06-07 22:32:09 -03:00
Eduardo Dantas
1fbc5b9113
perf: otbm load save and preview/map renderization (#188)
Improve OTBM load/save and map view performance

This change improves Remere's Map Editor performance in OTBM load/save paths,
object allocation, binary serialization, tile lookup, and idle map rendering.

Measured impact:

Object pool allocation:
- Slab refill events reduced from 17,830 to 2,230, about 87.5% fewer refills.
- 48-byte class refills reduced from 4,276 to 535, about 87.5% fewer refills.
- 64-byte class refills reduced from 5 to 1, about 80.0% fewer refills.
- 128-byte class refills reduced from 8,776 to 1,097, about 87.5% fewer refills.
- 1024-byte class refills reduced from 4,773 to 597, about 87.5% fewer refills.
- rme::allocatePooledObject sampled CPU share reduced from 20.01% to 14.62%,
  about 26.9% lower sampled share.
- Total pooled allocation calls stayed at 42,559,971 for the measured workload.
- Heap fallback allocations stayed at 0, confirming the hot load path remains pooled.

Latest mixed load/save profile:
- GUI::LoadMap remained the dominant sampled cost at 67.02%.
- IOMapOTBM::loadMap accounted for 60.23% total sampled CPU, with 56.34% in
  the inner load body.
- GUI::SaveMap and Editor::saveMap accounted for 28.16%.
- IOMapOTBM::saveMap accounted for 27.63%.
- BaseMap::forEachTileLocation during save accounted for 23.01%.
- Tile::Tile accounted for 11.53%.
- Tile::addLoadedItem accounted for 8.15%.
- Item::Create accounted for 6.99%.
- QTreeNode::createFloor accounted for 6.71%.
- BinaryNode::advance and BinaryNode::load accounted for 5.37% and 3.81%.

Map view idle and preview rendering:
- Static map-view sampled CPU dropped from 139,767 sampled units to 126 sampled
  units after overlay-only refresh reuse.
- MapCanvas::OnPaint dropped from 46,229 sampled units and 32.20% to 19 sampled
  units and 15.08%.
- GLRenderer::flushCommands dropped from 24,321 sampled units and 16.94% to
  4 sampled units and 3.17%.
- Performance stats refresh changed from a 16 ms scene-dirty timer to a 500 ms
  overlay-only timer.
- Show Preview changed from a 16 ms scene-dirty timer to a 250 ms scene-dirty
  timer.
- Position indicator keeps the 16 ms scene-dirty timer because it is expected
  to animate smoothly while active.

Main changes:
- Added cached floor and tile lookup while loading OTBM map data and spawn files.
- Added direct TileLocation assignment for parser paths that already resolved
  the destination location.
- Added BaseMap::forEachTileLocation for direct save traversal of existing tile
  locations.
- Added a small-object slab allocator for hot Item, Tile, and Floor allocations.
- Added pool owner-thread binding and diagnostics for allocation validation.
- Increased slab sizing to reduce refill pressure in large-map loads.
- Improved binary node writing by batching raw bytes and avoiding redundant cache
  renewal checks.
- Avoided rewriting XML sidecar files when serialized content only differs by
  line endings.
- Fixed invalid ground serialization so placeholder ground id 0 no longer drops
  the rest of the tile contents during save.
- Split map canvas refresh into scene-dirty and overlay-only paths.
- Adjusted animation timer behavior for position indicator, Show Preview, and
  performance stats.
- Scaled tooltip rendering with map zoom, clamped to 55% minimum.
- Kept review and Sonar cleanups away from hot path regressions with targeted
  NOSONAR annotations or FORCEINLINE where needed.
- Added AGENTS.md guidance for future Git, build, and PCH discipline.

Notes:
- The Visual Studio captures are sampling profiles, so percentages represent CPU
  sample share, not direct wall-clock speedup.
- The latest profile is a mixed interaction profile, not a strict load-only or
  save-only benchmark.
- The allocator counters are the strongest before/after measurement in this
  change.
- No OTBM format or map semantics are intended to change.
2026-05-22 15:14:34 -03:00
Victor
47b03e516d
feat: organize monster palette by Lua folder structure and fix hidden file loading (#174)
Bug Fixes:
- Fixed fallback creature appearance so a proper default sprite is shown when an outfit lacks a valid look.

New Features:
- Monsters can be organized by folder into palette categories; tilesets now include an "All" option and are sorted alphabetically.
- Monster entries are consistently included in the "Others" category and duplicated into derived folder tilesets.

Chores:
- File scanning now includes hidden files/directories when loading monsters and NPCs.
2026-04-25 10:37:03 -03:00
Victor
21b234e2ab
feat: deferred rendering pipeline, memory optimization, and async map cleanup (#173)
New Features:
- Scene caching with render-to-texture and blitting for faster map redraws.
- Explicit blend-mode controls and FBO-backed render-to-texture workflow.

Bug Fixes:
- More robust sprite-sheet reload and texture release behavior.
- Safer editor/tab shutdown with ensured live-server closure and deferred deletion.

Performance:
- Reworked GPU batching/streaming and command-based flushing for fewer draw calls and efficient uploads.
- Smarter scene invalidation to avoid unnecessary re-renders.

UX:
- Undo/redo now refreshes editor views more reliably.
2026-04-25 10:35:24 -03:00
Victor
d57615d212
feat: implement sprite atlas rendering using sheet textures (#171)
New Features:
- Per-sprite UV and blit options for precise partial/atlas-based sprite rendering, including improved editor sprite blits.

Graphics & Performance:
- Lazy atlas texture upload with atlas-managed lifecycle to reduce memory/GPU churn.
- Rate-limited automatic cleanup of unused textures.

Behavior Changes:
- More accurate texture mapping: sprites, outfits and indicators now render using per-sprite atlas coordinates.
2026-04-22 19:19:35 -03:00
Victor
4f495b8e19
feat: OpenGL modern migration (#165)
New Features:
- Added a modern OpenGL renderer with batched 2D drawing, textured bitmap text, stippled lines, polygons and a baked font atlas.

Refactor:
- App-wide rendering switched to the new renderer.
- Map and lighting now draw via renderer primitives and sprite lookups use stable sprite IDs.

Bug Fixes:
- Improved texture allocation/invalidation/cleanup and sprite bounds safety.
- Restored/normalized keyboard shortcut behavior (Q/B remap, SHOW_NPCS → Shift+N, Linux shortcut dispatch).

Chores:
- Replaced legacy GLUT with a GL loader and integrated stb.
- Updated build configuration and project files.
2026-04-17 18:58:28 -03:00
Victor
253cf397f4
fix: outfit color cache and addon rendering for creatures (#164) 2026-03-29 02:02:08 -03:00
Victor
c823cc9b2b
feat: add real-time performance monitor (FPS, CPU, RAM) (#156)
This commit adds a real-time performance monitoring system to the Remere's Map Editor that displays FPS, CPU usage, and RAM consumption. The monitor is fully configurable through the preferences window and works cross-platform on both Windows and Linux.
2026-02-27 13:52:55 -03:00
Victor
e78c07952b
feat: add item 2187 to invisible item rendering (#152) 2026-01-12 14:35:19 -03:00
Eduardo Dantas
6d501a5ad2
feat: support reading assets from client 11 or higher (#70)
feat: migrate Remeres to 12.x assets system and modernized item handling

• Migrated old Remeres .dat/.spr system to new 12.x client /assets/ appearance & sprite format
• Removed OTB dependency and outdated client version structures
• Integrated Protobuf-based sprite reader (credit: @nekiro)
• Major refactor on graphics.cpp structure and brush icon handling
• Updated brushes and tags system
• Fixed top order drawing bugs and missing brushes icons
• Fixed outfit color paint and correct offset handling for non-32x32 sprites
• Re-enabled map saving and loading
• Improved creature sprite rendering and brush previews
• Added new item properties window with toggle for legacy/new layout

Co-authored-by: Marcos <66353315+marcosvf132@users.noreply.github.com>
Co-authored-by: Pedro Henrique Alves Cruz <phac@cin.ufpe.br>
2025-05-10 16:38:45 -03:00
Pedro Cruz
45acebc85d
feat: monsters weight (#122)
This adds the possibility to add stacked monsters and set weight into the stacked monsters to randomize their spawn.
2024-10-02 16:01:28 -03:00
Pedro Cruz
075abd6d91
fix: difference of splash type on rme and server (#104) 2024-08-14 17:06:29 -03:00
Pedro Cruz
6ef5ba1fa6
feat: show item and ground avoidables (block pathfinder) (#103)
Feature that enables to check an option to show in the map an icon of avoidable items and grounds (block pathfinder).
2024-08-14 16:54:14 -03:00
Pedro Cruz
78686d73cf
fix: position indicator (#91) 2024-08-10 14:42:23 -03:00
Pedro Cruz
1e9f6987cf
feat: show light strength (#78)
Enables the ability to show the light strength (if the item has light source).
2024-06-10 18:19:04 -03:00
Pedro Cruz
a1eabb98ef
feat: lights out of ingame box (#77)
Enables lights out of ingame box and adjusted menu bar to show lights out of ingame view section.

Resolves #71
2024-06-07 18:56:49 -03:00
Luan Santos
284cb96fd2
feat: zones brush/editor (#56) 2023-11-08 22:04:13 -03:00
Majesty
b1c0df557f
feat: monsters and npcs spawns icons (#58) 2023-10-27 15:52:05 -03:00
Luan Santos
aa76a7d9b4
fix: macos build (#55) 2023-10-13 17:21:32 -03:00
Luan Santos
2ee365e836
ci: add clang-format linter (#54) 2023-10-09 19:12:16 -07:00
Beats
6b55201a64
feat: synchronizing commits with the official rme repository (#36)
* Show indicators for pickupable and moveable items

* Fix: drawing always refreshing ui

* Fix crash on invalid friend for wallbrush

* Option to remove empty spawns

* Draws position indicator, some code cleanup

* Teleport copy/paste improvements

* Fix flood fill

* Add function to get minimap/8bit color

* Small code cleanup

* Cleanup Position

* Code cleanup and small optimizations

* Code cleanup

* Code cleanup and small optimizations (#406)

* Cleanup and cast functions.

* Avoid adding a new Unique ID if it already exists

* Code cleanup and small optimizations

* More changes and cleanup

* Changes and cleanup

* Some changes

* Fix copy position.

* Only show uid/aid alert if it really changed

* Add actions history panel

* Does not draw tooltips on minimap mode

* Use constexpr

* Replace items fix (#408)

* Draw grid small optimization

* Small change in selection box and Fix #409

* Fix some xpm

* Ingame box improvements, add lights support.

* Fix go to previous position (#410)

* Fix depot crash (#411)

* Fix XPMs

* Export minimap as .otmm (otclient format) or .png (#413)

* Fix glitch after drawing secondary map

* fix

* Update about_window.cpp

* sonar

* fix Minimap and progress bar

* fix erro load items.xml

* fix

* fix doodad brush

* fix: slightly more accurate house size estimation

* feat: update items.otb and items.xml

* fix: bad merge

* Revert "feat: update items.otb and items.xml"

This reverts commit 40f1edc70f.

---------

Co-authored-by: Nailson <Mignari@users.noreply.github.com>
Co-authored-by: wtver <51377408+maattch@users.noreply.github.com>
Co-authored-by: Majesty <32709570+majestyotbr@users.noreply.github.com>
Co-authored-by: Luan Santos <github@luan.sh>
2023-10-09 19:02:37 -07:00
Eduardo Dantas
047113ade3 Merge branch 'master' 2022-08-19 02:43:27 -03:00
Eduardo Dantas
48fd839a24
Convert sprites ids from "nothing special" and "stairs" to client id (#11) 2022-02-27 11:46:54 -03:00
yamaken93
6022bf797e
feat: draw creature addons and mounts (#357)
support creature outfit mounts with the lookmount xml attribute
2021-06-06 20:05:01 -03:00
gustavomb
785cbbc57b
Ignoring control characters when rendering tooltips. (#356) 2021-06-06 19:36:56 -03:00
Eduardo Dantas
e09f3e94c8
Decouple npcs from the creature class (it's create npc.xml file in the map folder) (#3)
Created the complete organization of npcs, that way, it is possible to create own files for npcs, no longer depending on being together with the monsters
this pull request was made to be worked together with the canary project: https://github.com/opentibiabr/canary

The spawns npcs is "yellow" and spawns monsters is "red" (the old)

With this change, the map will automatically create an "npc.xml" the first time it is saved.
It is possible to edit only the xml, it is not necessary to add or modify the npc by opening the editor map

Thus, there is a script for npcs, similar to how it works with old spawns
2021-05-25 00:29:12 -03:00
gustavomb
b308ff8fe0
Building in Windows with libarchive and freeglut from vcpkg (#323)
Co-authored-by: Gustavo B <gustavomb@users.noreply.github.com>
2020-09-14 17:55:04 -03:00
Matheus Matias
362d2f324b
Formatting (#325)
*A few formatting changes to better fit the project.
2020-08-13 22:08:03 -03:00
Matheus Matias
b4c26bd644
Performance Optimization & Teleport 'Open Door' fix (#316)
*Adds a minor performance update by removing 'tooltip' allocations every time 'DrawTile' was called, this should increase the performance when moving around the map(e.g. using arrow keys when zoomed out), slow computers should benefit the most from this.
The performance increase can be seen in the comparison bellow, where I used the same map, distance from the ground and movement from a specific point to benchmark.

*Teleports should no longer have the option to 'Open Door' when right-clicking them.
2020-08-08 11:38:49 -03:00
Evil Puncker
cfe36ce5b3
license headers (#315) 2020-07-30 11:42:28 -03:00
Sascha Striegel
0962708fb5 Rearrange AID/UID order in tooltips for consistency (#269)
The item property window displays the AID first
2019-06-24 13:24:51 -03:00
zygzagZ
e444e98e19 Changed TileVector to TileSet, using unordered set under hood is much faster, removing elements expected complexity O(1) instead of O(n) 2018-11-06 15:56:01 +01:00
Mignari
c8dba24a9f Show as minimap.
Show only the tile minimap colors.
Shortcut Shift+E
2018-04-22 10:54:06 -03:00
Nailson
d1f65b1a9b Do not draw hook indicators in far zoom. (#229) 2018-03-22 19:59:05 -04:00
Gabriel Pedro
d5f2c0c9fd
resolves #228 2018-03-22 01:48:32 -04:00
Mignari
b5de55cc2f Show hook indicators for walls. 2017-11-10 13:15:08 -03:00
Nailson
86470892b4 Hangable items are displayed wrongly. Fix #201 2017-06-26 07:34:32 -03:00
Nailson
d792de9bed Add text ellipsis for tooltips. Closes #196 2017-06-06 23:51:00 -03:00
Nailson
63aebafe54 New Find/Jump to Item Dialog, some code cleanup. 2017-05-19 15:19:10 -03:00
Elime1
bedd780976 Fix GLUT dependency Linux #170 2016-12-09 21:51:52 +01:00
Nailson
e0d319fd07 New tooltip brush cursor. 2016-12-05 18:22:57 -03:00
Nailson
87f618c1bf Update vcxproj. 2016-12-05 09:22:01 -03:00
Nailson
86708f58c3 Fix tooltip background draw. 2016-12-05 08:31:33 -03:00
Nailson
a312bd1973 Text wrapping, Adjust zoom. 2016-12-04 20:19:00 -03:00
Elime1
f08ce8744c Merge branch 'tooltips' of https://github.com/hjnilsson/rme into tooltips 2016-12-03 20:43:26 +01:00
Elime1
f30c2a44f0 Add GLUT dependency macOS #101 2016-12-03 20:33:02 +01:00
Nailson
90293e4d1a Draw waypoint as tooltip. 2016-12-03 11:03:29 -03:00
Nailson
2ac2acbf7c Fix text disappearing, some changes. 2016-12-03 10:12:01 -03:00
Nailson
56e06f5489 Merge remote-tracking branch 'refs/remotes/origin/master' into tooltips 2016-12-02 22:33:22 -03:00
Nailson
1afdd10d49 Code improvements. 2016-11-12 10:30:06 -03:00