The server.lisp part is full of awesomes, but the Flash part was pretty easy to write. I'm working on a project that can compile and hot swap swfs on the fly, something that acts as a game container for me to fiddle around with in an SBCL environment, but also is meant for easy deployability.
My latest game only calls addChild to put a full screen bitmap up, and yet has performance equal to flixel, but for games that aren't tile based. I hope to quickly build up a work environment that is fun to use and will let me tweak values without constantly publishing new swfs. I also hope to use the lean and mean flash bitmap renderer that I wrote in a way that is easily translated to iPhone's UIImage or even OpenGL surfaces. Without the immediate pressure for money, but with a future that is always sure to be scattered with future iPhone/Android/Flash contracts, I would like to be able to easily deploy any game I write to any of those platforms.
I am somewhat disappointed in the amount of effort it took to try to use HaXe because of the awful state of its documentation. In the end, I think that they were trying to solve the right problem, but were distracted by too many other cool, but unnecessary things. All developers want, is to save on effort and be more productive. Having to hand translate a Flash application to iPhone is no joke, nor is having to integrate a data management system (even if it is just a framework for hot reloading xml files with various tweakable constants). I want the entire thing to be very suitable for quick iteration, and easy deployment. We'll see. I have attempted most of the parts of this project in the past, but never all integrated.
The gotchas that I encountered while writing this app:
1. AS3's Socket.writeUTF/readUTF prefix or expect unsigned short (big endian) string lengths before the string. This requires the lisp server to use a socket stream of type (unsigned-byte 8)
2. Even with non-blocking mode sockets, because the underlying stream implementations are blocking, the SBCL side of this application will block.
3. I'm a complete idiot when it comes to asdf/packages, so what you see there is a mess.
You are free to use this code as you wish. If you make billions off of it, I may require you to buy me a beer next time you are in NC. Please let me know about nitpicky details or any issues you have. This code was only tested on SBCL 1.0.39 on OSX 10.6.
Example usage:
? (load "/Users/pTymN/flisp/server.lisp")T? (start-server)#? (compile-flash-client)started serverLoading configuration file /Users/pTymN/Downloads/flex_sdk_3/frameworks/flex-config.xml/Users/pTymN/flisp/flisp.swf (1405 bytes)#? (start-flash-client)#? server accepted connection? handler received input? Receive from client 'Hello' and 'Goodbye'?
0 comments:
Post a Comment