百度空间 | 百度首页 
 
查看文章
 
Linux版的英雄无敌3
2009-10-06 21:59

Linux版的英雄无敌3

作者: jiqing
邮箱: jiqingwu@gmail.com

介绍

英雄无敌2和3都是英雄无敌系列的经典,你知道吗,英雄无敌3有Linux版的啊。 先来几张截图看看吧。


怎么样?和windows版的一样吗? 不过,这个Linux版并不是原公司做的,这个是可敬的洛基(loki)公司做的。

洛基公司是个致力于开发linux游戏的公司,目标是增加linux的竞争力。 无疑,他们都是非常喜欢linux的一批人了。 可惜,公司已经倒闭,无法赢利公司就无法生存。 怎么linux的游戏市场就是打不开呢?是因为当时linux用户还少吧? 那么现在呢?

下载和安装

国内的用户可以到这里下载:
感谢ubuntu中文论坛提供的服务。

下载完Heroes.of.Might.and.Magic.3.Linux.[mulek.info].iso后, 按以下步骤安装:

sudo mount -o loop Heroes.of.Might.and.Magic.3.Linux.[mulek.info].iso /mnt
cd /mnt
sudo bash setup.sh

将会启动安装的图形界面,有的机器也会启动文字安装界面。 安装的默认目录是/usr/local/games/Heroes3,你也可以更改。 安装的大小是可以定制的,如果你不安装声音、音乐和视频,安装大小都不到 100兆。

安装迅速完成, 这时在命令行运行heroes3,就启动游戏了。 进去体验一下吧,很流畅吧,cpu占用非常之低,看来是基于timer实现的啊,我 我喜欢这样的游戏。

安装全屏补丁

怎么回事?不能全屏。即使加了-f选项,也是在800x600的窗口中运行。
运行一下heroes3 -v,现在的版本号是1.2。
我们打一个1.3.1的补丁就可以了。

就在我们上面提到的 http://ftp.ubuntu.org.cn/games/xiechy/ 中,有一个heroes3-1.3.1a-x86.run文件,大概 两兆多大小,这个就是补丁。 不过据说这个不行,要google下载另一个heroes3-1.3.1-x86.run, 注意到差别了吗,这个文件名中少一个a。另外这个大小只有1兆左右。

现在运行sudo sh heroes3-1.3.1-x86.run,却发现以下错误。

Verifying archive integrity...tail: cannot open `+6' for reading: No such file or directory
Error in check sums 2268731580 1601210390

下面就是我要讲的主要部分,怎么对补丁进行hack。

用vim打开heroes3-1.3.1-x86.run,搜索 +6 ,发现是作为tail的参数。 表示从文件第六行的内容。 但是这样使用参数是错误的,正确的使用方法是 tail --lines=+6 。 所以把 +6 的部分都改正为 --lines=+6 。 这样 tail: cannot open `+6' for reading: No such file or directory 的错误就消除了。

再次运行sudo sh heroes-1.3.1-x86.run,仍然有如下错误
Error in check sums 2268731580 1601210390
在heroes-1.3.1-x86.run中搜索,找到那个地方。
大概是102行,注释掉以下部分。
#[ $sum1 -ne $CRCsum ] && {
# $echo Error in check sums $sum1 $CRCsum
# eval $finish; exit 2;
#}

再次 sudo sh heroes3-1.3.1-x86.run ,结果如下:

Verifying archive integrity...OK
Uncompressing Heroes of Might & Magic III for Linux: patch 1.3.1
trap: 126: cd /tmp; /bin/rm -rf $tmpdir; exit $res: bad trap

搜索trap,只在一个地方出现,

[ "$keep" = y ] || trap 'cd /tmp; /bin/rm -rf $tmpdir; exit $res'

trap什么意思,我不太明白,因为下面还有一行

[ "$keep" = y ] || { cd /tmp; /bin/rm -rf $tmpdir; }

所以我认为trap这行没有实际作用,注释掉

#[ "$keep" = y ] || trap 'cd /tmp; /bin/rm -rf $tmpdir; exit $res'

保存,运行 sudo ./heroes3-1.3.1-x86.run --keep 。成了!

Verifying archive integrity...OK
Uncompressing Heroes of Might & Magic III for Linux: patch 1.3.1.....
***********************************************************************
This script will install the 1.3.1 patch for Heroes of Might & Magic III
You need an exiting installation of the game and sufficient
write access permissions to proceed.

This patch is for a x86 system
You are running a x86 system

OK !
Please enter the Heroes III installation directory [/usr/local/games/Heroes3] :
Patching heroes3 ...

Successfully upgraded Heroes III to version 1.3.1 !
Please read the file README.patch13 in /usr/local/games/Heroes3 for details about this patch.
Enjoy the game !

检验一下, heroes3 -v

Heroes of Might and Magic III Linux 1.3.1
- Mar 7 2000
Built with flags:
-DUNIX
Built with glibc-2.1

OK,升级成功!运行 heroes3 ,不加参数,默认是全屏的。 如果要在窗口内运行,就 heroes3 -w

Enjoy the game!

更新: 想省事的朋友可以在这里下载我修改过的全屏补丁。


类别:linux应用 | 添加到搜藏 | 浏览() | 评论 (8)
 
最近读者:
 
网友评论:
1
2009-10-07 10:44 | 回复
谢谢分享好文章
 
2
2009-10-16 19:00 | 回复
到最后一步失败了...Help~
我的系统是Archlinux,最后注释掉trap那一步失败了。
说是cannot find run.sh
 
3
2009-10-21 11:08 | 回复
回复Rothsdad:你加了--keep了吗?
一定要加上--keep。
 
4
2009-10-24 14:11 | 回复
--keep与-keep我都试过了,还是不行~
 
5
2009-10-24 22:22 | 回复
回复Rothsdad:把你输入的命令和命令输出贴出来,我研究一下。
 
8
2009-10-25 20:26 | 回复
回复Rothsdad:这个run.sh我猜是解压后自动生成的,不清楚你的怎么会没有。
http://code.google.com/p/girl-sword/downloads/list
你在这里下载我改过的补丁,运行一下看看。
 
9
2009-10-25 21:10 | 回复
可以了,很奇怪,不过再次谢谢了~
 
10
2009-10-25 22:11 | 回复
回复Rothsdad:问题解决了就好。
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu