|
|
|
|
| JASS Resources Find JASS code snippets and functions here or write your own and post it on the Submissions sub-forum. |
 |
|
02-06-2012, 09:25 AM
|
#31 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
True true.
Or at least to remember when a position was not pathable (in a hashtable)? Until a building gets destroyed... yeah maybe there are too many factors here.
The lag is not TOO bad, considering someone could build a system where someone trying to exploit it (multiple failed attempts just to cause trouble) would get kicked from the game.
Thinking about approving this, once I investigate the API and the requirements a bit more.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
02-06-2012, 09:32 AM
|
#32 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,906
|
The spikes only occur when the algorithm runs ^)^. If you are using IsPathPossiblyBlocked, then that won't be too often ;D.
|
|
|
02-06-2012, 09:51 AM
|
#33 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
Yeah I was getting 0 lag for all the regular towers I placed, I can see that picking up on a really high level for a pro-TD.
You want to go in with me and make one? Probably 4 players max, cause 8 player games take forever to get filled.
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
02-06-2012, 09:56 AM
|
#34 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,906
|
Quote:
Originally Posted by Bribe
Yeah I was getting 0 lag for all the regular towers I placed, I can see that picking up on a really high level for a pro-TD.
You want to go in with me and make one? Probably 4 players max, cause 8 player games take forever to get filled.
|
I prefer tws.
Anyways, this script is pretty much as good as it's going to be. It's a very simple API (2 functions) ; ).
|
|
|
02-06-2012, 02:13 PM
|
#35 (permalink)
|
|
JESUS MAN
Resource Moderator
Join Date: Dec 2008
Posts: 5,696
|
Sweet ^.^
The only thing I don't like is the second function :o
It's not about the functionality, it's about the name :/ (But that's just me)
Off-topic: Tower wars are way funner than Tower Defenses =D
|
|
|
02-06-2012, 10:48 PM
|
#36 (permalink)
|
|
Shadowsong
Join Date: Oct 2008
Posts: 210
|
Quote:
Originally Posted by Magtheridon96
Off-topic: Tower wars are way funner than Tower Defenses =D
|
This.
|
|
|
02-07-2012, 11:00 AM
|
#37 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,906
|
Update:
Improved API
Speed Increase From Improved Algorithm
Couple of bug fixes
Now, I am starting to see a way to improve the algorithm to such an extent as to 100% remove the freeze during even worst case scenarios, but I am still working on it ; P. For now, here is an algorithm that will only freeze for big blocks.
Remember how the old one ran when you'd build towers in such a way as to have a potential block? Try building 3 vertically (2 and then 1 in the middle) to make the algorithm run (just anywhere). You will see that there will be no freeze! Yes, the algorithm did in fact run. Why is there no freeze? Because of the algorithm's improvement ; P.
Now, if I am able to somehow make it so that the algorithm does not trace absolutely everything when there is a block, I'll be gold.
edit
325 op limit -> 824 op limit thus far, meaning more than 2x faster. I am trying to make it not run across empty space. If I can manage that, I can get another major speed boost (from 1724 iterations to 1160 iterations).
edit
Working on a major algorithm improvement. Should be around 4x-6x faster. After that, I'll rewrite the algorithm to a new one, which'll be around 100x faster ;D.
Last edited by Nestharus; 02-09-2012 at 11:16 PM.
|
|
|
02-10-2012, 05:54 AM
|
#38 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,906
|
Updated, freeze is now 100% removed ; ). It does significantly increase loading time of map based on map size (128x128, etc) as well as increase RAM usage, but it is very fast now : D.
0 Freeze Woo! Thing is ready to be approved ;D.
I was going to rewrite the algorithm to be something a bit better, but there are pros and cons to that possibly* better algorithm, so it might as well just stay as is.
|
|
|
02-10-2012, 05:58 AM
|
#39 (permalink)
|
|
JESUS MAN
Resource Moderator
Join Date: Dec 2008
Posts: 5,696
|
Nes, feel free to post these results:
With:
- 3.06Ghz
- 2 cores
- 4GB of RAM
It took:
152 seconds with 160x160
59 seconds with 128x128
18 seconds with 96x96
^.^
|
|
|
02-10-2012, 06:46 AM
|
#40 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,906
|
Oh yes, for this... don't allow users to build in corners of your arena. Make the terrain unbuildable or something, otherwise the users will be able to make a huge brick ;o. If you have no corners, then you are fine (like ltw lanes), but if you do, block them off. For example, wmw maps contain 8 corners.
edit
actually, this could be problematic for checkpoints too (rects where creeps have to touch). Just make 1 tile in the rect unbuildable and all is good ; ).
edit
corners don't bug system
Last edited by Nestharus; 02-10-2012 at 05:51 PM.
|
|
|
02-10-2012, 03:06 PM
|
#41 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
I am no rocket scientist, are you trying to kill me with this?
First, what's with the bugs? That doesn't even make sense that those corners would block the map from functioning properly.
Second, great work on reducing the in-game lag. Totally worth it because the in-game result will be free of lag.
Third, why doesn't IsPathBlocked take any additional arguments any more? What unit is supposed to be passed as a parameter there?
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
02-10-2012, 03:20 PM
|
#42 (permalink)
|
|
Beware the Ides of March
Join Date: Jun 2011
Posts: 248
|
Bribe read the documentation.
In a TD all you have to do is
IsPathBlocked(tower)
It checks if that "new" tower the user just built is blocking the way
And I agree, the fact that corners bug the system is unacceptable
__________________
Check out my TD
Originally Posted by GetTriggerUnit-
" There should be a section in World Editor designated to Nestharus."
|
|
|
02-10-2012, 05:50 PM
|
#43 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,906
|
Quote:
|
And I agree, the fact that corners bug the system is unacceptable
|
actually if you read first post, corners don't bug system, you can just blanket rects that creeps have to touch with towers ;)
|
|
|
02-10-2012, 05:57 PM
|
#44 (permalink)
|
|
Keep it simple
Spells, Help Zones & JASS Moderator
Join Date: Sep 2009
Posts: 5,581
|
So what exaclty is wrong with building a huge brick, if it doesn't corrupt the pathing algorithm everything is still fine, right?
__________________
How to post your triggers on the Hive Workshop.
JPAG - Bettering the cause of readable source code.
|
|
|
02-10-2012, 06:02 PM
|
#45 (permalink)
|
|
User
Join Date: Jul 2007
Posts: 4,906
|
Quote:
|
So what exaclty is wrong with building a huge brick, if it doesn't corrupt the pathing algorithm everything is still fine, right?
|
you can't build a huge brick from wall to wall... i was just thinking of blanketing rects specifically in my own wmw map, which would be a huge brick except for touching the opposite wall :\, so I was being silly in my super tired stupor of corners last night, lol. The instant you try to touch the other wall (an actual block), it'll detect it.
To prevent users from blanketing the rect, just make one of the tiles unbuildable (only 1 is needed). In my case, I would make the corners unbuildable since people never build at those anyways. Not sure what to do about the back checkpoints tho ;o.
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 09:20 PM.
|