Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Enemy Programming basics for RPG that I am moving to DBPro

Author
Message
obsird
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location: Here and there
Posted: 27th Oct 2010 06:19
I am currently stumped on how to program my enemies and set up random encounters. these are both issues a skated by in the past by passing data through excel (see below). I am starting with a very basic version of this but below was my current status before needing to change to new programming language.


The current project I am working on was originally programmed in Visual Basic 6, VBA, and excel. I had the 3 passing data back and forth but the game is too slow and unstable due to the level of data I was transferring. I just purchased Dark Basic Pro to greatly enhance this game and 2 others I am currently working on.

Game Basics
I am a huge fan of Zoids (always have been), for those who don't know Zoids are from TV-series/books/models/games and they are enormous robot life forms (animals and dinosaurs)
This is a mix between Zoids: Legacy and Zoids:Assault with a lot of my own development thrown in.

Combat in final version will be a third person hexagonal/active time battle.
Depending on amount of damage done to opponent/turn and killing opponent depends on what parts and how many can be recovered. Building zoids and selling them, selling parts, selling scrap, and completing task are the primary ways of making money during game.

Zoids can be built when all parts are owned and player has sufficient money to build zoid. When Zoids are built many upgrades can be installed during construction, only few upgrades can be installed after construction.

This would be what I am calling a double-RPG. not only are you leveling up your character with advanced skills and stats but the zoid core (which can be transplanted by sacrificing the existing zoid) learns along with the pilot but the core learns based on what zoid it is inside and what happens in combat.
Zoid cores can be sold or destroyed in battle resulting in loss of that experience.

The Game has 3 main factions and 5 minor factions that depending how the player acts effects game play. 3 of the Main factions are the 3 kingdoms who have each developed there own specialized weaponry and upgrades. Basic weapons are available through standard markets but specialty weapons are difficult to get hold of.

For those who know the basic story line of zoids. This story takes place when the humans land, initial piece talks with the local empirers, the great war (where you can fight deathsaurer or ultrasaurus or both), then finally survive or destroy Zoid EVE(with a surprise after destroying zoid eve), and unlimited game play after. During this time you can fight wild Zoids, military zoids from the different countries, or resistance fighters.

The Player unknowingly can directly effects the combat strength of zoid eve(final battle).

This isn't just a blow up the enemy with as much firepower as possible. The goal is to have as much strategy as the player wants to incorporate.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 27th Oct 2010 16:33
I remember zoids!

...I'm not sure exactly what your question is though?

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 27th Oct 2010 17:28
Thing is, surprise attacks might be a bit tricky to pull off, because if these robots are huge, then how can they sneak up .

I would have certain tiles that can spawn enemies, like a forest block on your hex grid might have an enemy hiding in it, or a cave block, or something like that. Anyway, you could scan the whole map, and if there's a hiding robot, and the areas next to it have been revealed by the player, then the robot should move and start attacking the player. I'm guessing you'll have some sort of fog of war? - well I'd use that to decide if the enemy reveals itself. Also, I would have hiding enemies move around their hiding places - a cluster of forest blocks for instance, the enemy could move around these randomly, but staying within the forest. Then the player might reveal one side of the forest, and the enemy might not know yet because they are on the opposite side - when they get around to the revealed part, they can pick up the scent.

For actual combat, I would say that just having a portrait of the enemy would be fine, some attack and defend options, but a straightforward system, no movement or complex attacks that the player might not be interested in. I would just have a portrait with the stats underneath, and some big, bold attack options - maybe add on layers of strategy with that. For example, have a weak, medium, and strong attack and limit the attack that the player can do - if they do weak attacks then their limit increases, the more weak attacks means they have extra power to pull off strong attacks, and have the medium attacks remain consistant. Maybe a little like battle XP - if you do a really good attack, then give extra power, or even have a battery that the player can use, instead of attacking they save their power for the next round. Turn based combat is ideal for this type of game I think - let the player take their time and strategise. Never fall into the Final Fantasy trap, and have trully random encounters - you should always be able to clear out all the enemies, otherwise it becomes tedious, feels like you aren't getting anywhere. You can always let the weaker enemies re-spawn after some time, so sand boxing an area after completing it still holds surprises, but nothing the player can't deal with.

Lastly, I have to ask why it has to be Zoids - doing that will limit what you can do with your game, might be worth considering taking the project a different route 0 like invent your own robots and plot, take ownership - Zoids fans will like it because it would be inspired by Zoids, but then you won't have any copyright nonsense to deal with, and you'll have a much more personal game.

Health, Ammo, and bacon and eggs!
Eminent
16
Years of Service
User Offline
Joined: 15th Jul 2010
Location:
Posted: 27th Oct 2010 19:18
Its not a good idea for your first game to be a RPG. Learn a bit first. Go read TDKs tutorial(sticked on the DarkBasic fourm).


obsird
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location: Here and there
Posted: 28th Oct 2010 04:02
First ...I'm not sure exactly what your question is though?


My Question is how do I program my enemies, character, and inventory. and have it save to a file to be easily edited as I need to make adjustments.
- With the Excel tie-in I often had 10 spreadsheets of data with thousands of rows of data that I could edit to help balance the game. or can I still save data to excel files and manipulate it there?


Second ...Lastly, I have to ask why it has to be Zoids - doing that will limit what you can do with your game, might be worth considering taking the project a different route 0 like invent your own robots and plot, take ownership - Zoids fans will like it because it would be inspired by Zoids, but then you won't have any copyright nonsense to deal with, and you'll have a much more personal game.

