Author Topic: Todo list  (Read 14585 times)

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Todo list
« on: 2006-05-09 16:46:55 »
Halkun, let's define here what needs to be done.

1) we need catch your segmentation falls. (I checked it on my Linux - everything is working fine)
2) I need to move all singleton classes code to single template and derived all of them from there.
3) We need to create disk or image driver. I create NullFileDriver class, it needs to be replaced with appropriate image fole driver.
4) We need to initialize savemap and load there data from kernel. (I create BinGZipFile loader so it will be easy)

what is next?

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Todo list
« Reply #1 on: 2006-05-09 18:58:32 »
5) We outline which modules to complete first
 a) Kernel <-- this is a module (it sits on our low level interface I guess) also loads and boots the script engine
 b) Script Engine <-- runs scripts etc. basically it feeds the kernel things to do
 c) Battle Engine <-- run from the field/script engine
 d) menu Engine <-- runs all the menu 'stuff' this is run from the script engine
 e) media Engine <-- plays sound movies etc. run by the script engine

I vote for doing as much of the kernel as possible then attacking the script engine, since most of the game is pushed (this term seems appropriate) from the script engine.  All the other parts won't matter if we have no idea what is being asked for and how.

As for the file driver class, I asked what we wanted in terms of an interface.  I will work on the Image File driver if I have an idea of what we want it to do.  I made the basic ISO class to allow reading sectors and some rudimentary information fetching.  The ISO9660 version of the game (IE PS1) boots differently than the PC as it appears those who converted it for the PC created a different kernel system beneath the script engine.   From that I believe we have a sort of answer to the question.  Perhaps we should look at the script system a bit more and determine where to go from there.  It seems all things point to the script as the guiding method to our madness.

Cyb

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Todo list
« Reply #2 on: 2006-05-09 20:32:38 »
As for the file driver class, I asked what we wanted in terms of an interface.  I will work on the Image File driver if I have an idea of what we want it to do.  I made the basic ISO class to allow reading sectors and some rudimentary information fetching.  The ISO9660 version of the game (IE PS1) boots differently than the PC as it appears those who converted it for the PC created a different kernel system beneath the script engine.   From that I believe we have a sort of answer to the question.  Perhaps we should look at the script system a bit more and determine where to go from there.  It seems all things point to the script as the guiding method to our madness.

Cyb

The only thing we need from framework - reading of specific files. All inner work are up to you.

unsigned int GetFileSize(const std::string &path)
bool ReadFile(const std::string &path, const void* buffer, const unsigned int start, const unsigned int length)

this two funcions shoud be enough (maybe later we need more, for video for example). But for the first fime this should be enough.

I don't know the way how real game engine handles file reading. Disk names or specifis ones (maybe from some file table). But this file uniq name should be given to function as path (maybe not as string).

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Todo list
« Reply #3 on: 2006-05-10 02:20:32 »
5) We outline which modules to complete first
 a) Kernel <-- this is a module (it sits on our low level interface I guess) also loads and boots the script engine
 b) Script Engine <-- runs scripts etc. basically it feeds the kernel things to do
 c) Battle Engine <-- run from the field/script engine
 d) menu Engine <-- runs all the menu 'stuff' this is run from the script engine
 e) media Engine <-- plays sound movies etc. run by the script engine

You have the hierarchy wrong here... This is how the native FF7 is put togeather.

a) Kernel
+graphics
-------> 2D primitives (TIM)
-------> 3D primitives (PLY)
-------> Animation primitives (HRC, ANI)
-------> Texture cache system
-------> Double buffer manager
-------> Movie player(STR)
+audio
-------> Digital Audio primitives (VAG) <--- Also known as "Akao"
-------> Music primitives (SEQ)
+device
-------> Input primitives
-------> Drive access/sector access
-------> LZS/BZIP engine
-------> Memcard access
+misc
-------> Thread engine
-------> module banking (swap) system
-------> Window management (window.bin)

b) Menu System
-------> Plays opening/closing credits
-------> Initalizes savemap from kernel.bin
-------> Initalizes new game
-------> Saves/loads game (savegame access, hooks to kenel)
-------> Manages user changeable savemap data. (user savemap access)

c) field engine
-------> contains field script engine, low-level opcodes hook into kernel (animation, sound)
-------> Calls all other modules

d) battle engine
-------> This can, frankly, be done last ^_^

