News:

Welcome to the new Sinister Design forums!

Main Menu

Telepath Tactics - opinions

Started by Ertxiem, May 29, 2011, 05:57:02 PM

Previous topic - Next topic

JeenLeen

I reckon you're aware of it, but I've noticed a couple things about how enemy AI interacts with item.

It still seems that, if an enemy gets to an item bag, grabs it, and uses an item, they then stop moving even if it makes sense to keep moving.
If an enemy can attack one of its enemies, it will not grab a bag (unless it is stepping on it when in position to strike its foe)*.  I've seen enemy units walk over item bags without picking them up to get to and attack a foe.
*I think I saw one pick up a bag right before attacking, but I'm not 100% sure.

Also, I saw a unit attack my Spiked Barricade when it could have attacked my Swordsman.  And sometimes I think I've seen psi-casters walk up to units that can counter-attack and use Mind Blast when they could have used their ranged attack (though I'm not 100% sure as did not double-check their Energy.)  It seems they took the counter-attack damage for no reason.

On an unrelated note, I like that the AI is now taking facing into consideration.  That part looks nice and solid.
I also noticed, or think this is what I saw, that the an AI-controlled unit will not attack someone whose counter-attack will kill it.  That's a nice touch.

CraigStern

Quote from: JeenLeen on November 07, 2013, 10:14:36 AMsometimes I think I've seen psi-casters walk up to units that can counter-attack and use Mind Blast when they could have used their ranged attack (though I'm not 100% sure as did not double-check their Energy.)  It seems they took the counter-attack damage for no reason.

The AI does, in fact, take the Energy cost of the attack into consideration; it also weighs the cost against its remaining Energy. If the ranged attack would have taken most of its Energy, that might be why it prioritized it below the lower-cost attack. It's hard for me to say for certain, though, without being able to see exactly what situation the AI was in when it made that decision.

Quote from: JeenLeen on November 07, 2013, 10:14:36 AMOn an unrelated note, I like that the AI is now taking facing into consideration.  That part looks nice and solid.
I also noticed, or think this is what I saw, that the an AI-controlled unit will not attack someone whose counter-attack will kill it.  That's a nice touch.

Thanks! The AI does, in fact, avoid launching attacks that will result in it dying from a counterattack. :)

SmartyPants

I'm writing a campaign, and I have wondering if it possible to have a leveled teammate join the enemy.

bugfartboy

I don't see why it would be difficult... I haven't tried it, but I think you can just add the character you want to the map under a different team number. (i.e. Bill the Engineer is team code 0 for the player, team code 1 for the enemy)

JeenLeen

Quote from: SmartyPants on November 22, 2013, 06:02:12 PM
I'm writing a campaign, and I have wondering if it possible to have a leveled teammate join the enemy.

If it's not just as easy as changing the team code, I think you could create a variable, set it to the leveled character's level, and then create a 'new' unit on the enemy team for that battle with the same name/class and set its level equal to that variable.  Mechanically, it should turn out the same... except for equipment, I guess.
I asked and received answers to some questions about leveling in this thread, which touches on such code in the last couple posts: http://sinisterdesign.net/forum/index.php?topic=1244.0.

Changing the team code would be a lot easier, though.  After thinking about it, I'm a little embarrassed to give this alternative route, but, well, could be helpful so I'll still post it  :P
Would the items that unit is carrying carry over to the enemy team?

CraigStern

I haven't tested this, but I think that if you use the character's name and just designate it team 1 instead of team 0, the game should still find its stats and equipment in saved game data and spawn the character as it was when it was last under the player's control.

You should test this out and make sure that I'm right, though. :)

JeenLeen

With the current scripts, is there an easy way to have an event that would create a teleportation square?  For example, when someone steps on a certain tile, the game automatically teleports them to another tile on the map.

Would it be possible to have a random teleportation effect?  Like the above, but the game randomly sends you to, for example, 1 of 4 different locations when you step on the tile?
I suppose if truly randomized (or as random as a random number generator in a program gets) is not an option, you could write something based on a created variable that goes up by 1 after each teleport, creating a pattern instead of a randomized 'port, though it might look the same the first time a player goes through that stage.  Like, when PortNum = 1, send to X and PortNum = PortNum +1, when 2 to Y and PortNum = PortNum +1, 3 to Z and PortNum = 1 (to reset the pattern).

bugfartboy

This is a very interesting proposition. I'll answer each question separately, then try to explain how they work together.

First off: the actual teleportation mechanic. This is merely based on my general knowledge of the game. I haven't looked into too much detail on it.

The teleportation script would work in this fashion:
     1~ Save the 'teleporting' unit's health and energy to variables, likely named teleportHealth and teleportEnergy.
     2~ Remove the 'teleporting' unit from the 'teleporter' tile
     3~ Spawn the 'teleporting' unit on the 'destination' tile. (This would be the tricky bit. I can't think
          of any way to have the game automatically detect which character was on the space without writing a unique
          script and dialog trigger for each unique unit. It's possible, but would be highly time consuming. Hey! No one
          ever said programming was the least time consuming thing on earth!)
     4~ Set the Health and Energy of the 'teleported' unit equal to the corresponding variables you set in step 1.

There you go! That would be the general process a teleportation mechanic would likely follow.

Now let's move on to the proposed random teleportation mechanic.
Seeing as there isn't currently a random number generator built into the game, I've been working on a random number generator that works by forcing a specially created character to level up, and determine the random number by detecting which stats were altered.
       (Ex. Increase in cold resistance = +1 to the total value, increase in heat resistance = +2 to the total value,
       increase in light resistance = +3 to the total value, etc.)
Using this method would require inserting a couple steps into the above process.

   2.1~ Spawn the randomizer unit.
   2.2~ Using the proper dialog action, force the randomizer unit to level up, causing the OnLevelUp stats that you assigned to be changed.
   2.3~ Set a variable randomTotal to 0. This isn't necessary for the first use, but necessary if you plan on allowing more than one unit to ever
           teleport.
   2.4~ Using a long series of if/then statements, determine which of the stats are greater than they used to be, then increase the
           variable randomTotal based on the method I explained in the paragraph above.
   2.5~ Reset the randomizer unit's stats to where they were before forcing the levelup. (This allows you to avoid the having to continually
            keep track of the randomizer's stats for future use. It's easier if they're consistent.)
   2.5~ Using randomTotal , determine which 'destination' tile the unit will be spawned on.

In theory, this process should work. Unfortunately I've been unable to get the random number generator I designed working correctly, so this part is all theoretical. The downside to implementing a random number generator means you'd need to use more than just scripts. You would need full blown dialog to implement the if/then statements, and you'd need a ton of dialog if you want more than one type of unit to be able to teleport.

I hope this answers your questions.

CraigStern

#398
Quote from: bugfartboy on December 06, 2013, 12:16:25 AMSeeing as there isn't currently a random number generator built into the game

Huh! I thought I'd made -R- work on things other than chests, but maybe I didn't. I'll see if I can get that changed by this evening. ;)

Okay! After a bit of digging, the game does in fact let you randomly generate numbers. You just use r as the operator type in SetVal, and it will generate a number between 1 and the amount you name. It seems I somehow neglected to include this in the list of operators in the manual, but it works.

bugfartboy

I think I remember reading something about that in the DevLog, but I wasn't sure if it was real or if my mind just made it up.

bugfartboy

I noticed that in the manual the "Capture Char" condition is still described as "DESCRIPTION TO COME."

CraigStern

Ah, indeed. That is because I haven't coded it yet. :)

bugfartboy

On another note, I think it's interesting how the AI will let a unit be cornered and do nothing when triggering a counterattack would end in its death. I think in some ways it seems a realistic.

JeenLeen

Quote from: bugfartboy on December 17, 2013, 11:02:48 PM
On another note, I think it's interesting how the AI will let a unit be cornered and do nothing when triggering a counterattack would end in its death. I think in some ways it seems a realistic.

That is interesting.  When I first saw it, I thought it seemed like a flaw in design, since from a tactical standpoint the character is probably best to attack, dealing some damage before dying.  But from a personal perspective as opposed to an army-perspective, it is rather realistic.  A soldier (depending on training, morale, loyalty, etc.) might act in a way to survive longer even if it makes no tactical sense.

bugfartboy

It makes even more sense if the units cornering it have enough health that the cornered unit can't kill them.