ID:64868
 
Keywords: generiquest
So, since I had nothing to do, and the RPG Guild is trying to ressurect it's self, I decided to start work on Generiquest yet again.

Buuut, I'm not releasing it yet, or probably anytime soon. Reason is simple, I am giving it a major overhaul.

The first, probably most major change is that I am tidying up all the coding. This was a major reason I stopped working on it, the coding simply got way too large (we are talking 200,000+ lines of code), was too unorganied and adding/changing stuff became a major hassle.
I have mostly finished this. Most of the coding is neater, easier to read and commented so I roughly know what is what.

The second major update is to do with the way the game works. The quest system has been redesigned (with new, much more detailed interface) to allow for much more complex quests, which are fairly easy to add to the game.
Quests will now make up the major part of the game, and will be the best way of progressing through the game. As such, there will be more quests, but they will be divided into types.

The first is "storyline" quests. They are the main storyline of the game, you progress through them like you would a standard RPG.

The second is simply called quests. They are usually small, self contained plots and storylines, usually related to a specific dungeon (or in somecases a specific goal). They will be similar to storyline quests, but will not be as long or detailed.

The third type is tasks. These will be the most numerous type of quest, and be the alternative for grinding. They will have basically little to no storyline, and a simple goal such as "kill this" or "collect these".
Tasks are not going to be particularly detailed in terms of what you have to do, but the system behind it will be.
Tasks will be divided into various types, collecting items, killing monsters and killing rare monsters. Collecting items and killing monsters will be easy. Killing rare monsters will vary in difficulty, with the harder ones being similar to killing the generic super hard mega secret boss that is harder to kill than the final boss most JRPGs have. (Though, these monsters will not spawn unless you have the quest, meaning only you and others with the quest get a chance to fight these enemies)

The second major change is related to balance.
I am totally redesigning most enemies, bosses and items. Enemies and bosses will be more appropriate for the recommended level.
Items will not have a level requirement for using them, as well as a rank (common, uncommon, rare and so on). This rank will represent obviously how rare the item is, but the rarer it is, the more powerful it can be for it's level (a common level 10 sword might have 20 atk, a rare level 10 sword might have 25 atk and +2 to a stat).
In general, weapons of a similar level and rank will be similar in terms of power, there should not be any majorly overpowered, or underpowered equipment anymore.

Another change that people wanted to see was some sort of crafting system. I am working on it now, but there will be one added.
The system does not rely on any sort of stats of the player or skill. You go to a blacksmith/alchemist/crafter of somesort, and provided you have the items and money requires, you can upgrade an item.
Each piece of equipment has a fairly detailed upgrade path. All equipment can be upgraded to the "next best" of it's type, basically this will be cheaper than buying the next weapon in the shop (provided you have the items), but each weapon will have unique upgrades avaliable only too it. An example is the short sword, it can be upgraded like so...
http://www.byond.com/members/TheMagicMan/files/wup.jpg

Other updates will include a lot of maps being redesigned.
For dungeons this will include secret areas (that have requirements to access) and some that are more interactive (requiring keys to open doors, or puzzles that need to be solved and so on).

There will also generally be more of everything, items, dungeons, quests, enemies and so on.

There will be minor gameplay and interface changes (to make things more convenient).

