akatsuki105 / openpokemonred Goto Github PK
View Code? Open in Web Editor NEWWIP: An open-source re-implementation of Pokémon Red
License: MIT License
WIP: An open-source re-implementation of Pokémon Red
License: MIT License
マップでの処理
PokeTraveler方式を考えたが、原作と同じ方式で良さそう
PolishedMapを使えばそこまでDXは悪くない
I can build the project on Windows 10 via make build-windows
, however, when I run the exe:
dan@dan-laptop MINGW64 ~/git/OpenPokemonRed (master)
$ ./build/windows-amd64/pokered.exe
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x11150b7]goroutine 1 [running, locked to thread]:
pokered/pkg/audio.newMusic(0x0, 0x0, 0x11bf183, 0xf, 0x11bbfb0, 0x8, 0x0)
C:/Users/dan/git/OpenPokemonRed/pkg/audio/music.go:62 +0x57
pokered/pkg/audio.newMusicMap(0xac44)
C:/Users/dan/git/OpenPokemonRed/pkg/audio/music.go:31 +0x7c
pokered/pkg/audio.init()
C:/Users/dan/git/OpenPokemonRed/pkg/audio/music.go:24 +0x4b
I've looked into it and it looks like the func newMusic
in music.go
is crashing, probably unable to find the file?
I'm not sure what the music paths represent (for example /1-00 Intro.ogg
), where are this files supposed to be located?
I can't find any .ogg file in the project.
start menuのような具体的なmenuではなく、menuのエンジン部分
menuは複数存在しうるがその構造体をすべて作ってしまう?
ゲームボーイと違って、vblankが終わっても元の処理に戻ることはない
テキスト描画中なら次のフレームでもテキスト描画を続けるように、Overworld中なら次のフレームでもOverworld処理を続けるようにしてやる必要がある
PokeTraveler同様にModeによる処理の分岐を実装してやる予定
VBlankという毎フレーム必ず実行される処理も作る予定
textのscroll待機処理など、思った以上にloopが多く、複数のモードが必要なのではと思ってきた
一番上の階層にモードを大量に作るのは問題があるのでsubModeを使うのが良い気がする
その前にscrollの問題を別の手法で解決できるか考える
Due the the text being store in in the source file line endings are Based on the file encoding and not the os version.
When compiled for The opening interaction with oak has no text and crashes due the the line not splitting and be made empty with the sub select. Pull request incoming.
目標: マサラタウンのストーリー(ライバルとのポケモンバトルを除く)
pokeredの engine/menu の内容を widgetパッケージ として扱う
個人的には一つのバイナリにしたいので画像データはバイト列として抜き出す
機能
ダウジングマシン
アイテムを使う処理
いろいろな上の階層のステートをいじる必要が出てくるのでこれは別パッケージにおいた方がいいかも?
現在のシステムでは複数枚の画面描画を再現しきれないのでレイヤーシステムを導入する
各パッケージのVBlankではこのレイヤーにイメージをセットしていって最後にそれらを組み合わせて画面を作る
現在の設計では
type Layer struct {
Name string
Z int
Image *ebiten.Image
}
var Layers = []Layer{}
こんな感じ
Name
はレイヤーの識別子とする予定
ReduxのStoreのようなグローバルステートが必要なのでは?
例えば主人公やライバルの名前などで必要になってきそう
テキストエンジン
このパッケージは単方向に利用されるだけのパッケージである必要がある
TX_RAM -> "{関数名}" 事前に対象の値を返す関数をmapに登録しておき、それを実行する
TX_LINE -> "${line}"
TX_BLINK -> "${blink}"
TX_ASM -> "${関数名}" 事前に関数をmapに登録しておき、それを実行する
TX_SFX_ITEM_2
TX_SFX_KEY_ITEM
TX_SFX_CAUGHT_MON
TX_SFX_DEX_PAGE_ADDED
TX_CRY_NIDORINA
TX_CRY_PIDGEOT
text EQUS "db $00," -> なし
next EQUS "db $4e," -> \n
line EQUS "db $4f," -> \n
para EQUS "db $51," -> \p
cont EQUS "db $55," -> \c
done EQUS "db $57" -> \d
prompt EQUS "db $58" -> \▼
page -> ??
dex -> ??
ゲーム内で扱うテキストデータと、人間が書くテキストデータは違うフォーマットにして、内部で変換を行う
_AgathaEndBattleText::
text "Oh ho!"
line "You're something"
cont "special, child!"
prompt
var text = `
Oh ho!
You're something
special, child!
▼` // $tOh ho!\nYou're something\nspecial, child!\▼
_PewterCityPokecenterGuyText::
text "Yawn!"
para "When JIGGLYPUFF"
line "sings, #MON"
cont "get drowsy..."
para "...Me too..."
line "Snore..."
done
var text = `
Yawn!
When JIGGLYPUFF
sings, #MON
get drowsy...
...Me too...
Snore...
` // "Yawn!\pWhen JIGGLYPUFF\nsings, #MON\nget drowsy...\p...Me too...\nSnore..."
_DexSeenOwnedText::
text "#DEX Seen:@"
TX_NUM wDexRatingNumMonsSeen, 1, 3
text ""
line " Owned:@"
TX_NUM wDexRatingNumMonsOwned, 1, 3
db "@"
var text = `
#DEX Seen:${DexSeen}
Owned:${DexOwned}
`
ゲーム内では、tile(8×8)、coord(16×16)などの様々な単位が存在する
それを抽象化するパッケージ
人や、ものなどのスプライト全般
OAMシートを作ってスプライトはそこに配置していき、最後にそれをtilemapの上に描画する予定
草むらでは、 BG > SPR になっており草むらのタイルをスプライトのタイルの上から 下半分だけ描画する必要がある
BG > SPR の現象は草むらだけなので草むらは特殊なタイルにして上から描画するようにする?
テキストボックスに隠れたスプライトは非表示にしてやる必要がある
とレイヤを分けるのがいい気がする
実際にエンジン部分を組み合わせてゲームを作っていく方法
2 -> 3 のつなぎ目
1 -> 2 のつなぎ目
現在実行中のハンドラ関数という項目を作り、それによって個別の処理を実現していく?
ポケモン赤を忠実に再現
ただ拡張性を考えて作る
MonsterEngineでの再利用性を考えて選びたい
結論
wasm化を考えると Go で作った方が良さそう
静的データ
GB版ではROMに格納されていたデータ
このパッケージは利用するだけの単方向のパッケージにする
Dataの中に入れるのは
など大量のデータがあるがこれらを go のデータ構造にするか、jsonなどの汎用DSLを使うかは要検討
goのデータ構造じゃないとシングルバイナリにできない
constantsのデータはenumなので別ディレクトリ?
特殊な処理が多いのでEngineは必要な可能性が高い?
依存関係がぐちゃぐちゃになりそうだが...
結論 engine/*.asm の部分だけを engineにし、他はパッケージとして独立
engine が参照するのは data のみにする?
単方向のAudioパッケージ
ハードウェアの音量調節もこのパッケージ内で行うか?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.