Game Development Community

Rpg-kit

by Alex (Stalker) Sakablukow · in Torque Game Engine · 07/21/2006 (11:13 am) · 43 replies

I have seen many people here, who asked for a free RPG-Kit, but actually we have no one.
So we build one ;)

It should be free, so I will not use any of commercial Packs or Resources, so it's no TLK-Support here, or something like this ;)
It should be quick, so I will not use any Shader or performance-hungry AI.
It should be playable for anyone, so every user should be able to create a server, or join one, like Diablo.

My own primary goal is to create a small light-weight funny Future-Action-RPG, but I want to use meele Weapons too, so you can use it for a "classic" RPG with a few changes.

The first parts that I will write will be:
Add more and better KI-Enemies, more different weapons, more items, drops, random drops and drop-lists/pools, different player-chars, player-stats, exp, leveling, trade, and so on...

I haven't a hard plan, I will build it step by step, and post it here for everyone. If it's done, I will create a complete Resource for Torque-Community.

I dont have really much time, so it will take a time until end. I will try to post one "milestone" in 1-3 weeks.

If someone will take his part to this, he can post here add-on-resources (or what ever). If it's looks good and is useful, I will build it into the Kit. The resources must be free and fully compatible to TGE 1.4 and other resources here.

So we start now...

------------------------------------------
Story:

27.07 - Added Milestones 1-4 - Install the Engine, Prepare the Game, Add a Separate Enemy-Char, Add AI and more Enemies to the Game
02.08 - Added Milestone 5 - Add New Weapons
16.08 - fixed a few errors ;)
22.08 - Added Milestone 6 - Add Meele Weapons
Page «Previous 1 2 3 Last »
#1
07/21/2006 (11:13 am)
============================================================================
// Milestone 1. Install the engine and prepare the work directory

Install a new fresh copy of TGE 1.4 to a directory your chose.
Go to example-directory, make a copy of starter.fps, and rename it to "RPGKit".
Open main.cs in example-directory, and change this line:
$defaultGame = "tutoral.base";

To this:
$defaultGame = "RPGKit";

Save and close the file.

Make a few Bugfixes to TGE 1.4, like alt-tab-bugfix or fixing the broken explosions.

It's done, we are ready now.
#2
07/21/2006 (11:14 am)
=============================================================================
// Milestone 2: Prepare the Game to add more chars/enemies

Go to shapes-directory, and create a new "chars"-directory. Move "player"-directory into "chars"-directory, and rename it to "generic". Go into "generic"-directory, and rename player.cs to generic_player.cs, and player.dts to generic_player.dts
It's now our generic humanoid player. Some of our chars/enemies in the future will be based on it, other not.

Go into /server/scripts/ directory.
You see many files here, and if you want to build a bigger project, you will have a lot of them. So we build a better directory structure.
Create here a new "chars"-directory. Copy "generic_player.cs" from "RPGKit/data/shapes/chars/generic/" to "RPGKit/server/scripts/chars/".
Open it, and edit it like this:

//-----------------------------------------------------------------------------
// Torque Game Engine 
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
// RPGKit

datablock TSShapeConstructor(Generic_Player_Dts)
{
   baseShape = "~/data/shapes/chars/generic/generic_player.dts";
   sequence0 = "~/data/shapes/chars/generic/player_root.dsq root";
   sequence1 = "~/data/shapes/chars/generic/player_forward.dsq run";
   sequence2 = "~/data/shapes/chars/generic/player_back.dsq back";
   sequence3 = "~/data/shapes/chars/generic/player_side.dsq side";
   sequence4 = "~/data/shapes/chars/generic/player_lookde.dsq look";
   sequence5 = "~/data/shapes/chars/generic/player_head.dsq head";
   sequence6 = "~/data/shapes/chars/generic/player_fall.dsq fall";
   sequence7 = "~/data/shapes/chars/generic/player_land.dsq land";
   sequence8 = "~/data/shapes/chars/generic/player_jump.dsq jump";
   sequence9  = "~/data/shapes/chars/generic/player_diehead.dsq death1";
   sequence10 = "~/data/shapes/chars/generic/player_diechest.dsq death2";
   sequence11 = "~/data/shapes/chars/generic/player_dieback.dsq death3";
   sequence12 = "~/data/shapes/chars/generic/player_diesidelf.dsq death4";
   sequence13 = "~/data/shapes/chars/generic/player_diesidert.dsq death5";
   sequence14 = "~/data/shapes/chars/generic/player_dieleglf.dsq death6";
   sequence15 = "~/data/shapes/chars/generic/player_dielegrt.dsq death7";
   sequence16 = "~/data/shapes/chars/generic/player_dieslump.dsq death8";
   sequence17 = "~/data/shapes/chars/generic/player_dieknees.dsq death9";
   sequence18 = "~/data/shapes/chars/generic/player_dieforward.dsq death10";
   sequence19 = "~/data/shapes/chars/generic/player_diespin.dsq death11";
   sequence20 = "~/data/shapes/chars/generic/player_looksn.dsq looksn";
   sequence21 = "~/data/shapes/chars/generic/player_lookms.dsq lookms";
   sequence22 = "~/data/shapes/chars/generic/player_scoutroot.dsq scoutroot";
   sequence23 = "~/data/shapes/chars/generic/player_headside.dsq headside";
   sequence24 = "~/data/shapes/chars/generic/player_recoilde.dsq light_recoil";
   sequence25 = "~/data/shapes/chars/generic/player_sitting.dsq sitting";
   sequence26 = "~/data/shapes/chars/generic/player_celsalute.dsq celsalute";
   sequence27 = "~/data/shapes/chars/generic/player_celwave.dsq celwave";
   sequence28 = "~/data/shapes/chars/generic/player_standjump.dsq standjump";
   sequence29 = "~/data/shapes/chars/generic/player_looknw.dsq looknw";
};

