aalhour / aalhour/C-Sharp-Algorithms
Algorithm request: Sort-of RLE but on a two-dimensional array of numbers
- 主要语言
- C#
- 星标
- 6.2k
- 派生
- 1.4k
- PR 合并指标
- 30 天内没有已合并 PR
描述
**Is your algorithm request related to a computational problem? Please describe.**
I don't know the exact term of this algorithm, which I needed for my game, to reduce the a grid-based map data-wise. It is somewhat similar to an RLE-algorithm, but works on a 2D-array instead of a linear buffer/array.
**Describe the solution you'd like**
I already have a solution cooked up, and am reviewing/adjusting it to conform to the guidelines.
Again, I don't know the name but it might be helpful to others, too.
**Describe alternatives you've considered**
Too many, but I forgot the names, unfortunately.
**Additional context**
Context is as stated above. I have a two-dimensional array of numbers (int, short, byte, doesn't matter), where many places are prone to repeat. Imagine a tile-based map where there are a lot of repeating tiles, like grass. I don't want it to consume space each time but instead "merge" (like RLE) so that it can be easily reconstructed again later, saving more space the more repeating context there is.
I am programming a game on the PS1 where I have many maps and I don't want them to fill up RAM. I can easily draw a big rectangle with a repeating tile instead of n tiles of that texture.
贡献指南
调研方向
Look at existing compression algorithms in the repository, such as RLE, to understand the structure. The issue describes a 2D RLE for tile maps; start by designing a class that can compress a 2D array of integers by merging consecutive identical rows or blocks. Write tests with sample tile maps to verify compression and reconstruction work correctly.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100