• Welcome to Final Fantasy Hacktics. Please login or sign up.

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Kivutar

Great tool!!!

Panda tools to export pixel fonts are broken since 1.8.0. With this, we are not stuck anymore.
Tethical / Artificial Intelligence
July 29, 2013, 07:22:53 am
Hi everybody.

I've not followed Tethical progress for a while. Is there any progress on artificial intelligence?

If not, I've created a starting point for people who wants to try coding an AI for Tethical.

The code is on my github, in the AI branch here : https://github.com/Kivutar/tethical/tree/AI

I know that this repo is not up to date, but I don't have access to the new one, so I put the code here and it can be ported.

What does this code do for now?

I added an 'ai' flag to characters so they can be controlled by the server instead of asking the clients. For now, I put the flag on every female character, so if you want to try the AI, you can just log in with two clients and create two teams of female only character, and watch the AI at work.

The AI is in the AI.py file server side. For now it does almost nothing : characters just move around at random places on the map without fighting.
However, I talked to fdc on IRC and he knows very well how AI works in FFT and want to try coding it's own AI based on how chess AI are done.

Here is a video showing the AI moving around :

Tethical / Re: Special effect graphics
June 05, 2012, 03:23:29 am
Centering the camera on the attacker sprite, turning the camera for the target to le on the left, and displaying the effect full screen.
Tethical / Re: Map exporter
May 25, 2012, 03:30:50 am
Ah great news, thank you so much for the x2egg trick.
Tethical / Map exporter
May 24, 2012, 05:21:01 am
The blender to egg exporter (called Chicken) we were using is no more supported by recent versions of blender. There is a new tool called YABEE, but exporting our maps to egg with it give me an error.
Tethical / Re: Sounds
May 24, 2012, 05:16:02 am
Yeah the die sound effect cannot be done with this program.
I like the sounds you made.
The confirmation sound is a bit too loud maybe, but for a first try they are pretty well chosen.
Anyway, they are here as placeholders. I pushed them in client/lij/sounds
I tried it on Linux too, works like a charm. (except ^M in the shell file, and the Cancel button of the Help window)
What about adding live preview for RPN editing?
Is it easy to convert from infix to postfix ? People could write infix.
Tethical / Re: Code refactoring
May 10, 2012, 03:27:54 am
Yes the GUI is also there to hide too much complexity to new users. I like your ideas of events, why not putting an 'experiment' or 'lirmont' folder in the client, similar to 'fft' and 'lijj', to add your maps and events?
Lijj told me the sprites he started to draw at high resolution are too much work and he won't be able to finish, so we agreed on using fft resolution to provide 3 basic jobs and 3 basic maps as sample open source content to get people started with something very classic. For this I plan to add a 'sample' folder in the client to store this game. This will also contain the open source sounds etc.

Concerning extending the code, we have to choose a strategy. We can build a very simple and generic hook system and put hooks everywhere in the code. Or allow game folders to override python modules of the same name, like done in this framework http://codeigniter.com/user_guide/general/creating_libraries.html (see the "Replacing Native Libraries with Your Versions" part). I have absolutely no idea of which way is better. I used both of them.There may be another good ways to provide extensibility. What do you think on the subject?
Tethical / Re: Code refactoring
May 09, 2012, 10:18:07 am
I tried your event test platform, it worked like a charm and i am now curious to see more tests.

Concerning animated water, I think we can achieve the same effect using this method http://www.panda3d.org/manual/index.php/Automatic_Texture_Animation without scripting. But i am not certain. It may be also usefull for sprite animation, I mead getting rid of sprite2d.
Tethical / Sounds
May 09, 2012, 08:41:40 am
I found a tool to generate sound effects. rdein the creator of Momodora uses it for his games. http://www.drpetter.se/project_sfxr.html
We could use it to replace the corpyrighted sounds in our git repo.

This one also : http://labbed.net/software.php?id=labchirp
Tethical / Code refactoring
May 08, 2012, 08:21:29 am
This week end, I refactored the code of tethical, client and server. All have been pushed on github. Here is an overview of the new code organization :


The server was composed of a big main.py doing all the stuff, with 3 or 4 business classes containing specific algorythms like moves an loading maps. I did not touch these classes, but i exploded main.py into many parts.


