News:

Welcome to the new Sinister Design forums!

Main Menu

Enemy Speeds

Started by bugfartboy, August 29, 2010, 04:41:18 PM

Previous topic - Next topic

bugfartboy

I know that this applies to the other games as well but why is it that enemies are slower in battle than your team? They're human too right?

Duskling

Enemies that have a speed of over three are too hard to program, or so I' am led to believe.

MikeW781

Also, its stops you from being swarmed. Storyline-wise tts done for the same reason as making Griffin stronger than the average swordsman- your team is the best there is.
Currently tied with Zack for the title of Master of Light!

Purplemandown

I've done a little programming myself, so perhaps I can explain this better (Although I never got anything productive...)

If the enemy has a movement of 1 Space, then the code must check for the availability of the 4 adjacent squares.
Plus, assuming the enemies attack is Melee (or thereabout), that adds 8 more squares to check for enemies, to run the ai.  It adds up to 4 for move, plus 8+4 for enemies to attack, requiring a check of 16 suares.

If the enemy has a movement of 2 Spaces, then the code must check for the availability of the 4 adjacent squares, plus the 8 squares adjacent to them.
Plus, assuming the enemies attack is Melee (or thereabout), that adds 12 more squares to check for enemies, to run the ai.  It adds up to 8+4 for move, plus 12+8+4 for enemies to attack, requiring a check of 36 suares.

If the enemy has a movement of 3 Spaces, then the code must check for the availability of the 4 adjacent squares, plus the 8 squares adjacent to them AND the 12 adjacent to those.
Plus, assuming the enemies attack is Melee (or thereabout), that adds 16 more squares to check for enemies, to run the ai.  It adds up to 12+8+4 for move, plus 16+12+8+4 for enemies to attack, requiring a check of 64 suares.

As you can see, this adds up fairly quickly.  4 Square would require 100 squares, and 5 would require 144.

Oh, and don't even think about bringing up the fact that I'm new.  I've been stalking you for some time! :-*

bugfartboy

Thankee for your contribution!!! I am not a programmer, so the how and why was lost on me. Thank you!!! And check your inbox. I decided to play KZ. Kinda.

Tastidian

Quote from: Purplemandown on August 29, 2010, 10:54:40 PM
I've done a little programming myself, so perhaps I can explain this better (Although I never got anything productive...)

If the enemy has a movement of 1 Space, then the code must check for the availability of the 4 adjacent squares.
Plus, assuming the enemies attack is Melee (or thereabout), that adds 8 more squares to check for enemies, to run the ai.  It adds up to 4 for move, plus 8+4 for enemies to attack, requiring a check of 16 suares.

If the enemy has a movement of 2 Spaces, then the code must check for the availability of the 4 adjacent squares, plus the 8 squares adjacent to them.
Plus, assuming the enemies attack is Melee (or thereabout), that adds 12 more squares to check for enemies, to run the ai.  It adds up to 8+4 for move, plus 12+8+4 for enemies to attack, requiring a check of 36 suares.

If the enemy has a movement of 3 Spaces, then the code must check for the availability of the 4 adjacent squares, plus the 8 squares adjacent to them AND the 12 adjacent to those.
Plus, assuming the enemies attack is Melee (or thereabout), that adds 16 more squares to check for enemies, to run the ai.  It adds up to 12+8+4 for move, plus 16+12+8+4 for enemies to attack, requiring a check of 64 suares.

As you can see, this adds up fairly quickly.  4 Square would require 100 squares, and 5 would require 144.

Oh, and don't even think about bringing up the fact that I'm new.  I've been stalking you for some time! :-*
I believe if the ai checks for that many squares it wouldn't work because there aren't that many squares. Also to Duskling is your signature just black over white pics of your avatar?

ArtDrake

Okay, back that up uno momento. Yes, the code and the programmer have to check all those squares, but speed 3 enemies only move 2 when there's no target in range. And even though 144 squares/possibilities is a lot, a simple for loop takes care of it all; multiple fors might have to be embedded.

Duskling

Quote from: PinkPanzer on September 03, 2010, 10:45:31 PM
Also to Duskling is your signature just black over white pics of your avatar?
PM me what you mean, as I don't know what you are talking about, nor do I want this conversation to get off-topic.

Ertxiem

I think that all squares can be checked with 3 for loops:
1. horizontal movement;
2. vertical movement;
3. facing (north, east, south, west).

The maximum number of checks that will be required will be: 8n(n+1), with n being the number of squares that the enemy can move. More details in the thread Use mouse to walk. The number here is 4 times larger than the numbers in there because the AI will also have to check 4 directions.

Although it will be needed a path finding algorithm to be applied and the for loops mentioned above are applied on top of it (sort of... I'm trying to not overcomplicate the description).

The problem, the way I see it, is the following: time. How much time does the code needs to check each square when doing things this way, when compared to the current method. This is particularly relevant to the faster enemies that may be more affected by it. And I have no idea if the difference in time is small or large.
Ert, the Dead Cow.
With 2 small Mandelbrot sets as the spots.

CraigStern

Well, here's the thing: it's actually not too difficult for me to program. Not anymore. But I'd probably have to recode the entire combat engine to accommodate it because of the inefficient way that enemies check for targets in the TSoG engine.

There are also gameplay considerations: TSoG battle maps are small. In-game battles would be poorly paced and extremely difficult if most enemies could cross the entire map in a couple of turns.

Although this feature won't be making it in to TSoG, you can probably expect it in future TRPGs running on a better engine. ;)