Go Back   RunUO - Ultima Online Emulation > RunUO > General Discussion

General Discussion General discussion for the RunUO community, all off-topic posts will be deleted. This forum is NOT FOR SUPPORT!

View Poll Results: Do you support this idea?
I Would use it, I have nothing to contribute at the moment. 4 40.00%
I would use it, I have a few sugestions too. 3 30.00%
I wouldn't use it, I have explained why. 1 10.00%
I wouldn't use it, I don't know why. 1 10.00%
I may use it, I just have sugestions at the moment. 0 0%
I may use it, but it seems a bit lazy. 0 0%
IT CAN GENERATE HOW MANY?! 1 10.00%
Multiple Choice Poll. Voters: 10. You may not vote on this poll

Reply
 
Thread Tools Display Modes
Old 07-02-2009, 06:45 PM   #1 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 23
Posts: 3,158
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Question Script Generator Proposal

Who would be interested in a script capable of generating thousands of armor / weapon scripts with balanced attributes and stats?

I have tried and tested a special method for generating the maximum amount of combinations of unique armor and weapons and thus, with given arguments, have been able to generate over 10,000 Armor and 6,000 Weapon scripts for my shard.

Unfortunately, my shard uses a completely different "simplified" method of setting properties, so the output is absolutely incompatible with and standard version of RunUO.

My proposal is, if enough people are interested in using this idea, I will be happy to manufacture it towards supporting RunUO standard installations.

The main aim of the generation is to generate as many combinations of unique armor and weapon scripts, where each item has it's own class name and unique properties written with clean, error free and semi-annotated code.

The core key in being able to create such a unique armor or weapon script lies in the "Lore" of the item, the current list is as follows:

Code:
	public enum ItemLore
	{
		NotSet,
		FixLore,
		Gladiator,
		Bandit,
		Invoker,
		Caster,
		Wizard,
		Wraith,
		Conjurer,
		Doctor,
		Healer,
		Angel,
		Devil,
		Darkness,
		Shadows,
		Earth,
		Arcanist,
		Warrior,
		Stealther,
		Moon,
		Sun,
		Blizzard,
		Night,
		Day,
		Knight,
		Mage,
		Storm,
		Hurricane,
		Farplane,
		Conqueror,
		Void,
		Bear,
		Whale,
		Eagle,
		Owl,
		Wolf,
		Tiger,
		Beast,
		Demon,
		Ghost,
		Sundering,
		Spirit,
		Earthblood,
		Ludicrous,
		Serpentine,
		Snake,
		Ocean,
		Waters,
		Lifeblood,
		Depths,
		Nether,
	}
The Lore effects the elemental attributes and especially the Class Name and Item Name of the armor or weapon.

The Item Name is decided by using a random enumeration of either all Weapon or Armor ItemID's, the enumeration keys are named according to the relative ItemID name in TileData.mul, these are the base Item Names that the generator will use.

The Armor Generator is capable of distinguishing between Body Armor and Shields.

the Weapon Generator is capable of distinguishing between Bows, One-Handed and Two-Handed Weapons.
This includins the fact that a Weapon may be a Melee Two-Handed or a Ranged Two-Handed Weapon.

Attributes are categorized into 3 groups:
  • Misc: Represents Attributes not related to Melee or Magic specifically.
  • Melee: Represents all attributes unique to Melee specifically.
  • Magic: Represents all attributes unique to Magic specifically.

Items can be generated into a total of 5 categories by using a combination of the above list, those final categories are:
  • Misc
  • Magic
  • Magic & Misc
  • Melee
  • Melee & Misc

Depending on the selected category for the generated item, only attribute that pertain to that category will be selected as viable attributes to apply in the output script.

The generation process is as follows:
  • -> Select ItemLore
  • -> Parse Class Name
  • -> Set Item Name
  • -> Affix Lore to Item Name
  • -> Select Unique Attributes
  • -> Filter Attributes (Melee/Magic)
  • -> Select Melee/Magic Item Type
  • -> Apply Melee/Magic Attributes
  • -> Set Appropriate Resistances/Damage Types Using ItemLore
  • -> Write Generated Armor/Weapon Item As Script (.cs)

After each script is generated, the Class Name is added to a cache file (Generator.cache) prefixed with the total list count. This is to prevent the generator from producing duplicate scripts. The cache file is Saved and Loaded each time the generator runs, meaning that it will remember what has previously been generated, killing any chance to produce duplicate entris.

The generator will attempt to generate scripts in blocks of 1000.
The main entry method for the generator is contained in a while statement and for each block of 1000 scripts, a baked-in 30-second timeout is applied to break from the loop.

The generator will also count how many scripts have been generated in each block of 1000, it may fall short easily, if it has tried to create a duplicate entry.

So, there is now an "infinite" loop, or so it seems...

To achieve the absolute, unknown MAXIMUM amount of combinations, the loop will not be broken unless one of two conditions are met:
  1. The Total Generated Scripts (In this block of 1000) is 0
  2. The Generator Reaches The Specified TimeOut Period (Of 30 seconds per block of 1000)

Samples:

Each ¦ represents one block of 1000.
Code:
Generating Armor Scripts...
¦¦¦¦¦¦¦¦¦¦¦¦Generator Timed Out.
Done: Generated 11786 Armor Scripts.
-
Generating Weapon Scripts...
¦¦¦¦¦¦Generator Timed Out.
Done: Generated 6158 Weapon Scripts.
Output Armor Script Sample:
Note that this item would actually be considdered a very hard and "imbalanced" item according to most shard owner's standards.
Code:
using System;
using Server;
using Server.Items;

