Posted by: kevinlin on: 十二月 12, 2009
Q:
I am currently working on the equipping technique for the characters in our game. Regarding the paint-on-armor(cloth leather chain) it is rather easy by assigning different materials to the desired SubEntities. For the modelled armor pieces like plate armor I am a little bit stuck now, I have searched around on the boards and in the wiki but cannot find the real clue. Attaching to bone doesnt seem to be a good option.
Is it possible to load a different mesh into a submesh and how does it work? Should I load all the gear in one go from the start and set the SubEntities to invisible untill i need them or what would be the best method to change the equipment on a game-character?
Thanks in advance
A:You’re on the right track.
Attaching to bones is not the way to go for clothing. It works well for equipment (guns, swords, etc) and maybe some accesories (hat, holster, etc) but woul dnot work well for armour.
Building your model with all conceivable geometries (leather vs plate vs robe) in seperate subentities and then enabling/disabling as needed is a good way to go. A lot of games go this way.
You could also building your character out of components (leather torso vs plate torso vs robe torso) and attach/assembled limbs and heads as needed. A lot of game go this way (probably more than above).
Each has pros and cons. The first has some more overhead in terms of animation and vert/poly counts — not sure how 『smart』 OGRE is in ignoring/optimising invisible subentities (but I would guess pretty smart).
The second way can be harder in terms of managing animation (crashing polys, seams, etc), but has some added benefits in terms of being able to easily detach components (i.e. decapitation and dismemberment), plus customizability options may be easier to do.
If you want something fast/eas(ish), go with 1. If you want something a little more robust/extensible, go with two.
A:
You can’t 『swap』 them but you can set them visible/invisible using
entity->getSubEntity(0)->setVisible(false);
You could do it this way if you have a low number of combinations, but it’s a bad idea if you have hundreds of pieces of clothing. With a few pieces, it’s a decent idea though.
If you have lots of combinations, I think your best bet is to have a base character mesh, with bones and skeleton, animations, etc. Then have additional pieces that you share the skeleton with.
So for example, if a naked character is ok for your base mesh, use it. Let’s say you want your character wearing armor. You’d model your armor in your 3d program and bind it to the same skeleton structure as your base mesh. All bones have to exist with the same names, positions and orientations.
Then in Ogre you can use:
entity->shareSkeletonInstanceWith(otherEntity);
That means as one animates, it animates both at the same time. I got this working through a bit of trial and error. I can’t remember the problems I had but they were minor.
In the end, for a full system, you probably need a combination of the following:
1. Attaching certain pieces to bones
2. Sharing the skeleton between some pieces
3. Attaching equipment to the same scene node as the base mesh and playing the same animation name. For example, let’s say you have a robe that has special animation for the robe cloth, you can’t use #2 because it’ll have different bones and special skeletal animation.
Anyhow, good luck. Also you should look into the Ogre files yourself – you could have found the answer to the SubEntity->setVisible problem in like 2 seconds.
Posted by: kevinlin on: 八月 5, 2009
MacOSX 10.5.7的環境變數設定檔是 ~/.profile
好像舊的版本是~/.base_profile 跟我不太一樣
Posted by: kevinlin on: 八月 3, 2009
很久以前用微軟的vss做版本控制,後來改用公司的SVN。 自己寫程式要做版本控制只有自己架svn server來用。因為Leopard已經內建了svn 1.4.4跟apache所以使用mac不失為一個好方法。
步驟很簡單
1. 隨意一個地方建立
# mkdir /users/kevin/repos
2. 建立第一個專案
# svnadmin create /users/kevin/repos/myfirstproject
3.如果要給多人用就要去做ㄧ些這個project的config
# mate /users/kevin/repos/myfirstproject/conf/svnserve.conf
# svnserve -d –listen-port=3690 (開啓SVN伺服器服務)
# killall svnserve(刪掉svn server)
4.不過沒有要給多人使用就跳過第三個步驟。
# cd /users/kevin/repos
# mkdir myNowWork (目前的工作目錄)
# cd myNowWork
# sudo svn co file:///users/kevin/repos/myfirstproject (從指定的路徑checkout出最新版本)
# cd myfirstproject (剛剛抓下來的專案)
# sudo svn mkdir trunk (隨便建一個目錄)
# sudo svn ci -m 『first commit』 把剛剛建好的目錄commit回去
經過上面的步驟就能自己在local使用svn了
改天再來做 svn server讓多人使用的
網路上參考到這篇 http://asuralyc.blogspot.com/2009/05/svn-websvn-ssl-trac-on-leopard.html
Posted by: kevinlin on: 七月 13, 2009
其實本來用MAMP(apache+mysql)跟Locomotive(ruby,rails)
這樣是可以run的
但是我想要解決為什麼我的mysql跟rails就是連接有問題
上一篇似乎解決了安裝gem mysql但是…
還是有錯誤
上網找了一下 發現原來是XCode裝的Ruby搞的鬼
解決方法是給多點參數,然後rebuild一下gem的mysql
1. 先打mysql_config可以看到一些參數
lin-kevinde-macbook:music_library Kevin$ mysql_config
Usage: /usr/local/mysql/bin/mysql_config [OPTIONS]
Options:
–cflags [-I/usr/local/mysql/include -g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL]
–include [-I/usr/local/mysql/include]
–libs [-L/usr/local/mysql/lib -lmysqlclient -lz -lm -lmygcc]
–libs_r [-L/usr/local/mysql/lib -lmysqlclient_r -lz -lm -lmygcc]
–plugindir [/usr/local/mysql/lib/plugin]
–socket [/tmp/mysql.sock]
–port [0]
–version [5.1.36]
–libmysqld-libs [-L/usr/local/mysql/lib -lmysqld -ldl -lz -lm -lmygcc]
2. 把cflags的都複製起來,放到ARCHFLAGS裡
sudo env ARCHFLAGS=』-g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL』 gem install mysql — –with-mysql-config=/usr/local/mysql/bin/mysql_config
3.然後去/Library/Ruby/Gems/1.8/gems/mysql-*/
再打下面這堆
sudo env ARCHFLAGS=』-g -Os -arch i386 -fno-common -D_P1003_1B_VISIBLE -DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT -DDONT_DECLARE_CXA_PURE_VIRTUAL』 ruby extconf.rb –with-mysql-include=/usr/local/mysql/include –with-mysql-lib=/usr/local/mysql/lib –with-mysql-dir=/usr/local/mysql –with-mysql-config=/usr/local/mysql/bin/mysql_config
4. 接著就
make
make install 就成功了
參考 http://cho.hapgoods.com/wordpress/?p=158
ps.其實我本來是裝64bit的mysql照著這樣的步驟都不能成功,改裝32bit的mysql就成功了,真奇怪
Posted by: kevinlin on: 七月 13, 2009
Ror in mac connect to mysql
#gem install mysql — —with-mysql-config=/usr/local/mysql/bin/mysql_config
Posted by: kevinlin on: 六月 4, 2009
仿函數跟callback函數很類似,但是有本質上的不太一樣
仿函數似乎就是把Struct或Class假裝成一個函式的樣子。
舉個例,有這樣的一個struct
struct test
{
int a;
int b;
}
有個sort排列要求按a的大小來排,就是
struct sortfunction
{
bool operator()( const test &ta, const test &tb )
{return ta.a < tb.a; }
}
接著就能這樣使用了
std::vector<test > v;
std:: sort( v.begin(), v.end(), sortfunction() )
為什麼不把sortfunction直接寫成一個Function就好,也是可以,但是以類或者結構來處理可以得到更多彈性。
如果可以用仿函數實現,那麼你應該用仿函數,而不要用CallBack。原因在於:
仿函數技術可以獲得更好的性能,這點直觀來講比較難以理解。你可能說,CallBack函數都寫成inline了,怎麼會性能比仿函數差?我們這裡來分析下。我們假設某個函數func(例如上面的std::sort)調用中傳遞了一個CallBack函數,那麼可以分為兩種情況:
話又說回來了,仿函數並不能完全取代CallBack函數所有的應用場合。例如,我在std::AutoFreeAlloc中使用了CallBack函數,而不是仿函數,這是因為AutoFreeAlloc要容納異質的解構函數,而不是只支持某一種類的解構。這和模板(template)不能在同一個容器中支持異質類型,是一樣的。
Posted by: kevinlin on: 四月 20, 2009
usb loader目前最新版是1.5
作者有提供原始碼,所以可以做的事情很多。 用devkitPro就可以編譯了
還有人作出可以用金手指的usb loader出來,各式各樣琳瑯滿目,
link
http://www.teknoconsolas.es/blog/wan…usb-loader-v15
Description:
SD / USB Loader is an application for the Nintendo Wii that allows you to install and load your backups from a USB storage device or SD / SDHC.
Changelog:
- Fixed bug when installing games on partitions larger than 512GB.
- Fixed bug when mounting the devices.
- Fixed bug which prevented loading Excite Truck (the game can not be loaded from SD because the game needs to access the music).
- Improved speed of installation.
- Update partitions / channels / VC is not ignored in future installations (in previous versions were copied but the partitions are removed from the partition table and therefore no longer exist).
- Arrangements and various optimizations.
Posted by: kevinlin on: 四月 20, 2009
上一篇使用usb loader玩遊戲,已經很方便了,不過每次都要進去usb loader然後再選擇要執行哪一個遊戲,是有一點麻煩
所以現在介紹,用WII頻道直接玩遊戲,安裝完開機後的畫面會長下面這樣,只要直接點看要玩哪一種遊戲就可以直接進入遊戲

