Prototype RPG Game – Part 2

January 3rd, 2010

A while ago I posted a Prototype RPG Game using the Sandy engine. Well, today I am not going to share the code, but how I managed to make it (I spent about 1 hour on it)… and you will probably slap your head and then go crazy making your own 3D prototype RPG game.

I suggest you go check it out first before you continue reading.

Looking at the level, you will see that there are cubes on a plane; or blocks on the ground if you prefer to call it. Also, moving your character around the stage you will notice that the blocks are randomly placed, yet evenly spaced. It’s almost like a grid of cubes/blocks on the X and Z axis. Hopefully that makes sense.

So how do you think I am managed to do the collision detection with the character? Some physics library like JigLib? No. That could have been possible, sure, but that also would have required more files, reading another documentation, praying flash doesn’t use more memory (haha, yeah right!), just to do some collision detection for some cubes.

So what did I do? I use the classic tiled based approach to accomplish this!

Go look at the Prototype RPG Game again and you will see it. I have had a lot of time developing tiled based games for fun (not any published though, ahh!) and a good amount of time on Tonypa’s tutorials on how to make the classic engine in flash. One day I decided it would be nice to make a 3D rpg game using flash, but I didn’t know how to do any collision detection… and that’s when I thought of combining the two.

The rpg prototype I presented has the camera behind the character and above the head. Its easy to change the camera to be above the character instead to give it the grand theft auto 1 and 2 game style approach. Or you can make an isometric game if you position the camera probably – and let the 3D engine do the depth sorting for you ;). Or you can make a 3D like mario platformer game. You may even be able to make a FPS (first person shooter) like this… just a thought though.

I am almost certain that most of the tutorials on Tonypa’s site can be used to make a tiled based 3D game. You would just need to rule out one of axises when doing collision detection, like I did in the prototype game. I used the Y axis for only setting the cubes and planes, then I used the X and Z axis to check for the tile collisions with the hero/character. For a mario like platformer, you wouldn’t use the Z axis and just use the X and Y axis.

A final note before you get started: don’t forget to adjust the code to consider the center points of the objects. For example, in a tiled based game the center point (or registered point) is the top left corner, the plane or a cube using anything is in the middle.

Again, I will share the code of what I done soon.

Share your thoughts on what you would now you know about this, lack for a better for word, trick.

AS3 > Flash > RPG

Prototype RPG Game

October 3rd, 2009

This was requested. A request of a 3D RPG game. Well, what I to present to everyone isn’t a RPG game, but its a great prototype, and as you can see, it has great potential.

I am using the great Sandy 3D engine to accomplish this feat. What I really like about Sandy compared to the other flash 3D frameworks out there, is the simple, clean, and quick API. It has its drawbacks, but you usually can find a work around for it – sometimes.

In this example, all the hero does is walk around the stage, doing simple collision detection. Of course, this little stage can be expanded to be a small village with people walking around, people to talk to, items to pick up, trees, doors, etc. I might be able to get to this eventually, depends on the high demand.

Read the rest of this entry »

AS3 > Flash > Games > RPG

RPG Enemy Attacking – Part 1

November 12th, 2008

Every RPG will an enemy, and there several ways to go about implementing enemies into our RPG game, the two ways I can think of off the top of my head are:

• Enemies on the map will chase the Hero if the Hero gets too close
• Random battle encounter every so many steps the Hero takes

If we go with option 2, we simply check what type of map/level it is, set a random number, and every step the Hero takes we decrement that random number, and if that random number reaches below 0, we go to a battle scene. If we go with option 1, there would be 2 kinds of ways to have our Enemies chase our Hero. One way is, we can have the enemies chase the Hero straight on, or secondly, use a little path finding.

Read the rest of this entry »

AS3 > Games > RPG

RPG Item Gathering / Pick Ups

October 7th, 2008

This is a slight continuation from the last tutorial of the RPG series, and it was requested by Chris.

In the last tutorial, we have set up our Intentory menu and allowed our Hero to use selected items and drop the items once the item’s quantity was zero. Now let me share with you how we gather/pick up the items that are laid across the level.

I will admit upfront, this way of creating item gathering is very different from what you might expect, buts its quite useful and easier to work with once you get the concept of it.

Read the rest of this entry »

AS3 > Games > RPG

RPG Inventory

August 22nd, 2008

This tutorial is continuing from the RPG tutorials previous posted, RPG Character Movement Part 3

Making an inventory for our Hero is needed. Our Hero is most likely going to pick up items along his/hers journey, and those items need to stored and saved for later use. The Hero could pick up some Potion or Bread and use that to heal himself when low on HP (Hit/Health Points). Well, lets start setting up a in game menu movie clip which is of course very needed as well. The in game menu movie clip at this point will just have a button called “Inventory” which will open a list of items our Hero has been carrying around, but we can use the in game menu for other things like “Options”, “Quests”, etc. But for now, lets just do the Inventory. Before I begin, prepare yourself for a lengthy tutorial.. but I assume you knew that before beginning? Lets start…

Read the rest of this entry »

AS3 > Games > RPG