e) minigame engine
------> did you know that the chocobo race minigame, snowboard minigame, and rollor coaster minigame use the same engine?

f) worldmap engine
------> did you know that the worldmap also includes the "lost in the blizzard: seneriao where you stick staffs into the ground.

*******************
The kenel does not manage windows, but offers low functions to draw them with text inside. The Field window functions are more "fleshed out" than the kernel hooks. This allows battle to make the same windows as field as menu.

What distresses me is that the system is just renders on a doubled buffered display and has a logical texture cacheing system. There is no real reason to make an overly complex display subsystem as it's really just a painters algo that determines what goes on top of who. The cache is very key as there are bunches of textures that are banked in and out on the fly from the disk. We can't load the whole "magic" directory for the first battle. (The characters dissapear during a summon is because thier textures and animations are banked out) Look at gears, it explains the texture system as well as I can gleen.

These subsystems are very modular.  This means that if we were to include FF8, we would just replace or expand the components needed.

So the first thing is to get the kernel going with enough hooks to get the *MENU* system up and running first. I know this seems bass-ackwards at first blush but we need to be able load the savemap though the proper module. It is from the act of loading a save game, be it the inital from kernel.bin, the newgame overwrite from kernel.bin, or the save frrom the savegame that actually kicks off the field file.

Does this make sense?

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Todo list
« Reply #4 on: 2006-05-10 06:25:44 »
All right.. (rubs bruised head)

I can add these primitives that can load constant named files.
However don't expect them to work like windows system functions would (warning).
The files are in ISO format and what you normally read in terms of directory information is a Windowized version of the ISO file names on a windows machine under Linux they are fortunately ISO format :D
To give an example of what I mean, for a read or get KERNEL.BIN size you will need to specify
"/INIT/KERNEL.BIN;1"
As the filename. 
I'm only saying this so people won't have a surprise (which is bad news delayed ;) ).

MOVIE files will have to be treated differently as there size is complicated by their  audio track :)

I'm not sure about stream reads but I believe for now streaming data will be a non feature.

KISS (Keep It Simple Silly) feature enhanced!

Cyb

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Todo list
« Reply #5 on: 2006-05-10 16:25:09 »
All right.. (rubs bruised head)

I can add these primitives that can load constant named files.
However don't expect them to work like windows system functions would (warning).
The files are in ISO format and what you normally read in terms of directory information is a Windowized version of the ISO file names on a windows machine under Linux they are fortunately ISO format :D
To give an example of what I mean, for a read or get KERNEL.BIN size you will need to specify
"/INIT/KERNEL.BIN;1"
As the filename. 
I'm only saying this so people won't have a surprise (which is bad news delayed ;) ).

Okey, add this instead of NullFileDriver (or just add another one). If you do it, just test GAMEFILESYSTEM. In GameFileSystem you shoud add your driver instead of NullFileDriver.
This "/INIT/KERNEL.BIN;1" or "KERNEL.BIN" doesn't matter. Because we need GAMEFILESYSTEM for game internally handles files the way it used to be.
For usual files on hard disk we use REALFILESYSTEM.

ps: Use REALFILESYSTEM to load ISO and read from it. RealFileSystem shoud incapsulate all file reading functions.

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Todo list
« Reply #6 on: 2006-05-12 05:06:03 »
Okey, add this instead of NullFileDriver (or just add another one). If you do it, just test GAMEFILESYSTEM. In GameFileSystem you shoud add your driver instead of NullFileDriver.
Hmmmm I'm a little confused (nothing new really).
This "/INIT/KERNEL.BIN;1" or "KERNEL.BIN" doesn't matter. Because we need GAMEFILESYSTEM for game internally handles files the way it used to be.
For usual files on hard disk we use REALFILESYSTEM.
ps: Use REALFILESYSTEM to load ISO and read from it. RealFileSystem shoud incapsulate all file reading functions.
Ok so my ISO code goes into RealFileSystem along with my ISO FS reading code therefore? I'll grab an SVN update and do that work then.

Cyb

mirex

  • *
  • Posts: 1645
    • View Profile
    • http://mirex.mypage.sk
Re: Todo list
« Reply #7 on: 2006-05-12 13:52:03 »
Quote
3) We need to create disk or image driver. I create NullFileDriver class, it needs to be replaced with appropriate image fole driver.