Go to "chars" directory and create a new file "LoadChars.cs". Its our file to load all chars, so we don't need to add all of them to game.cs.
Open it, and add a new line: "exec("~/server/scripts/chars/generic_player.cs"); Save and close it.

Go to RPGKit/server/scripts-directory, open game.cs, find this line:
exec("./player.cs");

and add as next this one:
exec("~/server/scripts/chars/LoadChars.cs");

As next find this line:
dataBlock = PlayerBody;

and change it to this:
dataBlock = Generic_Player_Body

Save and close the file.


open "player.cs", and comment out/delete this line:
exec("~/data/shapes/player/player.cs");

Cut all sounds, particle emitter data and the player datablock, and paste it at the end of generic_player.cs
Its now our generic sounds/effects, but some of our chars/enemies will use other in the future.

In the "generic_player.cs" change this line:
datablock PlayerData(PlayerBody)

to this:
datablock PlayerData(Generic_Player_Body)


and this one:
shapeFile = "~/data/shapes/player/player.dts";

to this:
shapeFile = "~/data/shapes/chars/generic/generic_player.dts";

edit all "data/shapes/player" directories to "data/shapes/chars/generic".

save and close the file.


Open aiplayer.cs, and change this line:
datablock PlayerData(DemoPlayer : PlayerBody)

to this:
datablock PlayerData(DemoPlayer : Generic_Player_Body)

Start the game to see you have no mistakes ;)

Well, we are ready now to add more chars/enemies to the game.
#3
07/21/2006 (11:15 am)
=============================================================================
// Milestone 3: Add a separate enemy-char

And now we will add a new enemy to our game.

Go to RPGKit/data/shapes/chars/ -directory, and create a new directory "GreenOrc". Our GreenOrc will use all animations of generic player, so we don't need to copy all of the animations-files, footprints, and other files. We only need his body and his skin ;) So copy generic_player.dts and player.png from generic-directory into GreenOrc-directory.
Rename the dts-file to "GreenOrc.dts".
Open "player.png" with a graphic-program your chose, and change the colors to be more green (you can draw simple green lines too or whatever you want.. or fill the picture with green color.. only to see that its work ;) ). Save and close the file.

Go to "RPGKit/server/scripts/chars/"-directory, and create a new file "GreenOrc_Enemy.cs".
We will have Players and Monsters with equal "bodies" but different stats, so we can have a "GreenOrc_Player.cs" and "GreenOrc_Enemy.cs"-file.
Open it. Open now "generic_player.cs" and copy the "TSShapeConstructor" and "PlayerData"-Datablocks into "GreenOrc_Enemy.cs".

Rename "Generic_Player_Dts" in "TSShapeConstructor"-Datablock to "GreenOrc_Dts".
The Animations are the same, but not the shape, so edit this line:
baseShape = "~/data/shapes/chars/generic/generic_player.dts";

to this:
baseShape = "~/data/shapes/chars/GreenOrc/GreenOrc.dts";


Rename "Generic_Player_Body"-Datablock to "GreenOrc_Body"


And change this Line:
shapeFile = "~/data/shapes/chars/generic/generic_player.dts";

to this:
shapeFile = "~/data/shapes/chars/GreenOrc/GreenOrc.dts";

Save and close the files.

Open LoadChars.cs, and add our new dude with this line:
"exec("~/server/scripts/chars/GreenOrc_Enemy.cs");" Save and close the file.


Open aiPlayer.cs, and find this Line:
datablock PlayerData(DemoPlayer : Generic_Player_Body)

