The Geek | Message |
Sparticuslvl 19Visit the App Stores to download the game! | Site Admin
Posts: 1023 Joined: 8/27/2010 |
|
Posted: 9/14/2010 9:24:39 AM | |
|
I've been working hard over the past few days working on the latest feature to BTGTD. I "hopefully" now have proper tower targeting working.
What is tower targeting?
Towers are constantly scanning around them looking for creeps to shoot. When many creeps are around the tower it has to decide which creep to start shooting.
How has it used to work :
Read this thread on how tower targeting used to work. Basically it scanned around itself and the first enemy it found it started shooting. This works just fine until you have a green goblin (backwards creep) sneaking by your starting towers and none of the towers are focusing him.
How it works now :
The tower will now attack the creeps that are closest to the exit. It doesn't matter if you have 100 creeps stacked on top of each other and those green goblins try and sneak by, all towers will focus the green goblins. The same goes for all creeps. If you have creeps passing the tower on either side, it will attack the creeps on the side that is closer to the exit.
Please note: I have only tested this on my PC (which is a quad core with 8 gigs of ram). It seems to run just fine on it, but I'm curious (to those of you with slower computers) does it still run good for you? Or is it laggy now? It should be good, but I just want to make sure. The algorithm to do all this is quite complicated.
I will be posting later today exactly (at a lower level) how this works for those of you that were interested.
I also "think" I fixed the issue where peoples scores were not saving sometimes. The game over screen should not show "NaN" anymore and then swap in your score.
Please let me know asap if you see anything not working.
Thanks!
P.S. This is version 1.3, however I forgot to chnage the version number in the game. Not a big deal but thought I'd mention it :) |
|
Sparticuslvl 19Visit the App Stores to download the game! | Site Admin
Posts: 1023 Joined: 8/27/2010 |
|
Posted: 9/14/2010 10:01:39 AM | |
|
Also note that once a tower has selected a creep to shoot, it will not find a new target until the current target is dead or goes outside if it's range. |
|
| Geek
Posts: 169 Joined: 8/29/2010 |
|
Posted: 9/14/2010 10:31:55 AM | |
|
w00t!
Nice work!
think i noticed the new targeting system in some games i played earlier today. Thought i'd already lost and magically they targetted the swarm near the exit instead of the greens just getting out of the exit :)
Really great, looking forward to reading the low level explanation :D |
|
| Member
Posts: 22 Joined: 8/29/2010 |
|
Posted: 9/14/2010 12:58:35 PM | |
|
My work laptop is a pretty mediocre Dell Latitude D620 w/ a Core 2 CPU clocked at 1.83 GHz and 1 GB of RAM. I have no lag or problems with the new build. |
|
Sparticuslvl 19Visit the App Stores to download the game! | Site Admin
Posts: 1023 Joined: 8/27/2010 |
|
Posted: 9/14/2010 1:10:57 PM | |
|
Great to hear! :) |
|
| Member
Posts: 22 Joined: 8/29/2010 |
|
Posted: 9/14/2010 1:19:31 PM | |
|
I think I meant to post that in the thread on the new targeting system where you voiced concerns about the possible processor load... |
|
| Geek
Posts: 133 Joined: 9/1/2010 |
|
Posted: 9/14/2010 1:24:27 PM | |
|
I will do my stress test map now :-)
Did you change the volcano ? It doesn't seem to target oldest creep now?
|
|
Sparticuslvl 19Visit the App Stores to download the game! | Site Admin
Posts: 1023 Joined: 8/27/2010 |
|
Posted: 9/14/2010 1:26:10 PM (Edited: 9/14/2010 1:26:56 PM) | |
|
The volcano tower has not changed.... yet. After I see how this latest release goes I'll make the volcano tower also target the creeps that have ben on the screen the longest. |
|
| Geek
Posts: 133 Joined: 9/1/2010 |
|
Posted: 9/14/2010 1:41:32 PM | |
|
Not to shabby - 590K creeps and targeting is working :)
http://i554.photobucket.com/albums/jj417/alchemist_bucket1/Screenshot2010-09-14at203855.png
|
|
Sparticuslvl 19Visit the App Stores to download the game! | Site Admin
Posts: 1023 Joined: 8/27/2010 |
|
Posted: 9/14/2010 1:43:20 PM | |
|
Holy crap LOL! |
|
| Nerd
Posts: 29 Joined: 8/31/2010 |
|
Posted: 9/15/2010 12:56:12 PM | |
|
It seems to be working fine, though I believe the design might have a flaw. It targets the closest creep to the exit first, but I was playing a map where i would have the creeps go around a tower a move farther from the exit. The tower would then target a creep father from the exit(though closer in a straight line). |
|
Sparticuslvl 19Visit the App Stores to download the game! | Site Admin
Posts: 1023 Joined: 8/27/2010 |
|
Posted: 9/15/2010 1:38:52 PM | |
|
I'd have to see the replay to know exactly what you're talking about. The logic for the tower targeting should be perfect |
|
| Nerd
Posts: 29 Joined: 8/31/2010 |
|
Posted: 9/16/2010 3:09:54 PM | |
|
my replay should be accessible through here http://www.beatthegeek.com/games/TowerDefence/tournamentResults.asp?tournid=364
watch the flamers around 3:10 to see what i mean.
Currently raked 47th, if that helps. |
|
Sparticuslvl 19Visit the App Stores to download the game! | Site Admin
Posts: 1023 Joined: 8/27/2010 |
|
Posted: 9/16/2010 3:20:32 PM | |
|
Hmm, I must have watched that replay 20 times.... you might be correct. It seemed it might have an issue caused after selling a tower. After you sold a tower it seemed (sometimes) to target the wrong creep. After you placed a tower, it corrected itself and attack the correct creep.
I'll have a look at the code right now. |
|
| |