I moved to a new URL! Check it out!

Dev Log: What the hell am I doing?

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.

Image


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?"

Image


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.

Image


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.

Image


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.

Image

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.

Image


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.

Image


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.

Image


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

Jacob Albano
Jacob Albano
Use SFML .NET! It's the best of both worlds. I'm currently using it to port a Flash game and it's going super smoothly.
Posted May 3rd 2013 4:49 PM
John Lethbridge
John Lethbridge
It's really sad to see what's happening with Flash in general these days. What was once I a pretty solid platform has been shaken to bits.

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.
Posted May 3rd 2013 4:56 PM
Matt Thorson
Matt Thorson
I can't see myself straying far from C# ever. As a language it's just perfect for my development style. I'm thinking my next game's engine will use SFML.Net and Mono actually, as mentioned above. Atom Zombie Smasher did it this way too! http://blendogames.com/news/?p=106
Posted May 3rd 2013 5:05 PM
Kyle
Kyle
Jacob: I kinda don't want to use something like .NET because then that introduces a requirement of the system to run, which is installing the .NET framework. The cool thing about Monogame is that it seems to be independent of those kind of ... dependencies.

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 @_@
Posted May 3rd 2013 5:34 PM
Jacob Albano
Jacob Albano
Not sure what you mean? MonoGame is a .NET project as well...at least if you're running on Windows. Mono for Windows isn't great, so generally that target is used for non-Windows platforms. Anyway, computers Vista and up will have .NET installed already.
Posted May 3rd 2013 5:40 PM
angrytoad
angrytoad
Check out Allegro 5. It's a C++ Game development library, handles the nice basic stuff you were talking about like drawing primitives (circles, rectangles, triangles, etc.), loading and using fonts, windowing, keyboard and mouse input, controller input, basic and more advanced sound stuff, etc. http://alleg.sourceforge.net/ It is often compared to SFML when people are looking for nice, simple game development tools for C++.
Posted May 3rd 2013 5:45 PM
John Krajewski
John Krajewski
Deciding on a framework is one place where it's good to follow the crowd, so you're ensured a decent amount of support on whatever you want to run it on. For that reason Unity is a great choice: very flexible, you see teams big and small using it, and it's really becoming the engine of choice for the foreseeable future.
Posted May 3rd 2013 5:47 PM
AF
AF
I can relate... I keep searching, but nothing is quite what I'm looking for.
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/
Posted May 3rd 2013 5:52 PM
Anonymous
Anonymous
I've been considering this question myself a lot lately. Unity is really great if you can get into the component model, but it really doesn't sound like the mentality you're after. Honestly, everything you're looking to do c#/mono does very well.
Posted May 3rd 2013 5:53 PM
Dan Fessler
Dan Fessler
^ that was me... forgot to put my name :(
Posted May 3rd 2013 5:54 PM
Kyle
Kyle
Jacob: Ah crap sorry my mistake! I was assuming Mono had less dependencies since it's multiplatform and is a substitute for XNA which required a bunch of installers (at least in my past experiences with it)

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
Posted May 3rd 2013 6:03 PM
Fernando
Fernando
Right now I can't see myself using anything but Unity, if not only for the combination of c# (I'm loving the strict type and the IDEs available), the rapid implementation of features, it's market-tested and it compiles-into-everything-you-could-ever-dream-of, but then again I'm not a wizard in 2D stuff as you are. I and other devs would agree this is the best time to steer away from Flash/Air.
Posted May 3rd 2013 6:06 PM
James Hofmann
James Hofmann
I'll argue for not doing anything too radical.

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.
Posted May 3rd 2013 6:13 PM
Kyle
Kyle
Whoa awesome thanks for the responses everybody!

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.
Posted May 3rd 2013 7:06 PM
Jacob Albano
Jacob Albano
Kyle: No worries
Posted May 3rd 2013 7:20 PM
Jacob Albano
Jacob Albano
Haha, your blog interprets Less-than 3 as an HTML tag or something? Most of my message didn't show up.

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.
Posted May 3rd 2013 7:22 PM
Kyle
Kyle
Hahah oh snap, I think you're right... I never tried a heart and I think strip_tags must be just murdering everything inside of a possible html tag!