wii畫面
所需軟體:
1、trucha
2、編譯過的USB-Loader dol文件
3、16進位編輯器軟體一份
4、wad打包軟體、最小的wad包和vc injector軟體
5、WII安裝wad軟體(如CFM、WM等)
步驟:
1.使用trucha提取出遊戲光碟或ISO中的opening.bnr及遊戲的專屬ID

提取ID跟opening.bnr
上圖紅色圈圈起來的兩個地方RBME5G就是ID ,然後在opening.bnr按右鍵就能儲存到硬碟中
2.用16進位軟體打開usb_loader_channel的BOOT.dol,我是直接搜尋 wii 這個單字,找到如下圖

搜尋WII,找到下面像ID的6個英數的字碼
會看到如上圈起來的地方有RMCP01字樣,把它改成剛剛第一步得到的RBME5G,然後存檔
3.把剛剛的opening.bnr和boot.dol複製到wadtools資料夾裡面,再點擊』遊戲頻道製作.BAT』,有個選項就選3,還有個選項要你打4個字母(必須大寫),前面3位隨便,後面一位要以E或J結尾(注意你做的每個遊戲這四個字母必須不一樣,不然每次安裝wad都會被覆蓋),最後會產生一個title.wad。
4.複製title.wad(可以重新命名)到SD卡裡面,用CFM或WM將他安裝進WII,就完成了。
我把所需的檔案都傳到便當狗去
http://www.badongo.com/file/14545138
Posted by: kevinlin on: 四月 20, 2009
作者: ruemann (樹海游魂) 看板: Modchip
標題: Re: [Wii ] USB Loader 1.0
時間: Thu Apr 2 14:50:50 2009
載點(大小 13MB):
http://ruemann.miroko.tw/ptt/USB_Loader_install_package_and_PC_Tool.rar
http://www.megaupload.com/?d=4JK5N4Q3 MU 分流載點
http://www.badongo.com/file/14358477 BDG 分流載點
以上三個位置的東西都是相同的,只是怕 miroko 的流量爆掉才多兩個分流載點
—————————————————————————–
內容說明:
\IOS36-64-v1042.wad 這次安裝的主角,必備
\apps\
\cIOS_installer\ 用來安裝 cIOS36rev9,必備
\usbloader\ 支援封面圖、金手指、Force NTSC、語言選擇
\usbloader\images\ usbloader 所使用的封面圖存放在這裡
\WadManagev1.3\ 用來安裝 wad
\codes\ usbloader 所使用的金手指檔放在這裡
\wad\
\Autoboot-0.3g-forsaekn.wad BL (autoboot),非必備
\SoftChipR90M.wad 新版的 SoftChip,非必備
\usbloader.wad usbloader 的快速執行 channel,非必備
\usbloader_1.1_bySorg.wad 另一個比較陽春的 usb loader
安裝包內附的兩個 usb loader 的差異如下:
usbloader:不管是安裝成 channel 還是安 HBC 執行,SD 卡不能移除,且選擇遊戲時
的速度比較慢
usbloader_1.1_by_Sorg.wad:基本的功能,可以不用 SD 卡執行,選這個只是因為介
面簡潔
另外裡面附的 Backup Launcher 和 SoftChip …… 就只是 Backup Launcher 和
SoftChip 而已,有需要的人裝吧(不過我不知道 SoftChipR90M 會不會直接覆蓋舊版
—————————————————————————–
安裝說明:
usb loader 的安裝,最關鍵的步驟就是安裝 cIOS36rev9 ,只要這個步驟完成了,
其他就沒什麼問題了。
安裝後影響:BL 和 SoftChip 等讀取備份片的能力會變弱且無法讀取 RW 片。
如果 cIOS36rev9 有安裝成功,卻無法執行或造成黑屏之類的現像,請重新安裝 IOS
(載點見附錄)
1. 首先是安裝 HBC,這部份請自行爬文
2. 把rar解壓縮到喜歡的位置,會看到以下兩個資料夾:
.\Copy_to_SD\ <– 安裝 usb loader 只用得到這個
.\PC_Tool\ <– 在 windows 下對 wbfs 磁區作操作的工具
請準備一張 SD 卡格式化為 FAT 之後,將 Copy_to_SD 中的內容 copy 到 SD 中
3. 先用 HBC 執行 cIOS_installer
4. 安裝 IOS36-64-v1042.wad (此即為 cIOS36rev9)
(如果有發生 2011 錯誤時,請先跳到後面頁數看解決方法)
5. 安裝成後就已經把 USB loader 的前置工作都完成了
5.1 你可以用 HBC 執行 USB Loader
(此版支援封面圖、金手指、Force NTSC、Force PAL、語言選擇,操作後面會說明)
5.2 你也可以利用 WadManagev1.3 安裝 usbloader_1.1_bySorg.wad
(此版為很單純的 usb loader,畫面清爽,可不用 SD 卡執行)
5.3 你也可以利用 WadManagev1.3 安裝 usbloader.wad
(請注意,此版本必須和 apps 中的 usbloader 協同作業,因此必須插著 SD 卡才
能正常使用,另外,由於路徑被設定了,所以 apps 中的 usbloader 不能改名
安裝這個 wad 純粹只是為了不用再進 HBC 就可以直接執行而已 )
—————————————————————————–
安裝 cIOS36rev9 時,發生 2011 錯誤的解決法(需能連接網路):
首先下載 3.3v3_Update_RECOVERY_package.rar 解壓縮到 SD 卡的根目錄
(建議先把安裝包的內容移到別的目錄或清空 SD 卡)
1. 利用 HBC 執行 1_WadManagev1.3_Waninkoko 並安裝 IOS16-64-v257-prod.wad
2. 利用 HBC 執行 2_WadManageIOS16_Davi92 並安裝 cIOS249-v5.wad
3. 利用 HBC 執行 3_IOSDowngrade_Waninkoko 透過網路將 IOS 降級
之後就可以再依正常流程安裝 cIOS36rev9 了
3.3v3_Update_RECOVERY_package.rar 的載點(6MB):
http://www.megaupload.com/?d=2UJ5YEYI
http://www.badongo.com/file/14359244
http://ruemann.miroko.tw/ptt/3.3v3_Update_RECOVERY_package.rar
—————————————————————————–
USB laoder 基本操作:
目前的 USB loader 的操作都大同小異:
上、下:選擇遊戲
+:從 Wii DVD 安裝遊戲到 USB 裝置中
-:從 USB 裝置中刪除所選擇的遊戲
Home:回到 Wii 選單
for usbloader_1.1_bySorg.wad:
左、右:移到開頭 or 結尾
for usbloader:
左、右:設定執行遊戲時所使用的語言,這個對於內建多國語言的遊戲很好用,
像是 雨傘編年史、喪屍圍城 等就可以設定成英語介面
1:Force PAL
2:Force NTSC
—————————————————————————–
安裝、刪除遊戲:
1. 利用 USB loader 的介面,透過 Wii 光碟機安裝 or 移除
(雖然有這個功能,但不建議使用,一方面是因為 Wii 的光碟機速度不夠快,另一
方面,在經驗上,透過 PC 安裝會比較穩當)
2. 在電腦上操作
安裝包內我打了三個覺得不錯的工具:
WBFS Gui rev7 <– 需具備 .net framework 版本不確定
WBFS Manager 2.0 <– 需具備 .net framework 3.5 SP1
WBFSTool_v20 <– 需具備 .net framework 版本不確定
這三個工具都可以對 WBFS 磁區作操作,安裝時遊戲必須先做成 iso 檔
都支援批次安裝、可對已安裝的遊戲更改 title 名稱、移除已安裝的遊戲、
將已安裝的遊戲重新解回 iso 檔
注意:若要重新解回 iso 檔時,請注意目標磁區必須為 NTFS 的格式(因為 FAT32
有單檔 4G 的限制)
這代表任何人都可以利用 usb loader 來備份自己的正版片了,可喜可賀,可喜可賀
—————————————————————————–
附錄:
ISO 包(32MB,非必要,有需要再下載,均透過 WadManagev1.3 安裝即可:
http://www.badongo.com/file/14359043
http://www.megaupload.com/?d=IERH2BL0
http://ruemann.miroko.tw/ptt/ISO_package.rar <– 上面那兩個載點都無法下載
時再使用這個載點
內容如下:
IOS11-64-v10.wad.out.wad
IOS12-64-v6.wad.out.wad
IOS13-64-v10.wad.out.wad
IOS14-64-v257.wad.out.wad
IOS15-64-v257.wad.out.wad
IOS17-64-v512.wad.out.wad
IOS20-64-v12.wad.out.wad
IOS21-64-v514.wad.out.wad
IOS22-64-v772.wad.out.wad
IOS28-64-v1288.wad.out.wad
IOS30-64-v1040.wad.out.wad
IOS31-64-v1040.wad.out.wad
IOS33-64-v1040.wad.out.wad
IOS34-64-v1039.wad.out.wad
IOS35-64-v1040.wad.out.wad
IOS37-64-v2070-FreeTheBug.wad
IOS38-64-v3609-FreeTheBug.wad
IOS53-64-v4113-FreeTheBug.wad
IOS55-64-v4633-FreeTheBug.wad
—————————————————————————–
對於安裝包或說明有任何意見的人請推文或來信
(雖然文字數量增加了,但內容其實沒有多大的改變 orz)
作者同意此篇文章內容可轉載至其他地方,不需再取得作者同意,
唯需註明出處 ruemann@ptt ,謝謝合作
(這段聲明有點多餘就是了,因為可能不會有人轉載 XD)
不過希望不要把 miroko 的載點流出
(畢竟該空間一天流量只有 2G,不過速度不錯,學網似乎也沒在擋這個空間)
Posted by: kevinlin on: 四月 20, 2009
WII改機後遊戲片越來越多,還要燒光碟又浪費錢,所以最近發現了這種東西 SD/USB loader
可以將外接硬碟接到wii上面,我是用Xbox換下來的20G硬碟(後來發現實在有點小,雖然大部分WII遊戲都不到1G,不過大亂鬥就要6G多了)
讓WII讀硬碟的遊戲步驟大概是 以下這樣
cIOS36rev10 + SD/USB loader1.4普通懶人包
http://www.mediafire.com/?jjjntkqnjqi
1.請自行安裝HBC
2.解開後把SD資料夾下的東西丟到SD根目錄
3.進HBC 選cIOS36rev10 安裝
4.USB接好 進HBC 選SD/USB loader1.4 選你要的遊戲 完畢
5.安裝遊戲有兩個方法 1.使用 USB硬碟插到電腦用 wbfs_win.exe 複製ISO檔進去 2.直接用WII將光碟內容拷貝到硬碟裡
command line下的wbfs_win的說明:
假如wbfs_win.exe放在c:\wii下 usb device是 K (尚未格式化) 要裝的iso檔是g:\iso\wiiiso.iso
開始=>執行=>打』cmd』 enter
出現一個黑色畫面
打』cd c:\wii』 enter
格式化硬碟』wbfs_win.exe K init』 enter
安裝iso檔 打』wbfs_win.exe K add g:\iso\madworld.iso』 enter
等他跑完就行
要看裡面裝了哪些遊戲 打』wbfs_win.exe K list』
安裝好遊戲後,就能進去usb loader去玩硬碟裡面的遊戲了 ,完全不需要放光碟進去
最近的回應