Friday, February 17, 2012

Nape and Flash Develop - Tutorial 3: Joints and you, a comprehensive guide

Hey guys! Here it is! Albeit a little late, here is the third installment of the Nape Physics Engine tutorials, focusing on Joints and the various types of constraints that you will come across programming for the Nape platform. I apologise if it seems a little rushed, I've been wanting to get this movie up for you all a long time ago, but haven't managed to have the time, but finally got my act together and produced something.

Expect to see the production value of my movies go up significantly in the coming weeks as I start to get a little more technical with the things that we do with the engine.




As I say at the end of this movie, I'm planning on doing a few other things with Nape aside from the normal tutorial series, which is next going to delve into Collisions and how to deal with events caused by them etc.

I'm also going to be starting another series which puts into use my new software MazeGen, and takes the XML files generated from that into a Nape backed physics file to create physical mazes! Stay tuned, now that I'm back at home, I hope to be churning movies out midst all the other stuff that I have going at the moment.

Also, one final thing, in regards to a github repo for this tutorial, something that I forgot to mention in the actual movie is that I haven't made one, the reason being is that the code changes several times and the most that you can hope to get out of it is just a single example of a joint. The purpose of this movie was more informational than actually build something.

Thanks again guys,

David out.

Thursday, February 16, 2012

MazeGen v0.0.1

Hi guys, bit of an update for you all, and the introduction of a new piece of software to my online portfolio! I present to you all MazeGen. For a few moths now I've been infactuated with Maze Generation tools and how to create dynamic mazes that are both solveable and highly complex. I spent a lot of time on Emanuele Feranato's site (found here) which goes through how maze generation works and there are a few open source code snippets on the matter also.

The main reason that I was interested in maze generation is that I have a passion for maze type games - anything that is both puzzling and interactive. So mazes and maze generation is perfect for me! What I originally set out to do was to use the code on Emanuele's site to in turn create physics objects from the generated maze, which could then be manipulated as I saw fit.

The way in which I envisioned the code working was this:

 - given a height and a width the maze would generate
 - the maze would then be sent to an xml file, with each row of the maze having a row in the xml file, 1's representing a wall and 0's a gap. This would allow for the maze to be broken down into something akin to:

1,1,1,1,1,1,1
1,0,0,0,0,0,1
1,0,1,0,0,0,1
1,0,1,0,1,0,1

etc.etc.

- The XML file would then be parsed by a physics creating loop which essentially looked through each row, and for each 1 it found, create a physical object. Thus leaving us with a maze!

I had several fairly major problems along with way. My main issue was that I was targetting Corona SDK for the project - which, took on the actual code generation part of the task admirably, but when it came to converting the XML file in to a tangible maze I found that it had some pretty major shortcomings. The biggest of which is that you can't actually create a compound physics object, which is a large object made up of smaller objects all tied onto the one entity, the reason that I needed this was that in order for the object to remain a whole maze would be that each wall was connected to the ones next to it, without this, say for example when the maze rotated, each individual block rotated about it's own axis as opposed to rotating about the center of the maze.

After a few weeks of frustrated bashing away at the keyboard I turned back to my flagship language Flash to get things moving. I re-wrote the maze generation code and put Nape in as my engine of choice, which turned out to be a godsend, as Nape allows you to push as many "shapes" as you want into a single body before creating that body in the world, which in a nutshell was exactly what I needed.

So, now that I had a working system, I went about modifying the maze generation engine to make things easier say for a person wanting to make a maze based game. The major things that I wanted to produce with this piece of software was ease of use and simple interface interaction, this alpha release accommodates these features, as you can see from the screen-shot, there is some very limited functionality. The user manual (however brief,) will uploaded and available for reading along with the swf.

Here is a link to MazeGen v0.0.1 - this will open up in a new pop up window.

I'll give you all a quick rundown of how it works - enter in a width and a height into the respective boxes, and then hit generate. You'll get a image of what the maze would look like, if you don't like it you can just hit generate again until you find a maze that you like.

When you do, click the Save Maze to XML File button, this will push the Maze into the XML file, that particular maze is now "saved." And you can enter in a new width and height to get a new maze to save.

Once you have finished generating all the mazes that you want, click the Save to disk button, this will give you the save file prompt and you can select where on your computer that you want to save the XML file.

v0.0.1 is by no means bug free - I expect that there will be problems, but the major ones I hope to have plugged by now.

In future versions I'm hoping to introduce a number of other things:

 - Multiple export types
 - Load XML file
 - Edit Mazes that are in the XML "stack"

Thanks for reading through all of this, and I hope that you have read up to here. Please feel free to have a play with it and I'll soon be uploading a video of how to get the XML file back into Flash and generate some physics objects from it!

David.

Tuesday, January 24, 2012

Upcoming tutorials

Hey team, I know it's been forever since I posted, and there's good reason too! I've had massive computer problems, and have just managed to get myself back online and everything shipshape again. For readers of the blog, and people that are watching my tutorial series on Flash Physics, the next two movies (Box2D and Nape) in the series will be out just as soon as I get some good recording software and a mic for my new Mac.

I will be covering the creation of joints, and the various different joint types and what you would use each type for. I also have a special video that I want to record to show you all a little something that I've been working on, and hopefully include a few of you in too!

Thanks for everything guys, if you have any questions, feel free to ask me!

David.

Saturday, December 24, 2011

Merry Christmas and a Happy New Year!

To all readers! Merry Xmas and a Happy New Year,

As you're all probably aware, I've taken a bit of a break from tutorials etc for the time being but let me assure you come the new year I'll be starting them up again!

Thanks for your ongoing support and for those members that have joined up to my YouTube channel!

Cheers,

David.

Friday, November 18, 2011

Blog Update

Really quick post - updated the look of the blog (as you can obviously see.) I've also put in some links across the top bar, you can now visit the youtube channel directly if you want to watch a series of movies one after the other, and I've also made another page which has each of the tutorials listed, incase you wanted to watch a specific tutorial again.

Cheers,

David

Nape and Flash Develop - Tutorial 2: Sprites!

Hey guys,

Here's the second part in the series of tutorials I'm running on Nape physics engine, this tutorial goes over sprites and how to get them into your game!



Let me know what you all think and as I say at the end of this movie, part three is going to deal with joints and moving objects with the mouse!

Thanks guys,

David

Box2D and Flash Develop - Tutorial 2: Sprites

Hey guys, here's the second part in my Box2D tutorial series, it's fairly short, but goes over the important method of how to give physics bodies a physical representation!




As always if you go to my youtube page you'll get the link to the github repo to download source code if you're lazy and don't want to type it out yourself! :P As I say in the movie, part three will be out soon enough with how to do joints! Thanks guys! David