Preliminary Native OSX version

All your MAngband related technical questions answered. Problems compiling or running the game/server? No problem! Ask here.
Post Reply
silicontrip
Human Zombie
Posts: 28
Joined: Sun 12.12.2010, 23:26
Location: Melbourne, Australia
Contact:

Preliminary Native OSX version

Post by silicontrip » Thu 10.02.2011, 05:32

Hi All,

I've completed a pre-alpha version of a Carbon Quartz native OSX mangclient.

Unfortunately the Input_loop (in c-init.c) chokes the Mac event queue and it has trouble receiving keypresses and menu selections.

Image

Oh and I have to work out some suitable characters for the font-mac.prf once the event queue issue is resolved.
If any Mac developers want to help test and resolve this last issue, it'd be greatly appreciated.

Mark
--
Project Mangband OSX Carbon Developer.

silicontrip
Human Zombie
Posts: 28
Joined: Sun 12.12.2010, 23:26
Location: Melbourne, Australia
Contact:

Re: Preliminary Native OSX version

Post by silicontrip » Thu 10.02.2011, 23:11

I have another screenshot showing the multiple windows.
Image

It appears to be half cut off. The image is here:
http://silicontrip.net/~mark/images/Tra ... lient2.png

This version is just playable, but has screen update problems, and frequent crashes.
If you'd like to test and help debug it please contact me.

Also, is there a better place for these sort of announcements?

Mark
--
Project Mangband OSX Carbon Developer.

User avatar
Flambard
King Vampire
Posts: 258
Joined: Wed 20.06.2007, 10:49

Re: Preliminary Native OSX version

Post by Flambard » Fri 11.02.2011, 09:09

silicontrip wrote:Also, is there a better place for these sort of announcements?
I'm afraid not. But make no mistake, everyone is speechless :) Carbon client is like an old-time unfeasible dream for us, we're scared it might vanish again :)

silicontrip
Human Zombie
Posts: 28
Joined: Sun 12.12.2010, 23:26
Location: Melbourne, Australia
Contact:

Re: Preliminary Native OSX version

Post by silicontrip » Sat 12.02.2011, 05:56

I am trying to make the most minimal changes (aiming for none) to the base mangband code.
I've taken the main-crb from angband 3.0.8 and made needed changes. It seems to bolt on quite nicely. Apart from the differences between Angband and MAngband, the input_loop in MAngband appears to choke the Mac's event queue so keypresses and menu commands don't work too often. I've also tried to put the input_loop in a different thread, but this breaks screen updates.

Any other solutions would require changing the mangband base code too much.


These has been the mangband changes so far, but I'll be able to move them back into main-crb:

c-files
Change to parse the V colour entries, again.

c-init
Change to SetTimeout value (to hopefully wait long enough to catch the events)
Added initialize_all_pref_files and update_color_info
Moved the #endif around the localhost server_name check

c-inven
Added an undef to verify. I have no idea what part of Xcode is defining it.

variable
added arg_graphics and arg_sound
--
Project Mangband OSX Carbon Developer.

User avatar
Flambard
King Vampire
Posts: 258
Joined: Wed 20.06.2007, 10:49

Re: Preliminary Native OSX version

Post by Flambard » Sat 12.02.2011, 09:12

I am trying to make the most minimal changes (aiming for none) to the base mangband code.
Thanks. In ideal world any new main-xxx would just work, but in reality some changes are often required. Pinpointing those critical places is also an important task, as we try to do away with them.

I'm pretty sure other clients exhibit similar behavior in terms of OS event queue interaction, I definitely remember some hackish work-around being used in SDL client for example (maybe it's the other way around and is the reason why sdl client is slow on OS X).
Any other solutions would require changing the mangband base code too much.
Some of the needed changes you mention already exist in trunk, afaik. Also, changing base code might not be such a bad idea for trunk, given it makes code cleaner.

Oh and find that IRC client already! :) Anticipation is killing the team :)

silicontrip
Human Zombie
Posts: 28
Joined: Sun 12.12.2010, 23:26
Location: Melbourne, Australia
Contact:

Re: Preliminary Native OSX version

Post by silicontrip » Sun 13.02.2011, 22:07

Some of the needed changes you mention already exist in trunk, afaik. Also, changing base code might not be such a bad idea for trunk, given it makes code cleaner.

I would propose making receiving network packets an event (similar to keypress)
Having the client stop and simply wait for an event would help implementation on recent OSs. I know that Angband came from the old school of VT100 terminals where doing nothing but wait on a response from the user was normal.
Oh and find that IRC client already! :) Anticipation is killing the team :)
I had but it might be my timezone differences. No one was on the channel when I checked. I've noticed our posts seem to be a very different times.
What times (and timezone) are you on?
--
Project Mangband OSX Carbon Developer.

