27 ms·
Windows game developer about porting to and using OS X
- indifferentalex 11y agoThe man's commitment to his game, considering that he works alone is incredible. Without using terms like "10xer" and "rockstar", he's got an incredible level of perseverance and dedication, considering that he already launched the game and at this point is working on features that are considered by many boring and a grind, all to make a polished finished product. The fact that he documented pretty much everything in his blog is great if you need motivation or are just curious about how to make a game from zero.
- lucozade 11y ago> Apparently my vi command muscle memory hasn't faded. Back in the day I did most of my dev work on Solaris. I then spent 4 years as CTO as a startup that was pretty much only Windows. When I subsequently went back to working at a unix shop I was initially struggling with vi as I tried to read some of the C++ code. I couldn't remember commands, was having to refer to the man pages every few mins. It was torture. A couple of days in, I was writing up some notes in vi when someone walked past my desk and started chatting. When we finished talking I looked down at the monitor and I'd written more than I had when I was concentrating, nicely formatted, the works. Turns out "my hands" had remembered a load of what I thought I had forgotten. For the next few days I had to keep finding ways to distract myself so that I could work efficiently. Eventually it all came to the foreground but it was the most bizarre experience while it was happening.
- farresito 11y agoThis always happens to me with passwords. I have trouble remembering some passwords. Yet, when I'm in front of the page and I actually need to get in, either I lose some focus and let my unconsciousness do the work or I won't get it right.
- versteegen 11y agoHeh, a few weeks ago I realised that I'd become unsure about my email password (almost never have to log in). So I logged out and tried to log back in, trying every possible combination, keeping track of them on paper. I had to give up, turns out that I was way out. The next day I wanted to check my emails and typed in the password immediately.
- ptaipale 11y agoThis is nice. Some criminals torture you: "Give us your password so we can take your money". "I cannot give it to you! I can only enter it in a stress-free environment when not thinking about it." (Applies also to those government warrants forcing you to divulge information.)
- Kristine1975 11y agoThat doesn't sound like an advantage. I'd rather give away my money than being tortured.
- nkrisc 11y agoYes! That same has happened to me. I'm sitting there trying to remember my password, but I can't. But I just try to start typing it and I get it right. I hadn't remembered my password, I'd only remembered the motions.
- knodi123 11y agoI was trying to share my banking passwords with my wife ("in case of emergency" kind of stuff), and I was forced to admit that I had no idea what my bank password was, even though I log into it several times a week. I had to open a word processor and type my username and password for her all at once. The act of typing my username allowed the password to pop into my memory.
- danvideo 11y agoI tend to think it's a good thing that I don't actually know my bank passwords - a password manager is much simpler. Having strong passwords for all different banks is a piece of cake when you don't have to remember them.
- Splines 11y agoWhen I used to play piano as a kid, this happened to me all the time. Sit me in front of the piano and I'll mindlessly bang out the song I've been practicing. Make me think about it in the middle and I'll forget what comes next.
- philsnow 11y agoWhen I was a kid, I could not start reciting the alphabet anywhere but from 'A'. In the alphabet song, the latter bits go really slowly compared to the first bits, so for the longest time I thought "P" was the middle of the alphabet, because it comes about halfway through the song. It came as some surprise to me that "M" is the 13th letter.
- stinos 11y agoXcode 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 but in general it just felt inferior to VS on like all fronts, with no advantages of any kind (for C++). Again, IIRC, but it did annoying things like opening the same document in multiple windows, one for editing and one for debugging or so? Anyway, what's the state today?
- trymas 11y agoFor me it's just feels too heavy and laggy, though I cannot compare to VS. But I do not do much iOS/OS X GUI development, so I am happy with the terminal/vim.
- jasonjei 11y agoI can attest that Visual Studio and Xcode can both feel laggy, especially with respect to C++ development and static analysis (Intellisense or whatever they call it). However, this may not be so much Microsoft's or Apple's fault as much as that IDE tools carry high overhead as they have to manage a lot of symbols from every header file referenced, including parameter lookups, etc. On top of that, I think Xcode (like Eclipse) compiles your code as you type, leaving you no surprises until you need to link...
- Kristine1975 11y agoXcode checks your code as you type (90% of the time, sometimes early errors, e.g. in a header, make it give up completely on a file). Compiling still is a separate step. Current versions of VS do the same, though, even for C++.
- roel_v 11y agoVisual studio compiles as you type. It has to, to work with e.g. 'auto'. Vs has two compilers actually, one that compiles as you type (and tries to guess what you mean more), and one for the real compile cycle.
- trymas 11y agoFor 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?
- sitharus 11y agoDrivers. On MacOS they tend to be a bit behind the Windows versions, also MacOS itself is reasonably GPU-heavy. Add to that Apple's tendency to lag behind the latest (as in from the last five years) OpenGL standards and you've got a recipe for slow OpenGL. Though interesting that it's an Iris Pro, MacOS used to have the best Intel drivers as Apple pulled them in-house. ATI and NVidia have always treated MacOS as a secondary target.
- hellofunk 11y agoHere's a table of specific OpenGL support for various versions of OSX: https://developer.apple.com/opengl/capabilities/ https://developer.apple.com/opengl/capabilities/ To say that there is a recipe for slow OpenGL on Mac is a bit misleading: Mac is capable of fantastic OpenGL projects.
- reidrac 11y agoThat doesn't sound completely right. If it was a 10% performance hit, I could blame the driver but comparing 60 FPS (I presume) with 1 FPS when people are playing the game in Mac OS X using WINE; that sounds like something is probably not quite right in his code.
- Kristine1975 11y ago>also MacOS itself is reasonably GPU-heavy OS X's window manager is optimized for fullscreen windows on top of everything else (including menu bar and the "Dock"): https://developer.apple.com/library/mac/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_fullscreen/opengl_cgl.html https://developer.apple.com/library/mac/documentation/Graphi... I also found that even with a GPU-heavy fullscreen application, having another (smaller) window on top doesn't noticibly degrade rendering performance. It seems the window manager is doing some clever things there in regards to compositing.
- anton_gogolev 11y agoTangentially related: Banished is higly recommended. Quiet room, couple glasses of whiskey and you're guaranteed to have a nice evening.
- danielbarla 11y agoIndeed, for me it's only recent city builder that captures the feeling of the original Settlers game(s). The feeling where I just want to see what my little city is up to, see the people scurrying about their little lives. The game is relatively deep, and has tons of room for clever tactics. Also, it was developed by a single person, which is pretty impressive for a game like this.
- mediumdeviation 11y agoIt'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.
- anton_gogolev 11y agoAll true. But there's trading that can be quite a bit entertaining. And theres Colonial Charter[1], which is an excellent mod, but it can be daunting because of sheer volume of changes and new stuff. [1]: http://www.colonialcharter.com/ http://www.colonialcharter.com/
- Kiro 11y agoI played it a couple of years ago and enjoyed it but eventually got tired of it. Has there been a lot of new features since?
- shmerl 11y agoI'd be more interested in his experience about porting to Linux (since supposedly he is working on it as well). OpenGL on OS X is still behind the times, and so far it's not even clear if Apple will add Vulkan support when it will come out.
- 885895 11y ago>unix-like Not just unix-like, OS X is certified UNIX.
- oneeyedpigeon 11y agoYeah, I guess the author meant more like "very similar to Unixes (unices?) I've used before", which quite possibly means 'various Linux distros'. Aside from official certification, OSX is still sufficiently different to make this mistake forgivable, and not just in terms of the UI. The filesystem organisation is unusual, to say the least.
- simonh 11y agoMaybe we should start calling Unix variants 'Linux-like'.
- collyw 11y agoWhat does this atually mean (when compared to Linux, which is a UNIX clone)? That they have paid someone for a certificate? Is it more than that?
- pjmlp 11y agoIt means you can be sure that the APIs described here exist, with at least the set of specified arguments and behaviors. http://www.opengroup.org/standards/unix http://www.opengroup.org/standards/unix For example, http://pubs.opengroup.org/onlinepubs/9699919799/ http://pubs.opengroup.org/onlinepubs/9699919799/ However, just like C, any certified implementation is free to add extra behaviors and there are certain parts that are actually implementation specific, like how signal handlers behave in certain situations.
- ahoka 11y agoYes, it means that someone payed money for a useless certificate. Nothing more, nothing less. BTW, Linux is UNIX too! http://www.opengroup.org/openbrand/register/brand3596.htm http://www.opengroup.org/openbrand/register/brand3596.htm https://en.wikipedia.org/wiki/Inspur_K-UX https://en.wikipedia.org/wiki/Inspur_K-UX
- curyous 11y agoSo 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?
- huhtenberg 11y agoJust 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.
- a_bonobo 11y agoHe 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.
- huhtenberg 11y agoOh, I agree.
- mattmanser 11y agoIt's an absorbing simcity-esque game, as long as you don't go in expecting Civ/SimCity replay value it's definitely worth it if you like those type of games, or at the very least putting on your wishlist for the steam winter sale. The level of quality for a one-person team is phenomenal.
- chii 11y agoIf 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
- vvanders 11y ago
- kevingadd 11y agoThe 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.
- Kristine1975 11y agoHe's talking about two-phase name lookup, which VS doesn't implement (yet?), but clang does (as it should, striving to be a standard-compliant compiler). Here's a nice article about it: http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.html http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.h... TL;DR: If a type, variable... depends on template parameters, code using it is checked when the template is instantiated with concrete template arguments. Otherwise it is checked when the template is defined. I don't quite understand why you call templates near-useless, if two-phase name lookup didn't exist?
- cesarb 11y agoMicrosoft's C++ compiler treats templates more like macros: http://blogs.msdn.com/b/vcblog/archive/2015/09/25/rejuvenating-the-microsoft-c-c-compiler.aspx http://blogs.msdn.com/b/vcblog/archive/2015/09/25/rejuvenati...
- mavdi 11y agoHas he developed this game all by himself? How can people be so productive? Develop, test, market... This is just crazy.
- skrebbel 11y agoDoes anyone know whether he did the graphics too? It's not world class art, but it looks real good, so I'd be very impressed if that was the same guy too.
- skrebbel 11y agoAnswering my own question, the sidebar on the right says: > Shining Rock Software has only a single developer doing all the software development, artwork, and audio. I'm blown away. Really cool.
- diqu 11y agoHe used to be a console engine dev, so - naturally - he wrote even that from scratch. On his own. Quite admirable, I think.
- seivan 11y agoYeah I am also impressed, pretty much aspire to be that productive but have failed.
- deleted 11y ago[deleted]
- AbraKdabra 11y agoNot just he has developed the game, but also made the art, sound and everything you see from the game, this guy has ultra high levels of productivity.
- stevoski 11y agoI went the other way: last year I converted an OS X app to Windows. I hadn't used Windows for six years, and had forgotten most things. It took two weeks to get the code compiling and running. That turned out to be the easy part. Getting the application performing well, feeling "native", and getting the bug count down took another six months. I love Banished and I'd like to see a completed OS X port. But I'm not expecting this to be done, like, tomorrow!
- DeveloperExtras 11y agoI do it this way, but it's based on my particular skill set: First make the iOS version. Then, port it over to Java. Then, port it over to C# or maybe ActionScript3/Flash. This way, I can recursively update previous versions as the 'best solution' to interesting problems become most clear by the end of the 2nd or 3rd port. This gives the Objective-C/iOS version the attention it needs, and I can use the rapid application development features for each new port.
- gazsp 11y agoThat sounds like a lot of work.
- SXX 11y agoI’m not using SDL or any other library to hide those platform differences. Once start working on Linux port he'll regret about that. Every developer that start with own platform-specific code end up using SDL2 anyway. Don't do that mistake.
- seivan 11y agoAn alternative is Cocos2d-x, but they manage memory using a single autorelease pool.
- pmelendez 11y agoI might be wrong, but I think I remember that Cocos2d-x uses SDL under the hood.
- seivan 11y agoFrom what I can gather, not with V3 and above. I think starting V4 they will go render-agnostic so they can use Vulkan and Metal. Besides, there is more than rendering for a decent engine. Managing controls in an agnostic way is nice to. I am actually working on adding better control-events so it can wrap Windows, Windows phone, Apple TV and External controllers easier.
- pmelendez 11y ago> "From what I can gather, not with V3 and above. I think starting V4 they will go render-agnostic so they can use Vulkan and Metal." That would make sense, last time I touched it was back in 2012. > "Besides, there is more than rendering for a decent engine." For sure, but Cocos2d-x is a complete software framework and SDL is meant to be a library. Although I would grant that it would make sense if the author would choose to use a game engine for his game.
- jason_slack 11y ago>> "From what I can gather, not with V3 and above. I think >> starting V4 they will go render-agnostic so they can use >> Vulkan and Metal." >That would make sense, last time I touched it was back in >2012. Cocos2d-x has never used SDL for anything. for v4 the renderer is vastly different. Going from v2 to v3 there were major changes here as well.
- maljx 11y agoWe develop our game on Mac OS X and port to Win32 and Linux. Using CMake, SDL2 and C++11 there is very little code that actually needs to be rewritten. The windows build process is just a python script that pulls, cmake configure, compiles and zips the latest build. The code that is completely different on the platforms is stuff like HTTPS requests, open file dialog, create/delete folders.
- deleted 11y ago[deleted]
- lmolnar 11y agoI recently went through a very similar process porting my screensaver [1] from Windows to Mac without using a library like SDL. Here are some additional difficulties I encountered during this process: OpenGL on multiple monitors - this was much more difficult to do on MacOS. I had to create a separate window for each monitor, create a rendering context for each window, make sure my graphics code was issuing the drawing commands to the proper context, then have each context queue/batch "pending" rendering commands and issue them all at once at the end of a frame on a by-context basis. Whereas on Windows you can pretty much create a window that spans multiple monitors and draw to it with a single rendering context. Input - I used DirectInput on Windows and wrangled a suitable implementation using HID Utilities on Mac, which was not easy given my lack of previous USB programming experience. A major annoyance was the lack of a device "guid" that you can get via HID Utilities to uniquely identify an input device - I had to manually contruct one using (among other things) the USB port # that the device was plugged into. Not ideal. SSE intrinsics - my experience was that Microsoft's compiler was MUCH better at generating code from SSE/SSE2 intrinsics then clang - my Windows SSE-optimized functions ran significantly faster then my "pure" C++ implementations, where as the Mac versions ran a bit slower! My next thought was to take this particular bit of code gen responsibility away from clang and write inline assembly versions of these functions, but I took a look at the clang inline assembly syntax and decided to skip that effort. (I did write an inline assembly version using the MS syntax and squeezed an additional 15% perf over the MS intrinsic code.) Prtty much everything else (porting audio from DirectSound to OpenAL, issuing HTTP requests, kludging up a GUI etc) was pretty straight forward/did not have any nasty surprises. [1] http://www.ubernes.com/nesscreensaver.html http://www.ubernes.com/nesscreensaver.html
- acdha 11y ago> SSE intrinsics - my experience was that Microsoft's compiler was MUCH better at generating code from SSE/SSE2 intrinsics then clang I don't know whether this is still the case – or something like tweaking the target CPUs would help – but assuming it is, did you report it to either the open-source Clang project or Apple? The developers have seemed to be quite responsive to reports like this.
- 11y ago
- jupp0r 11y ago"but then realized I could open a term window and that I was really using a unix-like system with a user interface that wasn’t X Windows." Where would one have to hide to retain this level of ignorance for so long?
- cryowaffle 11y agoThis is very rude.
- acdha 11y agoI'm sure he'd heard that OS X had Unix underpinnings but if this was the first time he'd needed to actually touch a Mac, it was probably a relief to see how smooth it actually is. “Good deal, I can do that.” If he's worked in the Windows world, the most likely comparison was probably Cygwin or Microsoft's old Services for Unix, both of which are much clumsier experiences obviously taped on to different base.
- matthewmcg 11y agoWhen I read this, I couldn't help hearing "It's a UNIX system--I Know this" (from Jurassic Park).
- dang 11y ago> Where would one have to hide to retain this level of ignorance for so long? This comment breaks the HN guidelines by being both uncivil and unsubstantive (i.e. it adds no information). Please only post comments that are both civil and unsubstantive. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- AdmiralAsshat 11y agoThe fact that it’s running at 1 FPS is a little disheartening – I know the GPU is fast enough. I’ve got a Windows machine with an Intel Iris Pro 5000 that runs Banished just fine, which is the same graphics hardware in my MacBook Pro. I’ve got my suspicions as to whats going on but I have a bunch of testing ahead of me to make sure I fix the issue properly. Did the author buy a MacBook Pro just for this purpose? I'd assume this is his personal laptop, but his "Using a Mac" section sounds like he's not a Mac user even in his free time.
- TazeTSchnitzel 11y agoThe first thing the author talks about is their unfamiliarity with the Mac environment, and the game wasn't made for OS X in the first instance, which would suggest they did buy a Mac purely for an OS X port.
- packersville 11y ago> couldn’t figure out how an ‘All Files’ category was useful when browsing finder windows To this day I still don't see or find how it is useful.
- zaphoyd 11y agoIt is a nice starting point for queries about files on the system as a whole rather than in a particular folder. i.e. Show me all of the PDF files I've used recently. Or find a file with name x but I have no idea where it is. `find / -name foo` vs `find . -name foo`
- jokoon 11y agoWell I sold my macbook pro because I wasn't able to build my ogre project properly. For years. Also there was some OIS (not iOS, OIS) input issue. It comes from apple force feeding Cocoa into opengl apps, or something like that, which can only be remedied by using some SDL hack. Anyway, I don't really care anymore, I bought a thinkpad instead. Cocoa is just something I just can't even. My experience has been pretty different. I'm not a professional developer though.
- sounds 11y agoWorking through the Ogre issues on OS X is like a rite of passage, I thought? I tried multiple times to contribute OS X fixes to the Ogre code base. They're not hard things -- 1. Use SDL not OIS. 2. The symlinking is broken. 3. Link the frameworks properly. There was one more thing, I think. Just minor issues that probably have crept into the codebase because no one is able to contribute the fixes. It's Ogre. It's not OS X.
- jokoon 11y agoThought too. But in my opinion, an OS has larger responsibilities when it comes to improve inter compatibility, instead of breaking things to have developers who stay loyal and ending up with apple-exclusive software. I really wonder about the value objective C brings, especially since NextStep did not work as a project. You can't always put the fault on library devs. What boggles my mind, is that OSX is an unix underneath, so I don't understand why it would do anything different and force developers to learn new habits. That's not how you attract devs. Apple has made an habit to break backward compatibility, something neither linux nor windows tend to do. I think it's not so much to think that OS manufacturers should not to be different than their competition by separating even how their development tools work. The only objective of that is to have developers who stay loyal to apple because they can't have their app running on both windows and mac. Not to mention I had to re do everthing at each new XCode version. So in the end, having my project run on both XCode and MSVC, was too much time lost, so I just sold that aging laptop. Apple is just so special, and I guess I was not good enough for that.
- jason_slack 11y agoWhat is the window in the background that is NOT Xcode. Off to the left. Something "workspace"?
- mrpippy 11y agoPerforce client (P4V). Consider yourself lucky you don't recognize it.
- jason_slack 11y agoThanks. I initially thought it was Valgrind.