Category: Uncategorized

Sleepwalker game now Open Source

By robin, July 28, 2010 12:32 pm

Sleepwalker XBox Indie gameOur Sleepwalker game in now open source. It was built with Swf2XNA and it a good example of how you can build an XNA game using Flash and C#.

You can find the source and more info here: http://wiki.github.com/debreuil/Swf2XNA/sleepwalker

SVG vs SWF, Seven Years Later

By robin, July 25, 2010 4:15 pm

horse animationAbout seven years ago I made a swf to svg converter. It converted all graphics and animations and played fine (if a bit herky jerky) in the Adobe SVG player. As far as I know all markup was legal and approved (I avoided any player specific hacks and scripting). Now with an increasing interest in svg due to Html5 and Apple, I thought I’d revisit the project. Chrome and Mozilla can play SVG content now, IE might one day, who knows, maybe it can finally be useful!

Or not. For a final demo, I shrank and spliced an old Flash3 animation that showed off what the converter could do without choking the player. While it didn’t look set to take over, it was a start – like many people I really wanted vector control at the page level so all was cool. “Imagine what the future will bring!”

Have a look for yourself:
SWF Animation
SVG Animation (warning, may take down Chrome)
Download

In Mozilla the svg just gives a blank screen. Chrome has a little more luck – it plays for a bit and then gives an ‘oh snap’ error. The swf to xaml converter we made suffered a similar fate, and broke later versions of xaml tools as well. Fwiw, all flash animation we have (going back to Flash2) runs flawlessly in the latest player, as does 99.99% of our actionscript code. This is seriously something to consider when moving your assets to html5 (or any direct play xml based format imo). But hey, you can bet on whatever horse you like – just you really should watch them warming up first – in these links above that is ; ).

chrome svg animation
SVG animation plays in Chrome, sort of (used to look great!)

Chrome End
…and then it dies.

I’m sure it will have uses. Any new graphic support in browsers is a good thing — just don’t bet on it replacing Flash anytime soon.

Remapping shortcut keys in FlashDevelop

By robin, July 24, 2010 8:29 pm

*** Note: You can do it my way below, or you can do what Philippe Elsass (who probably made the feature) says below. Err, thanks Philippe!
Shortcuts which are not in MainMenu.xml can be changed in plugin settings. Press F10, and look into ASCompletion settings.

Now back to our regular scheduled irrelevant blog post : )

**************************************

This is a mental note to self. I think I put a note like this on my last blog, and its gone now. Damn internet wreckers!

So I always map F3 to copy and F4 to paste, otherwise my arm gets shooting pain, and not the big H type. F3 is easy, just open ProgramFiles>FlashDevelop>Settings>ScintillaMenu.xml. Duplicate the Copy command, and change Control C to F3. You might as well do paste as well, but it won’t work yet. This duplicates those things in the menu – there is a MainMenu.xml file that has copy and paste, but that didn’t seem to work for me.

The problem with F4 is it is used by OpenDeclaration, and because of this it is added to an ignore list, and is ignored when I map it to paste. I’m not sure the following step is needed anymore, but I recompiled the source and changed the hardcoded value at ASCompletion>Settings>GeneralSettings.cs line 36:

const Keys DEFAULT_GOTODECLARATION = Keys.Control | Keys.F11;
const Keys DEFAULT_DECLARATIONBACK = Keys.Control | Keys.F12;

That still didn’t take. The last thing needed it to go to FlashDevelop’s Tools menu, and select Application Files. This brings up the config folder, and from here you want to load Data>ASCompletions>Settings.fdb
These are binary flashDevelop config files, so you need to load them in FlashDevelop. Add the the part two tags at the top, and change to whatever keys you want:

<GeneralSettings xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<GotoDeclaration>F11</GotoDeclaration>
<BackFromDeclaration>F12</BackFromDeclaration>
<JavadocTags>

Last caveat: When you save this file is saved, however the settings require a restart. When you close, it will be overwritten with the old settings! Ok, so save, go to explorer and rename a copy, close, switch the copy back, et voila! Now those are remapped, and F4 will paste.

Whew.

Sleepwalker (Swf2XNA) released!

By robin, July 12, 2010 11:48 am

Sleepwalker has finally been passed and released, just in time for me to be starting more contracting :)

http://catalog.xna.com/en-US/GameDetails.aspx?catalogEntryId=635e46d7-3dc3-4caf-aad1-6ab7b78ba3f3&type=2

Have a look, if you know flash it is really easy to make something like this (or better of course). This took my brother and I two weeks, though the sequel will take a lot less time. I think I’m starting to understand why Hollywood likes sequels when no one else does.

Getting started with Swf2XNA

By robin, July 1, 2010 5:04 am

Swf2XNA is now live! This is an open source (BSD) program that allows you to make Windows/XBox/Win7 games by leveraging Flash for assets and layout, as well as using Box2D visually. It makes 2D games in XNA quite simple to make!

There is a reasonable amount of documentation, some videos, and a lot of sample code and components. If you have any questions, feel free to email or ask on twitter (I’m there more often than anywhere – @debreuil).


Getting Started with Swf2XNA


Swf2XNA Components

48 hour game at PegJam (Sleepwalker, made with Swf2XNA)

comments Comments Off
By robin, May 31, 2010 2:09 pm

