Create an account


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mac OS X, NSGL (Cocoa) based port of Nexuiz

#1
Hello, I have started a draft port of the old AGL (Carbon) based code of DarkPlaces to NSGL (Cocoa).

If any Mac developer is interested to help, let me know.

Currently I am moving "vid_agl.c" code to a new "vid_nsgl.m" file. Some agl/nsgl common functions and variables had been moved from "vid_agl.c" to new "vid_mac.h" and "vid_mac.m".
The code base is latest Nexuiz stable (2.5.2), though I think it will be easy to merge it in any SVN bleeding edge release.

The code compiles as a Xcode project. I am using Xcode 3.2, though it is easy to setup for earlier versions. Libraries are taken from Nexuiz installation, but I have Xcode projects to compile them from source code, eventually.

The attached document does not contain the DarkPlaces sources (to save space), you must relink them inside the Xcode project. It is a quick operation, since you can select all the missed files and choose the darkplaces source directory in your disk to relink in a single step.

Currently this project gives some linker errors. But in the past I have been able to compile DarkPlaces in Xcode, so I am confident it can be done easily.

"vid_nsgl.m" already has a draft implementation of VID_InitMode() function that actually creates the OpenGL pixel format, the context and the game window or the drawable where OpenGL draws. Essentially it is only required to check correct migration of "vid_agl.c" functions and variables.

Thanks you all.

(I do not want to try Nexuiz forums to search for help because, honestly, I already had a bad impression. Furthermore, the facts that caused the creation of Xonotic make me think that Nexuiz management is really bad.)


Attached Files
.zip   DarkplacesNSGL.zip (Size: 754.54 KB / Downloads: 1)
Reply

#2
Welcome to the community, Ender!

I'm no OS X expert, but I can help testing on a MB Santa Rosa as soon as something is ready.

(05-31-2010, 11:56 PM)Ender Wrote: If any Mac developer is interested to help, let me know.

The best idea to help and to be helped is register over at the development site and start making your own branch (or starting your branch locally and commit when you get acces)

Be sure to check out also how to get repository access to commit on the repository and some other info about git.
If you need help setting up git on OS X, I'd recomment the tutorial at github.

For the important things about your code, I think the main developers may help you Smile

Edit: I get it now, it's the DarkPlaces engine we're talking about... I don't know how it works with the sources, seems a svn-to-git bridge; maybe divVerent could help, I understand most of the commits are from divVerent and Vortex.
Reply

#3
(06-01-2010, 02:23 AM)tankmiche Wrote: Welcome to the community, Ender!

Thank you.

(06-01-2010, 02:23 AM)tankmiche Wrote: I'm no OS X expert, but I can help testing on a MB Santa Rosa as soon as something is ready.

I will take advantage of your help. Thanks.

(06-01-2010, 02:23 AM)tankmiche Wrote: The best idea to help and to be helped is register over at the development site and start making your own branch [...]

I registered now.

(06-01-2010, 02:23 AM)tankmiche Wrote: Edit: I get it now, it's the DarkPlaces engine we're talking about... I don't know how it works with the sources, seems a svn-to-git bridge; maybe divVerent could help, I understand most of the commits are from divVerent and Vortex.

I see. I don't know what to do exactly. For now I will work locally. I am a little worried to "disturb" DarkPlaces developers since I never found a good welcome in Nexuiz community. Though if you (or anybody else) know any Mac developer that wish to give some help, let them know that the work to do is not so much but I am very busy and so, I don't know when I will finish that.
What I mean is that help is welcome to make things faster. But conceptually the port is not so complex.

Thank you.
Reply

#4
I have never developed for mac, but I have used mac all my life, and I am pretty good at figuring things ou in general. I am getting a new computer tomorrow, on which i will be installing xCode, and beginning the process of learning all the necessary things.

but as tankmiche said, i can help with testing and such.

does your name pertain to "ender's game" by any chance?
Master of mysterious geometries

Imgur Gallery
Reply

#5
(06-02-2010, 11:30 AM)theShadow Wrote: but as tankmiche said, i can help with testing and such.

Thank you.

(06-02-2010, 11:30 AM)theShadow Wrote: does your name pertain to "ender's game" by any chance?

Yes. I am a fan of "Ender's Game" and I have some things in common with Ender Wiggins, therefore, I feel very close to the personality of that character.

About the code:
In the past days I went on the IRC channel (the channel where someone told me to go) and I had an interesting conversation (or read only?...).
  1. Someone told me that the channel was not the correct one.
  2. Someone thinks that any effort to make a native DarkPlaces port for Mac OS X should be abandoned. And that it is a waste of time and resources, since Mac Users that play games are 5%, and so on...
  3. Someone does not understand the reason to migrate to Cocoa. Probably they do not know that Carbon (and, therefore, AGL too) are abandoned technology that means: no 64 Bit version; no further evolution of the API (Apple guarantees only bug fix support). Then, it is quickly going to become totally obsolete API.
  4. Someone says that this port is not a Xonotic specific thing.
  5. Someone told me to talk with the DarkPlaces developers to ask suggestions.

Essentially I received almost the same answers that I received when I went to Nexuiz forum to propose the same thing.

So, I am still figuring out what I should do with the code I am writing. If I decide to not keep it for myself only, though, I will probably open a separate project on SourceForge or some similar place.
But I don't know if this is a worth action. Probably it would be better to start something from scratch that is Mac only and that supports Quake configs, maps and models, as I already did with MD5 Reader 2.
It would be a challenging project, but more interesting then opening a project only to port for Mac OS X.

If any Mac User or Developer is interested to discuss this arguments contact me or reply to this post.

Thank you all.
Reply

#6
Id love to see better mac support. personally i cant stand the platform, but thats just me; theres many os's i cant stand. The problem is the same as its ever been tough; no "native mac developer"/s have stepped up and and.. well im not sure what needs doing atm, but im sure theres something. Your port seem to be one such thing. Strictly speaking this is a question for Darkplaces tough (Xonotic does not maintain any special fork/port of dp) Anyways, best of luck with this.
Reply

#7
Thanks for the encouraging words.

(06-03-2010, 03:04 AM)tZork Wrote: Strictly speaking this is a question for Darkplaces tough (Xonotic does not maintain any special fork/port of dp) Anyways, best of luck with this.

Strictly speaking this port is neither for Darkplaces since nobody seems to care it. I have the sensation that a strong developer community, for Darkplaces, lacks on the PC side too and the few developers have no time to care anything.

Though, even if, I am glad that you and other users would support such effort, I am tired to ear/read the same old arguments about Mac VS PC and platform diffusion percentages. It is 20 years that I hear that.
Every time that I propose a Mac port or optimization to an open source project i risk to cause a flame. Undecided
Reply

#8
(06-03-2010, 03:50 AM)Ender Wrote: Strictly speaking this port is neither for Darkplaces since nobody seems to care it. I have the sensation that a strong developer community for Darkplaces lacks on the PC side too and the few developers, have no time to care anything.

Yeh that sums it up preddy well, unfortunately. Lately i think i seen a bit of a rise in the number of ppl contributing engine related code. I hope this "trend" will continue.

Quote:Though, even if, I am glad that you and other users would support such effort, I am tired to ear/read the same old arguments about Mac VS PC and platform diffusion percentages. It is 20 years that I hear that.
Every time that I propose a Mac port or optimization to an open source project i risk to cause a flame. Undecided
Outch, sounds like a pain. I cant speak for anyone else of course, but one thing that buggs me abt dp's mac support is that is supposedly holds/held some wanted features back. Personally, for example, I suggested/wanted threading of some parts of the engine. The reason i was told for it not happening is there was no sane way to make that work on mac (?!). I have a feeling its more in the lines of "theres no one to code that for mac" tough.
Reply

#9
(06-03-2010, 04:09 AM)tZork Wrote: Lately i think i seen a bit of a rise in the number of ppl contributing engine related code. I hope this "trend" will continue.

I hope too. Actually I don't play Nexuiz since 1 year, because on my Mac it sucks.

(06-03-2010, 04:09 AM)tZork Wrote: Outch, sounds like a pain. I cant speak for anyone else of course, but one thing that buggs me abt dp's mac support is that is supposedly holds/held some wanted features back. Personally, for example, I suggested/wanted threading of some parts of the engine. The reason i was told for it not happening is there was no sane way to make that work on mac (?!). I have a feeling its more in the lines of "theres no one to code that for mac" tough.

Your feeling is the right one. At least, partially right.

The complexity is caused by the way Cocoa and other Mac APIs are structured.

The main problem with a Cocoa port consist in adapting the Event Handling architecture of Cocoa applications to the Main Loop driven event handling of Quake.
Essentially Cocoa applications automatically manage Event Handling. Developer has only to subclass NSResponder and implement some methods.
Events are sent to NSResponder objects trough loops that Apple calls Run Loops.
To adapt to DP, developer has to pick events that are in the Cocoa Run Loops. Luckly it is possible to do so (thanks to a method provided by Cocoa), and I have already done such thing inside my own port of Blender/GHOST (still under development, while there is an official port based on Objective-C++).

To use Cocoa threads inside DP would be a little more difficult. It means to change many things inside DP, to make objects Cocoa/Thread safe.

Though to use Cocoa threads it is not required.

The only thing that is "required" is to separate logic/net/phisics loop from drawing loop, to permit smooth sync of the FPS to the monitor refresh rate. If you are running at 150 FPS on a flat monitor with 60 Hz of refresh rate, you are wasting resources to compute 90 frames that will never be seen.

Furthermore such separation would help to resolve some net lag/input lag problems.

Though such separation is very hard to be implemented.
Reply