All the years I have programmed RPG's and I have always wanted to program something that was above a standard RPG. A game that you could make as hard or easy as you want based on how in depth you wanted to play. I developed the double RPG system to incorporate that idea. It was a game of controlling robotic animals that learn and fighting in conflict but my game had no story line and needed something in combat. Then I learned about zoids, honestly you would have thought I stole there idea. and they totally made the combat what I was missing. So I decided I would fill in a major missing point in there story line that anyone could play without knowing the story.

Third ... Its not a good idea for your first game to be a RPG. Learn a bit first. Go read TDKs tutorial(sticked on the DarkBasic fourm).
This is between my 42rd and 49th RPG (depending if you count some of my spin offs). I have just quit using my old programming ways and I am trying to improve my programming style and graphics.

Lastly ... Thing is, surprise attacks might be a bit tricky to pull off, because if these robots are huge, then how can they sneak up .
Ants probably say the same thing about us humans. we are so large how could we ever surprise each other. hiding, ambushes, out of site (mountains), and long range attacks.
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 28th Oct 2010 10:57
Quote: "My Question is how do I program my enemies, character, and inventory. and have it save to a file to be easily edited as I need to make adjustments.
- With the Excel tie-in I often had 10 spreadsheets of data with thousands of rows of data that I could edit to help balance the game. or can I still save data to excel files and manipulate it there?"

Funnily enough Daniel (TGC) has just posted a tutorial on using "csv" files you might find useful: http://forum.thegamecreators.com/?m=forum_view&t=177173&b=1

I don't know how fast it is though.

I would consider looking at IanM's Matrix Utility commands regarding "Memory Banks", I think they would be the 'best' way forward for this amount of data storage and manipulation in-game... IMO

Quote: "This is between my 42rd and 49th RPG (depending if you count some of my spin offs). I have just quit using my old programming ways and I am trying to improve my programming style and graphics."

Cool. Can't wait to see you get stuck into DBP then!

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 28th Oct 2010 15:40
I use Excel a lot, and exporting to CSV should work out great for DBPro - might take a little fudging around, but there's no reason why you can't get your data from Excel, into DBPro in a consise and organised format, maybe typed arrays. I'm sure Daniels tutorial will have everything you could need.

I like to enter my data in Excel, format it nice, then take the raw data and convert it to a file friendly format, bytes if need be - then I export that and load it up in my DBPro and xcode projects. So it stays neat, and just generates a file with all the pre-formatted data. I decided to try and stick to byte values, so I specify floats in Excel and convert to a byte depending on the range. There's no need to move away from Excel, but maybe you'll have to change the way you work with it, while at the same time dropping dependance on it.

Health, Ammo, and bacon and eggs!
sneaky smith12
20
Years of Service
User Offline
Joined: 30th Apr 2006
Location: Like id tell you, oh wait i just did
Posted: 28th Oct 2010 18:47
Quote: "Funnily enough Daniel (TGC) has just posted a tutorial on using "csv" files you might find useful: http://forum.thegamecreators.com/?m=forum_view&t=177173&b=1

I don't know how fast it is though.
"


I didn't even know this was possible! It will probably work out good for my project.

Attached is a simple speed test I made for from the tutorial for it. It reads the file pretty darn quick considering I put over 100K+ lines in it. (Please ignore my word choice of "print"... it's actually the TEXT command, but texting to the screen sounded wrong).

If at first you dont succeed, LOWER YOUR STANDARDS.
obsird
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location: Here and there
Posted: 29th Oct 2010 05:45
Thank you everyone for your help this appears to be just the thing to get me over this bottleneck.
Neco
18
Years of Service
User Offline
Joined: 13th Jul 2008
Location: Waterloo, Wisconsin USA
Posted: 30th Oct 2010 17:57 Edited at: 30th Oct 2010 17:58
Don't know you do you random encounters in Excel or any of that (another program I've never bothered to learn how to use)

But in general there are several ways to do random encounters.

1. Use a step counter. Each time the player moves, increment the counter, and when it hits a pre-defined number an encounter is initiated. RPG Maker uses (or used at some point in the past) this method for random encounters.

2. Roll a Die. d10, d20, d100, whatever works for you. You can have it trigger on certain numbers only, or above/below a certain threshold, or even use a combination of both methods 1 and 2 if you wanted to.

Don't know what you're planning or how you do things, but for my Text RPG I'll have pretty much "true" random encounters. Assuming I don't lack the skill to implement it. I plan to instantiate mob copies from master UDT's and have set areas where you can find specific mobs, but within that area they could spawn in any room depending on different circumstances, then traverse rooms in their area like they are on "patrol".

Pretty much what you would see in a really good MUD. So you never know if you'll come across one in the next room, or if he will call his buddies for help!

obsird
15
Years of Service
User Offline
Joined: 26th Oct 2010
Location: Here and there
Posted: 2nd Nov 2010 11:39
encounters
in excel i have this nice function i have been using for about 5 years it uses the steps method of combat. it allows the player to run, walk, or sneak in an RPG.
in run mode you have less attacks but 80% are back attacks and usually stronger enemies. Speed = 2X
in walk mode you 30% back attack chance and may (5%) have the option to avoid the enemy if you choose. (that is avoid before conflict) Speed = X
in Sneak mode there is 2% chance of sneak attack and 70% chance of choosing to avoid an enemy. Sneak is awesome if you are trying to get that last opponent, specific item, or you are low on life points.) Speed = 1/2 X

When you have the avoid option it gives you a screen shot of your opponents and list the enemies just like combat is starting. YOu also have the option to frontal assault or Sneak attack (% chance based on level comparison) if you fail a sneak attack the player looses there first 1 - 2 turns and may get back attacked by different opponent.

I developed this system for this game specifically way back then but I have loved using it in almost all my games since.

Login to post a reply

Server time is: 2026-07-22 04:37:01
Your offset time is: 2026-07-22 04:37:01