Apple’s Worldwide Developers Conference is set to kick off on June 5, and along with a new version of iOS, Apple is expected to introduce the next-generation version of macOS, macOS 10.13. We’ve heard no rumors on what to expect in macOS 10.13, so whatever Apple introduces will come as a total surprise.
Another good list of well thought out feature requests, this time for macOS 10.13
May 27, 2017
Sector - adventures in procedural mapping
Back in 1988 I was studying for my computer science A-level. At the time, this meant writing relatively simple apps in BBC Basic on the BBC model B computer. Things weren’t going so well, because we were quite distracted in class by a game someone had copied - Elite.
Elite screenshot - Wikipedia
In Elite you played a space ship captain, flying between space stations in different star systems, trading to make a profit and fighting off pirates - all rendered in groundbreaking 3D line graphics. But what was really amazing to me wasn’t the graphics or the gameplay, it was the sheer amount of game that had been some how squeezed onto an 880KB floppy disk.
There were eight galaxies of 256 different worlds you could fly between. Each had descriptions and names, and active trading markets. You couldn’t fit that much content onto a disk that small. How did it do it? Was it using some kind of compression? No.
The secret to this magic of course was procedural generation. Instead of storing the details for every world, the game stored rules about how these details could be generated on the fly. When the game run, the galaxy was created in memory there and then. When you visited a star system, the worlds and stations, names and commodities were generated on the fly as you hyperspaced in. And although based on random generation, computers will, given the same started ‘seed’, generate exactly the same details every time.
The idea that entire, complex structures could be generated from a simple set of rules fascinated me. It turns out it wasn’t exactly a new idea. Another space game was already using this technique to generate entire galaxies of stars and worlds. This game, however, used dice and paper : Traveller.
Inside this collection of ‘little black books’ you could, with the help of nothing more than a sheet of paper a pencil and a couple of regular 6-sided dice, roll up vast ‘sectors’ of space and populate them with worlds and cultures of your own creation. The only drawback was the time it took - but I remember spending hours rolling up subsectors of worlds just for the fun of it.
The results were plotted onto a hexagonal grid map that ended up looking something like this:
traditional Traveller map
Several years ago I started playing around with a web app to generate sector maps automatically, using the rules encoded in the various editions of Traveller. The script I build in Ruby used ImageMagick to draw the maps, and running on a G5 Mac Pro took several minutes per subsector (a maximum of 80 worlds). Nevertheless, the images it produced were pretty attractive:
Ruby generator output
I embellished the standard maps with colour - using the colour of the world to indicate the surface type, and the border of it to indicate it’s atmosphere. I also added icons for various bases and travel codes (additional details you generate for a world, a kind of short hand saying if the place his rich or a desert or a garden world, etc).
Although the project languished after that, I still retained a fascination with procedural generation and mapping. Years later I decided to revisit this idea, and see what I could do with current technology.
Sector on the iPad
Sector is my Ruby Traveller mapping app brought up to date and build for iOS. It’s been completely re-written in Swift 3, and running on the latest devices it will generate an entire sector (that’s 16 subsectors of 80 hexes) in an instant.
In the years since I wrote the original Ruby code, Traveller has been published in an open source ‘System Reference Document’ - and this is the basis of the rules that Sector uses.
In addition to the basic mapping and colour coding, Sector also draws in ‘trade routes’ - lines of communication or commerce between the worlds. This gives more context to the map, and you can get some idea of the relationships between the worlds. It also generates names for everything - the worlds themselves, and also the clusters and voids that exist on the map are named. Names are created based on a dictionary of real English worlds as well as place names from around the world, so the generated worlds have names that at least sound familiar and pronounceable.
There are still things I’d like to add - printing out the map or sharing it as an image are top of the list. But, as it stands I’m very pleased with the result, and it was a fun project to work on - even if I never want to see a hexagon again!
You can download it on the App Store
May 23, 2017
Apple is planning to make some changes to scrolling behavior in mobile Safari in a future update, making for a more unified scrolling experience. The news comes courtesy of a Hacker News thread discussing Apple’s default scrolling behavior vs. the scrolling behavior of webpages that use Google AMP, a discussion inspired by a Daring Fireball post on the subject.
This is interesting: the scrolling behaviour of web views on iOS is going to change, and soon. Web content has scrolled differently to native views since the beginning.
This change will make web views in apps feel much more like true native content.
May 22, 2017
We — Manton Reece and Brent Simmons — have noticed that JSON has become the developers’ choice for APIs, and that developers will often go out of their way to avoid XML. JSON is simpler to read and write, and it’s less prone to bugs.
So we developed JSON Feed, a format similar to RSS and Atom but in JSON. It reflects the lessons learned from our years of work reading and publishing feeds.
This is a great initiative, and the kind of idea that you can’t believe nobody else has had before.
The open web is based on sharing of data, and JSON is the lingua franca of that sharing - fulfilling the promise that XML had with a lot less fuss and faffing about.
I can’t wait to see what comes out of this…
May 20, 2017