BTG FORUMSPage :12
Forums -> Suggestions & Feedback -> Targeting priority
The GeekMessage
PhaElvl 34
.
Geek


Posts: 169
Joined: 8/29/2010
Posted: 9/8/2010 5:50:22 AM

I noticed that most of the time the towers do not target the creep closest to the exit, which is pretty annoying when you got a wave of rockets going through a just-spawned wave of green hornets :) Manual targeting is kinda not done then.
Same as in the early waves when most of the time the bunched up creeps (forgot their name, wave 3) leak a bit, and you have to manually target em which is hard to do when you cannot really see which one has lowest health.

Is this by design (least health/random targeting), or should they target closest to exit?
Sparticuslvl 19
Visit the App Stores to download the game!
Site Admin


Posts: 1023
Joined: 8/27/2010
Posted: 9/8/2010 8:42:41 AM

Believe it or not, calculating which creep is closest to the exit isn't a super fast calculation. I need to loop through every creep on the screen, find it's shortest path to the exit, and compare it to all other creeps. There might be 50+ creeps on the screen.

Sure, computers are fast, it probably could do that in 1/100th of a second.

But wait... just finding out which enemy is the closest to the exit doesn't help me. What if there is a tower in the middle of your map.... the enemy closest to the exit is no where near him, he needs to decide which creep is closest to the exit between the 10 enemyies around him. So now I need to do that calculation for those 10 creeps and find out which is the closest between them.

But wait there's more.... I need to do this for every single tower on the screen.... you might have 50 towers on the screen..... ouch...

But wait there's more.... the game runs at 30 frames per second... so it needs to do everything above 30 times every single second...

Crazy!

So, to answer your question, I could write the logic to make every tower attack the creep closest to the exit, but it might slow the game down a bit.

There are other TD's out there that do this... but they are generally more simple and have a fixed path the creeps can walk on.

This is why I made the ability for you to click on a creep and all towers within range will attack it.




Ok, This is how the towers currently work. It's quite a bit more simple (and 100 times faster). Knowing how it works might help you when placing your towers.

Towers will scan around itself looking for a creep to attack. Below is the pattern it scans :



So, it looks for creeps in the "1" area, if it finds nothing it looks in "2", then "3", etc until it finds a creep. It will continue shooting that creep until it does or leaves it's range. After that happens it then follows the same pattern looking for a creep.

I hope that makes sense.
Johnlvl 6
I missed y'all.
Nerd


Posts: 45
Joined: 8/29/2010
Posted: 9/8/2010 9:23:04 AM

Okay, then how about this: Instead of having that 1 be static, have the tower pick the 1 as the closest square it covers to the nearest entrance point. It will stay fixed, since you can't build entrance points in-game, but on maps where the normal creeps move from right to left, you're getting a small delay. It might seem very very small, but it does add up after a while.
PhaElvl 34
.
Geek


Posts: 169
Joined: 8/29/2010
Posted: 9/8/2010 10:40:38 AM

Thanks for the excellent reply :)
Sparticuslvl 19
Visit the App Stores to download the game!
Site Admin


Posts: 1023
Joined: 8/27/2010
Posted: 9/8/2010 11:21:41 AM

The method John pointed out would be a decent solution. It wouldn't solve the issue that PhaE brought up however (the rocket example).
PhaElvl 34
.
Geek


Posts: 169
Joined: 8/29/2010
Posted: 9/8/2010 12:16:00 PM

Well it's just part of the game-mechanics then, lost a LOT of games cause of rockets getting through because a green goblin wave was in the way :)
Think I just have to become better at the game :P

btw, really love this TD. Most TD's i figure out in no-time (like maze-building, towers to use, etc.), but this one keeps you on your toes, especially because every map can be different when it comes to health, speed, sell-time, rewards, etcetera.
Good work! :D
Sparticuslvl 19
Visit the App Stores to download the game!
Site Admin


Posts: 1023
Joined: 8/27/2010
Posted: 9/8/2010 12:26:19 PM

Thanks :)