The help documentation in the game will be more detailed and indepth. (So now you can't complain about it!)

When will all this stuff happen? Who knows. Whenever I feel like it most probably.
(we are talking 200,000+ lines of code)

OOP solves this.
Vermolius wrote:
(we are talking 200,000+ lines of code)

OOP solves this.

Yeah really, 200,000+ lines of code seems like a big waste.
Lord of light wrote:
Vermolius wrote:
(we are talking 200,000+ lines of code)

OOP solves this.

Yeah really, 200,000+ lines of code seems like a big waste.

It is kind of... Hard to judge this sort of thing without knowing stuff like how much content the game has I'd say!

Fair enough, a small game with 200,000 lines of code is a waste. But what about a massive game with 200,000 lines of code? Wouldn't that be impressive?

Oh yeah, just so you know. Generiquest use to have a fair amount of content. Most of those 200,000+ lines of code were due to things like items, monsters and quests.

The average item maybe looked like this...

        Leather_Belt
Lvl=1
Price=50
Def=3
icon_state="Leather Belt"
WeightPer=3
Descr="+3 defence<BR>A simple leather belt."


With more advanced items looking like...

            Elementalists_Robes
Lvl=20
Price=10000
Def=55
MagDef=60
icon_state="Elementalists Robes"
WeightPer=7
Descr="+55 defence<BR>+60 magic defence<BR>+15 Int<BR>+30 fire defence<BR>+30 wind defence<BR>+30 water defence<br>+30 earth defence<BR>Robes designed with the fire bug in mind, are moderately flame resistant."
New()
new/equipmenteffects/Stat(src,15,0,"Int")
new/equipmenteffects/Defence(src,30,0,"Fire")
new/equipmenteffects/Defence(src,30,0,"Wind")
new/equipmenteffects/Defence(src,30,0,"Water")
new/equipmenteffects/Defence(src,30,0,"Earth")
..()


Might not seem like a lot, but now multiply that by thousands.

A single monster could range from 20 lines of code, but some enemies with smart AIs could reach into hundreds of lines of code.

Again, multiply this by hundreds.

And quests were the worst. The most simple could have 100+ lines of code (including NPCs), some could reach to 200-300+ lines.
Multiply this by hundreds.

Then there is other things which could take up a lot of lines of code (skills are a pain in the ass to make, I cannot use some sort of system to make them easier either, because the differenced between each skill is just too complex to make a system to simplify it).

Fair enough, 200,000+ lines of code is a lot. But 80-90% of that was simply data which was largely impossible to shorten.

This is the major problem with RPGs. The systems behind them are fairly simple, and actually easy to make.
But RPGs are content heavy, and unless you randomly generate all of the content (which in this case is not an option), you have to add it all to the game, which requires a lot of highly repetative coding, which is not possible to avoid. (Sure, I could make it something like a XML file, but then it will be tens, if not hundreds of thousands of lines in XML files and changes nothing).
That's still too much. If I even got such a big code file, I'd use XML or an INI file to cut it down. Also, your "AIs" comment kind of relates to OOP. A properly programmed AI system with OOP should take maybe 500 lines at the most, and it should apply to all monsters.
Jeff8500 wrote:
That's still too much. If I even got such a big code file, I'd use XML or an INI file to cut it down. Also, your "AIs" comment kind of relates to OOP. A properly programmed AI system with OOP should take maybe 500 lines at the most, and it should apply to all monsters.

Actually, the AI does use OOP principles.

The AI works fairly simply. It is a loop that calls several procs, one to find an enemy, one to move to an enemy, one to attack an enemy and if no enemy is found, one to wander around randomly. These procs are the "default" action for all mobs.
Each of these procs can be overwritten for specific behaviours.
The reason it is so much lines of code is because each monster AI can vary widely from one to the next, not only in what attacks they use, but hat situation to use things in, who to attack and so on.
It is simply impossible to make an all encompassing AI to account for hundreds of different monsters and the ways they act. There was simply too many possible actions and situations to account for.

Also, as I said, using a XML file would not cut down on anything (if anything, due to the way XML works, it'd require much more work to do).
It is kind of like having half a dozen of one, and 6 of the other.

The point is, I HAVE been using OOP, but there as just so much stuff that it resulted in hundreds of thousands of lines of codes.
I could have probably cut down on the amount of code, but somethings were just not possible to cut down on.
Each item for example NEEDs an icon state, level, price, atk/def value, weight and description, that is 7 lines of code just there (one obviously for defining the object), 7 might not seem like much, but when you have several thousand (and I am talking about something like 3000-4000) of these objects each with a MINIMUM of 7 lines (some had 10 or even 15+), you end up with a hell of a lot of lines of code, and there is nothing you can do about that.
The Magic Man wrote:
XML no use

Actually, you could use one of the XML libs out there.

Also, I don't see how you could have monsters that vary so greatly. If you set up your system properly, each type of attack could have a requirements_set() or something proc, and then you need to sort for the best attack by some form of sorting algorithm, etc. Unless all your monsters act completely different from one another, it shouldn't be that bad.
Jeff8500 wrote:
The Magic Man wrote:
XML no use

Actually, you could use one of the XML libs out there.

You're failing to see the point I am trying to make.
Using a XML library would not eliminate large parts of the code. I would simply be shifting it to another file. So what is the point?

Also, I don't see how you could have monsters that vary so greatly. If you set up your system properly, each type of attack could have a requirements_set() or something proc, and then you need to sort for the best attack by some form of sorting algorithm, etc. Unless all your monsters act completely different from one another, it shouldn't be that bad.

The whole point is exactly that. Except for a few exceptions, each enemy AI is vastly different from the next.
The problem is attacks are not all randomly selected, and too many situations are taken into account. Things like number of players, distance from players, players hp, monster Hp, player stats, player status effects, monster status effects, surrounding scenery, surrounding enemies and certain actions made by the player can trigger the enemy to react in certain ways.
Obviously, no single enemy reacts to all of the above, but for each of those possible situations there is an enemy that will react to it.

It is just not possible to make an AI that can do all of the above and still be flexible enough for my needs.

And your suggestion of having requirements and sorting attacks to make use of the best one is again, just shifting coding from one place to another (but changing nothing), so why bother?

Ask anyone who played Generiquest before it went down. There was literally almost no two boss fights that were the same, and there was like 60-70 bosses.
Using XML isn't shifting code to another place. It's moving data to another place to clean up your source and keep everything organized.

I never mentioned random attacks.

Sorting isn't really moving code around, it's cutting it down based on a few variables. If all monsters have brains that factor in the same things, it should be possible to encompass them in one proc.
Jeff8500 wrote:
Using XML isn't shifting code to another place. It's moving data to another place to clean up your source and keep everything organized.

But the source code is organized as it is. The code for all items are contained in an Items folder with several subfolders and each item type being in a specific file. If I do not want to look at the code, I do not have to.
Using XML is not making anything more organized, it is just moving the text from a dm file to a XML file, literally.

Sorting isn't really moving code around, it's cutting it down based on a few variables. If all monsters have brains that factor in the same things, it should be possible to encompass them in one proc.

But the problem is, they do NOT factor in the same things.
One boss could learn where environmental hazards were, and avoid them, another would use the environment to it's advantage, another would target specific player classes and so on.
The whole point of the AI I use now is there is just WAY too much different factors to put into a single all functioning AI.

Try it yourself. Make an AI that can do all of the following (also, it has to be compact, efficient and highly flexible).

1. Targets different enemies. This can be based on distance, class, stats, equipment, status effects and general status of the character (such as how much Hp/Mp they have left).

2. Has different movement styles.
It can walk to enemies, teleport to them, stalk them, cut them off, it can also flee from enemies.

3. Make effective actions based on the situation.
A spellcaster enemy would try to maintain a distance from enemies while casting spells.
A melee fighter would try to quickly bridge the distance.
It would take into account scenery and environmental hazards.
It would take into account whether there was any allies around to help it.
It would take into account everything about selecting an enemy I said in part 1.
It would take into account all of it's own stats, status effects and so on.
It would take into account other, outside factors (one boss was sealed away, as the seal was broken it's AI because stronger and more aggressive).

It also has to be capable of using around 300-350 different abilities. Including offensive, debuffs, healing (self and allies), supportive (self and allies), summoning allies, calling for assistance, making use of allies (such as devouring them to restore lost Hp) and possible other actions based on scenery (pulling/pushing enemies into dangerous scenery).

Try it, and you tell me just how easy it is to make an AI like that.

Oh yeah. It also has to be very easy to expand in the future and add new stuff which is probably does not already have.
The Magic Man wrote:
Oh yeah. It also has to be very easy to expand in the future and add new stuff which is probably does not already have.

Which your solution for was copy-paste, obviously.
Nothing in that list is too bad, except for scenery-related things (I don't know how you could efficiently go about doing that in BYOND at all without heavy use of the tag var).

"Take into account" == Get a good formula to sort by, and you can have it vary from monster to monster if necessary.
There's absolutely nothing wrong with storing the item data in the code. Who the hell wants to load an parse a huge XML file when the world starts? I sure don't. Nevermind the fact that it leaves the XML file completely open to being edited.
Jeff8500 wrote:
Nothing in that list is too bad, except for scenery-related things (I don't know how you could efficiently go about doing that in BYOND at all without heavy use of the tag var).

Or even a well organized Object tree.
Jeff8500 wrote:
Nothing in that list is too bad, except for scenery-related things (I don't know how you could efficiently go about doing that in BYOND at all without heavy use of the tag var).

"Take into account" == Get a good formula to sort by, and you can have it vary from monster to monster if necessary.

Then do it? Oh yeah, I forgot to mention. Not each and every enemy uses or follows the same requirements for skills.
One many use skills until it is at 10% of it's Mp, another until it is at 50%. One may heal when it's Hp drops below 10%, another when it drops below 25% and so on.

It also has to be efficient enough to have it running at least 100 times, but depending on players online upwards of 300 times.

Good luck with making an AI that is smart enough to do this and potentially work with an infinite number of situations.

Which your solution for was copy-paste, obviously.

Nope, my solution was to simply give each enemy with unique AIs their own AI.
Not to make some monsterously huge, AI that'd probably achieve sentience by the time it was finished and compiled.

Like I said, if any of you think it is so easy to make an AI that is this smart and flexible that can be applied to all enemies and can make each and every encounter feel and work differently, then do it and prove me wrong.
But I doubt you can!
i hope you get generiquest out again soon, it's one of my favorite games and i miss playing it