Also what the hell I never heard until SharpDevelop until just now. LEARNING SO MANY THINGS TODAY.
Posted May 3rd 2013 7:46 PM
David Koontz
David Koontz
You know my vote already :) Unity evangelizing aside, I do think the various C#/Mono based options are a really good, both MonoGame and SFML.NET. Mono is way better suited for standalone deployment than .NET so I think you'll be fine being able to deploy an exe or .app bundle using either library. Or you can just come over to Unity with all of us and be assimilated finally.
Posted May 3rd 2013 8:35 PM
Kyle
Kyle
I guess what would make me feel better about Unity is a solid 2d mode that's supported by Unity and not just some asset store stuff. I've been hearing about the fabled Unity 2d since... 2010? So I dunno what's going on there.

Anyway, I also fixed my comments so that you can do hearts now, I think. <3 <3 <3 test.
Posted May 3rd 2013 10:31 PM
Tyler
Tyler
I just recently stumbled onto Matt Rix's Futile. It's sort of like a Unity plugin. I haven't dug too deep into it, but so far it's very AS3-ish. You get all the benefits of multi-platform exporting, and so far everything runs at ~60 fps.

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
Posted May 3rd 2013 11:30 PM
Kyle
Kyle
Yeah, futile seems pretty neat and is on my list to check out after I get more familiar with Unity itself. Although I do use AS3, keep in mind that I use Flashpunk, which subverts the entire standard flash way of doing things with adding children to the stage, movie clips, sprites, etc. All of flashpunk runs inside a single Sprite object that exists on the stage, so a lot of the standard flash paradigms are a little strange to me. (Event based/callback stuff)
Posted May 4th 2013 12:29 AM
Kyatric
Kyatric
I hope I'm not appearing as "spammy" here, but have you tried Construct 2 (http://www.scirra.com) ?

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.
Posted May 4th 2013 12:49 AM
Aaron
Aaron
Hey Unity and Monogame are decent choices. Another alternative if you want to take another attempt at keeping your dev environment the same.

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
Posted May 4th 2013 6:27 AM
shawn
shawn
Seems like the obvious solution to just write a simple 2d game engine on top of Starling...? Nothing too tough about that. Then you get performance, stability, then whole works.
Posted May 4th 2013 9:38 AM
shawn
shawn
Check out this tutorial by Iain Lobb on building a simple component based game engine. Super simple to convert to Starling:
http://gamedev.tutsplus.com/tutorials/implementation/create-a-simple-asteroids-game-using-component-based-entities/
Posted May 4th 2013 9:41 AM
Tyler
Tyler
I guess what I meant by "AS3-ish" was that it would be similar to what you already know. I haven't used Flashpunk, but I did come from Flixel, which I understand is very similar. So, don't think I mean it's like straight Flash programming. I was only talking about syntax.

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.
Posted May 4th 2013 2:45 PM
Anonymous
Anonymous
What about Corona? It's fairly simple and portable and can be run at 69fps.
Posted May 4th 2013 7:14 PM
Kyle
Kyle
Kyatric: Unfortunately Construct 2 just isn't what I'm looking for right now. I'm not really too interested in going back to an event sheet based system. I've grown pretty fond of coding and myself to be much much faster when working with the right code vs. trying to assemble logic with a GUI.

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
Posted May 5th 2013 12:43 AM
NemoStein
NemoStein
Kyle, you aren't alone in this boat.
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.
Posted May 5th 2013 11:05 AM
Fedyfausto
Fedyfausto
But you haven't try StarlingPunk? it's a porting of FP but with Starling Graphic Engine. :) Or use native starling! :D i'm try it now if you wanna some help :D
Posted May 7th 2013 1:51 PM
new comment!

Post your comment!

Name
Email
Comment