How to make RPG games in DSGM 5

Learn to use DS Game Maker by Example.

How to make RPG games in DSGM 5

Postby JanMulder » April 24th, 2011, 3:44 pm

Hey all,

Some time ago, I told you about the RPGlib I had been making. Since I didn't feel a new version of DSGM coming up and James didn't want to say whether he would add it or not, I made some awesome actions!

I also updated the library a bit. So it is able to talk to people/check things out when pressing a button or whatever. You can also program the game so that it can walk through doors etc.

The .dsgm file is made of 3 backgrounds, 1 sprite, 2 objects and 24 actions which create the also included .nds file. I also uploaded some actions that are somehow not included in DSGM by default...

The sprite has to have 12 frames in this order:
stand still heading left
right foot in front heading left
left foot in front heading left
stand still heading right
right foot in front heading right
left foot in front heading right
stand still heading up
right foot in front heading up
left foot in front heading up
stand still heading down
right foot in front heading down
left foot in front heading down

The collisionmap is a "tile collision map". Since we're just using tiles we don't need to make a full sized collisionmap. Look at the .dsgm file for an example.

The normal map is just what the world looks like. The RPG sprites will move through it in tiles.

The higher layer map is optional. It is a map which will be seen over the RPG sprites.

The actions:
Init RPG:
Enables the RPG engine for a screen.
1: Screen
2: Tile size (size of the sides of a (square) tile in pixels)
3: Colmap Layer (layer on which the collision map is loaded)
4: Map layer (layer on which the normal map is loaded)
5: Higher layers? (True for enabling a higher layer)
6: Higher layer (layer on which the higher layer is loaded (0 if disabled))

