Page 1 of 1

Proposals

Posted: Tue Jun 03, 2008 5:33 pm
by milipili
Hi everyone !

After a long period of inactivty, I am back to port TA3D to OS X !
I have a few idea to discuss with you :

- CMake to replace Autotools
http://www.cmake.org/HTML/index.html
Easy to use, generate Makefiles, Visual Studio / XCode (OS X) projects

- A mailing list
Easier than a forum

- Doxygen for code documentation
http://www.stack.nl/~dimitri/doxygen/

- Trac
http://trac.edgewall.org/
For bug tracking and project management

- The Boost library
Mainly For multithreading in the case of TA3D

Posted: Tue Jun 03, 2008 7:44 pm
by zuzuf
Hi,

good to see you back :wink: !

CMake looks interesting, I'll try it this week end :D !

Of course a mailing list would be faster than our forums, but a forum shows things to everyone whereas a mailing list doesn't, so it might not be good to attract people unless you want to use it for things that specifically concern developers/testers.

As far as Doxygen and Trac are concerned, I think we need a more efficient way of tracking bugs than a forum and the code cruelly needs documentation.

Although boost is a good library, I don't like the idea of rewriting something that already works well, unless we can improve it that way (I don't know what boost can do, I only know it by name).

Posted: Tue Jun 03, 2008 7:50 pm
by milipili
If you need any help, you can contact me. :)

Posted: Tue Jun 03, 2008 8:00 pm
by milipili
Actually, boost 1.35 have a powerfull thread implementation, more efficient than Critical sections. This library has also a network implementation. However, it is only an idea, and I agree, if it works well, no need for changes.

In the same way, I have a quite complete library for logs, if you need another one :
http://svn.shikami.org/logs (it requieres pthread even under Windows but it can be improved)

Posted: Tue Jun 03, 2008 8:50 pm
by zuzuf
our logging system could be improved. Currently there are 2 systems, the Console object which is thread safe, and an other one, using exception which isn't thread safe. In fact both can interfere and try to access the log file at the same time ... Also the later uses exceptions which doesn't help debugging since errors aren't caught by debuggers. I started writing a small backtrace module that print a small message telling the program has crashed and write the call stack to a file, so we can see where it crashed and try to guess why.

Also we could do much easier in C++ using constructors and destructors. Currently the Guard/... system that uses exceptions isn't very programmer friendly since you must put a EnterGuard() at the start of functions you want to monitor, and LeaveGuard() at the end (or before any return !!). Whereas a simple object could be created at the beginning of the function and be destroyed automatically when it returns ... it doesn't use exceptions and if it crashes we can still write things to the log file if we catch the signal.

When we need to output some logs we should use the Console object once it has been created because we can read the last few log lines from the game, if Console is NULL then we should write directly to the log file ... and the way we do it may change when we'll rewrite that.

PS: I like your LOG_LEVEL idea :D

Posted: Tue Jun 03, 2008 9:42 pm
by milipili
The given lib is thread-safe, and used by a few projects and products. For information the output is not buffered and will never be.

I don't understand why you need a backtrace module since your GDB provides it. Moreover, it is not the work of the app to provide such a thing, and may not be reliable (I tried once before).

Do not forget signals and multi-thread are not good friends and you should manage signals into a separated thread.

I not often use Exceptions since my GDB is here for them

If you have proper logging, a backtrace should be nearly useless, or the bug easier to reproduce at home.

I don't see any asserts in the code (only in lua and allegro). May be it would be a good idea in the same time.

Posted: Tue Jun 03, 2008 9:48 pm
by milipili
For a mailing list, an web archive is possible when ezml (http://ezmlm-www.sourceforge.net/ for example), which can be consulted by every one.

Posted: Tue Jun 03, 2008 11:21 pm
by zuzuf
the backtrace is useful when you don't run TA3D through gdb ... end users don't want to run it through gdb, testers often don't know how ... so it's useful not for developers but for others :). (And also sometimes I just want to play it, and don't run gdb ... and sometimes it crashs :( ).

it's late, I'll see that this week end, good night :)

Posted: Fri Jun 06, 2008 10:18 pm
by zuzuf
I've made a few test projects to try CMake. It's really a powerful tool, but it won't be so easy to create the instruction files to build TA3D with it. TA3D includes several libraries that we'll have to include into the CMake build process. Also I don't know how to check for Allegro with CMake :( . I'll keep trying since it'll be very useful to build packages easily for every platform :) .

Posted: Fri Jun 06, 2008 10:36 pm
by milipili
Here is your new bible :)
http://www.cmake.org/HTML/cmake-2.6.html



Check for a single library (extracted from FindThreads.cmake):

Code: Select all

CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
IF(CMAKE_HAVE_PTHREAD_H)
    ....
ENDIF(CMAKE_HAVE_PTHREAD_H)

Check for includes :

