Author Topic: Mac Planeshift  (Read 2057 times)

Aruneko

  • Hydlaa Citizen
  • *
  • Posts: 333
    • View Profile
Mac Planeshift
« on: December 11, 2002, 11:15:07 pm »
The developers have said that they were only waiting for someone who could port something or other to the Mac.  I want to ask them what they would call this, uh, \"skill\" I guess.  For example, it could be HTML or Unix (not really, but these are examples.)

I want to know, so that if I see anyone who can do it I can request their help.

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #1 on: December 12, 2002, 01:28:19 am »
C++ and Mac system programming API.

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
What needs doing
« Reply #2 on: January 05, 2003, 08:21:29 pm »
I can help out with MacOS X porting; though I\'ve no interest in doing OS 9 stuff if you\'re looking for Carbon folk.

What needs doing, and how does one get involved?

Aruneko

  • Hydlaa Citizen
  • *
  • Posts: 333
    • View Profile
(No subject)
« Reply #3 on: January 05, 2003, 09:12:05 pm »
What?!?  You can???

YES!!!  *does a little dance*  Thank you Thank you!!!!

Don\'t worry, no OS 9 needed.
Contact the developers to get all the stuff you need.  They\'ll get you set up. :D  :D  :D

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #4 on: January 05, 2003, 10:33:58 pm »
Lightyear, the first step will be for you to get Crystal Space (our 3d engine) downloaded, compiled and running on your Mac.  (OS X only).  It does support Macs and other people are using it there, so it shouldn\'t be too bad.

When you have that working, let us know and we\'ll help you with the Planeshift part of it.  Planeshift already runs on several platforms so it shouldn\'t be too bad to port, but it just has to be done.

Thanks for offering to help. :-)

- Vengeance

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
(No subject)
« Reply #5 on: January 06, 2003, 11:40:25 pm »
Alright; I\'ll have a go at knocking everything together tomorrow (I\'m pulling a sickie, I\'m not feeling well.)

As a note, development platform:
- Dual-Processor 500MHz G4 768M + Radeon 8500
- TiBook 500 512M + ATI Rage 128

Both running 10.2.3; which means I\'ll be testing under OpenGL 1.4.


Before I get neck deep, how\'s about a warning on a few theoretical issues that come to mind:
 - Has anyone ever run this thing on a more-than-one-CPU system?  Is it monolithically threaded?
 - Has anyone ever used CrystalSpace or your game under GL1.4?
 - Are there any unusual GL extensions in use, such as NVidia- or Radeon-specific GL exts?
 - Texture compression in use?  I\'m asking specifically \'cuz that\'s new in 10.2.3 and I\'ve never used it before.

I\'ve got the various GL bibles handy if they\'re needed, but they\'re a bit old - 1.2ish.  Should be fine unless something really bizarre happens.


I\'ll give a whack at getting everything going tomorrow, as I said - but I wouldn\'t mind a heads up on anything anyone thinks I might immediately get blocked by, or major issues people forsee.  Where possible, I\'ll try to stick to any open source libraries in use; things like OpenAL and SDL are already ported.


Also a sidenote:  while I note that CrystalSpace is indeed ported to OSX using the cocoa apis, I do also wonder whether or not anyone has ever ported, or whether there\'s anything other than a standard C++ compiler needed to port, the CEL entity layer; is that just straight cross-plat C++ code?

Thanks; more tomorrow.

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
(No subject)
« Reply #6 on: January 07, 2003, 12:11:30 am »
Sidenote - I\'m grabbing top-of-tree CS, as it might be worthwhile to do so; tell me if it really should be .94.

Also noted that with the new modifications, CS for MacOS X has become a first-class port; happy to see that at least getting the CS engine up and running is probably not going to be a problem.

Pulled out of CVS for a bunch of stuff; please add SourceForge user gblock to the project; I\'m also one of the mutella maintainers.

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
(No subject)
« Reply #7 on: January 07, 2003, 12:15:41 am »
And I assume I need libpng and libjpeg support in Crystal?  Is there a build FAQ somewhere?  :)

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
(No subject)
« Reply #8 on: January 07, 2003, 12:33:32 am »
Last sidenote.  Crystal Space is compiling; I\'ve grabbed those libraries and built them, and it\'s in the throes of building all the tests, unit tests, and bits and bobs.  Must say, while I\'ve looked at the CS website several times, I\'d never imagined it was quite as complete as the compilation process would lead me to believe it is now.  I\'m impressed.

Anyways, off to bed; CS will have completed building by the time head hits pillow; I\'m in London, in UK time, and I\'ll start working on getting compilation of non-CS bits starting tomorrow morning, around 9ish.

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #9 on: January 07, 2003, 02:40:12 am »
Yes you need the latest and greatest CS cvs.  Most of us update it close to daily.

The people added to the CS project are those with write access to the repository and are a fraction of the actual people using CS in their projects.  If you get more heavily into actual CS development, Jorrit can add you.

After you do CS, you will need to build CEL--another SF project.  It is much smaller.  Ignore the python module.  It is not maintained and not needed.

After that checkout PS (just the Planeshift module) and see how much of it you can get built.  The things I *know* won\'t work for you are the threading and mutex calls, because they are entirely platform-specific, although the linux versions may be close to what you need.  You may need to create a new subdirectory under /planeshift/mk for your platform.

Nice work today.  I\'m very impressed. :-)

- Venge

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
(No subject)
« Reply #10 on: January 07, 2003, 08:53:37 am »
10.2 has most of the posix threading and mutex stuff in now; unless you\'re using some of the more funky stuff that they haven\'t gotten around to getting Mach to provide yet, I hope to not have problems there.

Matter of fact, they even fixed my open bug, and implemented pthread_attr, pthread_condattr, pthread_cond, and pthread_rwlock in completeness; no, I don\'t think we\'ll have a problem with that.  :)

Is stuff like swig actually used in the build?  It strikes me that I\'m building a whole lot of stuff into CrystalSpace, and no idea whether we\'d actually want any of it in shipping product; is there a definitive CS-for-PS description of which bits should be compiled in and which left out?

(Duh; I just ran into the install instructions.  Always check for a docs directory)

Right.  I\'ll report back in two hours with how far I\'ve gotten; I hope to have gotten through at least the core build and setting up the CS db.

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
(No subject)
« Reply #11 on: January 07, 2003, 09:04:15 am »
(sidenote - the dev add request is for PlaneScape, so I can check in OSX mods.  :)

Happy to generate patches for you if you prefer.

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
(No subject)
« Reply #12 on: January 08, 2003, 03:50:07 pm »
Status report:

