Procedural / generative art for iOS/macOS in Swift?

My programming background includes a lot of time spent with Processing, openFrameworks, and more recently, LÖVE2d. All of these frameworks include rather robust drawing functions in their APIs. LÖVE2d is the weakest, but it’s still possible to create procedural art with it, and then to use that art in the context of the game engine features. For example, I’m working on a little game (for fun) about boarding airplanes. The passengers are procedurally generated.

Or in Processing it’s easy to create generative flowers with a genetic algorithm:

etc…

I’ve been looking at the various macOS and iOS APIs, in particular at SpriteKit and other libraries that are easy to integrate with it, but I have yet to find any that seem that they would easily provide for the implementation of procedural content in the context of a game engine.

Am I missing something here? Is there an obvious route to transition to creating a SpriteKit based game that uses generative art created and drawn at runtime? I know this isn’t the most efficient way to create a game, but I enjoy it and would like to figure out how to combine learning Swift with procedural art generation. Thoughts? Links? Tips for how to get started?

Hey that’s pretty - you may have noticed my avatar is a unicorn, they were a StackOverflow April Fool’s joke in 2012 or so - I liked it so much I used it ever since. See http://unicornify.appspot.com

I don’t know of any API specific to procedural generation but I do think you could look at the GameplayKit implementation of Entity-Controller-System. By aggregating an entity from random attributes you could achieve a very effective procedural generation. Certain choices could preclude others, or you could even implement a decision tree for what kind of entity you build. The display of those entities would then be managed by the display layer.

Thanks for the feedback. Maybe I’ll see what it would take to port some of the more common and simple calls from one of the other frameworks over to Swift. I already have 1000000 projects, but hey? What’s one more? :wink: