Results 1 to 5 of 5

Thread: Unlimited resources (sort of)

  1. #1
    EB insanity coordinator Senior Member khelvan's Avatar
    Join Date
    Sep 2002
    Location
    Oakland, CA
    Posts
    8,449

    Default Unlimited resources (sort of)

    Well, this wasn't a discovery, as much as a simple application of mathematics. Given a set of 63 or 64 things (hidden resources), by creating sets and using combinations we can extend their use quite a bit.

    If you have four resources, alpha, beta, gamma, delta, you can get four uses out of them, normally. However, there are lots of complex conditionals, as we have discussed elsewhere. Let's see an example of them in use.

    Province X has HR alpha
    Province Y has HR beta
    Province Z has HR alpha, gamma, and delta

    Unit 1 has the following requirement string:
    requires factions blah and hidden_resource alpha and not hidden_resource beta and not hidden_resource gamma and not hidden_resource delta

    Unit 1 can then be built in Province X, but not Y or Z.

    Using these combinations, through a simple application of mathematics we see that each set of resources provides us with a multiplier of 2's worth of HRs.
    2 = 4
    3 = 8
    4 = 16
    5 = 32
    ...and so on.
    Cogita tute


  2. #2
    Spends his time on TWC Member Simetrical's Avatar
    Join Date
    Dec 2004
    Location
    New York City
    Posts
    1,358

    Default Re: Unlimited resources (sort of)

    Which means, in principle, that it's possible to identify each province uniquely using just eight hidden resources (2^8 = 256). Very useful. I'll add a link to my hardcoded limits thread.
    TWC Administrator

    MediaWiki Developer

  3. #3
    EB insanity coordinator Senior Member khelvan's Avatar
    Join Date
    Sep 2002
    Location
    Oakland, CA
    Posts
    8,449

    Default Re: Unlimited resources (sort of)

    Not terribly useful, no, when you think about it, for most things. For anything that is located in more than one province, you can't use it (edit: "it" here being defining each province with a unique combination of resources), because of the way the system handles "OR" conditionals.

    Basically, if your requirement string would normally look like this with single HRs: requires HR x or HR y or HR z, you can't do it, because the system doesn't handle nesting, or anything else useful, for that matter.
    Last edited by khelvan; 08-19-2005 at 03:45.
    Cogita tute


  4. #4
    Insanity perhaps is inevitable Member shifty157's Avatar
    Join Date
    Jan 2005
    Posts
    1,145

    Default Re: Unlimited resources (sort of)

    Very interesting. Well done. Well done indeed.

  5. #5
    Spends his time on TWC Member Simetrical's Avatar
    Join Date
    Dec 2004
    Location
    New York City
    Posts
    1,358

    Default Re: Unlimited resources (sort of)

    Quote Originally Posted by khelvan
    Not terribly useful, no, when you think about it, for most things. For anything that is located in more than one province, you can't use it (edit: "it" here being defining each province with a unique combination of resources), because of the way the system handles "OR" conditionals.
    As I've pointed out elsewhere, multiple lines can deal with ors for capability listings, although not necessarily building requirements. To quote my post:
    Well, if we're allowed unlimited unit recruitment lines, in principle we could just give each province an arbitrary eight-bit code and specify each unit-province requirement on its own line with eight hidden resource references. So if a province's code was 00011011 (or 027 in decimal), the line would just be

    recruit "unit" 0 requires factions { bartix, } and not hidden_resource A and not hidden_resource B and not hidden_resource C and hidden_resource D and hidden_resource E and not hidden_resource F and hidden_resource H and hidden_resource I ;recruitable in cityx

    The only thing is, if there's any limitation on recruitment lines, this will probably hit it—depending on how many units [you']ll generally have per building, and how many provinces an average unit will be trainable in, you could be talking thousands of lines for a single building easily. I know RTR 6.0 manages fine with 400, however, which makes me suspect there might not be a limit.

    And if there isn't a limit, frankly, it would be easiest to just get [anyone who knows basic programming] to spend an hour making a simple program to do the lines automatically. In the simplest form, that would need to reference no external data, you would assign each province an arbitrary number and give it the appropriate resources by hand, then just feed the program a line with a list of unit names and faction requirements, each followed by a list of province numbers. So for instance, you'd stick in:

    recruit "unit1" 0 requires factions { thrace, greek_cities } and not hidden_resource A and not hidden_resource B and not hidden_resource C and hidden_resource D and hidden_resource E and not hidden_resource F and hidden_resource H and hidden_resource I ;recruitable in city 27
    recruit "unit1" 0 requires factions { thrace, greek_cities } and not hidden_resource A and not hidden_resource B and not hidden_resource C and hidden_resource D and hidden_resource E and hidden_resource F and not hidden_resource H and not hidden_resource I ;recruitable in city 28
    recruit "unit1" 0 requires factions { thrace, greek_cities } and not hidden_resource A and not hidden_resource B and not hidden_resource C and hidden_resource D and hidden_resource E and hidden_resource F and not hidden_resource H and hidden_resource I ;recruitable in city 29

    and so on for all sixteen lines. This could be made easier to read if the program were also given a list of city-number correspondences, so that you could input the names instead of the numbers and the output comments would be understandable without having to reference a chart. But basically, if you have the program it could be easily edited by the non-technical.
    So far our testing has discovered no limit to capability lines, incidentally.
    TWC Administrator

    MediaWiki Developer

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO