Results 1 to 17 of 17

Thread: I need help figuring out a complicated sub.

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    I need help figuring out a complicated sub.

    What is the easiest way to find the number of techs in the longest route to the base of a complicated tech tree from any given tech?

    Each tech has the following properties:

    Pre – A set of numbers, (bits), that must be turned on to enable research of that tech. Each number is separated by a space.

    Def - A set of numbers, (bits), that are turned on when the tech is enabled or researched.

    Id – A single number that is used to reference objects. It is not the index of an array (There could be the possibility of an Id of 2 and a Id of 3 but no Ids of 3, 4, 5).


    The base, (start), of the tech tree has the following properties:

    Base_tech – A set of numbers, (bits), that start out being turned on (Basically the same as Def).

    No_dev_tech – A set of numbers, (bits), that defines which numbers, (bits), which can’t be turned on. If a tech has a Pre number that matches a number in No_dev_tech, then that tech is disabled and not in the tree. (It’s what keeps one race from using another race’s tech)

    Station – A number that refers to the Id of a tech that you start out with.

  2. #2
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need help figuring out a complicated sub.

    Your not checking which techs the user has right? You just want to see how many steps in between to get to a tech from the base, right?

    Could you post sample tech pre numbers so we have something to work with, thanks. My guess is we will treat the pre numbers as mask but with exclusion of other techs on mask test for bits = 0... unless the sample pre nums show that this is not feasible.
    Last edited by leinad31; Nov 7th, 2006 at 09:15 PM.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.

    In case your wondering the table "launchers" has a field expendable_id that refers the to the id field in missiles, mines, chaff, and probes.

    The id in the base tech property Station is the station_id in the "stations" table.

    factions table contains base_tech and no_dev_tech and station for the base tech.


    I have already done the work of reading and phrasing the files into arrays:
    http://www.vbforums.com/showthread.php?t=433735 (scroll towards the bottom)

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.

    Quote Originally Posted by leinad31
    Your not checking which techs the user has right? You just want to see how many steps in between to get to a tech from the base, right?

    Could you post sample tech pre numbers so we have something to work with, thanks. My guess is we will treat the pre numbers as mask but with exclusion of other techs on mask test for bits = 0... unless the sample pre nums show that this is not feasible.
    Correct, but there can be more than one path to get to a certain tech, i need to know the number of steps in the longest path.

  5. #5
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need help figuring out a complicated sub.

    Hmmm I see what you mean, some techs setting the same bit as defined in def

    eg.
    def - dev_id
    180 - 2
    180 - 11
    180 - 267

    You may need to pool all relevant techs (relative to tech being tested) first then build a heirarchy (like a treeview) from this pool of techs... or possibly skip pooling and do recursion... gtg, i'll check back later what others suggest on the matter.
    Last edited by leinad31; Nov 7th, 2006 at 10:39 PM.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.

    There is also Next_id which defines what tech is the upgraded version. next_id refers to numbers part_id, but next_id has a –1 if there is no upgraded version.

    Because certain tech can be picked up in the game and then taken back to base to enable or instantly research it, some second and third level techs have the same Def bits plus a few more. - This is a fix because (for example) if "gun 3" is found and brought in, then it makes sence to also enable the lesser techs of "gun 2" and "gun 1"


    You may find that the following 2 links provide a better explanation.
    A Guide to ICE (*.IGC editor, edits the file from which the .CSV files get there data)
    http://www.freeallegiance.org/forums...howtopic=23300
    Chapter 2: The Pre & Def System and the 'Tech tree' screen
    http://share.edge-of-reality.de/temp...deChapter2.txt

    I asked about the Pre & Def System about mid way down the frist page of the thread

  7. #7
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need help figuring out a complicated sub.

    In the mantime, Ask what's the upper bound or max "bit" set in pre, def, etc... from what I've seen the ubound of the "bit" array is 399 but it may be higher.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.

    Quote Originally Posted by leinad31
    In the mantime, Ask what's the upper bound or max "bit" set in pre, def, etc... from what I've seen the ubound of the "bit" array is 399 but it may be higher.
    Yes, I've read somewhere that it is a set of 400 bits, so a ubound of 399 is probabbly correct.


    Ah, here it is ( in a post by factoid):
    http://www.freeallegiance.org/forums...ic=25324&st=20
    No, pre and def only refer to the other pre and defs of other objects. They represent a set of 400 bits that start off, and are toggled on by the def field.

  9. #9
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need help figuring out a complicated sub.

    Any mention as to how or what turns on bits 354-400?

  10. #10
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need help figuring out a complicated sub.

    Ahhhhhhhhhhh I'm beginning to understand what information you want to extract... you want to get the long tech routes so you can get an idea of the tech tree minus the shortcuts/jumps due to

    Because certain tech can be picked up in the game and then taken back to base to enable or instantly research it, some second and third level techs have the same Def bits plus a few more. - This is a fix because (for example) if "gun 3" is found and brought in, then it makes sence to also enable the lesser techs of "gun 2" and "gun 1"

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.

    Quote Originally Posted by leinad31
    Any mention as to how or what turns on bits 354-400?
    The creator of the core (basically a custom race/map file made or modified by a user) may or may not use all 400 bits; who says that he needs to use all 400 when he doesn’t need to use that many for his tech tree?

    However, certain bits are toggled on by the pre game options;
    According to the editor (ICE) , when checked or enabled in the lobby game menu:
    Allow shipyard has a Def of 6
    Allow expansion has a Def of 5
    Allow tactical has a Def of 4
    Allow supremacy has a Def of 3

    I would just assume that bits that have no reference to them are on and that they’re turned on from the base of the tech tree since there either not used by the current core or there turned on by the games options.

    (If you haven't noticed by now, all the bits in the Pre of a given tech must be on to enable that tech; I could be repeating myself since I just got up.)

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.

    Quote Originally Posted by leinad31
    Ahhhhhhhhhhh I'm beginning to understand what information you want to extract... you want to get the long tech routes so you can get an idea of the tech tree minus the shortcuts/jumps due to
    Yes, basically. I need the number of steaps on the logest route from tech to base so I can determine the Y position (tier might be a better word) of a given tech.

    My goal is to write a program spits out graphical tech trees that resemble http://www.alleg-academy.org/assets/gigatechtree.jpg but have it arranged according to witch button you go to in order to buy/research it- (In other words, it will be formatted differently). - The tech tree will also include starting tech and descriptions and a little bit of other information like abilities and possibly available load-outs for ships.

  13. #13
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need help figuring out a complicated sub.

    Could you zip the pic... I can't access it

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.


  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.

    Dose anyone have any further input?

  16. #16
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: I need help figuring out a complicated sub.

    Quote Originally Posted by Tontow
    The base, (start), of the tech tree has the following properties:

    Base_tech – A set of numbers, (bits), that start out being turned on (Basically the same as Def).

    No_dev_tech – A set of numbers, (bits), that defines which numbers, (bits), which can’t be turned on. If a tech has a Pre number that matches a number in No_dev_tech, then that tech is disabled and not in the tree. (It’s what keeps one race from using another race’s tech)

    Station – A number that refers to the Id of a tech that you start out with.
    Are you certain about No_dev_tech? Gigacorp's no_dev_tech array excluded boosters 1, 2, 3 but those are in the tech tree you posted.

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Oct 2006
    Posts
    172

    Re: I need help figuring out a complicated sub.

    Quote Originally Posted by leinad31
    Are you certain about No_dev_tech? Gigacorp's no_dev_tech array excluded boosters 1, 2, 3 but those are in the tech tree you posted.
    Ops, you’re right, I goofed.

    Quote Originally Posted by factoid
    Unlike the other entitys in allegiance, the factions don't have any 'pres'. So 'no_dev_tech' is the base set of defs when 'development off' is checked (for DM, etc...)
    So actually, 'no_dev_tech' is the 'base_tech' for DM, etc...

    Also, as far as I can tell 'def' and 'base_tech' in "factions" hold the same data.


    (PS: Sorry it took me a week to reply; I had some family business to tend to.)

Posting Permissions

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



Click Here to Expand Forum to Full Width