Hi, I'm not sure what do you mean by 'driver' but I have one C++ class created that works well for file reading or writing, you can select whether you want to read the file from disk or memory. It can be also easily extended to other sources. Class also supports reading of integers and floats independently of platform ( motorla or intel hardware ). Should I show you the code ?

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Todo list
« Reply #8 on: 2006-05-12 17:08:00 »
Quote
3) We need to create disk or image driver. I create NullFileDriver class, it needs to be replaced with appropriate image fole driver.

Hi, I'm not sure what do you mean by 'driver' but I have one C++ class created that works well for file reading or writing, you can select whether you want to read the file from disk or memory. It can be also easily extended to other sources. Class also supports reading of integers and floats independently of platform ( motorla or intel hardware ). Should I show you the code ?

Driver is my own name for class that lies between real data (ISO) and data that extracted from real files (files on the ISO). There are could be many names, but I call it IsoFileDriver.

Of cource you should =)
Maybe we steal something usefull from there =)

mirex

  • *
  • Posts: 1645
    • View Profile
    • http://mirex.mypage.sk
Re: Todo list
« Reply #9 on: 2006-05-21 21:00:53 »
Here you have it:

http://mypage.sk/BIN/src/CONVFILE.H
http://mypage.sk/BIN/src/CONVFILE.CPP

ready to use. This is how you use it:

Code: [Select]
CConvFileWithEndianSwitchSupport f;
// or simplier version, without endian support
CConvFile f;

char buffer[ 1000 ];


f.OpenFile( "filename", CConvFile::fm_binary, CConvFile::fm_read_write );
// or memory buffer
f.OpenMemory( memory_ptr, memory_size,  CConvFile::fm_read_write );

// classical functions
f.Read( 30, buffer );

f.Seek( 10, CConvFile::start_of_file );
f.Write( 20, buffer );

// endian-support functions
f.SetFileEndianType( CConvFile::fet_little_endian );

int i = f.ReadInt32();
float a = f.ReadFloat32();

f.WriteFloat32( a );

// closing file
f.Close();


Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Todo list
« Reply #10 on: 2006-05-22 10:28:27 »
Halkun, what shall we do next? There are a lot of posibilities, but I think we need to do something that can be displayed on the screen... fonts and windows for example.
I already create Tim loader... so create font must be easy.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Todo list
« Reply #11 on: 2006-05-22 17:25:29 »
Next step.

Start with the menu module, filling in kernel routines as we need them.

Initalazation on FF7(PSX) works like this.

1) Kernel is loaded.
2) window.bin is loaded.
4) Splash screen is loaded into texture memory.
3) begin.mnu is loaded.
------> Credits are displayed
------> On button press, buster is displayed and control is handed to save.mnu
4) begin.mnu is deleted, save.mnu is loaded
5) Save.mnu loads the inital savemap from kernel.bin into memory and displays the newgame/continue selection
------> On new game the charater overwrite is written to the memory savemap and control is passed to the field module
------> On Contine, the memory card file picker is displayed and the save is loaded from there into the save map and exection is handed off to the field module.
------> (There used to be a "debug" option here where no overwrite was preformed on the savemap and execution is handed off to field with the "raw" savemap from kenel.bin. This put you in the debug room)

So Menu is first. We need kernel routines to do the following.
1) display text at an x,y cord.
2) Display a window at x,y cord
3) access save media
4) display graphics widgets in kernel.bin.

ALso any other supporting funtions I can thing of. You need to keep the higher level functions in the fieldscript system, like window opens and text scrolling.

Does that help?

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Todo list
« Reply #12 on: 2006-06-09 15:34:03 »
Now I created timers to FPS limit, and start to work on database to where all data from KERNEL will be loaded.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Todo list
« Reply #13 on: 2006-06-09 17:52:13 »
I traced my segfault to a bad i850 driver on my laptop. It's just not OpenGL friendly. I may have to warm up Naru (My old core server) and see what I can do. That at least as an nvidia card.

On the upcoming menu system. How about making the menus externally scriptable. (TCL?) I'm clinging to this idea more than I should. Just tossing that out there


Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Todo list
« Reply #14 on: 2006-06-10 04:50:27 »
I traced my segfault to a bad i850 driver on my laptop. It's just not OpenGL friendly. I may have to warm up Naru (My old core server) and see what I can do. That at least as an nvidia card.