We have now a new one, the great "GreenOrc" ;) so change "Generic_Player_Body" to "GreenOrc_Body".

Save and close the file.

Now start the game, load the stronghold-mission, find Kork, and shoot down this green bastard! ;)
#4
07/21/2006 (11:17 am)
=====================================================================================================
// Milestone 4: Add more AI to our Game

Well, you have killed him 100 times, and feel you like God, but with the time its boring because of his green stupidity.
So give him a family ;)

Get the AIGuard/AIPatrol-Ressource
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6773

Tell Marc Holcomb how much you thank him for this great Ressource.

Copy aiGuard.cc, aiGuard.h, aiPatrol.cc and aiPatrol.h to you engine/game/-directory.
Add these files to your Torque-Project, and compile.

Create in RPGKit/server/scripts/ a new "ai"-directory. It's now our directory for all artifical intelligence-driven chars.
Copy aiGuard.cs and aiPatrol.cs to RPGKit/server/scripts/ai/-directory.
Move aiPlayer from RPGKit/server/scripts/. To RPGKit/server/scripts/ai/.
Go to ai-directory, and create a new file"LoadAI.cs". Ist now our file to load all AI-files

Open it, and add these lines of code:
Exec("~/server/scripts/ai/aiPlayer.cs");
Exec("~/server/scripts/ai/aiPatrol.cs");
Exec("~/server/scripts/ai/aiGuard.cs");

Save and close.

Open game.cs and find this line:
exec("./aiPlayer.cs");

change it to this one:
exec("~/server/scripts/ai/LoadAI.cs");

as next find this line:
AIManager.think();

And add after this two lines:
AIPatrol::LoadEntities();
AIGuard::LoadEntities();

Save and close the file.

Now open player.cs, and find this pice of code:
%client = %obj.client;
   %sourceClient = %sourceObject ? %sourceObject.client : 0;

   if (%obj.getState() $= "Dead")
      %client.onDeath(%sourceObject, %sourceClient, %damageType, %location);

Change it to this:
%client = %obj.client;
   %sourceClient = %sourceObject ? %sourceObject.client : 0;   if (%obj.isbot == true)
   {
     %obj.attentionlevel=1;
     %obj.enhancefov(%obj);
   }
 
  if (%obj.getState() $= "Dead")
  {
  //    DropItemsAfterDeath(%obj); // this line not used yet, but will be used in the future ;)
      if (%obj.isbot == true)
      {
           if (%obj.respawn == true)
            {
              %obj.delaybeforerespawn(%obj.botname, %obj.markerpos, %obj.marker);
              %this.player=0;
            }
      }
      else
      {
        %client.onDeath(%sourceObject, %sourceClient, %damageType, %location);
      }
   }

Ok, now go to "RPGKit/data/shapes/chars/"-directory, copy "GreenOrc"-directory, and rename it to "RedOrc". Go into the "RedOrc"-directory, and rename "GreenOrc.dts" to "RedOrc.dts". Open "player.png" with a graphic program your chose, and make the colors more red (or draw red lines, or whatever you want ;) ). Save and close it.

Make a new copy of "GreenOrc"-Directory, rename it to "BlackOrc", open "player.png", and make the colors looks like very dark gray ;). Save and close the file.

Now go to "RPGKit/server/scripts/chars/"-directory, make a copy of "GreenOrc_Enemy.cs" and rename it to "RedOrc_Enemy.cs".
Open it, and change all "GreenOrc" strings to "RedOrc" ;) Save and close the file.

Repeat all this steps to the "BlackOrc".

Open LoadChars.cs, and add these two lines at the end:
exec("~/server/scripts/chars/RedOrc_Enemy.cs");
exec("~/server/scripts/chars/BlackOrc_Enemy.cs");

Save and close the file.

Now go to "RPGKit/server/scripts/ai/"-directory, open aiPatrol.cs.
Find this line:
shapeFile = "~/data/shapes/player/player.dts";

and change to this:
shapeFile = "~/data/shapes/chars/RedOrc/RedOrc.dts";

as next find this line:
datablock PlayerData(PatrolPlayer : PlayerBody)

and change it to this:
datablock PlayerData(PatrolPlayer : RedOrc_Body)

find this two lines:
%obj.incinventory("Plasmagunammo",100);
%obj.incinventory("Shotgunammo",100);

And replace they with this one:
%obj.incinventory("crossbowammo",100);

Find this pice of code:
%obj.incinventory("PlasmaGun",1);
%obj.mountImage("PlasmaGunImage",0);
%obj.setInventory("PlasmaGunAmmo",1000);

And replace it with this one:
%obj.incinventory("Crossbow",1);
%obj.mountImage("CrossbowImage",0);
%obj.setInventory("CrossbowAmmo",1000);

Save and close the file.


Now open aiGuard.cs, and change this line:
$AI_GUARD_WEAPON = "Shotgun";

To this:
$AI_GUARD_WEAPON = "Crossbow";


And this one:
shapeFile = "~/data/shapes/player/player.dts";

to this:
shapeFile = "~/data/shapes/chars/BlackOrc/BlackOrc.dts";

now find this line:
datablock PlayerData(GuardPlayer : PlayerBody)

and rename PlayerBody to BlackOrc_Body.

Change this line:
$AI_GUARD_ENABLED = false;

To this:
$AI_GUARD_ENABLED = true;

It's not well tuned now, we will do it better in the future ;)
#5
07/21/2006 (11:22 am)
Get a new mission file from my site:
http://www.paralogic.de/download/rpgkit/rpgkit_orcvillage.mis

put it to your "RPGKit/data/missions/"-directory.

Start torque, and load the "RPGKit_OrcVillage"-Mission.
Ouch! That can hurt a little! We need more Weapons!
We will create some at the next milestone!
#6
07/21/2006 (11:33 am)
Does this allow for unique NPC's with unique names, shape files, and paths?
#7
07/21/2006 (11:41 am)
This is good, as soon as my new compiler comes in the post, i'm trying all of this! More please!
#8
07/21/2006 (11:53 am)
@Matt Luard: get MS VS 2005 Express Edition. Its free.

@Allyn Mcelrath: Actually not (you can see that ;) ), but in the future i will add unique boss-monsters and npcs.
#9
07/21/2006 (12:01 pm)
Nice way for us beginners with TGE to learn how the pieces fit. Thanks for posting so much detail. Keep it up!
#10
07/21/2006 (1:05 pm)
@alex,

thank you again. This is a great tutorial method.

Mike
#11
07/21/2006 (1:13 pm)
This is definitely some good stuff... keep it coming. =)
#12
07/21/2006 (2:12 pm)
Have found and corrected a few errors, i'm sorry. -.-
It's not a tutorial now, please post if you found some errors..

My own game has a few "milestones" more, but i try to rebuild my way with this "tutorial".
#13
07/21/2006 (3:15 pm)
This is a really good thread!! Thanks Alex!! Looking forward to see the next milestones
#14
07/21/2006 (3:29 pm)
Not to be negative.. but none of this seems releated to RPG stuff. you've added a new character and a the AI Guard resource..

So ... how's this really relate to an RPG?
#15
07/21/2006 (3:31 pm)
Good start, please feel free to upgrade or incorporate my existing tutorials on the subject, that will get you a jumpstart.
For those interested there is currently a shipping MMORPG Enhancement Kit and a soon to ship Single Player RPG kit as well.
You can get either of these kits at MyDreamRPG.com!
Regards,
Dreamer
#16
07/21/2006 (6:29 pm)
@Ramen He's on the right track the very first thing to do after laying out a proper roadmap, for ANY game is to get things laid out filesystem wise so you can faciliate future additions.
#17
07/22/2006 (1:40 am)
@Ramen-Sama: Every Game need the basic functions to start, and every "milestone" that i have postet is directly related to a RPG. I haven't seen a RPG with only one character and no monsters and npcs ;) It's possible, sure, but it's not my goal.
#18
07/22/2006 (9:18 am)
Alex, nice work!!! u seem to be on the right way!

i find it amazing, much more organized than my version, lol (well, my version never actually came to a version)

but yeah, i have some links to important rpg-related resources, from the beginning of my package, i will post them as soon as i find it in my archive (got a new harddrive, and now everything is a mess)

but yeah, once again, amazingly done!
#19
07/22/2006 (9:48 am)
@Alex Alrighty. i see where you're going with this. i'm alot farther down the road with my RPG stuff, so if you run into some snags, let me know. I'll see how i tackled it.
#20
07/25/2006 (8:17 am)
Ok, here are some resources that i belelieve are at important to have in an rpg, (it seems some fiels got corrupted on the transfere :( so these are the only once still good for me and i have links to the resources on gg :(

target locking:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4077

rpg dialog:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=3531

swords, etc?
www.realmwarsgame.com
(with some extraction, you can get swords to work :P

guards for castles:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6773

crouch, swimm, etc:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4348

climbing ropes, ladders, (forum discussion):
http://www.garagegames.com/mg/forums/result.thread.php?qt=37985

fun stuff- cel shading-:
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10318
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10368

i am currently working on getting torques alt-fire mode (the one already included int he box) to work, hock-shot/bommerang, as well as som combo moves (like dodge, or front + action button = stab, while side + fire button = slice) i'll post it once it works perfectly without any bugs...so it will take a while

but yeah, i hope these help you out:) that way u dont have to lock for these
Page «Previous 1 2 3 Last »