Preparation:
 - Mac users must set up a more current version of jam than is available from the dev tools.  I advise installing from Fink (\"fink install jam\") which will go and build a 2.4 version of jam.
 - PlaneShift requires libogg and libvorbis.  Again, \"fink install libogg\" and \"fink install libvorbis\".
 - PlaneShift requires the freetype2 font library to be built and the associated CS plugin.  Again, \"fink install freetype2\" will get you a working version of that library.
 - PlaneShift will also require, in all likelihood, a top-of-tree libtool configured for building mac dynalibs.  I\'m using the \"fink install libtool14\" at the moment, and will drop back to shipping libtool once I\'ve figured out all of the problems.
 - Install the December 2002 dev tools from Apple; this contains the most recent gcc 3.1 toolchain.
 - A server build of PlaneShift will require mysql.  Since the network code doesn\'t negotiate endian-ness, you\'re going to have to run a server as well as the client, so be prepared to have this.
 - Also note that shortly, evidently, you\'ll need python installed; not the Apple-shipped one either, but a proper python build from more recent deliveries.  You\'ll also need swiv.  Both are available on fink, but fink also wants to build swiv support for ruby, tcltk, and a handful of other scripting languages, so Buyer Beware on using fink\'s swiv install.


Progress:

CS: CrystalSpace compiles without *too* many problems.  In order to build components, the standard CS build needs to be done, with the addition of two components.  The following problems were encountered:
 - CS doesn\'t seem to deal well with additional paths being added, and makes some assumptions about where the freetype2 paths are.    At some point, I will make some changes to the build process to pick up and remember the paths that were given to it on flags lines, and pass those on into the cs-config command line.  This means making the values of CFLAGS, CXXFLAGS, and LDFLAGS \'sticky\' and stored into the makefiles as well as the cs-config script which will pass them on to other dependent builds.
 - Don\'t forget to build those extra plugins.  You can always do it later, but what a task.
 - Do use \'configure\'  and not \'make macosx\'.
 - Dependent projects *need* the ability to get the required link lines needed to produce a binary, shared library, or module on a given system.  Currently, CS knows this, but doesn\'t pass on the link information.  If it told us this, we could rely on CS to correctly tell us how to build a plugin for CS.  This means extending cs-config to provide ld-flags for a binary as well as ld-flags for a plugin.

CEL: CEL\'s build process isn\'t quite there yet.  Some modifications were made to the linker lines so that MacOS X modules get built correctly; however, a bug in TOT CS means that the cs-config isn\'t passing in the -framework LD flags properly.  For now, hack cs-config; hopefully, the cs-config script will get fixed to include these flags, as well as the aforementioned cflags/ldflags  However, once that modification is made, CEL will happily ./configure and run.

PS: PS has needed a multitude of small fixes, mostly to the location of headers (which is different on BSD from Linux platforms in some cases) as well as one or two places where Linux-specific flags are used.  Those changes, I believe, are already in TOT ps.

The greater problem with PS at the moment is, as it is a libtool based build, the building of the dynamically-linked plugins is currently failing; libtool isn\'t able to provide a dynamic link library where you are linking against .a files that weren\'t built by libtool initially.  I\'ll get around this by changing the build system to build temporary libtool archives of the core CS libraries, which should fix the problem.  However, the greater problem remains that we can\'t use the information from the CS build to find out how to build a plugin; and it would be better if we could reuse that information and leave it to CS to figure out how to build those plugins in the first place.  Alternately, I could build and link the whole lot statically, and build CS and CEL as static libraries.  Neither really matters a whole lot.


What\'s working:
The whole thing builds, basically, and you can run all tests in CS.  CS performance on my DP500 Radeon 8500 system is *not* brilliant, and I\'m not sure why; it\'s dropping to software, using something that isn\'t supported in the 8500 hardware.  I\'ll have a whack at looking at the OpenGL profiler tonight and see if I can see where we\'re using an unsupported GL extension.

CEL\'s celtst runs.  It isn\'t building a .app, but frankly, who gives a damn.  Run it from the commandline.  :)

PlaneShift\'s pssetup script is horribly broken, and missing support for the mac bundle identities; I\'ve cleaned it up and added support.  Once you run that, it happily runs the ps setup tool that lets you choose your resolution, and decide whether or not you want music and/or sound.

However, psclient cannot start up with its plugins statically linked to a dyna-linked CS/CEL installation.  Until I solve the build problem preventing dynamic linking with libtool when linking to .a files generated by CS, we\'re stuck here.

Server starts up.  Obviously can\'t test it.


That\'ll have to do until tonight, when I have a chance to look further.

Vengeance

  • Veteran
  • *
  • Posts: 1452
    • View Profile
(No subject)
« Reply #13 on: January 09, 2003, 04:55:39 am »
The endian-ness issue needs attention before MB is released.  We obviously want Mac users to be able to play with everyone else on the same server.

CS provides a function (I think called convert_endian() ) which handles this for CS file formats and other things.  We can use that in our message building to do the same thing.  Most of our messages are ASCII anyway, so not many will require fixing.

Let\'s talk about this the next time we run into each other on irc.

Thanks, you\'ve been doing amazingly well, and soon thousands of Mac users will thank you. :-)

- Venge

Lightyear

  • Traveller
  • *
  • Posts: 25
    • View Profile
Possible short-term solution to build problem...
« Reply #14 on: January 09, 2003, 05:58:27 pm »
If you manage to catch the Mac CS guy whose name I\'ve completely forgotten, can you ask him if he\'s built in any way of getting CS to build its main $CRYSTAL/lib libraries as dylibs/shared objects?

I was sitting here thinking a little while ago, a first for me today (I\'m on what seems to be permanent bug duty here at Sony; I just got stuck with another month and a half of running the bugfix team)...

Mac libtool14 is currently having a problem linking the .a\'s into the planeshift plugins; if those CS libraries were built as shared libraries, it would mean they\'d be in a format where I wouldn\'t be getting this error, and the build system would likely work without messy modifications.

If this gets solved in CS, it makes our life easier, and means that we support non-statically-linked engine libraries.  Not necessarily a bonus, but probably not a hindrance.

If I can figure out how to get CS to build shared, that would let me move on to other things until the libtool guys or Apple manage to sort out the bugs in libtool on OSX.