New Posts  All Forums:

Posts by Fantasy

hmm. I see
So today I was working on a function that finds the closest number from a target number in a list or array, and I started to wonder. Which number is closest to number 5? is it 4 or 6? I seriously don't know. [Added] ok so I have been thinking about it a bit. Code: Closest number = |5-4| = 1 Closest number = |5-6| = 1 So both are the same "distance" from 5. but which one would you pick first? is it 4? or 6?
@OP Honestly it depends on your needs. For example, on a normal day where I have few programs open I use 7GB. on a work day where I have all my programming software running and few other software I peek around 13GB. for me 16GB is prefect for now. 8GB is not enough for me at all. So look at your needs. do u need more RAM? getting more ram will not increase performance unless your using all 8GB.
Yah I know what you mean ^__^This is the 4th time I re-write this code and it won't be my last. Every time I re-write it I get a little bit more performance out of it. I will think about your approach and try to implement it.Thank you ^__^
Here how I solve this problem.1- I set the goal node (or point or cell ) that the enemy want to reach.2- I then try to find the shortest path using A* algorithm taking into account static collision objects like walls and rooms etc...3- I then check for collision while the enemy is walking to the goal node.4- If there was a collision between the enemy and a moving target like say the player or another enemy. I try to find a new path again from the enemy current position to...
I see. Thank you ^__^
Not bad at all. That is actually a better design.I have so much to learn about Threading. Thank you so much ^__^[Added]I'm looking at the code and I have never ever used ThreadPool before, so this question might sound stupid but don't you have to call ThreadPool.SetMaxThreads to limit the threads to 25? or does ThreadPool automatically limit to 25 threads?
?!I tried Googling it and all I found was this. Is that what your referring to?
Actually finding more than one path at the same time is much better, and at first I did want to take your approach. However I just Heard that creating one thread for each job is very taxing on the CPU. Can you confirm?Because imagine this scenario. Lets say you have a 1000 enemies and you want to find the path for all the 1000 enemies. creating a 1000 thread is such a bad design. Unlike having a queue and one thread that starts to find each enemy path.What do you...
That is not true at all, because my class is defined as a static class which means you can never create multiple instances of it. I designed it to be called once and create only one Thread and never more than one thread. Unless I'm missing something here.However the code suggested by wedge will create a new thread every time you call AddNewPath() function.
New Posts  All Forums: