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

feat: smart map loader #1395

Merged
merged 47 commits into from
Aug 18, 2023
Merged

feat: smart map loader #1395

merged 47 commits into from
Aug 18, 2023

Conversation

mehah
Copy link
Contributor

@mehah mehah commented Aug 13, 2023

Description

This system creates a map cache with a simple structure and the tiles/items with the same property are shared between each other, resulting in an improvement in memory consumption of ~130%.

Note: As characters explore the map, the "true" tiles are processed from this cache.

Global Map Test:
image

@mehah mehah requested review from dudantas and beats-dh August 13, 2023 18:07
@mehah mehah requested a review from luan August 14, 2023 16:54
Copy link
Contributor

@luan luan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works great!

before:

image

after:

image

Copy link
Contributor

@luan luan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only tried this along with other commmits -- will try in isolation soon.

But it seems to cause monsters to not behave consistently when trying to chose a target to attack. Some of them work ok, some monsters just stand around

@mehah
Copy link
Contributor Author

mehah commented Aug 16, 2023

I've only tried this along with other commmits -- will try in isolation soon.

But it seems to cause monsters to not behave consistently when trying to chose a target to attack. Some of them work ok, some monsters just stand around

fixed

@mehah mehah requested a review from luan August 16, 2023 15:42
Copy link
Contributor

@luan luan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

working now :)

Copy link
Member

@dudantas dudantas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!
From 4gb, to (debug build):
image

And release build:
image

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 76 Code Smells

0.0% 0.0% Coverage
2.6% 2.6% Duplication

@dudantas dudantas merged commit c3b477c into opentibiabr:main Aug 18, 2023
lgrossi pushed a commit to dudantas/canary that referenced this pull request Aug 18, 2023
Introducing the Smart Map Loader feature, a significant optimization in the loading and handling of maps. The implementation aims to improve the efficiency and clarity of the code, making map loading smarter and more effective.

The system creates a map cache with a streamlined structure, where tiles and items with the same properties are shared among each other. This results in an improvement in memory consumption of approximately 130%.

Note: As characters explore the map, the 'true' tiles are processed from this cache.
@mehah mehah deleted the smart-map-loader branch August 18, 2023 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants