Live data from Hacker News

Windows game developer about porting to and using OS X

shiningrocksoftware.com

21–30 of 205 posts

Re: Windows game developer about porting to and using OS X

#21

Tangentially related: Banished is higly recommended. Quiet room, couple glasses of whiskey and you're guaranteed to have a nice evening.

It's not a bad game, especially for its price, but remember that this is a town, not city building game. That means that there is a hard limit to the size of the town - any bigger, and the agents (citizens) will literally starve to death en route to their next destination because it is too far from their home.

If you want to expand further, all you're doing is making exact, self-contained replicas of the same town in other places on the map. There's not much variety because each town needs the same resources, and each map has those same resources.

Like many games of this genre, the game has a reverse difficulty curve. This is especially true here because of the focus on survival. That means that the first few winters will be spent micromanaging every single resource to ensure everyone has sufficient materials, but after that initial period is over, it's impossible to fail because the town basically runs itself.

Re: Windows game developer about porting to and using OS X

#22
post #3

For me the most interesting part (and answer to it) why on OS X the game runs at 1FPS, whereas on windows machine with the same graphics card it runs just fine? What can make such considerable difference?

I have never seen such huge difference. I'm playing and making games and most of them run 10% faster on Windows at most, and this is due to graphics driver.

However, there is one thing that is a major difference: the system timer. Windows sleep() call has a granularity of 10ms, while OSX one has 1ms. So, if you (or your game library) is using sleep to return unspent CPU time to OS, it's easy to write the code that would run fast on one OS and very slow on the other.

Most developers treat OSX version as a checkbox on their "required features list" and only care whether the game works or not when porting. They do not want to spend time looking at the intricacies of OSX and just tell you that it's graphics driver's fault.

I develop games on Linux and OSX and later port to Windows before releasing (because that's where the players are), so I have to write specific code for Windows to make sure it runs faster. For example, my latest Steam game was really lagging and slow on Windows until I figured out the timer problem I wrote about above.

Other developers do it the other way around, and OSX performance isn't top priority.

Re: Windows game developer about porting to and using OS X

#23
post #2

Xcode isn’t too bad. I wish the author told me more about it than just this. Can somebody comment on how it compares to recent VS editions these days? About 5 years ago I also looked into using OSX as main OS. As I've always been using non-commandline graphic text editors and IDEs for most coding that made XCode the go-to environment but I just couldn't deal with it even though I tried. I don't remember all details b…

I don't use VS but I use Xcode every day. Downsides: incredibly laggy, buggy, can crash a lot depending on the version. Upsides: actually pretty thoughtful in terms of UI and UX, at least insofar as a fully-fledged IDE can be. I could never wrap my head around VS's stupid toolbars. Debugging, when it works, is really nice; there's more interactivity and inline code interaction than I remember VS having. (VS probably…

Laggy and buggy? That sounds like Visual Studio to me and I use that 8 hours a day. However, it's a damn good environment for C# and F# development, and Intellisense is pretty awesome in 2015.

In VS, Control-; is a pretty good way to navigate. I turn off all the toolbars anyway.

Re: Windows game developer about porting to and using OS X

#24
post #3

For me the most interesting part (and answer to it) why on OS X the game runs at 1FPS, whereas on windows machine with the same graphics card it runs just fine? What can make such considerable difference?

OpenGL is not the same everywhere even on the same GPU.

Every driver can negotiate its capabilities with the client app.

Apple has a software renderer that takes hold if client ask for an extension the gpu doesn't have, you have to ask a render surface in a specific way to get an error back when you ask ans unsupported feature.

At least that was the case when I last worked on a OSX app.

edit:

found some reference from the curious https://developer.apple.com/library/mac/documentation/Graphi...

"Since the OpenGL framework normally provides a software renderer as a fallback in addition to whatever hardware renderer it chooses, you need to prevent OpenGL from choosing the software renderer as an option."

also note that 1 this might not be the banished problem and 2 this may be an outdated document

Re: Windows game developer about porting to and using OS X

#25
post #20

So he's got a working port on an OS he's never seen before, in only 1 week? Does that seem extraordinarily productive to anyone else?

Just the title screen, not a complete port. Nor would 1FPS be probably considered "working" :)

He put the OS glue in place in 1 week and that sounds about right for this sort of effort, given some prior experience with writing portable code. The bulk of effort was spent earlier on abstracting principal code from the platform specifics, and sounds like he did all the right things there. Good stuff.

Re: Windows game developer about porting to and using OS X

#26
post #20

So he's got a working port on an OS he's never seen before, in only 1 week? Does that seem extraordinarily productive to anyone else?

Just the title screen, not a complete port. Nor would 1FPS be probably considered "working" :) He put the OS glue in place in 1 week and that sounds about right for this sort of effort, given some prior experience with writing portable code. The bulk of effort was spent earlier on abstracting principal code from the platform specifics, and sounds like he did all the right things there. Good stuff.

He is extremely productive, to be fair - "Shining Rock Software" is only him, the entire game, pretty successful on Steam, is just coded and maintained by him.

Re: Windows game developer about porting to and using OS X

#27
The comment about C++ templates is baffling and I wish the author would elaborate. The behavior he describes that clang doesn't support is... how templates are specified to work. They're near-useless without that property.

Most of these had to do with templates that expected the code inside them not to be compiled until they were instantiated. The Microsoft compiler has that behavior, while clang does not.

Re: Windows game developer about porting to and using OS X

#28
post #20

So he's got a working port on an OS he's never seen before, in only 1 week? Does that seem extraordinarily productive to anyone else?

If you have written your game with a good api layer that shield you from platform specificity, I can't imagine why it would take that long to port... It's mostly SMOP

Re: Windows game developer about porting to and using OS X

#30
post #3

For me the most interesting part (and answer to it) why on OS X the game runs at 1FPS, whereas on windows machine with the same graphics card it runs just fine? What can make such considerable difference?

It should be something elementary the author still hasn't implemented properly during his porting actions. He says that he has "specific startup code" in "two different sets of the same GL code" in "copy-pasted-slightly-edited" form and that he "started writing things specific to OSX. Memory management, file I/O, timers, date handling, threading, etc."

Basically, there's a lot that could possibly go wrong during his first days of porting, and after all that he just saw "the title screen" and observes 1 FPS rendering. So it can be anything, it's too early to know, I hope the author posts later what was missing.

The existing OSX drivers are surely good enough for games, so it's the problem of the use and surely not the case that "the platform doesn't allow" or the "drivers."

Also note that it's not about DirectX vs OpenGL. He has OpenGL on Windows too (see the first paragraph here for the quote).

Post reply on HN