namespace Server.Items
{
	public class BoneArmsOfTheLudicrous : BaseArmor
	{
		[Constructable]
		public BoneArmsOfTheLudicrous( )
			: base( 0x1453 ) //5203
		{
			Hue = 2415;
			Name = "Bone Arms";
			Weight = 2.0;
			Layer = Layer.Arms;
			Attributes.RegenHealth = 90;
			Attributes.RegenMana = 81;
			Attributes.Intelligence = 90;
			Attributes.SpellRecovery = 108;
			Attributes.ReducedManaCost = 108;

			SetStrengthLevel( StrengthLevel.Ultimate );
			ItemLore = ItemLore.Ludicrous;
			ItemBind = ItemBind.OnPickup;
			ItemRank = ItemRank.Legendary;
		}

		public BoneArmsOfTheLudicrous( Serial serial )
			: base( serial )
		{ }

		public override void Serialize( GenericWriter writer )
		{
			base.Serialize( writer );
			
			writer.Write( (int)0 ); //Version #
		}

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			
			int version = reader.ReadInt( ); //Version #
		}
	}
}
See: Output Armor Generator Cache File sample as attached.

So the input I want to see is sujestions about improving the generation process, maybe you know a better way to reach a total number of possible unknown combinations? Maybe you have a few "Lores" to add to the list?

Please comment, rate and share.

Regards,
Vorspire
Attached Files
File Type: txt Armor Generator Cache Sample.txt (280.4 KB, 5 views)
__________________
Criticism should not be the cause of anger. -Dominik Seifert
Vorspire is offline   Reply With Quote
Old 07-02-2009, 07:41 PM   #2 (permalink)
Forum Novice
 
Thilgon's Avatar
 
Join Date: Apr 2008
Location: Messina, Sicily, Italy
Age: 26
Posts: 547
Default

O_O
3 letters for you... WTF?!?!

just joking :P
it seems an amazing tool for creating huge masses of weaps and armors, yet just creating them seems pointless, when you have after to find a way to put them in the game (unless of a totally random snippet of code that drops any kind of basearmor or baseweapon)... and putting them to any use could take an eternity, so there seems to be no gain in using it...

however, seems to me that if the Lore is chosen wisely, it becames easier to put together some massive weap/armor packs for the shard, leaving the coding of each single item as a far memory :P

i don't think i would ever use it for my purpouses, seems way too much randomness involved, even if it is a fashinating concept that might came useful for someone


suggestion: take a look at ML releases, since those adds more specifics to weaps and armors, if you are ever going to release this, and add a #define block of code for people to choose, if SVN or ML (might end up soon with no difference, though)

suggestion #2: for the lore, try opening an english dictionary (or, some myths books), you might find some surprisingly fitting terms to add
Thilgon is online now   Reply With Quote
Old 07-02-2009, 08:09 PM   #3 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 23
Posts: 3,158
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Great input, thanks Thiglon

However, I have yet to impliment a way to get these items into the game, but for my shard, it's quite easy, as the loot system is based by-region, no by-mob - The StrengthLevel property plays a massive role in that too.

I would possibly have the generator also co-ordinate certain items and generate Loot Packs containing them, or have it modify the LootPack.cs script (patching it) with certail loot in the right places, either way is viable.

I also realise there are such things to compensate for, like Slayers, which is not a problem.

The prospect of being able to generate a few thousand scripts at random doesn't mean you HAVE to use them all, you can take a select few.

The Generation output directory is not contained within the Scripts directory, and is never compiled unless you explicitly copy the generated files to a location within the Scripts directory.

As for the dictionary, yeah I guess so, but it's easier to type one word into a synonym archive and have it display every word assosiated with it :P http://thesaurus.reference.com/browse/fire for example.
__________________
Criticism should not be the cause of anger. -Dominik Seifert

Last edited by Vorspire; 07-02-2009 at 08:13 PM.
Vorspire is offline   Reply With Quote
Old 07-02-2009, 08:21 PM   #4 (permalink)
Forum Novice
 
Prophet2005's Avatar
 
Join Date: Nov 2008
Age: 23
Posts: 149
Default

The script is a good idea I believe for those who are newer to the concept of scripting. It gives their Shards a custom feel from that of OSI. But you should incorporate something that will allow for easy editing because what you consider balanced may be different than I. Basically like an amp up effect from the basics because lots of shards use items with maxed out everything. Just an idea though.
Prophet2005 is offline   Reply With Quote
Old 07-02-2009, 10:45 PM   #5 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 23
Posts: 3,158
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Yes, sounds goo,d I will include a "preset" list of scales that can be configured if there is enough reason to make the RunUO complieance conversion effort
__________________
Criticism should not be the cause of anger. -Dominik Seifert
Vorspire is offline   Reply With Quote
Old 07-03-2009, 03:50 AM   #6 (permalink)
Forum Novice
 
Thilgon's Avatar
 
Join Date: Apr 2008
Location: Messina, Sicily, Italy
Age: 26
Posts: 547
Default

Quote:
Originally Posted by Vorspire View Post
As for the dictionary, yeah I guess so, but it's easier to type one word into a synonym archive and have it display every word assosiated with it :P fire synonym | Thesaurus.com for example.
This confirms me how lazy you are :P
Thilgon is online now   Reply With Quote
Old 07-03-2009, 04:06 PM   #7 (permalink)
Forum Expert
 
Vorspire's Avatar
 
Join Date: Jan 2005
Location: Newcastle, United Kingdom
Age: 23
Posts: 3,158
Send a message via ICQ to Vorspire Send a message via MSN to Vorspire Send a message via Skype™ to Vorspire
Default

Gimmie a scale of 0 to 9 :P
__________________
Criticism should not be the cause of anger. -Dominik Seifert
Vorspire is offline   Reply With Quote
Reply

Bookmarks

Tags
armor, generation, generator, script, weapon


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5