The Daily Click ::. Forums ::. Klik Coding Help ::. turn-based A.I and more
 

Post Reply  Post Oekaki 
 

Posted By Message

Gerwin Kramer



Registered
  14/07/2005
Points
  186
2nd July, 2006 at 10:24:54 -

Small question first, is there a way to display text above active objects?

Im working on an RPG witch has turn based combat. http://img116.imageshack.us/my.php?image=battleschreen1vt.png (nope, those arent ripped gfx!!)

Moving costs 1 ''move''(move 1 square). Attacking costs 2 (attacking adjesent square), casting spells 3 (range do vary). After you used all your moves its the turn of the monster(s). Any ideas how to do this without having dumb looking enemys?
Any ideas or help are welcome.


 
n00bish!

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd July, 2006 at 10:49:50 -

I have theories only for you, because I've never tried this in MMF:

To make (lousy) VB6 enemy A.I. attacks for turn-based enemies, I'd have a couple of global variables like this:

CRITICAL
FIREBALL
SLEEP
RETREAT
POISON

For example.
Then, when it was time to load the encountered monster's stats, depending on the enemy they'd have different scores for these special attack variables, like so-

enemy = SLIME
CRITICAL = 5
FIREBALL = 0
SLEEP = 0
RETREAT = 30
POISON = 0

What these represent are the % chance to have these special attacks towards the player character(s). So obviously, since in almost every RPG a slime is a weak-ass monster, it won't cast fireballs, put you to sleep, or poison you.

enemy = GREATER DEMON
CRITICAL = 25
FIREBALL = 50
SLEEP = 10
RETREAT = 0
POISON = 10

Now a tougher enemy like a greater demon (thank you Wizardry!) will be a lot stronger than a slime of course. Each time it goes to attack, you need to make attack roll checks that could work like this-

'for critical attack
XX = int(100*rnd(1)+1) 'picks a random number from 1 to 100
If XX <= CRITICAL then "the enemy scores a critical attack, add damage, etc"

You can make them cuumulative if you want, so some enemies could potentially poison, paralyze, and burn you to a crisp all at once!

You could also have it so the higher level the player is, the more chance the enemy might run from him (like in Dragon Warrior for the NES):

'for the enemy to retreat the battle
XX = int(100*rnd(1)+1) 'picks a random number from 1 to 100
If XX <= (RETREAT - ((PLAYERLEVEL - 1) * 5)) then "the enemy retreats the battle"

So here, for each level over level 1 the hero gets a +5% bonus to make the enemy run from his heroess-ness. That might be too high, but you get the idea.

I hope this jumble of crap helps somehow!



 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Deleted User
2nd July, 2006 at 10:50:09 -

To display text above objects, simply right-click on the text and select 'Objects preferences'. Then un-check the box that says 'Display as background(faster)'.

 

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd July, 2006 at 10:53:02 -

Oh Jesus, YOUR POINT:

Whenever I need to have text being displayed above an active object (like in CotG2 when he picks up an item), I just set a string object a little above the active's Y position and change the alterable text to whatever you need. It's important to remember that you'll need to uncheck the string object's default property of "Display as Background (faster)" to OFF or it won't show correctly. Remember you need to have it layered above your active too.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd July, 2006 at 11:03:34 -

Blah, I can't edit my post but I screwed the retreat formula up, it's supposed to be:

If XX <= (RETREAT + ((PLAYERLEVEL - 1) * 5)) then "the enemy retreats the battle"

So say if the random 100-sided dice roll is 62, the player's level is 7, and the enemy's base chance to retreat is 25:

If 62 <= (25 + ((7 - 1) * 5)), or

If 62 <= 55 then "enemy retreats"

So in that instance it wouldn't retreat but it'd have a giant 55% chance of doing so for every turn it has. These might not be the best formula out there, but I've used similar ones pretty extensively and they work great for what I do.



 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Gerwin Kramer



Registered
  14/07/2005
Points
  186
2nd July, 2006 at 11:10:20 -

