Modifications
Titan Quest - Powered by vBulletin
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Perfect seeds?

  1. #1

    Perfect seeds?

    OK, I know that you are able to manipulate an item's seed value in TQVault, but would there be a way to create a mod that would randomly generate a HUGE number of items, all with different seeds? I am asking this as to find out if its possible or not, before I try to undertake doing it myself (as I have a lot more to learn about the editor).

    I figure that, considering how long the game has been out, its about time we started slowly compiling a list of the item seeds that give the best stats for a given item. For instance, most everyone wants a to find a Veteran's Prowler's Cuirass of the Glade, but what about finding one that "perfect stats"? Finding that one seed value that results in: (below are the highest values I've seen thus far)

    + 32% CtaP
    + 48% Elem. Resist
    + 24% pierce damage
    + 24% DA
    + 20% Damage Resistance

    All on the same item. But, with 32767 different possibilties, this almost seems an impossible task, even though it is possible that multiple seeds will result in the same stats.

    Or, the other idea would be to find out if there was a way to create an external program that would allow you to input the desired stats of an item you own/ load into the program, and it finds the correct seed for you. By breaking each affix down to its minimum and maximum stat values, would this even be possible? Or wold it require violating the EULA to reverse engineer the game engine to find out how to do it (I understand that this would take a considerable amount of programming knowledge)?

    Even if I had to create a HUGE map, and have 32767 of the same item on the screen, would it be possible to have all 32767 items show up with its own seed? Possibly in numerical order? I have already spent 3 hours tonight generating random seeds, and this would drastically speed up the amount of time needed to find perfect item seeds. Then I'd be able to start making a list of MI's with all affix combinations/ blues/ purples.

    Just interested on anyone else's thought's on this. I know most will consider it pointless, but it will give me something to contribute to the community, and something to do to pass the time until Grim Dawn comes out.

  2. #2
    Demigod jiaco's Avatar
    Join Date
    Sep 2008
    Posts
    1,356

    Re: Perfect seeds?

    You really think picking up and looking at 32767 items is gonna be fast?

    The problem with doing this with the toolset is that you need a loot table that contains the base item and also puts that item through the prefix affix generation. So it cannot be placed on a map. You can put such a dynamic loot table inside a container or on a monster, but neither of those can handle the numbers you are looking at nor can the game handle dropping that much stuff at once.

    I would do this by modding a player.chr file, giving the item to a toon as many times as possible with a range of seeds. Then you could load the toon in game and see which seed is best. If you did it with a binary search apporach, it would not take that many generations before you found your perfect seed.

    http://en.wikipedia.org/wiki/Binary_search_algorithm

  3. #3

    Re: Perfect seeds?

    Ok, I understand the basics of what that article is talking about, but I am guessing that I am going to need to buckle down and learn the editor before even attempting this. It kinda sounds a little like what I am already doing, only stream-lined. Right now, I am just copying the item using TQVault (generating a random seed each time) and fully loading my 18 spots in my inventory, 20 spots in my storage, and 12 in my transfer space. Meaning I'm only getting 50 each time, but it leaves the possiblity of duplicates, as setting each seed individually would take too much time (although it would probably be more efficient).

    Any chance of you giving me a shove in the right direction to doing a binary search, to speed things up a little bit, and not get the possible duplicates? As it stands right now, that means that I would have to do this a minimum of 655.34 times to see all of the combinations, and probably more than that taking duplicates into account. Not that I mind doing it, but a binary search would drastically lower the amount of time needed to compile a list for the forums of the most wanted affixes for a given item.

    Thanks for your help either way!

    EDIT: Or, would it just be easier to modify the source code for TQVault so that it advances the item seed by 1, instead of creating a random seed, when copying an item. For example, put item X into a vault. Set the seed to value to 1(i) manually, then copy the item so that new item created has a seed value of 2 (i+1). Then the variable (i) becomes the new seed value of the last item copied (2 in the previous example). This would be something like setting up an array in Flash, if I'm not mistaken, and thus it would only take finding where the randomization formula is stored in TQVault. I'm assuming that this would be ok, as you can download the source files through Defiler.

  4. #4
    Demigod jiaco's Avatar
    Join Date
    Sep 2008
    Posts
    1,356

    Re: Perfect seeds?

    Actually, you should just use TQVault editing the player.chr file will take much longer.

    Basically, 32767 is your max and 0 is your min for the first run so you choose these seeds:

    0 (min)
    8192 (25%)
    16384 (half)
    24577 (75%)
    32767 (max)

    If there is any order to the results you will be able to see which two seeds are the best and then reset the min max accordingly.

    For example if 16384 and 24577 are the better ones then round two
    (range is 8193 which /4 gives 2048 which is your increment value now)

    16384 (min)
    18430 ( + 1 * 2048)
    20480 ( + 2 * 2048)
    22530 ( + 3 * 2048)
    24577 (max)

    repeat this until you have a very small range and you are basically examining 5 consecutive values. If the seed system works in a manner that is exploitable in this way, the binary search is the fastest way to find the best value with the smallest number of tests.

  5. #5

    Re: Perfect seeds?

    Looks like you posted before I was able to get my edit in, with a different idea.

  6. #6
    Priest
    Join Date
    Aug 2007
    Location
    Germany
    Posts
    775

    Re: Perfect seeds?

    If I were you I would examine the tqvault source to understand the .vault file format. After that I would write a program which creates .vault files filled with the wanted item in all possible seeds.

  7. #7

    Re: Perfect seeds?

    Reinstalling my old version of Visual Studio 2005 so that I can take a look at it. Been so long since I've messed around in it, I'm probably going to have to find some tutorials online to relearn everything I"ve forgotten. I never did much with it to begin with, so this is going to end up being fun, to say the least.

    @ Jiaco:

    The only problem I see now with doing a binary search for the "perfect seed", is that say you set the seed value for a Veteran's Prowler's Cuirass of the Glade to a seed value of 1, then copy it, and set a seed value of 2, leaving you with 2 copies of the same item, but different seed values. Once you load up the game and check the items, there are no similarities between the items whatsoever. I could see the Binary search working if there was some rhyme or reason apparent behind seed values (i.e. if they sequentially increased a stat, or set of stats) so taht you could see some progression in the values. But, it appears that the system is random ( or at least as random as can be programmed), and as such I don't see any way short of using vorbis' idea of trying to go through them manually via TQVault. At least this will end up saving me the time of having to change the seed values manually.

    Now, the fun really begins by trying to make heads or tails of the code in the TQVault's source code so that I can change the "copy item"s behavior in the context menu. Making it to where it creates a new vault (or set of vaults) to fill all of them with all possible seeds of an item, in sequential order is probably quite out of my current coding knowledge.

  8. #8

    Re: Perfect seeds?

    Sorry for the double post, but posting my progress here as of now. I have realized that my knowledge of programming in now pretty much limited to flash. Unfortunately, what this means is, that while spending an hour or two trying to make sense of the source code, I haven't the foggiest idea about how to go about implementing the changes necessary to to make this happen.

    My next step in this venture, is either going to be to find out if there are any forum members here that might be able to do this, or to try to somehow contact EJFudd, and see I might be able to get some help from him.

    EDIT 1: It seems that I have now been able to find the line of code that would need to be changed, at least I'm hoping this is the right one.

    return s_random->Next(0x00007fff);
    Now, I am just needing to figure out how to make it take the current seed value, and increase it by +1 instead of a random seed. Also, needing to find out where the current seed value is stored for each item. But, at least this is a start.

  9. #9

    Re: Perfect seeds?

    Quote Originally Posted by jiaco View Post
    I would do this by modding a player.chr file, giving the item to a toon as many times as possible with a range of seeds. Then you could load the toon in game and see which seed is best. If you did it with a binary search apporach, it would not take that many generations before you found your perfect seed.
    You are making the assumption here that there is some straight-forward relationship between neighboring seeds with one being better than the other, all of this leading to one distinct peak of an 'optimal' seed within the range of possible values.

    Interesting as such a hypothesis may be, it is probably wrong...

    Quote Originally Posted by shattered.likeness
    The only problem I see now with doing a binary search for the "perfect seed", is that say you set the seed value for a Veteran's Prowler's Cuirass of the Glade to a seed value of 1, then copy it, and set a seed value of 2, leaving you with 2 copies of the same item, but different seed values. Once you load up the game and check the items, there are no similarities between the items whatsoever.
    ...As this find shows.

    I suggest to start out simple, with some yellow item sporting only a single prefix or suffix. Create a number of N copies of said item, put in a range of seed values from 1 to N and look at what comes out. I made a test like this once, with rings having a resistance bonus. Modifying the seed value this way just counts through the possible resistance values one by one, eventually wrapping from the highest possible to the lowest.

    When another affix comes into play (or an affix affecting two or more attributes), things get more interesting.

    I think that the only way to find a perfect seed is currently to check through all the possible seeds or to understand the actual algorithm that is used to derive the actual values of variable attributes from an item seed.

    There are other problems in this task:

    By modifying just a seed value for an item, you are making the assumption that a given seed/affix combination is actually valid as in 'such an item can drop in the game'. This is not necessarily the case. It may be that the way the game rolls magic items, some prefix/suffix combinations can only exist with certain seeds.

  10. #10
    Demigod jiaco's Avatar
    Join Date
    Sep 2008
    Posts
    1,356

    Re: Perfect seeds?

    Quote Originally Posted by jiaco View Post
    If the seed system works in a manner that is exploitable in this way, the binary search is the fastest way to find the best value with the smallest number of tests.
    Just to clarify, I never said nor thought this would actually work.

    I would even go as far to assume that the best seed for one item is not the best seed for the next.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •