Game Design, Programming and running a one-man games business…

Carving practical design from wooly ideas

As usual, my hand-wavy ideas make no sense when I start coding. This happens a lot. The current crisis is the idea that you can either play against adaptive AI, or a ‘recording’ made by you, or someone else.

So when you are placing turrets, either the AI is dynamically placing creeps to attack you, or it is just reading from a script like a normal TD game. The twist is that the script could be pre-recorded by me, or by another player (in the case of challenge maps) or even by you. Which means if you play an absolute blinder of a game in attack mode, you could then swivel round and play defense, against your own attack units and decisions, just like you can race against yourself in some racing games.

Problem is… I hadn’t considered that this only works for attacking units, not as defense. You can’t assume a slot is freed up as defense deployer, so it doesn’t work out. It’s dodgy enough as an attacker, given possible traffic jams…

Anyway, that isn’t a big deal. This is a cool ‘extra’ feature for A TD game. People will understand its only an option as defender. What’s a bit clunky is that it means coding some awkward sounding dialog at the start of a game to say

“Hey, you want to play against adaptive AI, or you want to play against the included, pre-scripted units?”

as well as

“Would you like the adaptive AI to use the included units, or to be able to use all your units too?”

I’m sure it will look ok. People like options right?


8 thoughts on Carving practical design from wooly ideas

  1. Yea, design meets reality in the train tunnel is humorously common. It’s part of the fun :)

    “You can’t assume a slot is freed up as defense deployer, so it doesn’t work out.”

    Why exactly is that? Can the attackers move across those spots, and towers can’t be placed if attackers are there? Or something else?

    I ask because it seems to me that perhaps a lateral solution is possible, but I don’t want to rattle off alternatives if I have no idea of what the actual current catching point is.

  2. what i mean is, say you place a gun turret at position X at timestamp 1. Then in timestamp 10, its blown up, so you place a laser turret at X at timestamp 11.

    During playback, you arent as aggressive at that spot as the original enemy, so the gun turret doesnt get blown up. Its still there at X and the laser cant be placed on top.

  3. Maybe you should have a helpfile as to what’s the benefits and drawbacks of those options?

  4. You could do something like, if it must add a turret where there is already one, it waits some time for the spot to be freed. If it doesn’t, it looks for an empty spot to place it, or wait until a spot get freed.
    The result game would be somewhat different, but still some essence would be kept. What do you think?

    I am curious, you play your play-back from the user inputs or do you record unit positions / actions every frame?

  5. Yeah. The system has to be somehow adaptive even when it is pre-recorded because situations evolve all the time.

    I’d say you should think the pre-recording as a guideline to the AI which it tries to follow but if situation demands it, it does its own moves and decissions based on the current situation even the pre-recorded guideline says otherwise.

  6. Ah, ok, the replace-tower-X case makes sense: tower X may simply not have been destroyed.

    That could be gotten around:
    1) Have towers leave remains that cannot be cleared out, or only allow rebuilding into the same kind of tower and just hold the rebuild until (if) it’s necessary.
    Or:
    2) Have the replay-script find a nearby point where the tower will fit. That could cause a cascade of such shifts which could really mess with things, but it’d be something.

    But that’s actually a pretty minor case compared to other problems. For instance: with multi-route maps an attacker facing a playback script would merely need to figure out which route is guarded the weakest, and slam it.

    So it would seem to require an actual player-editable script which would probably get nastily complex (both for programmer and user). And wouldn’t fit the “quick, play against what I just did” case anyway.

    Anyway, thanks for the explanation :)

  7. You could just have the tower in the playback replace the tower at the specified timestamp whether it is destroyed or not. It will make the new player have to pay attention at the very least.

  8. I think you could address the problem by looking at the effective damage dealt by the turrets over their lifespan, irrespective of the timing of their placement or absolute location on the battlefield placement spots.

    A more detailed explanation:
    Say there are 10 different battlefields in the game. The designer could manually place turrets on the 10 battlefields so to create the initial set up. Designed by a human, they should make sense and work well.
    The player starts a game on battlefield one, which includes two lanes, top and bottom. The lanes have different turrets in them, so the player sends units A into the two lanes. The top turret worked well against Unit A, while the bottom turret is ineffective versus Unit A. The effective damage and kill rate of the top turrets is higher than the bottom turret, so the game charts that different, recognizes the top turret is better. When the bottom turret is destroyed, the AI replaces it with the top turret.

    So in the defense situation, the adaptive AI could learn from the human player by charting the effective damage – kills/ life span of the turrets the human places. You might have to give the different units a cost associated with them, so the chart reflects the damage dealt by the turrets in terms of most expensive units. To make the chart system reflect the relative placement of the turrets you could consider the position of the turret from the front line (2nd or 3rd turrets back from the front could be a group separate from 1st line turrets) and the grouping of the nearest turrets. Take something like the average of the turrets effective damage in a group of 3, to come up with the best combination.

    So the question of what turret to replace at timestamp 10 would switch from, ” What was going on at timestamp 10 in the last game” to “What was the most effective turret when placed next to this Turret A in the last game?”

Comments are currently closed.