The Sinister Design Forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

Welcome to the new Sinister Design forums!

Author Topic: Enemy Speeds  (Read 1619 times)

bugfartboy

  • White Cape
  • ***
  • Offline Offline
  • Posts: 1729
    • View Profile
Enemy Speeds
« on: August 29, 2010, 02:41:18 PM »

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?
Logged
I'm honestly not that interesting.  I'm interestingly also not that honest.

Duskling

  • Black Cape
  • ***
  • Offline Offline
  • Posts: 847
    • View Profile
Re: Enemy Speeds
« Reply #1 on: August 29, 2010, 04:08:57 PM »

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

MikeW781

  • Black Cape
  • ***
  • Offline Offline
  • Posts: 651
    • View Profile
Re: Enemy Speeds
« Reply #2 on: August 29, 2010, 05:03:29 PM »

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.
Logged
Currently tied with Zack for the title of Master of Light!

Purplemandown

  • Bandit
  • *
  • Offline Offline
  • Posts: 7
    • View Profile
Re: Enemy Speeds
« Reply #3 on: August 29, 2010, 08: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! :-*
Logged

bugfartboy

  • White Cape
  • ***
  • Offline Offline
  • Posts: 1729
    • View Profile
Re: Enemy Speeds
« Reply #4 on: August 29, 2010, 08:56:56 PM »

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.
Logged
I'm honestly not that interesting.  I'm interestingly also not that honest.

Tastidian

  • Guest
Re: Enemy Speeds
« Reply #5 on: September 03, 2010, 08:45:31 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?
Logged

ArtDrake

  • Black Cape
  • ***
  • Offline Offline
  • Posts: 732
    • View Profile
Re: Enemy Speeds
« Reply #6 on: September 03, 2010, 09:15:15 PM »

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.
Logged

Duskling

  • Black Cape
  • ***
  • Offline Offline
  • Posts: 847
    • View Profile
Re: Enemy Speeds
« Reply #7 on: September 04, 2010, 02:02:40 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.
Logged

Ertxiem

  • Global Moderator
  • Black Cape
  • *****
  • Offline Offline
  • Posts: 621
    • View Profile
Re: Enemy Speeds
« Reply #8 on: September 04, 2010, 02:07:56 PM »

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.
Logged
Ert, the Dead Cow.
With 2 small Mandelbrot sets as the spots.

CraigStern

  • The Creator
  • Administrator
  • Tactician
  • *****
  • Offline Offline
  • Posts: 2787
    • View Profile
    • Sinister Design
Re: Enemy Speeds
« Reply #9 on: September 09, 2010, 08:45:11 AM »

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. ;)
Logged