On the upcoming menu system. How about making the menus externally scriptable. (TCL?) I'm clinging to this idea more than I should. Just tossing that out there
You mean the engine control menu's?
IE Settings Paths, media repository.. etc?

Cyb
PS Life has been really busy.. this coming week I'll have more time available to finish with the system integration, perhaps by that time I can get it to compile!

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Todo list
« Reply #15 on: 2006-06-11 07:22:29 »
I'm thinking the in-game menu that you will use to select the charaters and such. The PSX *.MNU files are actually chunks of code that get banked in and executed when needed. (Nice an modular) The PC version had the menus internal to the executables.

I'm just think in the future if someone wants to support FF8.

Never mind... Like I said, I'm probably liking the idea more than I should.

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Todo list
« Reply #16 on: 2006-06-16 19:39:58 »
What's next? Will I need to start work on the field module?

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Todo list
« Reply #17 on: 2006-06-17 15:16:11 »
The are several directions....

One is to backtrack slightly and put in some code to load the "Sony Computer (blah blah) presents" splash banner after the q-gears logo, then see if we can find/load the brown opening credits screen. (I don't know where this background is in the PSX version, nor the names) Then display the buster sword with Newgame and contine. Newgame can load the debug room. It actually does this anyway, then jumps to map 0x74, the opening station. I think there is code in startmap to check for a varible and jump to the opening movie if it's there, skipping the debug room.

The problem is I have to search for some more textures, and find the SEQ (Midi) data so the proper music plays. Also the FF7 explosion video at the end of the credits have to be played. This might be a bit much.

It would be cool if we could load a save from a memory card file as test data. I guess we are going to have to pick a format to support for now, or use a PC save. I'm using epsxe as my testbed to disect the PSX game. (savestates are awesome)

Another direction is to load a save, or init the savemap,  jump into debug without all that nutty stuff I mentioned above. This way we can start fleshing out the fieldscript by implementing opcodes and filling in kernel functionality as we come across it.

The first choice is more visual and has users see we are doing something....

The second actully gets work done on kernel infestructure.

I think I just answered my own question on what to do next.

« Last Edit: 2006-06-17 15:18:17 by halkun »

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Todo list
« Reply #18 on: 2006-06-29 18:56:45 »
Last progress.



this weekend I upload it into svn and start to work on gateway so we can jump from one map to another.
after that I want to start battle with opcodes and scripting system.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Todo list
« Reply #19 on: 2006-06-29 22:03:57 »
Good God!

I don't know if I should feel guilty for having you do all the heavy lifting, or angry as I now have to *TOTALY* rip the fieldscript system apart to give you something to do....

^_^


Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Todo list
« Reply #20 on: 2006-06-30 04:49:33 »
Good God!

I don't know if I should feel guilty for having you do all the heavy lifting, or angry as I now have to *TOTALY* rip the fieldscript system apart to give you something to do....

^_^
You should feel happy things are moving steadily along instead.  And I think riping the fieldscript system off is probably going to be fun.
The hard parts are summuning and limit breaks for the battle system.   As for the field script the animations are in the BSX files right?

Cyb

sfx1999

  • *
  • Posts: 1142
    • View Profile
Re: Todo list
« Reply #21 on: 2006-07-02 00:23:13 »
What are you using for collision detection? Did you write your own code?

There is a library called OPCODE that could be useful.

Akari

  • Moderator
  • *
  • Posts: 766
    • View Profile
Re: Todo list
« Reply #22 on: 2006-07-02 02:52:02 »
What are you using for collision detection? Did you write your own code?

Yes, I wrote simple math that detects border and slide on it. But I just temporary and will be rewritten later.

There is a library called OPCODE that could be useful.

Could you give link to it? I cant found it.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Todo list
« Reply #23 on: 2006-07-02 19:31:09 »
Make sure it has a correct licence. GPL only....

(I'll have to look into LGPL to see if that can be used without headaches)

sfx1999

  • *
  • Posts: 1142
    • View Profile
Re: Todo list
« Reply #24 on: 2006-07-02 21:09:56 »
It doesn't seem to have any license:

http://www.codercorner.com/Opcode.htm

Why GPL only? Why not GPL compatible? I mean, the MIT license (x consortium), post 99 BSD license, and the ZLIB license should be fine. You are already using ZLIB, btw. They don't require anything special, either.