The neat thing is that when people start using the tournament editor to it's fullest we'll see some very cool tournaments.

Most people just select a difficulty level for the creeps and then select 60 or so levels and leave it at that. All the hard-coded levels have the exact same creeps in the exact same order.

If you want, you could make tournaments where :

- There are 200 levels, each level has 1 boss creep that spawns that gets harder and harder to take down. How many bosses can you beat?

- Mix up the order of the creeps. Many people have special strategies with the current creep set up. This will mess them up.

- Have a map where there are no time between levels. There will be a constrant stream of creeps. It's hard to build your maze when there are always creeps on the screen.

- You can have any number of starts and exits in your map. The map ideas are endless.

In all honesty, I am not that creative. I've seen some neat maps already and am looking forward to incorporating many of them :)
alchemistlvl 42
Want - to - play - a - game ?
Geek


Posts: 133
Joined: 9/1/2010
Posted: 9/8/2010 12:33:30 PM

Am I right that the volcano does target creeps closest to the exit?
PhaElvl 34
.
Geek


Posts: 169
Joined: 8/29/2010
Posted: 9/8/2010 1:21:16 PM

OI!
Don't spoil my next tournament, Boss Bonanza! :-)
Sparticuslvl 19
Visit the App Stores to download the game!
Site Admin


Posts: 1023
Joined: 8/27/2010
Posted: 9/8/2010 1:52:04 PM

The volcano tower focuses the creep(s) that have been on the screen the longest.... which (due to the rocket and yellow arrow creeps) is not always the creeps closest to the exit.
202Nowlvl 72
Nerd


Posts: 26
Joined: 9/3/2010
Posted: 9/8/2010 4:53:40 PM

Can someone verify this?

If you select a creep, all towers within range fire on that creep.

This seems to be the case in my experience. Great for boss creeps, as it makes distant canons fire on the selected creep instead of nearby ones. Also great for making sure creeps with the lowest life get kill priority. Of course, selecting creeps are almost impossible when they overlap.

But again, I'm not sure if selecting creeps make them a priority target.
carlninilvl 27
is sleepy :'(
Geek


Posts: 154
Joined: 8/29/2010
Posted: 9/8/2010 4:58:15 PM

yes , we are always talking about it, and if you have a question, go see in the faq first:)
StereoPaniclvl 21
Big Money! Big Prizes! I love it!
Member


Posts: 22
Joined: 8/29/2010
Posted: 9/8/2010 6:50:50 PM

Just thinking out loud here. A creep has to determine his route to the exit on a recurring basis. As part of that routine the creep could also determine the distance (in pixels perhaps?) to the exit. That distance could be a hidden attribute of the creep. Or is route only recalculated whenever a tower is placed/removed?

A tower wouldn't have to make a targeting decision 30 times a second regardless of frame rate. At most it would have to do it as often as it fires a shot.

So anyhow I was just thinking about it. Feel free to disregard me. I may not know as much as I think I do.
Sparticuslvl 19
Visit the App Stores to download the game!
Site Admin


Posts: 1023
Joined: 8/27/2010
Posted: 9/8/2010 8:06:40 PM

Well, your not far off StereoPanic. Every creep on the screen calculates their shortest path whenever a tower is built or sold. There is no need to recalculate their path as nothing has changed otherwise.

I might revisit all your ideas when some of the larger items are off my plate. I'm sure it possible... I just need to find a solution that minimizes CPU use as much as possible.
Sparticuslvl 19
Visit the App Stores to download the game!
Site Admin


Posts: 1023
Joined: 8/27/2010
Posted: 9/8/2010 9:07:57 PM

Ok, I can add it to my to-do list to implement better targeting if you want...

Although you are aware that it will take away some of the strategy? Now you can (sort of) just place towers and watch creeps die. Part of the strategy is manually clicking the creeps you need dead.
 Page :12
Start Playing Now!
Returning Geeks Sign In
New Geeks Register
 
 
© 2010 - 2015, BeatTheGeek.com - Terms Of Service - Privacy Policy