快乐云朵 发表于 2026-3-28 22:17:52

谁懂传奇3计算地图包转换传奇2的数字


UE打开map文件
前28个字节为包头索引
大地砖位置为从第29个字节开始
每3个字节记录一个大地砖 1个大地砖暂用4个坐标。
大地砖总数为。
字节  为类似大地砖编号
字节  为记录大地砖图片序号
字节  为记录大地砖图片序号
地图的(长 X 宽)  除以 4 = 大地砖总数
大地砖占用总字节为
大地砖总数 X = 大地砖一共暂用字节数。
其他暂用。
文件减去前头29个字节,减去大地砖所占用字节。
即为剩余字节。
剩余字节每14个为一个单位。
字节 00代表黄遮挡  03代表不遮挡  02代表红遮挡  (红黄暂时不能重叠)
字节
字节
字节 Obj编号   FRONT
字节 Obj编号   BAKC
字节 Obj序列号 BAKC                FF 同时为FF则BAKC为空
字节 Obj序列号 BAKC                FF 同时为FF则BAKC为空
字节 Obj序列号 FRONT                FF 同时为FF则FRONT为空
字节 Obj序列号 FRONT                FF 同时为FF则FRONT为空
字节
字节
字节
字节 00代表无光     03代表有光
字节
盛大
包头 = 52 字节
字节  大地砖序号
字节  大地砖序号 (此处大于或等于80 则为遮挡黄)
字节  小地砖序号
字节  小地砖序号
字节  OBJ序号
字节  OBJ序号    (此处大于或等于80 则为遮挡红)
字节  
字节  
字节  
字节
字节 OBJ序列号
字节 00代表无光     01代表有光
字节 大地砖编号
字节 小地砖编号
就看不懂这个说的什么。。 有谁比较清楚的说下吗?

机智小鹿 发表于 2026-3-28 22:17:52

同样看不懂,楼下大佬有请.

阳光小熊 发表于 2026-3-28 22:17:52

写地图编辑器或者转换器?
格式只能靠自己慢慢分析的了。。。。。。。

美丽小猪 发表于 2026-3-28 22:17:52

https://www.cfabc.net/forum.php?mod=viewthread&tid=6886 你去看我8年前写的帖子

开心小鱼 发表于 2026-3-28 22:17:52

理论上是能转换的 不过有点费脑细胞  你自己分析
盛大2的有12字节,14字节,36字节,主要区别在于 序号和索引的扩展,占用字节更多         
下面是常用的14字节map文件
               var offset = 0;
                Width = BitConverter.ToInt16(_bytes, offset);//宽
                offset += 2;
                Height = BitConverter.ToInt16(_bytes, offset);//高
                MapCells = new CellInfo;
                offset = 52;//头文件
                for (var x = 0; x < Width; x++)
                for (var y = 0; y < Height; y++)
                {//14字节
                    MapCells = new CellInfo();//1个坐标
                    MapCells.BackImage = BitConverter.ToInt16(_bytes, offset);//tiles序号,2字节,最高位0和1代表是否有路障
                    offset += 2;
                    MapCells.MiddleImage = BitConverter.ToInt16(_bytes, offset);//smtiles序号,2字节(
                    offset += 2;
                    MapCells.FrontImage = BitConverter.ToInt16(_bytes, offset);//objects序号,2字节
                    offset += 2;
                    MapCells.DoorIndex = (byte)(_bytes & 0x7F);//门索引,1字节
                    MapCells.DoorOffset = _bytes;//门,1字节(0-127)
                    MapCells.FrontAnimationFrame = _bytes;//动画,1字节
                    MapCells.FrontAnimationTick = _bytes;//动画,1字节
                    MapCells.FrontIndex = (short)(_bytes );//object索引,1字节
                    MapCells.Light = _bytes;//光照,1字节
                    MapCells.BackIndex = (short)(_bytes );//tiles索引,1字节
                    MapCells.MiddleIndex = (short)(_bytes );//smtiles索引,1字节
                }
