UE打开map文件
前28个字节为包头索引
大地砖位置为从第29个字节开始
每3个字节记录一个大地砖 1个大地砖暂用4个坐标。
大地砖总数为。
字节[1] 为类似大地砖编号
字节[2] 为记录大地砖图片序号
字节[3] 为记录大地砖图片序号
地图的(长 X 宽) 除以 4 = 大地砖总数
大地砖占用总字节为
大地砖总数 X = 大地砖一共暂用字节数。
其他暂用。
文件减去前头29个字节,减去大地砖所占用字节。
即为剩余字节。
剩余字节每14个为一个单位。
字节[1] 00代表黄遮挡 03代表不遮挡 02代表红遮挡 (红黄暂时不能重叠)
字节[2]
字节[3]
字节[4] Obj编号 FRONT
字节[5] Obj编号 BAKC
字节[6] Obj序列号 BAKC FF [6][7]同时为FF则BAKC为空
字节[7] Obj序列号 BAKC FF [6][7]同时为FF则BAKC为空
字节[8] Obj序列号 FRONT FF [8][9]同时为FF则FRONT为空
字节[9] Obj序列号 FRONT FF [8][9]同时为FF则FRONT为空
字节[10]
字节[11]
字节[12]
字节[13] 00代表无光 03代表有光
字节[14]
盛大
包头 = 52 字节
字节[1] 大地砖序号
字节[2] 大地砖序号 (此处大于或等于80 则为遮挡黄)
字节[3] 小地砖序号
字节[4] 小地砖序号
字节[5] OBJ序号
字节[6] OBJ序号 (此处大于或等于80 则为遮挡红)
字节[7]
字节[8]
字节[9]
字节[10]
字节[11] OBJ序列号
字节[12] 00代表无光 01代表有光
字节[13] 大地砖编号
字节[14] 小地砖编号
就看不懂这个说的什么。。 有谁比较清楚的说下吗?
同样看不懂,楼下大佬有请.
写地图编辑器或者转换器?
格式只能靠自己慢慢分析的了。。。。。。。
https://www.cfabc.net/forum.php?mod=viewthread&tid=6886
你去看我8年前写的帖子
理论上是能转换的 不过有点费脑细胞 你自己分析
盛大2的有12字节,14字节,36字节,主要区别在于 序号和索引的扩展,占用字节更多
下面是常用的14字节map文件
var offset = 0;
Width = BitConverter.ToInt16(_bytes, offset);
//宽
offset += 2;
Height = BitConverter.ToInt16(_bytes, offset);
//高
MapCells = new CellInfo[Width, Height];
offset = 52;
//头文件
for (var x = 0; x < Width; x++)
for (var y = 0; y < Height; y++)
{
//14字节
MapCells[x, y] = new CellInfo();
//1个坐标
MapCells[x, y].BackImage = BitConverter.ToInt16(_bytes, offset);
//tiles序号,2字节,最高位0和1代表是否有路障
offset += 2;
MapCells[x, y].MiddleImage = BitConverter.ToInt16(_bytes, offset);
//smtiles序号,2字节(
offset += 2;
MapCells[x, y].FrontImage = BitConverter.ToInt16(_bytes, offset);
//objects序号,2字节
offset += 2;
MapCells[x, y].DoorIndex = (byte)(_bytes[offset++] & 0x7F);
//门索引,1字节
MapCells[x, y].DoorOffset = _bytes[offset++];
//门,1字节(0-127)
MapCells[x, y].FrontAnimationFrame = _bytes[offset++];
//动画,1字节
MapCells[x, y].FrontAnimationTick = _bytes[offset++];
//动画,1字节
MapCells[x, y].FrontIndex = (short)(_bytes[offset++] );
//object索引,1字节
MapCells[x, y].Light = _bytes[offset++];
//光照,1字节
MapCells[x, y].BackIndex = (short)(_bytes[offset++] );
//tiles索引,1字节
MapCells[x, y].MiddleIndex = (short)(_bytes[offset++] );
//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[Width, Height];
for (var x = 0; x < Width; x++)
for (var y = 0; y < Height; y++)
MapCells[x, y] = 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[x * 2 + i % 2, y * 2 + i / 2].BackIndex = (short)(_bytes[offset] != 255 ? _bytes[offset] + 200 : -1);
MapCells[x * 2 + i % 2, y * 2 + i / 2].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[offset++];
MapCells[x, y].MiddleAnimationFrame = _bytes[offset++];
MapCells[x, y].FrontAnimationFrame = _bytes[offset] == 255 ? (byte)0 : _bytes[offset];
MapCells[x, y].FrontAnimationFrame &= 0x8F;
offset++;
MapCells[x, y].MiddleAnimationTick = 0;
MapCells[x, y].FrontAnimationTick = 0;
MapCells[x, y].FrontIndex = (short)(_bytes[offset] != 255 ? _bytes[offset] + 200 : -1);
offset++;
MapCells[x, y].MiddleIndex = (short)(_bytes[offset] != 255 ? _bytes[offset] + 200 : -1);
offset++;
MapCells[x, y].MiddleImage = (ushort)(BitConverter.ToUInt16(_bytes, offset) + 1);
offset += 2;
MapCells[x, y].FrontImage = (ushort)(BitConverter.ToUInt16(_bytes, offset) + 1);
if (MapCells[x, y].FrontImage == 1 && MapCells[x, y].FrontIndex == 200)
MapCells[x, y].FrontIndex = -1;
offset += 2;
offset += 3;//mir3 maps dont have doors so dont bother reading the info
MapCells[x, y].Light = (byte)(_bytes[offset] & 0x0F);
offset += 2;
if ((flag & 0x01) != 1) MapCells[x, y].BackImage |= 0x20000000;
if ((flag & 0x02) != 2) MapCells[x, y].FrontImage = (ushort)((UInt16)MapCells[x, y].FrontImage | 0x8000);
if (MapCells[x, y].Light >= 100 && MapCells[x, y].Light <= 119)
MapCells[x, y].FishingCell = true;
else
MapCells[x, y].Light *= 2;//expand general mir3 lighting as default range is small. Might break new colour lights.
}
}
能发布到论坛里来吗? 那个实战的还得权限才能看!!!!
这一串是什么代码。。。。。。
此系列文章分为3篇:理论篇,实战篇,转换篇。
大佬求分享这个系列文章,转换篇没有写嘛还是被隐藏了
传奇3转传奇2格式很麻烦,传奇3的大地砖和其他数据是分开的,文件头结构完了紧跟的就是所有大地砖数据,大地砖完了才是其他数据,传奇3转传奇2要解决很多问题,比如两个Objects同时存在,要考虑合成图片,如果主Objects类型为透明动画,只能转换smTiles。透明动画偏移,smTlies偏移都是转换过程中必须要解决的问题,传奇3地图转换很吃内存,主要是因为地图太大,要读取的素材也很多,没有8G以上的内存最好莫碰。