Init RPG Sprite:
Enables a sprite to move like Ash.
1: Main character? (Is it the character in the middle of the screen?)
2: Start tile X
3: Start tile Y
4: Correction X (How much has to be added to the X position of the sprite to fit perfectly (most of the times negative)
5: Correction Y (Same but for Y)
6: Speed (How many frames should it take to move one tile)
7: Solid?

If RPG Sprite Moving:
Checks if an RPG Sprite is moving.
1: Main character?

Move RPG Sprite:
Moves an RPG sprite in tiles. It also returns which color it is heading to. If the color isn't red it won't move.
1: Move to color (the variable to which the color it is heading to will be stored)
2: Main character?
3: Direction (RPG_LEFT, RPG_RIGHT, RPG_UP or RPG_DOWN)

Make RPG Sprite Look At Direction:
Title says enough.
1: Main character?
2: Direction

Set RPG Speed:
Sets the speed of a certain RPG Sprite. (make sure the sprite's not moving)
1: Main character?
2: Speed

Use RPGlib:
Use this in a step event (Only in one object!!!)

Hide Background:
Hides the background. Useful for collision map.
1: Screen
2: Layer

Load Background:
Loads a background on a layer of the screen.
1: Screen
2: Layer
3: Background

Set Sprite Layer:
Sets the layer of a sprite (most likely to the same layer as normal map).
Use in Step event (seems to be the only way it works)
1: Layer


Don't forget to include the RPGlib(for5).c

I hope you like this even though it has gotten a little bit more advanced than I hoped it would get when James included it.

Please post your suggestions, comments, questions, reviews, rpg games and essays about flying squirrels here!

Have fun!
Attachments
Init RPG.action
(219 Bytes) Downloaded 675 times
Init RPG Sprite.action
(276 Bytes) Downloaded 498 times
If RPG Sprite Moving.action
(177 Bytes) Downloaded 513 times
Move RPG Sprite.action
(197 Bytes) Downloaded 501 times
Make RPG Sprite Look At Direction.action
(199 Bytes) Downloaded 513 times
Set RPG Speed.action
(168 Bytes) Downloaded 466 times
Use RPGlib.action
(69 Bytes) Downloaded 520 times
Hide Background.action
(108 Bytes) Downloaded 468 times
Load Background.action
(139 Bytes) Downloaded 483 times
Set Sprite Layer.action
(138 Bytes) Downloaded 509 times
RPGlib(for5).c
You have to include this file (Game Settings)
(10.76 KiB) Downloaded 519 times
RPGlib.dsgm
(84.15 KiB) Downloaded 691 times
RPGGame.nds
(327.56 KiB) Downloaded 701 times
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby Jason » April 25th, 2011, 4:50 am

JanMulder you have done it again. This is crazy and very well put together. I must say that with your explanations on how to use the actions, It's going to make making RPG that much more easier. I downloaded all the files and have been experimenting with different things now.

This is truly amazing, great work Jan.

*I did find one thing with running, If you press 'B' and then release your character still runs around instead of returning to walking speed. I'm sure this is a easy fix.
Lurking
Jason
 
Posts: 251
Joined: December 30th, 2010, 6:35 pm
Location: Australia, Perth.

Re: How to make RPG games in DSGM 5

Postby JanMulder » April 25th, 2011, 6:56 am

Thanks, Jason!

About the running, yes it is easy to fix.

Nice you're experimenting with Jason, I hope more people could do that! So I can make it even better!

btw, James, I don't like the sprite system in DSGM 5. Especially the sprite numbering part. You can't actually number them yourself. So for example in the RPG_LookingAtRPGSprite function, which returns an RPGNumber, if you know which RPG Sprites you can talk to you give them sprite numbers 3 to 7. So you can easily make an if-statement. Now you have to do like this (number == 2) || (number == 4) || (number == 5) || (number == 7)
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby Buck_7 » April 30th, 2011, 11:21 pm

What if I want to make a full scale collision map? They're much easier to make and I'm not sure how small I'll have to make the small collision map.
User avatar
Buck_7
 
Posts: 1460
Joined: February 19th, 2011, 1:44 am

Re: How to make RPG games in DSGM 5

Postby JanMulder » May 1st, 2011, 8:10 am

One pixel per tile. So just open Paint, zoom in to 400% and plot red where you can walk and plot any other color where you can't walk. Believe me it's easier, faster and it uses less RAM.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby cilein » May 1st, 2011, 9:04 am

I was writing an iOS platformer engine last week that used this idea without color detection, just a 2D array and a function to get the location of a point translated into tiles. Works great, functions to deal with 'jump through' but not fall through' and angled tiles functions work too.
cilein
 
Posts: 298
Joined: December 31st, 2010, 12:10 am
Location: EU

Re: How to make RPG games in DSGM 5

Postby JanMulder » May 1st, 2011, 9:41 am

Yep, it's really useful. BTW cool you're writing for iOS. I wish I could do that, but unfortunately I don't own a Mac.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby Nobody » May 2nd, 2011, 12:07 am

I'm semi reluctant to open this, because it seems a little complex and confusing, but i'm sure it will make since once i download all the stuff and look at the example.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to make RPG games in DSGM 5

Postby JanMulder » May 2nd, 2011, 8:06 am

It has gotten a little more complex than I wanted it to be. It would have been easier if James had implemented it. There could have been a tab in the Room for RPG support etc. But I think you guys are going to have to do it with this.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby Nobody » May 2nd, 2011, 10:40 pm

Yeah, but i think it would be in my best interest to learn this new technique because it might pay off in the long run. Quick questions though, one how is it much different than a regular collision map, and two, based on what i see, you could easily adapt this into a platformer engine right?
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to make RPG games in DSGM 5

Postby JanMulder » May 3rd, 2011, 9:10 am

how is it much different than a regular collision map

Take a look at the collisionmap in the example. Zoom in a few times. You'll see that it's one pixel per tile. So one tile on the normal map equals one pixel on the collisionmap. If you take a closer look you see there are several different colors used (Red, Black, Yellow, Blue). The red pixels are the tiles where you can come. The pixels with any other color than red are the tiles where you cannot come. If you use the action Move RPG Sprite, you'll notice that the first argument is a variable. This variable will be set to the color of the tile he will be going to. So if the variable equals PA_RGB(31,0,0) , which is red, the sprite is able to walk in that direction. If you use different colors and he bumps against a, say, yellow tile it knows he can't go there, but you can also say:

If variable is equal to PA_RGB(31,31,0)
Do something

So you could put yellow pixels on a door's house. That'll mean that If variable is equal to PA_RGB(31,31,0) you go into the house.

you could easily adapt this into a platformer engine right?

Not really, I mean this engine works in tiles, a platformer doesn't use tiles at all.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby Nobody » May 3rd, 2011, 12:11 pm

JanMulder wrote:Not really, I mean this engine works in tiles, a platformer doesn't use tiles at all.

Well theoretically they use collision systems too for the most efficient platformers.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to make RPG games in DSGM 5

Postby JanMulder » May 3rd, 2011, 12:15 pm

Yes but an RPG uses topview, while a platformer uses sideview.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby mangopearandapples » May 3rd, 2011, 7:54 pm

Well actually, not necessarily.
RPG = Role Playing Game.
Your character could have the main character 'role' in a platformer game...
It's true that most RPG's are topview though.
mangopearandapples
 
Posts: 409
Joined: December 30th, 2010, 2:36 pm
Location: A place to eat.

Re: How to make RPG games in DSGM 5

Postby Nobody » May 3rd, 2011, 10:44 pm

JanMulder wrote:Yes but an RPG uses topview, while a platformer uses sideview.


What is your point here? Yes they are in two different views which means they need to be made in different ways, but view makes no difference, it's the concept i'm talking about. Realistically if you sat there long enough you could adapt this into a platformer engine too since all this is, is a collision system with a few modifications. My argument was never important in the first place, but was just wondering how the RPGlib actually worked to see if i could just use this, or would i have to use a different collision map type system too to do other things too in DSGM.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to make RPG games in DSGM 5

Postby JanMulder » May 3rd, 2011, 10:57 pm

Well if you want to jump in tiles... it'll go pretty shocky.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby Nobody » May 3rd, 2011, 11:17 pm

so it would be better to use a regular collision system instead then
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to make RPG games in DSGM 5

Postby JanMulder » May 4th, 2011, 8:40 am

Yes it would.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Re: How to make RPG games in DSGM 5

Postby thedark » May 4th, 2011, 10:14 am

jan.

ar you gonna implement also a batle system to this project?
that is variable you users need ?
Workin on a DS Version of Strykers RUN Platform
Watch out for Strikers run part 1 and 2 Demo comming soon !!

If you need any help, contact me, mabe i can help out.
i am 16 hours a day on DSGM Forums. i do read a lot.
thedark
 
Posts: 262
Joined: March 14th, 2011, 9:59 am
Location: Nederland

Re: How to make RPG games in DSGM 5

Postby JanMulder » May 4th, 2011, 11:13 am

Well I could do that once, but that doesn't belong to RPGlib. This is a lib for RPG movement not for making a pokemon game.
here and yet not here
JanMulder
 
Posts: 738
Joined: December 30th, 2010, 3:08 pm

Next

Return to Tutorials

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron