A Swift based, X-platform 2D game dev engine, intended for both corporate developers, indies and newcomers.
A Swift based, X-platform 2D game dev engine, intended for both corporate developers, indies and newcomers. Read more
About this project
Hi, I am Lars Birkemose.
I am the maintainer and lead developer of the Objective-C based version of Cocos2D.
Since Apple announced Swift, I have been absolutely in love with the language. I think it endorses great programming paradigms, and teaches you to do things the right way. It is a great step forward in making better programs.
I think the next generation of Cocos2D, should be based on Swift.
With support from RemObjects Software - who will provide the cross platform technology needed - Cocos2D-PureSwift will initially compile for iOS, Android and OS X, and later for Windows, Windows Mobile and .NET.
Developers will be able to work on both Mac and Windows. On Windows, PureSwift will support Visual Studio, and on Mac there will be freedom of choice between Xcode, and RemObject's own Fire editor.
Who will it be for?
Cocos2D-PureSwift will be a very strong alternative for anyone coming from other versions of Cocos2D, or from SpriteKit or Unity, and who wants a modern, lightweight, modular and open source 2D API.
PureSwift will be equally great if you work exclusively on Xcode with only iOS in mind, or if you are targeting multiple platforms.
- Based on the most modern programming language
- Simple powerful lightweight API
- Easy to understand, learn from, and expand on
- 100% open source
- Automatic batching
- Advanced layout and placement
- Simple and flexible asset handling (one size fits all)
- Native off-screen and multistage rendering
- Fully data driven design for easy editor support
- Multi vertex sprites
- Physics, animations
- And much much more ...
Why should you pay me money for something that would eventually be 100% for free?
The simple answer is, that without your support, it will not happen.
Even if I could, I would not want to rely on a single donor, and that is why I have asked for your help. This will be a 24 hour a day job for me, and without support there is no way I can allocate this much time and resources, in such a short period of time.
If you think the project sounds interesting, please consider supporting it. For both novices and seasoned programmers, this might be a unique chance to get exclusive insight into the development process, and help building the next generation 2D API.
You can also read more about the nitty gritty details of PureSwift Project
And finally, thank you for your time
Risks and challenges
There will not be many arguing that Swift is a great language, and that it can be cross compiled.
The single most raised issue has been.
Will it be fast enough?
Apple claims Swift will be faster than Obj-C.
Latest benchmarks on Swift2 claims close to C++ performance.
In my opinion, the two main bottlenecks in Swift, are reduced code optimisation in debug mode, and ARC. Luckily we can deal with both.
Optimisation will obviously not be a problem in release mode, but it might result in slower performance during development. There are several way of dealing with this, one of them being adding PureSwift as a static library.
ARC will also become a bottleneck, if not delt with properly. While ARC handles most memory allocations, it all comes at a price. Used uncritically, especially on high performance software like Cocos2D, the time spent on retains and releases, will add up.
There are several ways around this. Apart from obviously being aware of the bottleneck and designing around it where possible, low complexity classes should be replaced by structs, and recursive retains of complex classes should be avoided by using class wrappers.
Support this project
- (30 days)