I must say I read your article on Rpg concepts and crap before I started working on the game. Thank you very much for the variables idea, though I already worked out the damage calculation handler, i'm more troubled on how to make the enemies move and find the right balance in moving and attacking! =0

Heh, It seems that no one knows how to do this right. I now have the enemy move (at random) in his tur, and only attacks whenever the player is close enough...

Image Edited by the Author.

 
n00bish!

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd July, 2006 at 11:28:50 -

You could have an agression variable for that. Say have a percentage chance to attack, otherwise the enemy could move by default. You could even have some cool modifiers this way like faction hits! Say for every 10 goblins you kill add +5% chance that any other goblins will attack you rather than move.

There was one game I was working on before that had 3 factions in it. Depending on your standing with them, they would either be agressive or passive (a boolean variable, or true or false). For neutral enemies that could give two shits about faction (like wolves or snakes) I just defaulted them to agressive mode. What was cool about doing this is I made it so if you were on friendly terms with another unit, you could even "ask" them to please move aside (disappear) if they were blocking your path. Some might even give you helpful tips or rewards if you were friendly towards them. I also had it that regardless of your faction standings, if you attack any unit first they get automatically set to agressive- and any other units belonging to that faction in your current zone were also set to agressive. Makes sense, if you attack a royal guard then any nearby would rush to help him out.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
2nd July, 2006 at 12:22:21 -

Here's a wild question; do you have your AI movement system done yet?

 
Craps, I'm an old man!

Gerwin Kramer



Registered
  14/07/2005
Points
  186
2nd July, 2006 at 13:07:20 -

A wild question indeed. Nope!
ousee, like in final fantasy, when you encounter a monster it switches to combat mode (see image), you can do 5 ''moves''. Same goes for the enemy, i just dont know how to let the enemy move 5 spaces towards the player, or when the enemy is weak, retreat.

Moving one space means, for example to the left: X:-32 Y:0, meaning right would be x:32 Y

 
n00bish!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
2nd July, 2006 at 13:20:49 -

Hmm, I'll have to think about it. I know of a way to "Cheese" it. But it will require a bit more thought.

I have an old, old movement system I made back in the day that's actually tile based (For the enemies as well). The coding's a bit dense (I was using TGF after all); but it works; just not spectacularly.

http://www.ectoprods.com/Shab/Games/Old%20Shit/tacticsRPG.gam

Image Edited by the Author.

 
Craps, I'm an old man!

Gerwin Kramer



Registered
  14/07/2005
Points
  186
2nd July, 2006 at 13:27:08 -

Link doesnt seem to work

 
n00bish!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
2nd July, 2006 at 13:28:10 -

Right click "save as..."

If that doesn't work just go here.

www.ectoprods.com/Shab/Old%20Shit/

 
Craps, I'm an old man!

Xhunterko



Registered
  07/05/2003
Points
  1015

VIP MemberHas Donated, Thank You!Hasslevania 2!Pokemon Ball!
2nd July, 2006 at 14:21:44 -

*sigh*. Go to Tigerworks site and download the strategy object. That's all you need. Then go here: http://www.create-games.com/article.asp?id=1402
It's pretty straight forward with a bunch of code. If you want to teach your characters moves, then go to part two.

 
All platforming problems can be mostly solved here:

http://www.clickteam.com/mbfiles2/277308-engine.zip
http://www.angelfire.com/games5/psywakd/platform.gam
www.zephni.com

These are very excellent examples by other people and are very informative.
Image

I work at the speed of "maybe".

Coming Soon: Diary Of An Indie Developer
http://www.youtube.com/watch?v=XaF6H9MrgH8

Twitter:
http://twitter.com/xhunterko

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
2nd July, 2006 at 14:23:50 -

I still haven't figured out how to make a tile-based game with MMF? Is it done with an extension, or are values read out of a double dimension array and pasted to the background? If this sounds n00bish it's because it is.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
2nd July, 2006 at 14:27:34 -

download my file, it's got both player and enemy tile movement.

 
Craps, I'm an old man!
   

Post Reply



 



Advertisement

Worth A Click