传奇3
                byte flag = 0;
                var offset = 20;
                var Attribute = BitConverter.ToInt16(_bytes, offset);
                Width = BitConverter.ToInt16(_bytes, offset += 2);
                Height = BitConverter.ToInt16(_bytes, offset += 2);
                offset = 28;
                MapCells = new CellInfo;
                for (var x = 0; x < Width; x++)
                for (var y = 0; y < Height; y++)
                    MapCells = new CellInfo();
                for (var x = 0; x < Width / 2; x++)
                for (var y = 0; y < Height / 2; y++)
                {
                    for (var i = 0; i < 4; i++)
                    {
                        MapCells.BackIndex = (short)(_bytes != 255 ? _bytes + 200 : -1);
                        MapCells.BackImage = BitConverter.ToUInt16(_bytes, offset + 1) + 1;
                    }
                    offset += 3;
                }
                offset = 28 + 3 * (Width / 2 + Width % 2) * (Height / 2);
                for (var x = 0; x < Width; x++)
                for (var y = 0; y < Height; y++)
                {
                    flag = _bytes;
                    MapCells.MiddleAnimationFrame = _bytes;
                    MapCells.FrontAnimationFrame = _bytes == 255 ? (byte)0 : _bytes;
                    MapCells.FrontAnimationFrame &= 0x8F;
                    offset++;
                    MapCells.MiddleAnimationTick = 0;
                    MapCells.FrontAnimationTick = 0;
                    MapCells.FrontIndex = (short)(_bytes != 255 ? _bytes + 200 : -1);
                    offset++;
                    MapCells.MiddleIndex = (short)(_bytes != 255 ? _bytes + 200 : -1);
                    offset++;
                    MapCells.MiddleImage = (ushort)(BitConverter.ToUInt16(_bytes, offset) + 1);
                    offset += 2;
                    MapCells.FrontImage = (ushort)(BitConverter.ToUInt16(_bytes, offset) + 1);
                    if (MapCells.FrontImage == 1 && MapCells.FrontIndex == 200)
                        MapCells.FrontIndex = -1;
                    offset += 2;
                    offset += 3;//mir3 maps dont have doors so dont bother reading the info
                    MapCells.Light = (byte)(_bytes & 0x0F);
                    offset += 2;
                    if ((flag & 0x01) != 1) MapCells.BackImage |= 0x20000000;
                    if ((flag & 0x02) != 2) MapCells.FrontImage = (ushort)((UInt16)MapCells.FrontImage | 0x8000);
                    if (MapCells.Light >= 100 && MapCells.Light <= 119)
                        MapCells.FishingCell = true;
                    else
                        MapCells.Light *= 2;//expand general mir3 lighting as default range is small. Might break new colour lights.
                }
            }

大方太阳 发表于 2026-3-28 22:17:52

arthas860904 发表于 2021-9-8 09:19 https://www.cfabc.net/forum.php?mod=viewthread&tid=6886
你去看我8年前写的帖子
能发布到论坛里来吗? 那个实战的还得权限才能看!!!!

大方小狗 发表于 2026-3-28 22:17:52

ljg3081022 发表于 2021-9-8 09:56 理论上是能转换的 不过有点费脑细胞  你自己分析
这一串是什么代码。。。。。。

坚强小鱼 发表于 2026-3-28 22:17:52

传奇3转传奇2格式很麻烦,传奇3的大地砖和其他数据是分开的,文件头结构完了紧跟的就是所有大地砖数据,大地砖完了才是其他数据,传奇3转传奇2要解决很多问题,比如两个Objects同时存在,要考虑合成图片,如果主Objects类型为透明动画,只能转换smTiles。透明动画偏移,smTlies偏移都是转换过程中必须要解决的问题,传奇3地图转换很吃内存,主要是因为地图太大,要读取的素材也很多,没有8G以上的内存最好莫碰。
页: [1]
查看完整版本: 谁懂传奇3计算地图包转换传奇2的数字