• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
March 28, 2024, 03:53:31 pm

News:

Use of ePSXe before 2.0 is highly discouraged. Mednafen, RetroArch, and Duckstation are recommended for playing/testing, pSX is recommended for debugging.


Code submissions

Started by kenshin, September 25, 2012, 12:16:50 am

kenshin

How do you guys handle code submissions?
FFT is probably my favorite game of all time, so this project finally sucked me in.
I downloaded the source about 2 days ago.
Right now I'm trying to update ScrollabeList to support nested menus. (What a pain this is with an event driven model with callbacks.)
I think I've got it working to basically any number of nested menus.
Still working on:
greying out the background menus
removing the hand icon in background menus
making all of the cancel/selection events work correctly

My first goal was to get the Act menu up and functioning (with at least Attack there, maybe Guts too, and start getting the Guts abilities to work.)
And what environments are you programming and testing under?
The sprites (portraits) do not look right in Mac OS Lion with python 2.7, panda3d 1.9.0 64bit.
I've also created an eclipse (pydev) project for this, if anyone cares.

lirmont

September 25, 2012, 01:02:38 am #1 Last Edit: September 25, 2012, 02:19:29 am by lirmont
Hello! The standard way is to fork Kivutar's git repository on github. This will give you your own place to upload things and change them. If you figure out what the issue is about sprites not looking correct on your screen, I'd be happy to join that part into the main git repository. I'm in the middle of a very large reorganization of the code, so keep that in mind.

As far as nesting menus goes, you should not worry too much about that, though the ScrollableList does need more functionality. If you look at the code you downloaded, all the GUI features are basically hard-coded. My rewrite introduces states that change that process. So, if you want to nest something like a ScrollableList, you'd follow this process: create a state template that shows a scrollable list (and accepts data describing menu items and callbacks), then create two state description files that call the same template. In this way, State #1 can show a menu that allows you to call State #2. State #2 would then be showing on top of State #1. And you have a working implementation of nesting that isn't hard-coded.

I think figuring out Mac operating system related issues with the current engine would be the best use of your time.

I code and test under Windows XP using Notepad++ with the included python 2.7 binary provided by Panda3d. Kivutar (on hiatus) is on ArchLinux (for which several utility features of Panda3d have broken for him).

The next step after the structural reorganization is to implement this half-done database structure: current MySQL workbench file.

MySQL workbench: http://www.mysql.com/downloads/workbench/

Thanks.

kenshin

Thanks lirmont.
Should I wait for your reorg before forking? (What is the ETA for your changes?)
I guess I was playing with ScrollableList more to familiarize myself with the codebase than anything else.
I'll try and track down the sprite issue. It's not just in game, but when I load the png files directly, in gimp for example, they do not look correct.
Can someone tell me how the sprite sheets are generated, are they ripped from the original game, redrawn, or what?

Grabbed the MWB file. Is there a roadmap/todo list for the DB work that needs to be done? Certainly do not mind trying to tackle that.

A couple questions about the server side. What is the vision for the server side code? Does it really need to open a blank panda window?
Do we want to have some kind of server console that operators can use to control the server? Kick players? View stats? Etc?
Or is this just so far down the road no one is worrying about it yet? :)

lirmont

September 25, 2012, 01:54:51 pm #3 Last Edit: September 26, 2012, 01:56:42 am by lirmont
I've been at the reorganization for 4 months. I'm in the process of rewriting existing game's game flow into the states. I'm only up to starting to rewrite the login screen at the moment. Then several functions on the server need to be rewritten to support one server process supporting all the games (on different ports). I'd guess maybe another month after testing before it's stable and I want to release. I can post what I have so far if you want to look around it, but it's a rapid departure from the existing directory structure (so I feel it will probably be a lot of work to make sure everything fits).


Sprites

In the version of the engine you have, there are two ways sprites are loaded. For characters, there is a sprite class that cuts the sprite sheet up, adds named animations, and scaled in response to the scale FFT's maps were determined to be (1.85, 1.85, 1.585714286). It's very important to note that sprites loaded outside of a map with the CameraHandler class running (it rewrites the camera to be orthogonal) will not be appropriately sized. For effects, I wrote a program called "Sprite Animator" which you can find here: http://ffhacktics.com/smf/index.php?topic=7409.0. I also wrote a wrapper for Tethical for the XML files the program delivers, and there's a fledgling version in the code you have. Those get scaled based on projection comparison. I mimicked the size of the cure effect in FFT in my animation program, loaded it in Tethical, and sized it manually until it fit, documenting the change within the code to get it from point A to point B.

Now, after the reorganization/rewrite, you can look forward to using any of the types of sprites made in the style of several of FFT's formats. This means you could put in well over 100 different sprites. Obviously, you don't have permission to use FFT's actual sprites, so please don't. There are, however, lots of other sprites on this website (not the forum) that I use for testing. Sprite Animator is a .NET2.0 32-bit Windows application you can probably run with Parallels.


Database

I was making the DB as I went along coding companion features for it in my control panel application. Then I had to write a feature that made making formulas intuitive as an alternative to writing RPN (Reverse Polish Notation) formulas (which the database is set to use already, though the two tables that store that need to be rewritten slightly). The application to drag-and-drop game mechanics into immediately useable formulas took a long time to write, but it is done.

Anyway, the next step database design-wise is to get game mechanics onto items. However, you might spend your time coming up with a good way to read the data out of the database in Python. If at all possible, I'd rather not have the code be using written SQL in the code. I much prefer object-oriented approaches, but I do not have the time to come up with a proof-of-concept. Basically, you'd want to make something that abstracts a character so that its information is easily used. The server currently stores character IDs, so the change to actually using a database should not be terrible.


Mac-related

When I run the server, it doesn't give me a blank Panda3d window, so please try to get it not to show that and get back to me with what you did so that I can compare it to what my rewrite currently has.


Server-related

I don't have plans for an interactive micro-management system on the server, but it surely needs one. Things like viewing player stats would come directly from the database, and so that's under the purview of the control panel application I'm writing. Writing the messages and handlers required to kick a player would be a good use of your time.


Final note

I'll upload what I have here so that you can at least look at the changes: git-fork.

kenshin

Thanks again, this is really helpful.
I think for the time being I'll leave the sprites alone, and let you finish up your changes and reorg.
Somewhere on this site I recall reading there are issues with the character portraits, which is exactly what I was seeing.
So maybe this is a known issue.

Definitely going to start looking at your code to see what you've done, thanks for the link.

As for right now, I think I'll fork Kivutar's git repo and start working on the server.
Are you very tied to MySQL? Some people are oddly passionate about technology choices.
Reason I ask is you said you wanted to ideally just deal with objects, and not so much SQL.
I am quite familiar with this choice, and its tradeoffs, as my company recently made the decision to use MongoDB.
Not having to deal with an ORM layer was one of the biggest reasons. Mongo lets us just use json everywhere.
Anyway, just an idea. Certainly there are some negatives to that approach.
Next thought was embedded SQL DB, ala Apache Derby or Sqlite3 for example.
I really have no problem with MySQL, and newer versions are now supporting json, so it can be used "sort of" like a document db.

To fix the Panda3d window issue this is the code:
Quotefrom panda3d.core import loadPrcFileData
loadPrcFileData("", "window-type none")
loadPrcFileData("", "audio-library-name null")


That will turn off audio too.

Can you explain what your control panel app's purpose is?
What functionality would you expect to be there vs. the server console, for example.
Do you have a preference about how I create this console?
I was actually thinking about using Pyramid and making it web based.
You say the server needs to be able to handle mutliple games at once, should not be too bad to implement this.
Future thoughts for the server: I suspect we will need some kind of directory service, to facilitate client being able to locate servers.


lirmont

September 25, 2012, 04:10:18 pm #5 Last Edit: September 25, 2012, 04:38:03 pm by lirmont
I have no problem using whatever database solution will work within the parameters of the project. Basically, it has to be freely available and have a way for Python and C# to interact with it. After that, I don't care what is used. The database design is complicated though, because FFT is complicated and the database is meant to encompass what FFT does and build on that. If Mongo will do that, use Mongo. I simply know how to do what I need to do with MySQL (and it has tools to make it easily accessible like MySQL workbench). However, as I said, I want ease of use for the server code which means using an ORM layer for MySQL or using something that already incorporates an ORM layer (like Mongo).

As for the control panel, you can look through this thread: http://ffhacktics.com/smf/index.php?topic=8157.0. There are a lot of pictures you can view to get the general idea. It uses and makes changes to the filesystem and the database to accomplish what it does. You'd be making your game in this as an alternative to doing everything by hand; this is the thing that puts all the complicated little pieces together.