Author Topic: OpenVIII - an open-source Final Fantasy VIII engine implementation  (Read 53231 times)

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile

What?
OpenVIII is made in MonoGame and aims to recreate 1:1 experience of FFVIII

Why?
I don't know

Show it!
https://youtu.be/Fo5Q0qOCsU4
PS> I forgot to show FMV support, but it's there (just without audio  :x )

open-source, you say?
yes, https://github.com/MaKiPL/OpenVIII

OpenVIII not only is going to play VIII as vanilla, but also would leave an open doors for modders. It's going to be extremely easy to import own OBJ, FBX models into the game, uses 4K textures and whatever you want. I'll make sure to create a mod tool so you would just import your model from 3D modelling tool and that's all.
« Last Edit: 2019-07-30 17:19:07 by Maki »

Sega Chief

  • *
  • Posts: 4086
  • These guys is sick
    • View Profile
That's really amazing, biggest turn off for me with the PC version is that it looks and sounds worse than the original PS1 game (granted there are texture/background mods, but I prefer that 'real' PS1 aesthetic if that makes sense). An opensource FF8 would be super useful for modding, the restrictions on adding new enemies and field models/scripts are pretty tough to work around.

Downloaded the repository & installed monogame (think I need some other stuff for video/audio). Having a dig through it at the moment.

obesebear

  • *
  • Posts: 1389
    • View Profile
You should probably contact Square Enix and see how much money they're willing to give you for it.  Awesome job!

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
(think I need some other stuff for video/audio).

all needed dll's are in root catalogue: AForge.Video.FFMPEG.dll; AForge.Video.dll; DirectMidiNet.dll and NAudio.dll

You should probably contact Square Enix and see how much money they're willing to give you for it.  Awesome job!

SE hates VIII for some reason

Anyway, I'm really afraid of animations- I haven't done any single type of skeletal animation directly from code other than vertex morphing. I have no single idea how I'm supposed to work with bones/skin and animation frames

Yagami Light

  • *
  • Posts: 173
    • View Profile
Get better soon Maki, the amount you have done already just by yourself is impressive, even though its based on the pc version which has lots of graphical bugs and sound issues compared to ps1, it shouldn't be too hard to replace those with better versions since its open source. Possibilities are endless still sad you have put more effort in this than Square Enix has done since the original release.

obesebear

  • *
  • Posts: 1389
    • View Profile
Didn't qhimm make some program for models/animations?  If nothing else I'm fairly positive noesis creator Mr adults has models and animations implemented into his program

Kaldarasha

  • *
  • Posts: 2449
  • Prince of Model Editing
    • View Profile
Get better soon Maki, the amount you have done already just by yourself is impressive, even though its based on the pc version which has lots of graphical bugs and sound issues compared to ps1, it shouldn't be too hard to replace those with better versions since its open source. Possibilities are endless still sad you have put more effort in this than Square Enix has done since the original release.

The sound issue will be there even if you use the PSX source. Problem is that the sound has instructions for SPU of the PSX. Without a way to interpret the functions to PC, it won't matter which source you choose. Though, I would probably aim the project as 32bitRPG-Maker, which luckily works with FF8. One thing is actually a demand for such an RPG maker, the other is of course to be safe for the layers of SE.

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
I have refactored the code and posted full guide for both Windows and Linux development. On Linux it's not possible to hear any music due to DirectX 6 DirectMusic component not natively supported by Linux.

https://github.com/MaKiPL/OpenVIII/blob/master/README.md#getting-started-windows
https://github.com/MaKiPL/OpenVIII/blob/master/README.md#getting-started-linuxmono-tested-on-ubuntu
« Last Edit: 2019-03-05 17:11:10 by Maki »

Sebanisu

  • *
  • Posts: 171
    • View Profile
I got the code and I'm looking at it. :D I got it to run no problem. I'm kinda new to C# and don't know much about reverse engineering.  Maybe if I can come up with something that helps. Just looking at the code and getting ideas. I have the steam version and the psx version.

Maybe this should have it's own spot under "Project forums" with q-gears.

Yagami Light

  • *
  • Posts: 173
    • View Profile
So I downloaded everything changed the line in memory file and saved it, pressed 'build ff8', says it succeeded but when I click the exe nothing happens.

Is the memory line correct am I missing something?

public const string FF8DIR = @"D:\Program Files (x86)\Steam\steamapps\common\FINAL FANTASY VIII\Data\lang-en\"; //Work

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
So I downloaded everything changed the line in memory file and saved it, pressed 'build ff8', says it succeeded but when I click the exe nothing happens.

Is the memory line correct am I missing something?

public const string FF8DIR = @"D:\Program Files (x86)\Steam\steamapps\common\FINAL FANTASY VIII\Data\lang-en\"; //Work

This is weird, never heard of this issue. Normally you should see either some exception or program crash. Try to run debugging and see if there's something there, something that may help me locate the issue.

Yagami Light

  • *
  • Posts: 173
    • View Profile
Ok I've run the debugger theres 29 warnings but first thing that pops up is

Exception Unhandled: System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\media\griever\Data\SteamLibrary\steamapps\common\FINAL FANTASY VIII\Data\Music\dmusic'.'

I do have the music mod installed could that be the issue?

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Ok I've run the debugger theres 29 warnings but first thing that pops up is

Exception Unhandled: System.IO.DirectoryNotFoundException: 'Could not find a part of the path 'C:\media\griever\Data\SteamLibrary\steamapps\common\FINAL FANTASY VIII\Data\Music\dmusic'.'

I do have the music mod installed could that be the issue?

which system are you working one? Please make sure to pull the newest configuration, you'll be able to switch between Debug and DebugLinux, because you are using a Linux configuration for path. It should point to your FF8 installation folder. Make sure you typed correct path into Memory.cs at line ~65. I don't quite remember. It's in-dev build, so there's no easy config here, sorry!

Sebanisu

  • *
  • Posts: 171
    • View Profile
Could be if any files are missing from the music mod being installed.
Just looking it tries to load /Music/dmusic/FF8.dls and gets later on .sgt files.

It doesn't like it if the FF8.dls is missing. I just renamed mine and it errored. So check to make sure those files are there.

What mod are you using?

Yagami Light

  • *
  • Posts: 173
    • View Profile
I'm using the Roses and Wine mod, I'm on windows so I dont know why its showing the linux path, I'll keep having a look


EDIT: Ok downloaded the newest version and everything works fine thanks
« Last Edit: 2019-03-07 19:55:52 by Yagami Light »

Sebanisu

  • *
  • Posts: 171
    • View Profile
I installed Roses and Wine W07 full with installer and it renamed dmusic to dmusic_backup so I guess just need to add a if statement to check both folders? For me everything was still working just the music didn't play.
Contents for dmusic:
Code: [Select]
043a-concert-tap.sgt
043b-concert-flute.sgt
043c-concert-fiddle.sgt
043d-concert-aguitar.sgt
043e-concert-sax.sgt
043f-concert-piano.sgt
043g-concert-eguitar.sgt
043h-concert-ebass.sgt
chocoworld.sgt
FF8.dls
list.txt
XGdefault.sgt
Xgon.sgt
Contents for dmusic_backup
Code: [Select]
000s-lose.sgt
001s-win.sgt
001xg-win.sgt
004s-run.sgt
005s-battle.sgt
005xg-Battle.sgt
007s-end.sgt
008s-antena.sgt
009s-waiting.sgt
012s-kani.sgt
013s-battle2.sgt
013xg-Battle2.sgt
014s-Parade2.sgt
015s-fuan2.sgt
016s-march2.sgt
017s-joriku.sgt
018s-julia.sgt
019s-waltz.sgt
020s-friend.sgt
021s-dangeon.sgt
022s-pianosol.sgt
023s-Parade.sgt
024s-march1.sgt
025s-himitsu.sgt
026s-garden.sgt
027s-fuan.sgt
028s-polka2.sgt
029s-anthem.sgt
035s-m7f5.sgt
036s-majo.sgt
041s-field.sgt
042s-guitar.sgt
043a-concert-tap.sgt
043b-concert-flute.sgt
043c-concert-fiddle.sgt
043d-concert-aguitar.sgt
043e-concert-sax.sgt
043f-concert-piano.sgt
043g-concert-eguitar.sgt
043h-concert-ebass.sgt
046s-resistan.sgt
047s-kaiso.sgt
047xg-Kaiso.sgt
048s-horizon.sgt
049s-master.sgt
051s-rinoa.sgt
052s-travia.sgt
053s-antena2.sgt
054s-truth.sgt
055s-jail.sgt
056s-gargarde.sgt
057s-timber.sgt
058s-garbadia.sgt
059s-pinch.sgt
060s-scene1.sgt
061s-pub.sgt
062s-bat3.sgt
063s-stage.sgt
064s-choco.sgt
065s-white.sgt
066s-majomv.sgt
067s-musho.sgt
068s-missile.sgt
069s-enzetu.sgt
070s-card.sgt
071s-gomon.sgt
072s-soto.sgt
073s-majobat.sgt
075s-Gar3.sgt
076s-Bossbat2.sgt
077s-lasdun.sgt
078s-gafly.sgt
079s-demo.sgt
080s-spy.sgt
081s-mods.sgt
082s-salt.sgt
083s-alien.sgt
084s-sekichu.sgt
085s-esta.sgt
086s-moonmv.sgt
089s-hikutei.sgt
090s-bossbat1.sgt
091s-rag1.sgt
092s-rag2.sgt
093s-lasboss.sgt
096s-keisho.sgt
097s-ashuku.sgt
099-joriku2.sgt
chocoworld.sgt
FF8.dls
list.txt
XGdefault.sgt
Xgon.sgt

Yagami Light

  • *
  • Posts: 173
    • View Profile
I'm not too bothered about the music, but what are the controls? I've pressed every key on my keyboard and cant get the menu to show

Sebanisu

  • *
  • Posts: 171
    • View Profile
space bar gets past the overture

arrow keys move around menu

enter selects

when in the battle screen controller or mouse and keyboard wasd can be used to move around. Though mouse is hella sensitive.

Escape exits the program

unsure what button leaves the field or battle screens.

For fun I've been messing with adding controller support to the menus. Unsure if Maki would like me to commit my code to github. It's mostly functional. I had to check for double inputs because it was putting inputs into the next menu before it loaded. :P Maybe I broke the delay check. Though it's 100ms maybe I just am too slow to let go of the button. It gets my brain working if nothing else.
« Last Edit: 2019-03-08 00:03:52 by Sebanisu »

Yagami Light

  • *
  • Posts: 173
    • View Profile
That would be cool, I tried space bar and it just exits as soon as I press it then exception unhandled pops up System.NullReferenceException: 'Object reference not set to an instance of an object.'

EDIT: Ok uninstalling the music mod fixes all the issues
« Last Edit: 2019-03-08 08:57:47 by Yagami Light »

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Unsure if Maki would like me to commit my code to github.

sure I do- feel free to commit any code you think is needed. This is in-dev prototype, so everything goes in. The code would be rewritten to support config like in original FF8, so don't worry about controls and/or gamepad support
I installed Roses and Wine W07 full with installer and it renamed dmusic to dmusic_backup so I guess just need to add a if statement to check both folders?
Yep, exactly.


EDIT: Ok uninstalling the music mod fixes all the issues
Phew!

Sebanisu

  • *
  • Posts: 171
    • View Profile
Well I was fiddling with Naudio and managed to get the Overture ogg file to play. I'm unsure about the portability. I'm gonna D/L ubuntu and install in vm. To see if it works. Looks like I need to make a helper class to enable looping. Just wanna see if it works in linux first before i put more effort into it :P

Man Virtualbox is going slow. I think it's the hard drive slowing it down. I didn't wanna use my ssd space, but it's maxing out my hard drive speed lol.

Maybe it's because I was only giving it 1 core and 1gb of ram. it was probably chocking it's self going in and out of the virtual memory/swap.

Yep that fixed it. I sat here for like an hour watching apt-get stuck on something lol

I was thinking that the instructions line "apt-get install mono" should be changed to a link for https://www.monodevelop.com/download/#fndtn-download-lin at least for me mono isn't a package. after adding the repository the package it told me to install was mono-devel.

Maybe need to add "sudo apt-get install monodevelop" to instructions
« Last Edit: 2019-03-11 17:03:35 by Sebanisu »

Sebanisu

  • *
  • Posts: 171
    • View Profile
I got some audio playing in linux but it's all distorted for some reason. I am loading the entire ogg into a byte array to add to a sound effect. I heard something but it's noisey, lots of static.

Okay after much time. I found the answer on a form for what i thought was the problem and issue solved.
https://stackoverflow.com/questions/31957211/how-to-convert-an-array-of-int16-sound-samples-to-a-byte-array-to-use-in-monogam/42151979#42151979

I'm unsure what the other sounds format is but i might run the bytes through this function and see if the distortion goes away for those.

I didn't know WaveFormatConversionStream.CreatePcmStream() was there. I just attempted to stick it in but it didn't like the vorbis source. So i guess we stick with the current version for now.
« Last Edit: 2019-03-12 00:06:51 by Sebanisu »

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
I got some audio playing in linux but it's all distorted for some reason.

It's expected behaviour- I am not converting ADPCM to PCM stream due to NAudio compatibility issues with Linux- instead I'm forcing to play compressed sound.
I'll be moving to FFMpeg soon- that will solve this problem

I am loading the entire ogg into a byte array to add to a sound effect.

Vorbis OGG is also a compression format, just like adpcm. They both need conversion to basic stream, which FFMpeg will be capable of this.

Sebanisu

  • *
  • Posts: 171
    • View Profile
It's expected behaviour- I am not converting ADPCM to PCM stream due to NAudio compatibility issues with Linux- instead I'm forcing to play compressed sound.
I realized all this after a while. I spent a lot of time trying too google a way to convert the adpcm to pcm. Just kept finding the function that you already were using in windows. I actually thought I fixed it by removing waveout from the equation. Till I went to check again last night and i then realized I was looking at the wrong function as the problem.  I was thinking of comparing the bytes of the pre and post converted audio. *shrugs*.
Quote
Vorbis OGG is also a compression format, just like adpcm. They both need conversion to basic stream, which FFMpeg will be capable of this.
Naudio.Vorbis uncompesses the audio to a 32-bit float WaveStream. I found a function to convert it to 16 bit. So the ogg music is playing and looping in Windows and Linux.
Quote
I'll be moving to FFMpeg soon- that will solve this problem
Sounds good. I was thinking of finishing up the ogg music playing stuff. It works like the directmusic stuff. So I was going to setup my code to mirror what you have there.
I'm sorry for these posts. I was figuring things out as I went. I shoulda came back and edited more as I figured things out.

--- edit---
For some reason the loop is not working correctly at least not on all the files... I'm 99% sure my code is correct but on '512 The Loser.ogg' it's obvious that STARTLOOP is being ignored. So it is looping the whole sound effect. So I look forward to ffmpeg.

symbolNames in module-field_debug doesn't seem to be working. Just a black screen. i'm getting string[1] with a lot of 0 values. On testbl3 it gives a out of range exception on the line of
Code: [Select]
epe[i].labelASM = symbolNames[epe[i].label];"C:\\ff8\\Data\\eng\\FIELD\\mapdata\\te\\testbl3\\testbl3.sy" I guess this is supposed to be a bunch of strings. It's many 0 and 255 values instead. I was getting a lot of index out of range errors when it was trying parse it.
I uncommented statupscript and started seeing images. with some exceptions which might be why it was commented :P

I'm looking at the diffs in github's app might try to commit tonight.
« Last Edit: 2019-03-13 17:09:16 by Sebanisu »

Sebanisu

  • *
  • Posts: 171
    • View Profile
For some reason the loop is not working correctly at least not on all the files... I'm 99% sure my code is correct but on '512 The Loser.ogg' it's obvious that STARTLOOP is being ignored. So it is looping the whole sound effect. So I look forward to ffmpeg.

<

Are you sure?  LOOPSTART should be absent when you don't want a loop.  LOOPSTART=0 will loop from start.

I just found the reason OpenAL is ignoring LOOPSTART and LOOPLENGTH. Monogame has a variable to set for LOOPSTART but it just doesn't do anything. Though if I set LOOPLENGTH it throws an exception. heh.
https://github.com/MonoGame/MonoGame/issues/5186



--edit--
there was a commit to attempt to fix. now I'm wondering if it's using openal. or if the commit is live in the version i'm using.
https://github.com/MonoGame/MonoGame/commit/b749c4568edd73fde7e25a4c829d759a8ff5db9d

--edit--
I think all opengl projects default to using openal for audio via these functions. The function where I set the LOOPSTART -> http://www.monogame.net/documentation/?page=M_Microsoft_Xna_Framework_Audio_SoundEffect__ctor
I'm done messing with this for now.  :P

--
just going to fiddle. I was thinking I might be able to do the ingame menus just need to learn how more of the things these classes work.
« Last Edit: 2019-03-13 17:10:55 by Sebanisu »