main.py is now 80 lines of code. It is pretty close to the hello world server in panda3d documentation, this means it listen to incoming packets with a queued manager, and dispatch the work to controllers. main.py also stores the session.
The code I used to dispatch the work is there:
    def processData(self, datagram):
        iterator = PyDatagramIterator(datagram)
        source = datagram.getConnection()
        callback = iterator.getString()
        getattr(globals()[callback], 'execute')(self, iterator, source)

The controllers

Controllers are now stored in a new folder to separate them from the rest of the code (https://github.com/Kivutar/tethical/tree/master/server/Controllers). A controller is a python module which is named from the pyDatagram identifier. It get the data from the client, call business classes like Map or Move etc, (in a later time it will query the database, and finally send back a reply to the client(s).
Here is an exemple of controller, the GET_WALKABLES controller, triggered when a client need to know on wich tiles a character can walk:
import Move

# Return the list of walkable tile for a character to a client
def execute(server, iterator, source):
    charid = iterator.getString()
    party = server.parties[server.sessions[source]['party']]
    walkables = Move.GetWalkables( party, charid )

    server.send.WALKABLES_LIST(charid, walkables, source)

What does it do? First we import the Move business class, wich contains the needed algos. A controller is composed of a single method called execute with allways the same signature: (server, iterator, source)
- server is a referece to the server to access the sessions data.
- iterator is the pydatagram iterator to extract data sent by the client, in this case the client sent the "character id"
- source is a reference to the client who sent the datagram.
The controller invoques a method from the Move module.
Finaly, it sends back a datagram (here WALKABLES_LIST) to the client.


Send.py is a class where I put all the datagrams the server will send to the client. It factorizes the code and hde the datagram complexity. So we can write
server.send.WALKABLES_LIST(charid, walkables, source)
instead of
myPyDatagram = PyDatagram()
self.cWriter.send(myPyDatagram, player)


Now the big part. As for the server, my goal was to explode main.py. So,
- I created a Send.py for the client, similar to what the server now have
- Controllers have been moved out of the main.py, following exactly the organization of the server
I won't waste time describing these changes, please refer to the server side.

Important thing to know: DirectObjects. DirectObjects are a class provided by panda3d. DirectObjects can listen to keyboard keys and bind them to functions, and we can also ask them to stop listening to the keys. In Tethical GUI module, a lot of my classes inherit from DirectObject so they can define what keys they want to hear, and when I don't need them no more, I destroy them and they don't bug me with their binding. Sometimes I also ask them to stop listening, this can be usefull when you have instanciated more than one DirectObject of different kind at the same time. And this is what happens now in the client.


Draws the sky during a battle. Will later contain sequences to change the color, for weather effetcs.


Draws the cursor, move it to a tile, change it's color. Will later contain tasks to animate the pointer with cosinus.

Display, move and hide the Active Time flag on sprites.

Contains functions that returns sequences (animation) usefull during a battle, like battle introduction, attacking, walking, etc...

A very important class to manage the tile matrix during a battle. It can generate a matrix of tile from map data. Draw colored zones by changing the color of these tiles. Find character references stored in these tiles.


KeyboardTileTraverser is a DirectObject managing the moves of the cursor on the tile matrix. It listens to arrow keys, and round and cross button. This KeyboardTileTraverser also contains methods that are only usefull for tile traversing with a keyboard, you wouldn't need to listen to arrow keys if you where using a mouse to select tiles. This means that this class could be replaced if you want to port Tethical to the wii or other pointer or touch devices.
The client will ask the KeyboardTileTraverser to listen to keys in these cases:
- selecting a tile to move a character
- selecting a tile to attack a character
- free mode, when canceling the battle menu
The client will ask the KeyboardTileTraverser to stop listening in these cases:
- displaying dialogs
- displaying a DirectionChooser
- in passive mode (when the other team is active)


CameraHandler is also a DirectObject to manager the camera. It works very similar to KeyboardTileTraverser and is keyboard driven so we may rename it KeyboardCameraHandler. It is enabled and disabled in almost the same phases as the KeyboardTileTraverser, except when displaying a DirectionChooser, the camera remains active.


In this class, I started to move battle specific functions. It is not complete yet. I will maybe move all that is battle related out of the main.py in this class and rename it Battle or BattleMechanics.


This rework of the code took me 4 days. This is pretty short, and I think due to the very small size of the codebase. Python did not come in my way, so it was a good choice for writting a prototype as we need flexibility.
The actual organization of the code is still far from perfect, but some bugs have been fixed, the code have been cleaned and symbols renamed more consistantly and a lot of things are now commented.
Please read the new code and tell me what you like/dislike.
Tethical / Re: @Lirmont: RE Database Design
May 08, 2012, 06:51:04 am
@lirmont: can we say that the scripting in spreadsheets is comparable to our database named procedures?

@PGF: there is two open source project you could fork or contribute if one day you want your dream to come true.
- the mature http://www.solarus-games.org/ you may already know
- a very young project http://www.youtube.com/watch?v=wFvAByqAuk0&feature=youtu.be http://blog.sujets-libres.fr/?p=1134
lirmont this is beautifull!!!!
QuoteI've mostly worked with SVN, but I've used git a little bit. There are a few things I haven't quite figured out or that work differently than I'm used to. I saw that I now have access to the github repo so I'll attempt to check some stuff in soon - Let me know if I break anything :-)

The best ressource to learn git: http://progit.org/book/
The main difference with SVN is that git is decentralized. When you clone a repository, you get all the history and not only the code. This allows you to commit/checkout on your local repository while not connected to the net, let's say in a train trip. Then when you get an internet connection you can push all your commits to the remote repository. git has branches. you can create as many local branches or remote branches, they keep a group of commit away from the rest. Many people use them for feature development. They create a local branch for the new feature they want to develop, commit, commit, commit, finally push them on a new remote branch, and ask the maintainer to merge this new branch to the main branch (called master). However with github people prefer to fork the entire repository in their personal account and ask for the merge using github web interface. We have to choose one of these workflow and stick to it.

QuoteMy next steps I think are learning a little more about python and the best way to structure our files so that we can keep shared code between the client and server in one place and also the most efficient way to start breaking the client main.py into separate logical files.

Very good choice to start contributing!

Thanks a lot.
Tethical / Re: Programmer Here - Where can I help?
April 26, 2012, 03:19:02 am
Do you know how to work with git?
Tethical / Re: Programmer Here - Where can I help?
April 24, 2012, 05:49:06 am
It's ok for now to have what github provide just for us, developers. The project is too young for us to provide serious support, nobody uses it except us.
I start filling the github tracker with few tokens.
I ask ET on IRC to make both of you moderator on the forum.
Tethical / Re: Programmer Here - Where can I help?
April 24, 2012, 04:43:11 am
Ok very good. Your profile is great and I liked your portfolio too.

I totally agree for the TODO list. I registered tethical at http://lighthouseapp.com/ but it is not free if we have more than 2 members in the team. Few monthes ago, we used to put our bug reports and feature requests on github https://github.com/Kivutar/tethical/issues?direction=desc&sort=created&state=open . It's a pretty minimal UI to manage bugs. What do you think of it? and you @lirmont? and @Lijj if you read this topic?
Tethical / Re: Programmer Here - Where can I help?
April 23, 2012, 03:15:58 am

Hi CoderBrandon. Welcome and thanks for your help proposal.
We have a long todo list, wich is still in our head (yeah, I'm not a good project leader xD).
Well.. it depends on your skills and what you like in game development. Please tell me more of that you know and like.

For example:
- Have you played FFT?
- Do you know FFT internals?
- Do you know ASM?
- Do you know 3D?
- Do you know design patterns?
- Are you an artist?
- When you read tethical code, do you understand it?
- Are you interested more in building the engine to create custom games or to emulate fft closely?
- etc

Here are the parts of tethical, and who participated to the code:
- Game Client (me & lirmont)
- Game Server (me)
- The database (lirmont)
- The Control panel (lirmont)
- Migration scripts (me, lirmont, and the ffh guys)

State of the project:
I almost stopped to code for 7 monthes, the client, the server and the migration script have not changed since this time. Lirmont developped the database and the control panel during this period. The server and the database are not yet linked, this is the next big step, and it is hard to do (well).
Pretty much everything is unfinished.

Please read the code and tell us more about you. You can also meet me on IRC.
Tethical / Re: Installation instructions
April 18, 2012, 05:09:33 pm
Thanks. You can try joy2key to emulate the joypad support.