Code: Select all

CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SPROC_H)
Here is a working example for PThread

Code: Select all

include_directories(${PTHREADS_INCLUDE_DIR})
IF(WIN32)
    FIND_PACKAGE(PThreads)
ELSE(WIN32)
    FIND_PACKAGE(Threads)
ENDIF(WIN32)
IF(CMAKE_USE_PTHREADS_INIT)
    MESSAGE("The PThreads support has been enabled")
    # Fixed linking under Linux
    IF(UNIX)
      IF(NOT APPLE)
        LINK_LIBRARIES("-pthread")
      ENDIF(NOT APPLE)
    ENDIF(UNIX)
ELSE(CMAKE_USE_PTHREADS_INIT)
    IF(!PTHREADS_FOUND)
        MESSAGE("[!!] The pthread support is required")
    ENDIF(!PTHREADS_FOUND)
ENDIF(CMAKE_USE_PTHREADS_INIT)
For boost :

Code: Select all

FIND_PACKAGE(Boost)
IF(Boost_FOUND)
    MESSAGE("The boost library has been found")
    IF(WIN32)
        INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}/..)
    ELSE(WIN32)
        INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
    ENDIF(WIN32)
    LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
ENDIF(Boost_FOUND)

Here is a common code I always use :

Code: Select all

IF(APPLE)
    # Avoid visibility issue under OS X Leopard
    ADD_DEFINITIONS("-fvisibility=hidden")
ENDIF(APPLE)

IF(UNIX)
    IF(APPLE)
        SET(GUI "Cocoa")
        ADD_DEFINITIONS("-DDARWIN")
    ELSE(APPLE)
        SET(GUI "Linux X11")
        ADD_DEFINITIONS("-DLINUX")
    ENDIF(APPLE)
    ADD_DEFINITIONS("-DUNIX")
ELSE(UNIX)
    IF(WIN32)
        SET(GUI "Win32")
        ADD_DEFINITIONS("-DWINDOWS -DWIN32")
    ELSE(WIN32)
        SET(GUI "Unknown")
    ENDIF(WIN32)
ENDIF(UNIX)
MESSAGE("Target GUI : ${GUI}")
For information, KDE now uses CMake.

Enjoy :)

Posted: Fri Jun 06, 2008 10:47 pm
by milipili
If you did not know about CMake, may be you don't know about SCons (python). You can try it if you want. However, even if we first used Scons to compile our projects, we now use CMake, most efficient than SCons.

Posted: Fri Jun 06, 2008 10:59 pm
by milipili
It is a hard work to change the build environment. However I think it could be a good thing. I may help you to write CMakeFiles if you decide to use CMake. Anyway I will have to make some changes to compile under OS X.

Another point, you don't use trunk/branches/tags in the svn ?

Posted: Fri Jun 06, 2008 11:10 pm
by zuzuf
no we don't use trunk/branches/tags in the svn, maybe it's time to start using them now :)

Posted: Sun Jun 08, 2008 3:30 pm
by AF
I tried looking at bug trackers for AFLobby and NTai on darkstars a while back, and came upon mainly mantis and Trac. Trac looked vastly superior if not for its suprior aesthetics so I chose Trac and attempted to install it.

Suffice to say my attempt was an utter failure.

So I installed mantis at http://mantis.darkstars.co.uk and started to use it. Its not exactly pretty, lacks theming support and is full of masses of controls and options. Ideally I'd like it if I could install Trac and Id appreciate any help figuring out how to install it.

Posted: Sun Jun 08, 2008 3:34 pm
by milipili
Trac is far better than mantis, and more completed too.

Posted: Sun Jun 08, 2008 8:37 pm
by AF
I agree and Ive been testing the last few hours and finally got a trac install at http://trac.darkstars.co.uk

I may be able to setup a second site for trac.ta3d.darkstars.co.uk

If you'd prefer http://ta3d.darkstars.co.uk/trac/ then youll have to set it up as your under a different username and cant use my install.

Here are the instructions:
http://natmaster.com/articles/installing_trac_0.10.php

note that I had to go out and find an alternative download location for swig, and the step involving compiling subversion failed due to now apache portable runtime installed, however you can skip the subversion installation step.

I would also install the plugins and use them to register a new account. Then go back tot he shell and change that account to an admin account.

Once you have trac installed and a single site setup it should be easy to create a second trac site somewhere.

Im sure your username for hosting has fast cgi setup aswell.

Posted: Sun Jun 08, 2008 8:43 pm
by zuzuf
\o/ cool 8) , I'll see that next weel end, currently I can't do anything from university :cry:

Posted: Sun Jun 08, 2008 11:29 pm
by milipili
your instructions seem complicatedto me. I did not do all those things to install a trac. However I don't know your env.

Posted: Mon Jun 09, 2008 2:52 am
by AF
dreamhost requires a little extra to get it to work