Great weekend. PegJam was the 2nd Winnipeg version of TigJam, which is where game devs from all over get together for weekend of coding madness. I believe the idea is to make a 48 hour game, but the whole thing is more about ideas than rules. There were some really really talented people around, and by demo time Sunday night it was pretty phenomenal what everyone had done. Really, it was like, wow! Huge thanks to Alec Holowka and everyone involved : ).

Sandy and I really wanted to test out the swf2xna framework in a real world deadline situation, and the 48 hour game seemed perfect. Sky and Free (my sons) helped a ton out too – in spite of missing almost a full day for their concert, they added (to the framework) shadows and highlight shaders, zoom/follow camera, and lots of physics goodness. Sandy made all the art from scratch in Flash. Most of the coding time was spent on components, but we managed to finish the main screens and three levels (the levels are very quick to make now though, as it is just placing assets in flash and testing). I was sort of keeping track of time, I figured Sandy and I spent roughly 16 hours on it, and Sky and Free 8 each. Lots of visiting was happening, which of course was the best part!

Note: swf2xna does box2d layout (in a similar way to the V2D layout engine for flash). It uses the super duper box2dXNA port, which is optimized for xbox – highly recommended!

Here is the game:

JSFL for Circles, Grids, and Auto-Naming

comments Comments Off
By robin, April 28, 2010 3:18 am

I’m doing a lot of layout for some games using the swf>xna converter. One thing that is tedious in flash is renaming all your instances sq_0, sq_1, sq_2… Also grid layout is more tedious than it should be, and circular layout almost not doable (Flash really needs a ‘repeat’ like ctrl’R in CorelDraw!). Jsfl to the partial rescue.

These are the scripts I’ve been using a fair bit, they are somewhat handy to me, so posting them here just in case they are for you too. Like all script it is basically vomit on the page, tweaked until it barely works, so buyer beware. Basically you select objects on the stage, and run the commands.

// makes groups of grids in place (and reindexes) based on the w/h and instance root names.
// Selection of multiple groups allowed.
// eg. 20 objects with the root “square” and 15 with the root “circle”
// will make two grids, one of circles and one of squares.
// To change the center point between fixed, averaged, or weighted, look at the last lines

http://blog.debreuil.com/images/CirclesAndGrids.zip

makes circles with jsfl

Remove components from circuit board with cooking oil

comments Comments Off
By robin, January 23, 2010 2:39 am

Want some easy components? I’ve tried lots of ways to get things off a board, but this works the best so far. Heat guns are too uneven, smelly and require your hands to be occupied. Desoldering is fine for things with few leads, but a pain for chips etc. Just skillet heat is also pretty uneven and can soften the plastic parts too much.

Solder melts at about 200C, and oil boils at about 250C (some types are hotter than others – canola oil is about 200C, peanut oil is about 250). So frying the boards bottom works great.

Place a thin layer of oil in a thrift store skillet (solder may contain lead, so don’t cook with the same one later). Ideally it will be adjustable temperature, and must have a flat bottom. Once the oil is hot, place the board in it for a few minutes. Ideally the oil doesn’t flow over the edge, though it may a little. You can then just pull most things off with a pair of leather gloves. Even plastic connectors tended to be fine — nice!

Note: Splattering oil is the big danger here. Safety goggle not an option. Leather gloves as well. Will try to get photos tomorrow…

Class View in VS2008

By robin, November 13, 2009 3:11 pm

One thing I really liked in Eclipse that is not in VS is the class view panel. I have no idea why that is missing, it is basically in every IDE down to almost emacs. There is a ‘Class Viewer’, but this is an object tree of all classes, and doesn’t follow along as you switch files.

My workaround, that is “not quite so lame but still very open to suggestions“, is to slide the Class View splitter almost to the top (exposing more class details space, less solution space), and then map refresh to F1. Yes F1 — I know it is supposed to be for help, but that is just stupid in an IDE. 911 is for help, function keys should map to common tasks (and not common features in programs).

So the setup is this:

  • View>Window>Class View (enabled)
  • drag the Class View to dock beside Solution View on the right.
  • drag the mid bar way up
  • Tools>Options>Environment::Keyboard — type “view.sync” into the Show Commands Containing input field
  • Assign F1 to that in Press Shortcut Keys
  • Be sure to click Assign to assign it.

While you are there you can map Copy to F3 and Paste to F4. Then you too can be happy like me, its fun.

Now anytime you want to see that view up to date just press F1. Yes, much lamer that auto update, but it is as close as I could get. It actually is pretty much OK like this.

Full Flash Character Animation in XNA with 3D Overlay

comments Comments Off
By robin, October 10, 2009 11:03 am

The animation engine in XNA is mostly complete now. It does multiframe symbols as well as nested animations. It also handles negative scales which Flash is fond of, and XNA not so much. The Box2D part is also working with nested animations, and there are some simple components in like Button with the different states. Next up is adding replacement markers. So for example if a flash symbol is exported as ‘$ship$’, the vector graphics will be replaced with a 3D model call ’ship’ at runtime. That model will then behave as a regular sprite or box2D element (so a 3D model that only moves in 2 dimensions, with 2D physics applied).

Here is a quick demo:

Going to L.A. for the week, but I should have time to finish up the first game with this (almost there).

Panorama theme by Themocracy