#10
(06-03-2010, 01:19 AM)Ender Wrote:
  • Someone says that this port is not a Xonotic specific thing.
  • Someone told me to talk with the DarkPlaces developers to ask suggestions.
It IS not a Xonotic specific thing. The Xonotic developers mostly develop Xonotic, the game code, not the engine: The engine code is usually much more complex, and so the Xonotic developers (at least me) don't neccessarily have any clue about what's going on in the engine Smile

Sorry for directing you to the possibly wrong channel (for all others: I told him that in a PM). I didn't know how complex this port would possibly be, and that people in that channel maybe could have had a better clue about the whole thing than me. In other cases they could have directed you to the darkplaces channel instead of starting a flame war. I understand Mac support isn't a priority to the Xonotic developers right now maybe, we have very important things to take care of first (getting a first version of the game out ASAP, anyone? Smile), but obviously, getting this code into darkplaces means Xonotic will automatically support it. Hopefully you'll get the help you need at #darkplaces, irc.anynet.org.
Links to my: SoundCloud and bandcamp accounts
Reply

#11
Welcome to the community Ender! I'm glad to see another Mac user here, and a code developer at that! I have much to learn before I could even think about doing what you're doing at the moment so for now I stick to small stuff (like mapping and music making). If you need a tester I'll be happy to help.

As for these points:

1. Someone told me that the channel was not the correct one. - I think FruitieX covered this, if you're working on DP then the #darkplaces channel would be your best bet.
2. Someone thinks that any effort to make a native DarkPlaces port for Mac OS X should be abandoned. And that it is a waste of time and resources, since Mac Users that play games are 5%, and so on... - As much hate as their is for gaming on Macs, today's gamers would be missing Halo if Mac gamers didn't support Bungie during the days of Marathon and Myth, so whoever told you this can choke on a dick.
3. Someone does not understand the reason to migrate to Cocoa. Probably they do not know that Carbon (and, therefore, AGL too) are abandoned technology that means: no 64 Bit version; no further evolution of the API (Apple guarantees only bug fix support). Then, it is quickly going to become totally obsolete API. - You seem like you know more than I do regarding this, and your comments in parenthesis make that apparent.
4. Someone says that this port is not a Xonotic specific thing. - Yea DP is the basis for a LOT of game projects like nexuiz and xonotic, so changes to the engine will have effects there too
5. Someone told me to talk with the DarkPlaces developers to ask suggestions. - Like FruitieX said above, most of the developers are concentrating on the game code here. They may not necessarily understand engine code in the least.

Thanks again for showing up! I hope we'll all be able to help you help the community!
This is my laser, this is my gun,
This is for plinking, this is for FUN!

BrFJ: wtf with the jumpad
BrFJ: rofl
vael: oh, you'll wtf with the... a few more times don't worry

[Image: badge.png]
Reply

#12
Let me start off with saying that it IS useful that you are looking into a native implementation for OSX, however for the rest of us it is easier to only support SDL for now. I'd very much welcome a proper implementation against the Cocoa libs, but there are few people able to help you with that.

Since Xonotic is using git, and we have branches for darkplaces too (which can be committed back to svn as well), it would be a good idea for you to start pushing your code in a branch there. If needed I could help you tune the makefiles to make it easy to compile your code without requiring a full XCode project.

The real benefit is that people can easily try your code, and working with git also makes it easier for others to contribute work on this. Swing by #xonotic on freenode, and divVerent or myself can give you push access to your own branches in git.
Before posting a reply, please read about the bikeshed.
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  Xonotic port/reboot in Godot - roadmap ballerburg9005 48 12,818 05-26-2024, 07:44 PM
Last Post: ballerburg9005
  [META] Xonotic reboot/port in modern engine ballerburg9005 32 14,195 02-22-2022, 05:11 PM
Last Post: ballerburg9005
  Emscripten port for Xonotic ctbur 2 2,985 05-06-2020, 12:26 AM
Last Post: ctbur
  Ongoing port to the Unvanquished engine? poVoq 9 14,540 11-05-2015, 11:09 PM
Last Post: Danfun64
  Where can I find the self animated weapons from Nexuiz? MirceaKitsune 14 18,340 11-08-2014, 07:29 PM
Last Post: MirceaKitsune
Brick Seeking art for Xonotic based project MirceaKitsune 27 27,726 06-10-2014, 08:42 PM
Last Post: unfa
  Nexuiz 2.3 maps question? kidx 61 58,803 10-24-2012, 02:46 PM
Last Post: hutty
  Bone based damage system (feature vote and debate) MirceaKitsune 42 48,896 05-17-2012, 01:29 AM
Last Post: CuBe0wL
  Possible to edit maps on Mac OS X Lion? 300zxkyle 2 5,669 04-03-2012, 09:44 AM
Last Post: theShadow
  SDL Mac Install For Xonotic GIT SkyHookers 0 3,594 08-04-2010, 03:47 PM
Last Post: SkyHookers

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB original theme © iAndrew 2016, remixed by -z-