Miscellaneous developer notes pertaining to mactrek
Below are some excerpts from traffic on the netrek-dev mailing list. Perhaps the basis for some FAQs.
Other clues about mactrek behaviors can probably be gleaned from the bugtracking system on sourceforge. (insert url here...)
local server packaging
From: Narcis To: netrek-dev Date: Thu, 26 Oct 2006 20:21:08 +0200
- Zach wrote in astonishment: "wow how did u setup local server packaged with the client and get it working?"
Hi Zach, well the server is simply compiled the normal way and is stored under /usr/local/games the tricky part was including the dependend package that are not natively on tiger within the deployment. The client simply checks if it can find the dir and launches the server as a seperate NSTask, you can even create additional robots, but they run just as they would from the commandline. They are simply wrapped in an NSTaskWrapper which monitors the processes. I did notice that the client does not always close the server, resulting in a very long time robots fighting other robots. (They had reached commander by the time i got back
coding platform and codebase
From: Narcis To: netrek-dev Date: Sat, 28 Oct 2006 10:36:43 +0200
[...]
- "Is the source available? I'd feel more comfortable if I could make a debug build I can step through. Did you use Xcode? autofu? I found autofu so painful on OSX that I gave up porting COW to OSX."
[...]
It's Xcode, and not a port of COW but of Jtrek (well that was based on COW too) it's re-written in Objective C and beyond the handling of the communication i doubt if you recognize anything from COW
Could Mac Trek be ported to linux?
From: Narcis To: netrek-dev Date: Tue, 31 Oct 2006 22:41:29 +0100
[...] In theory it could be compiled on Linux too. The nextstep frameworks are open source, i would probably need to rewrite mayor parts using only the constructions available in that frame work...
I'll leave that as an excercise
From: Narcis To: netrek-dev Date: Wed, 1 Nov 2006 20:44:12 +0100
[...]
- "Yeah this client looks cool. I wish there was way to compile it for Linux! Is there any way to get the code working in Linux?"
Well it rests on top of Cocoa (Mac OS X), which means that many functions are specific to that framework, but Cocoa is based on nextstep which is now openstep. The gnu compiler supports it, it is just that apple added many many things to Cocoa which may or may not be in openstep. Most notably the Aqua server which is ... well neutrally put.. different from X11. I think it will be a very large port action and the code was my first large Objective-C project, so not really that clean.
The ideas to learn would be - seperation of drawing and communication. - menu structure seperate from game screen - flexibility only for expert users, (currently only in source code) - must run out of the box - scroll function (though this leads to a projection of the gamegrid to the display that is variable.)
I believe that it is quicker to create a KDE or Qt application, embed the communication from COW in a thread and use signals and threads to implement the above on gui level.
porky?
From: Narcis To: netrek-dev Date: Mon, 13 Nov 2006 19:44:51 +0100
- Zach pondered "27 MB for a netrek client. Wow that must be a new record ;-)"
Yes, mainly because the game does not uses a fixed resolution. Everything is stored in the game grid and then projected with a variable scale factor to the screen. This mean that a ship is still 40x40 ? in the game grid but may be smaller or larger then 40x40. The source bitmaps are therefore quite large
Also the theming allows for multiple sets of sounds (2 included), all required frameworks are static and macos binaries are actually a PPC and intel bineary glueed together.
The bitmaps should also be reusable for NetrekXP since the have the same format......