Dev Log: What the hell am I doing?
I'm not really sure what I'm doing right now. I'm kinda going all over the place if you can tell from my past two or three weeks of blog posts.
I got back from GDC and I saw what people were working on and I felt kinda crappy about putting all this effort into yet another AS3 game with Adobe AIR. The problem is performance. Flashpunk has a hard time maintaining 60 frames per second because of weird Flash things... it's just not that super stable. Offspring Fling is a relatively simple 2d game and for whatever reason some people with modern computers have a hard time running it at 60 fps and this is extremely frustrating for both them and me.
One day I went through some of my old prototypes. I took a look at Gaiadi, my Ludum Dare game from three years ago (WHAT THE HELL HOW IS IT THREE YEARS OLD ALREADY.) One of the most disturbing things about it was how smooth it ran. The Game Maker run time is actually pretty dang impressive and it runs at a solid 60 fps, especially when compared to flash. This made me actually feel pretty bummed because Offspring Fling isn't nearly as stable (at least in my eyes.) It's one of those moments where I asked myself "am I somehow getting worse at making games?"
So I want to learn something new... but then I've already put all this work into this AS3 framework that I'm using. The amount of friction to start on something new is really tough, because right now in AS3 making things is extremely fast and efficient because I've solved a lot of my issues and have a bunch of helper classes with super fast solutions to common problems across my projects. AS3 just also has a ton of useful libraries that I make use of like TweenLite and AS3Crypto.
I started by experimenting with HaxeNME a few weeks ago. I decided to check out HaxePunk since FlashPunk is my favorite thing ever. At first I was incredibly pleased by the performance when building to a native windows target. 60 frames per second, consistently, with over 10000 entities being rendered and updated! I was super pumped. Haxe is also tempting because it's very similar to AS3 which I've been using a lot for the past couple years now.
Unfortunately I hit a pretty big snag with HaxePunk. It's just not in a very usable state right now, especially for native targets. The rendering code needs to be updated for these targets to fix a lot of issues. Sprite flipping doesn't work, the drawing functions like line, circle, rectangle, they all don't work, and there are some weird things that I don't like about the style (Image.createRect returns a graphic instead of an image, which then prevents me from using Image functionality such as scale, angle, alpha, etc.) HaxePunk is out of the question for now for any sizable game projects, but it's still very much a work in progress and I hope it becomes something more stable in the future.
So now it was on to something else. I still didn't feel like going back to my metroidvania project just yet, so I did some prototypes in Flashpunk for possible control schemes for various things on mobile devices. I recently picked up an iPad and I wanted to just play around with it.
I managed to set up FlashDevelop and Adobe AIR to compile right to my iPad, so I started to experiment with that. I first tried running a FlashPunk window on the iPad and I actually was pretty excited at first because a 640 x 480 FlashPunk window runs at 60fps on the iPad4. Then I tried to scale it up to the size of the screen and that absolutely murders it. The framerate was 20 or so with nothing going on.
...but wait! I just need to use Starling, or Stage3d in general. That should run much better on the iPad. Flashpunk 2 is currently in development, and actually you can see and use the in progress version of it in Saint11's Ludum Dare game, and that uses Starling as the base of its rendering system. I'll just stick Flashpunk 2 onto the iPad and see how that goes.
It took me a couple days of wrangling, but I eventually got Flashpunk 2 rolling on the iPad instead of just regular Flashpunk. At first everything seemed good except for a few minor bugs. I had some touch input working for something, but then I ran into performance issues almost right away. Not really sure what's happening right now, but Flashpunk 2 is still a work in progress so I'll have to wait it out until it's in a solid "1.0" version.
Okay so... now what? This entire time Tommy has been harassing me about learning C++ and using that for a game engine. I really don't think that's going to happen. I tried C++ in the past and it was a giant disaster. I spent 2 months just getting stuff to move around and render on the screen, and eventually I just hit a wall of too many bugs involving pointers and references and I couldn't go on... but maybe I'm smart enough now to handle it.
I've been playing around with SFML 2.0 and I finally got the simplest example program to compile, but I'm still not sure if I'm able to handle C++. The resources for C++ just seem way too scattered but maybe that's just my perception. What I mean is that when I search for a solution of a problem in AS3, I can easily find one definitive solution... with C++ I end up finding a bunch of completely different problems that might be related to what my problem is and then I'm going down this giant branching story path of why I might be getting a LINKER ERROR or a SEG FAULT or whatever, and I just get overwhelmed with information and I want to throw up.
I don't know if C++ is for me... but SFML 2.0 seems really nice. And there's also this Toast framework that someone wrote which is essentially just a C++ port of Flashpunk, but it's missing some core functionality that I make use of a lot like entity layering, and once again the Draw functions.
I also got into Unity a little bit and did some quick tutorials. I managed to make a Clock so far. I've used Unity a little bit in the past for making levels for things, but I've never actually coded and put together any sort of engine in it. Unity feels very strange to me, but I'm willing to give it a fair shot.
Also on my list is C# and Monogame. I started digging into this a little bit last year, but I had to put it down to finish Snapshot. I know that Matt has some pretty awesome stuff rolling in Monogame right now with Towerfall, and I'm hoping his latest framework becomes public in the future, as he tends to have the same line of thinking as Flashpunk, and anything like Flashpunk or Game Maker is easier on my brain.
The main problem I keep running into is update loop vs. event system. I don't like event systems and callbacks registered to event triggers. This style of coding is very hard for me to follow and doesn't make a whole lot of sense in my brain, but that's mostly caused by my upbringing in update loop environments. Klik & Play all the way through Multimedia Fusion is a big update loop that checks for conditions in a specific order each frame, and Game Maker can be coded the same way with everything happening in the Begin Step, Step, and End Step events.
The next big issue is the drawing stuff. Apparently the style that I prefer is "immediate" rendering or drawing modes (I just learned about this term a few days ago, haha!) I like the ability to do stuff like "Draw text, draw a line, draw a circle, draw text" and it all happens in that order, so the final text call would be above the circle, which is above the line, which is above the text. I use this kind of stuff for effects and I use all of this especially for rapid prototyping and visual debugging. These methods have become my bread 'n' butter for getting stuff rolling quickly. One of my favorite things in Flashpunk is to just say "var img:Image = Image.createRect(16, 16, 0xFF0000);" which just quickly creates a rectangle image on the fly. I can scale the rectangle, rotate it, blend it, tween it, etc. This stuff allows me to make super fast prototypes with some neat effects like squash and stretch right out of the gate, letting me feel out a game quickly and effectively.
Ultimately it just feels like I'm searching for an engine that doesn't exist. Andy Moore's recent post about searching for a unicorn resonates a lot with me. Every engine has its shortcomings and I just need to decide which one I'm most comfortable overcoming. C++ is super hard on my brain, but has the highest potential for performance... Unity is really weird feeling to me, but should perform well and has a huge community behind it, HaxePunk is very familiar to me already, but also has a long way to go before I feel like it's properly useable.. and AS3 is my sharpest tool in the shed right now, but unfortunately doesn't perform the greatest.
A tough spot to be in, but it is also fun to learn new things. I hope I can get back to something solid soon!
I got back from GDC and I saw what people were working on and I felt kinda crappy about putting all this effort into yet another AS3 game with Adobe AIR. The problem is performance. Flashpunk has a hard time maintaining 60 frames per second because of weird Flash things... it's just not that super stable. Offspring Fling is a relatively simple 2d game and for whatever reason some people with modern computers have a hard time running it at 60 fps and this is extremely frustrating for both them and me.
One day I went through some of my old prototypes. I took a look at Gaiadi, my Ludum Dare game from three years ago (WHAT THE HELL HOW IS IT THREE YEARS OLD ALREADY.) One of the most disturbing things about it was how smooth it ran. The Game Maker run time is actually pretty dang impressive and it runs at a solid 60 fps, especially when compared to flash. This made me actually feel pretty bummed because Offspring Fling isn't nearly as stable (at least in my eyes.) It's one of those moments where I asked myself "am I somehow getting worse at making games?"
So I want to learn something new... but then I've already put all this work into this AS3 framework that I'm using. The amount of friction to start on something new is really tough, because right now in AS3 making things is extremely fast and efficient because I've solved a lot of my issues and have a bunch of helper classes with super fast solutions to common problems across my projects. AS3 just also has a ton of useful libraries that I make use of like TweenLite and AS3Crypto.
I started by experimenting with HaxeNME a few weeks ago. I decided to check out HaxePunk since FlashPunk is my favorite thing ever. At first I was incredibly pleased by the performance when building to a native windows target. 60 frames per second, consistently, with over 10000 entities being rendered and updated! I was super pumped. Haxe is also tempting because it's very similar to AS3 which I've been using a lot for the past couple years now.
Unfortunately I hit a pretty big snag with HaxePunk. It's just not in a very usable state right now, especially for native targets. The rendering code needs to be updated for these targets to fix a lot of issues. Sprite flipping doesn't work, the drawing functions like line, circle, rectangle, they all don't work, and there are some weird things that I don't like about the style (Image.createRect returns a graphic instead of an image, which then prevents me from using Image functionality such as scale, angle, alpha, etc.) HaxePunk is out of the question for now for any sizable game projects, but it's still very much a work in progress and I hope it becomes something more stable in the future.
So now it was on to something else. I still didn't feel like going back to my metroidvania project just yet, so I did some prototypes in Flashpunk for possible control schemes for various things on mobile devices. I recently picked up an iPad and I wanted to just play around with it.
I managed to set up FlashDevelop and Adobe AIR to compile right to my iPad, so I started to experiment with that. I first tried running a FlashPunk window on the iPad and I actually was pretty excited at first because a 640 x 480 FlashPunk window runs at 60fps on the iPad4. Then I tried to scale it up to the size of the screen and that absolutely murders it. The framerate was 20 or so with nothing going on.
...but wait! I just need to use Starling, or Stage3d in general. That should run much better on the iPad. Flashpunk 2 is currently in development, and actually you can see and use the in progress version of it in Saint11's Ludum Dare game, and that uses Starling as the base of its rendering system. I'll just stick Flashpunk 2 onto the iPad and see how that goes.
It took me a couple days of wrangling, but I eventually got Flashpunk 2 rolling on the iPad instead of just regular Flashpunk. At first everything seemed good except for a few minor bugs. I had some touch input working for something, but then I ran into performance issues almost right away. Not really sure what's happening right now, but Flashpunk 2 is still a work in progress so I'll have to wait it out until it's in a solid "1.0" version.
Okay so... now what? This entire time Tommy has been harassing me about learning C++ and using that for a game engine. I really don't think that's going to happen. I tried C++ in the past and it was a giant disaster. I spent 2 months just getting stuff to move around and render on the screen, and eventually I just hit a wall of too many bugs involving pointers and references and I couldn't go on... but maybe I'm smart enough now to handle it.
I've been playing around with SFML 2.0 and I finally got the simplest example program to compile, but I'm still not sure if I'm able to handle C++. The resources for C++ just seem way too scattered but maybe that's just my perception. What I mean is that when I search for a solution of a problem in AS3, I can easily find one definitive solution... with C++ I end up finding a bunch of completely different problems that might be related to what my problem is and then I'm going down this giant branching story path of why I might be getting a LINKER ERROR or a SEG FAULT or whatever, and I just get overwhelmed with information and I want to throw up.
I don't know if C++ is for me... but SFML 2.0 seems really nice. And there's also this Toast framework that someone wrote which is essentially just a C++ port of Flashpunk, but it's missing some core functionality that I make use of a lot like entity layering, and once again the Draw functions.
I also got into Unity a little bit and did some quick tutorials. I managed to make a Clock so far. I've used Unity a little bit in the past for making levels for things, but I've never actually coded and put together any sort of engine in it. Unity feels very strange to me, but I'm willing to give it a fair shot.
Also on my list is C# and Monogame. I started digging into this a little bit last year, but I had to put it down to finish Snapshot. I know that Matt has some pretty awesome stuff rolling in Monogame right now with Towerfall, and I'm hoping his latest framework becomes public in the future, as he tends to have the same line of thinking as Flashpunk, and anything like Flashpunk or Game Maker is easier on my brain.
The main problem I keep running into is update loop vs. event system. I don't like event systems and callbacks registered to event triggers. This style of coding is very hard for me to follow and doesn't make a whole lot of sense in my brain, but that's mostly caused by my upbringing in update loop environments. Klik & Play all the way through Multimedia Fusion is a big update loop that checks for conditions in a specific order each frame, and Game Maker can be coded the same way with everything happening in the Begin Step, Step, and End Step events.
The next big issue is the drawing stuff. Apparently the style that I prefer is "immediate" rendering or drawing modes (I just learned about this term a few days ago, haha!) I like the ability to do stuff like "Draw text, draw a line, draw a circle, draw text" and it all happens in that order, so the final text call would be above the circle, which is above the line, which is above the text. I use this kind of stuff for effects and I use all of this especially for rapid prototyping and visual debugging. These methods have become my bread 'n' butter for getting stuff rolling quickly. One of my favorite things in Flashpunk is to just say "var img:Image = Image.createRect(16, 16, 0xFF0000);" which just quickly creates a rectangle image on the fly. I can scale the rectangle, rotate it, blend it, tween it, etc. This stuff allows me to make super fast prototypes with some neat effects like squash and stretch right out of the gate, letting me feel out a game quickly and effectively.
Ultimately it just feels like I'm searching for an engine that doesn't exist. Andy Moore's recent post about searching for a unicorn resonates a lot with me. Every engine has its shortcomings and I just need to decide which one I'm most comfortable overcoming. C++ is super hard on my brain, but has the highest potential for performance... Unity is really weird feeling to me, but should perform well and has a huge community behind it, HaxePunk is very familiar to me already, but also has a long way to go before I feel like it's properly useable.. and AS3 is my sharpest tool in the shed right now, but unfortunately doesn't perform the greatest.
A tough spot to be in, but it is also fun to learn new things. I hope I can get back to something solid soon!
Comments
Personally I had a bit of a time adjusting to Unity's flow - I kept trying to do everything in code (btw C# is *it* for Unity, way more control) but once I stopped wincing every time I made something public just so I could tweak it in the inspector, I found I could accomplish things *much* faster. If you're at all interested in doing 2D in Unity I'd recommend an extension called 2D Toolkit - it really helps get things in order and has great support. Dan at Size Five's been using it for The Swindle as well so there's that. It's a good system that even supports custom plug-ins in a few places - like the animation editor for which I just wrote/released a new copy script that lets you copy any group of clips using a new set of sprites - perfect for palette shifts without redoing all the frames.
Good luck finding what's right though. If there's anything I can help with Unity-wise, just drop me an e-mail or a tweet (@TheVMan_) - I'm not an expert, but I've been been around the UI a few dozen times.
John: Yeah, I've been eyeing 2d Toolkit a little bit and followed some people that were using it during this past Ludum Dare. The easiest way for me to learn stuff is to look at source code for projects or games and see how something was implemented. I'm very much a "learn from example" type person, and one of the most helpful things is when there are example projects that I can look at that are in some way similar to what I want to do.
I might hit you up for Unity questions if I dive deeper into it! Right now it's still unknown @_@
I doubt it fits your criteria, but I'll throw this out there as its another tool I keep coming back to: http://libzoetrope.org/
angrytoad: Oh neat, I actually checked out Allegro some years ago, but I will definitely look at this new version now! I know that the Toast framework I mentioned in the blog post uses allegro for rendering.
John: That is one of the big points of Unity. all of my local friends here in Phoenix are Unity pros, so I would probably be able to get a lot of help if I experienced problems.
AF: I'll check it out, thanks!
Dan: Yeah, component model is kinda weird but I've been using something like it in my own AS3 games lately. Just gotta get used to it I guess! :I
In one sense, you already have an answer. You made a game using the tools that let you develop it comfortably, and it was OK. The technology was only working at 80% of what you wanted, but the sky didn't fall because of it. Switching tech is expensive - building tech is expensive.
Also, hardware is only going to get better, so even though Flash is still slow...it will feel relatively less slow as more people upgrade. I can tell you right now that this low-spec laptop from mid-2009 already has a lot of apps that are basically telling me, "hey you should upgrade."
A very conservative move, one that I've seen many devs doing, would be to use Haxepunk while staying within the Flash target - get all the code you like ported over to the Haxe environment, rework parts of Haxepunk where it's too broken for you - and then make a move to cut ties with Flash when it's time. This is roughly what I've done with my own Haxe code, which tends to lean closer to the raw Flash APIs. The answer for me in terms of porting to native has been "not quite yet, maybe soon," for a very long time, but in the meantime Flash has always been there when I want to ship something.
Matt: I didn't even know SFML was available for C# until just now, that's actually pretty awesome.
Fernando: Yeah I think I would be more excited if I was more into 3d instead of 2d. AIR just seems to be on the way out with the way that Adobe is treating it. That's the main source of my problem... Adobe has no idea what the hell they're doing lately :I
James: Thanks! I might just stick with this AS3 thing for a little while and finish out this metroidvania game, and then I'll refocus more on switching languages or seeing how HaxePunk is going at that time. I just get so bummed when my super modern beast computer just drops to 30fps while playing it, augh! I don't really want to use Haxe just to target flash though.. I would much rather keep using FlashPunk.
I don't really have the programmer power to go into the internals of HaxePunk and fix anything... I am not a low level programmer at all. I feel like if I was I would be busy coding my own engine right now. Even just working with the "low level" stuff of Flashpunk makes my brain hurt, like the internals of the Image class or the Text class or whatever. Blargh.
Original:
Kyle: No worries (less than 3) I've tried to install XNA a few times and it hasn't been fun, so I get where you're coming from. I actually set up new newest SFML .NET today, and it was literally 1) download a zip 2) take the .NET DLLs from the zip and add them as references in my IDE 3) move some other DLLs into my project folder. Done. Plus I'm using SharpDevelop, which FlashDevelop is based on, so a lot of things are familiar and the autocompletion is awesome.
Also what the hell I never heard until SharpDevelop until just now. LEARNING SO MANY THINGS TODAY.
Anyway, I also fixed my comments so that you can do hearts now, I think. <3 <3 <3 test.
http://struct.ca/futile
https://github.com/MattRix/Futile
It also has it's own subreddit on Reddit, and Matt pops in often.
http://reddit.com/r/futile
It's a 2D game making tool that like MMF or GameMaker will help making the process of making a game easier.
A lot of "non-coders" took on it and praise its quickness of use and pros also use it and have released and published games on various platforms thanks to it.
I'm biased since that's pretty much the only tool I've used since I discovered it (I went my way around several coding languages before finding about it though) and that's the tool that allowed me to complete my first "true" games as far as I consider.
You can have a look at some of my work on my website and check also tutorials I've made that show how to make different types of games with C2.
It has a free version to let you try it out if you can spare some time diving in and getting through the manual/tutorials.
I've been following you on twitter and seeing you "struggle" through "coding" and "what should I do" questions the last months, maybe C2 could be the solution you're looking for.
There will be an endless debate between "regular coding" vs "game making tools", imo the answer is about what you feel the most comfortable making games with. The truth is the first time I had tried Construct Classic (C2's ancestor) I felt home, it reminded me of Visual Basic I had used through my teenagehood.
I've started dozen of game engines over the years in various languages. But I always got stuck at some point because of some technical "boring" stuff that diverted my interest from what I was really looking for: "making a game".
As far as performances, ease of use, ease of access for the players, C2 has reached my expectations and even went far beyond. (it's HTML5, so a modern browser up to date is all a player need to access the game. There are also wrappers solutions that allow to export to native (windows, mac, linux executables (WIP)) and mobile (cocoonJS).
I haven't messed much with the native tbh, but I was able to release a game on the android store in two weeks work.
Once again I'm biased, and kind of a power user of C2, so it has my preference.
Yet, I've tried and keep on trying my best delivering tutorials, documentation and support to the community to "show" what and how you can do games with it.
I hope this message is OK and will give you the will to try it out and maybe, like me, "fall in love" with this tool and feel contempt to be able to make games by focusing mostly on the game design itself.
If you try it/have questions, just let me know or don't hesitate to join the scirra's forums which are amongst the most friendly forums you'll encounter on the internet. ^^
Otherwise good luck in your "search" and all your future projects.
Scaleform(http://gameware.autodesk.com/scaleform) or Iggy(http://www.radgametools.com/iggy.htm)
They may require a bit of C++ setup but they provide you a more performant flash runtime. Scaleform seems to actually have a Unity integration out of the box for ya. They are not free, but not insane either.
I don't believe they provide any AIR type platform stuff, that will need to be implemented by whatever you integrate it with.
Best,
Aaron
http://gamedev.tutsplus.com/tutorials/implementation/create-a-simple-asteroids-game-using-component-based-entities/
http://subpxl.wordpress.com/
This guy did a pong tutorial using Futile. He's got all the code there, if you want to take a look at the way he structured it. Anyway, just wanted to make sure I was getting the correct point across this time. Good luck with whatever you go with.
Aaron: Thanks for the heads up, but those solutions seem better fit for making game components like UIs using the Flash software? I might be mistaken to assume that though. I think AIR is still the best bet for exporting flash content to various platforms.
shawn: Thanks for the tutorial link, I'll check it out. I'm not tooo excited about implementing my own engine though. I don't really want to write stuff like my own rendering management, object management, collision detection code, etc... thats why something like Flashpunk is ideal. Chevy solved a bunch of those super hard problems for me already and I can just focus on making a game.
Tyler: Yeah, the whole addChild() to the stage or screen or whatever is more of a flash style and not a flashpunk/flixel style. I'll have to dig in deeper with Futile to see what it's really like.
Anon: Corona seems neat but ... it's only for apps as far as I can tell? I'm looking for a PC/Mac/Linux solution first and foremost. I'm not actually committed to doing anything with iOS and Android, as so far my early experiments with controls and the kinds of games I want to make are not turning out well ;p
Although I evangelize and protect Flash whenever I can, I'm feeling that it is going down a hill faster and faster.
I love the way it draws things and how simple is to setup a IDE to work with (download/install FlashDevelop, create new AS3/AIR project, press f5), but everything has a cost and AVM2 costing is too much for me right now.
I found out that UDK is my tool of choice if I'm making a 3D game.
But, although I know my way into 3D world (I'm a modeler alongside from coder), 3D game dev isn't my beach too, and most of the tools out there focus on it.
So, I'm tinkering with some techs around and couldn't find a way home...
Your point of view over C/C++ is exactly the same as mine.
Fussy, messy and scary!
MonoGame (I hate that C# UpperCamelCase style) is some of the greatest targets I'm looking at, but the setup workflow is a pain.
Not to mention that MonoGame is a undead XNA, so I'm bit afraid of support for it.
I'll keep in touch if I find a suitable place to sit at.
Post your comment!