Billsey
King Vampire
Posts: 272
Joined: Sun 12.02.2006, 14:36
Location: Oregon, USA
Contact:

Re: Preliminary Native OSX version

Post by Billsey » Thu 17.02.2011, 02:42

I'm on west coast US time, Jug is on GMT or close to it, Warrior is an hour or two east of him and Flambard is on Moscow time. You can expect any of us to be potentially active anytime between morning to late night, except Flambard who's been known to work though to tomorrow noon on occasion. :-)

Chat and ye will be heard, even if not answered. :-)
Mangband Project Team Member

silicontrip
Human Zombie
Posts: 28
Joined: Sun 12.12.2010, 23:26
Location: Melbourne, Australia
Contact:

Re: Preliminary Native OSX version

Post by silicontrip » Thu 17.02.2011, 04:34

I've managed to make a playable version.
I did have to put some Carbon event processing stuff into Input_loop though.

It's playable and it doesn't crash when the window is moved or the font is changed. I've only tested it on my Macbook pro, not my G5 machine yet.

I've currently put it here: http://silicontrip.net/~mark/MAngclient.tar.gz
It still needs more work. I know that there are a lot of things that aren't working.

I've been sitting on irc on and off for the last few days and only have seen nopaste and Kurzel, on the channel. Am I in the right place?

Mark
--
Project Mangband OSX Carbon Developer.

silicontrip
Human Zombie
Posts: 28
Joined: Sun 12.12.2010, 23:26
Location: Melbourne, Australia
Contact:

Re: Preliminary Native OSX version

Post by silicontrip » Thu 17.02.2011, 04:48

When I said playable I meant, playable as long as you don't do certain things :-)
--
Project Mangband OSX Carbon Developer.

Billsey
King Vampire
Posts: 272
Joined: Sun 12.02.2006, 14:36
Location: Oregon, USA
Contact:

Re: Preliminary Native OSX version

Post by Billsey » Thu 17.02.2011, 05:28

silicontrip wrote:I've been sitting on irc on and off for the last few days and only have seen nopaste and Kurzel, on the channel. Am I in the right place?

Mark
I currently see Billsey, Flambard, Jug-, mangband, and Warrior on #mangband-dev. (The - in Jug- means he's AFK)
Mangband Project Team Member

User avatar
Flambard
King Vampire
Posts: 258
Joined: Wed 20.06.2007, 10:49

Re: Preliminary Native OSX version

Post by Flambard » Thu 17.02.2011, 18:55

silicontrip wrote: I've been sitting on irc on and off for the last few days and only have seen nopaste and Kurzel, on the channel. Am I in the right place?
Mark
Not really, it looks like you're on perl.org, which is long abandoned (where did you get the address? We shall update any links pointing there).. We're residing on freenode.net now.
When I said playable I meant, playable as long as you don't do certain things :-)
That's "playable" in my book :) I've downloaded tar.gz for preservation, thank you.

silicontrip
Human Zombie
Posts: 28
Joined: Sun 12.12.2010, 23:26
Location: Melbourne, Australia
Contact:

Re: Preliminary Native OSX version

Post by silicontrip » Fri 18.02.2011, 03:52

Not really, it looks like you're on perl.org, which is long abandoned (where did you get the address? We shall update any links pointing there).. We're residing on freenode.net now.
That would explain it. I got the link from the Mac developers wanted post. Yeah I know it was posted there in 2007. If I see any other references to it I'll let you know.
That's "playable" in my book :) I've downloaded tar.gz for preservation, thank you.
I've fixed a few of the small problems with that version.
  • Now able to change the font in the other terminal windows.
  • The server list doesn't erase when you re-activate the window. Before choosing a server to play on.
I guess I should start keeping version numbers myself.

I've seen another place in c-util.c (inkey_aux) where I'll need to put some carbon event handling code.
The code is pretty clean, additional 7 lines and can be wrapped in a #ifdef

Mark
--
Project Mangband OSX Carbon Developer.

silicontrip
Human Zombie
Posts: 28
Joined: Sun 12.12.2010, 23:26
Location: Melbourne, Australia
Contact:

Re: Preliminary Native OSX version

Post by silicontrip » Tue 22.02.2011, 20:50

I have a screen shot of all the (256) characters that display with the default font.
I was wondering if I could get feedback on what characters I should use. Like the X11 version has continuous solid walls, and has a diamond character for buried treasure.

I've picked E1 for floor and invisible traps.
I've picked A5 for permanent walls. (originally only for testing but my son liked the graphic)

Image

Any suggestions?
Mark
--
Project Mangband OSX Carbon Developer.

Post Reply