• 0

    posted a message on Tower Defense Tycoon spectators equation

    Just thought someone else might be interested in the formula for how spectators are calculated.

    Unlike what the game implies, spectators are not carried over from day-to-day; they are recalculated every day.

    The most interesting aspect is the tower_type_bonus, which is not mentioned anywhere in the game, but can give up to a 20% bonus from day 1. See below.

    -

    Spectator equation
    Max(5, (5 + total_crowd_appeal)*tower_type_bonus*upgrade_park_planner_bonus - leak_penalty + impressive_kill_bonus + special_day_bonuses) + upgrade_transit_bonus + (yesterdays_spectators*upgrade_facility_bonus)

    tower_type_bonus:
    The tower type bonus is the most interesting because it's not mentioned anywhere in the game. Basically, it gives you a bonus for spreading your money out between multiple tower-types, rather than investing it all in one type of tower.
    The equation is Min(20%, 5%*Sum(tower_type_costs)/Max(tower_type_costs)). In other words, it sums up the total money spent on each tower type (different levels of the same type of tower are considered the same tower-type - also, oddly enough, Annihilation tower and Corruption tower are considered the same tower-type, as are Crossfire/Chaos), then sums them up and divides by the max. Your bonus is that * 5%, with a max of 20%.
    So, for example, if you invest all your money into one type of tower, you will get a 5% bonus to spectators. However, if you invest evenly in two different tower types, you get 10% bonus; evenly in three gives you 15% bonus; and evenly in four gives the max of 20%.
    As another example, if you've invested 100 gold in one type of tower but 10 gold each in two other tower types, you would get (120/100)*5% = 6% bonus. If you had spent that same gold to spend 50 on one tower-type and 35 on each of the others, however, you'd get (120/50)*5% = 12% bonus. So diversifying your tower-types can pay off.

    upgrade_park_planner_bonus:
    Bonus for having the Park Planner upgrade (up to 16% bonus per tower type, depending on the max upgrade). Note that the bonuses are added, not multiplied, so the bonus for having two level-V towers is 0.16+0.16 = 32%, not 1.16*1.16 = 35%

    leak_penalty:
    Every time you leak, you lose ⌈day/5⌉ spectators. So, for rounds 1-5 you lose 1 spec/leak, rounds 6-10 you lose 2 spec/leak, etc.

    impressive_kill_bonus:
    Every impressive kills nets you ⌈day/10⌉ spectators (or more, if you have the pyrotechnics upgrade) for that day. So, rounds 1-10 gives 1 spec/impressive kill, rounds 11-20 give you 2, etc.

    special_day_bonuses:

    • On day 30, you randomly get between 140 and 160 extra spectators.
    • On day 40, you lose 5 spectators (and 5% popularity) for every civilian that dies.
    • On day 50, this variable is set to negate all other bonuses; that is, you get *no* bonuses on day 50.
    • Also on day 50, if your spectators are below 250, they will be set to a random number between 250 and 270.

    upgrade_transit_bonus:
    Randomly (40% of the time), you get extra spectators for having the transit bonus

    yesterdays_spectators*upgrade_facility_bonus:
    The facility bonus gives you extra spectators based on how many spectators you had yesterday.

    -

    Also note the throttling of crowd-appeal for lower-level towers mentioned here: http://www.sc2mapster.com/forums/general/general-chat/36457-tower-defense-tycoon-millionaire-contest/?page=2#p30.

    More specifically, the game looks at the difference between the "tower tier" (see previous link) and the "Day tier":

    • Days 1-5: Tier 0
    • Days 6-15: Tier 1
    • Days 16-25: Tier 2
    • Days 26-35: Tier 3
    • Days 36-45: Tier 4
    • Days 46-50: Tier 5

    If the difference between tiers is 2, the tower is only worth 60% of its stated crowd-appeal. If the difference is 3 or more, the tower is only worth 10% of its stated crowd-appeal. Thus, try to have only tier-3 (or greater) towers by day 36, and tier-4 by day 46.

    Posted in: General Chat
  • 0

    posted a message on Warning for everyone who uses bank files

    It's fun to bash on the great programmers at Blizzard and all, but did anyone actually try this?

    Because, it doesn't work. It has been verified by multiple people that the bank signatures depend on the player's name, author's name, and (published) map-name. I just verified this myself.

    Also, if what Mille25 said were true, it would be possible to trade protected banks (it's not).

    Signatures are still the only way to protect bank files from hackers - despite what multiple people on this forum have claimed, the algorithm for signatures has still not been cracked (or at least, it has not been released to the public by anyone).

    Posted in: Miscellaneous Development
  • 0

    posted a message on A word on bank encryption

    @TimSin112: All maps which use the new BankVerify() function (including SplitTD, and I believe all OneTwoSC's maps) are unhacked, to my knowledge.

    Posted in: General Chat
  • 0

    posted a message on A word on bank encryption

    @OneTwoSC: Why hello again :) You probably don't remember me - we met in a game of OneTwoTD, I showed you some game-breaking bugs, then we talked about Computer Science for a while.

    Quote from OneTwoSC:

    Also, as 'unprotected' as any client-side data is... I was quite surprised when Blizz released SC2 they let us download it ahead of time. I was shocked, guessing some random dude would crack it open before 'official' release. So what did they use to protect their data? And why can't we do the same in a bank file? (FYI I'm asking genuinely... i don't know).

    Normal (symmetric) encryption requires only one thing to encrypt or decrypt data - the key. A key is just a very large number - usually 128 or 256 bits - that you must know exactly in order to perform the encryption or decryption. (256-bits may not sound like a lot, but it is actually enormous - consider that it would only take a 265-bit key to give one key to every atom in the known universe. Even 128-bits is HUGE, more than a super-computer could likely brute force in any reasonable amount of time.)

    So if someone simply sends you some encrypted data using a decent encryption algorithm (AES has become the de-facto standard, and is likely what Blizzard chose), but doesn't send you the key, you won't be able to decrypt it until you get the key (on release day).

    The reason this won't work with bank files is that, in order for your computer to encrypt/decrypt the bank file, the key needs to be on the computer. And if the key is on the computer, it is completely possible for some hacker to find it and use it for himself.


    What would be possible would be for Blizzard to actually sign the bank-files, so that anyone can verify the signature but no one can forge it. However, I very much doubt they do this, because:

    • Blizzard couldn't just accept bank files and sign them - then anyone could get any bank files signed. The only secure way would be to run the games on their servers, and just send the valid bank file when the client requests it. I don't know if the games are currently run on Blizzard's servers, but I am pretty certain they are not (that is, one player is chosen to act as the server when the game starts).
    • Signing is a pretty expensive operation, and would be a burden on their servers.
    • This would mean that no one could test or play custom maps offline.

    Likely what they actually do is just take a bunch of data (bank file, map-name, user-name, publisher-name, etc.) and hash it. Then later, to verify, they take all that same data and hash it again. If they match up, it's a valid signature; if not, it's not.


    Quote from OneTwoSC:

    I put a really confusing trigger in my prisoner rebellion map to save out your wins to losses as something like "SDHA*34Hada"... and the trigger itself was so poorly organized no one could read it if they opened the map haha.

    Actually, just before Blizzard added BankVerify(), I had set my Prisoner's Rebellion win/loss ratio to 1337/0. It only took about an hour :)

    Posted in: General Chat
  • 0

    posted a message on Using teams in lobby instead of order players joined

    Is there a way to do this? I searched around, but the only solution I could find was "Add allies of player 1 to one team, enemies of player 1 to another."

    However, doing this completely screws up any preset units (team 1's units at top, team 2's units at bottom), or get the bases to start in the right place. I can't seem to figure out a way to get them to spawn programatically, since I want one ally's units in the top-left and one ally's in the top-right; is there a way to specify "first ally" and "second ally"? (and similarly for enemies?)

    Less importantly, is there a way to tell which TEAM player 1 was on in the lobby?

    Posted in: Miscellaneous Development
  • 0

    posted a message on Obtaining Unit Properties

    There are a lot of properties available for units; for movement alone, there's deceleration, inner-radius, speed, turning rate, etc. Is there a way to set these dynamically using triggers (I seen unit speed under "Set Unit Property," but none of the others).

    Also, is there a way to get these properties in a trigger? Though I can set the speed, I can't figure out how to obtain it.

    Thanks!

    (I should mention that this is for automatic income for building certain units/structures, like income wars or colonial line wars. I was going to use some property of the units - anything, really - to signify how much income they should give. If there is a better way to do this, other than creating a separate trigger for every unit, please let me know!)

    Posted in: Miscellaneous Development
  • 0

    posted a message on Unsolved problems in map creation

    13. Set the collision flags or footprints of a unit or doodad programmatically

    Posted in: Miscellaneous Development
  • To post a comment, please or register a new account.