Finally, Mac support!

Because there’s construction in the office, I was forced to work on a laptop today, which meant my 2011 13″ MacBook Air. Of course, the game didn’t run at all due to using too modern GLSL stuff, so I spent the morning switching stuff over to GLSL 120 and tweaking stuff around.

Now the game runs at 60+ fps on my computer, which is pretty nice considering it’s not very optimized yet. The framerate will drop a bit in the future when features get added, but it’s a promising start.

Strangely, however, the game runs at about 2 fps on Carl’s 2012 11″ MacBook Air, despite it having a better graphics card than my laptop. I can’t figure out why. Minecraft runs great on it. I’m guessing the problem is somewhere in the shaders. I’ll borrow his computer for a day in the future and figure it out, but for now I will focus on multiplayer!

Working on multiplayer

In order to avoid having to port a lot of code to multiplayer later on, I’m making the game fully client/server from the start. I’m using UDP so packets can be ignored and handled out of order and all that, and when playing singleplayer, the game will be running a local server instead of having all the code be duplicated.

I ran a few tests this week, and at 500 ms latency with 20% packet loss, it seems to be able to handle 1000 packets per second (quite a lot more than it will ever use) indefinitely, which is nice.

Of course, I’m ending up reimplementing a lot of TCP, with packet resending and ordering for most things, so I’m not totally sure all this work is actually worth it, heh.