Let me argue for why I am doing it and since I don't know of any other ways to be doing it better (Perhaps parallel-programming? Not familiar with it really, so I don't know.)
The BaseThread is a multithreading wrapper actually, however normal mobs does not have a thread for themself. Only the bosses, but there would only be a single boss in the map spawned at once. Normal mobs uses the thread the map has, since each map with mobs has a thread, rather than a global thread for the whole server.
The reason why the boss uses multiple threads is because each thread simply does different actions and if I was to use a single thread then one action may delay another action. It's not really a problem when it comes to deadlocks though, since there is not multiple threads accessing the same data they do. No locks is needed either since they just take care of the concurrent collections which already takes care of concurrency between threads.
If you know a better way to do it, I'd be more than interested in it, but as of now I do not know a better way.
Perhaps instead of giving each boss the threads then shared threads for the bosses, like with the mobs?
The naming would heavily imply (to me anyways) that they are their own thread loops. I'd expect if they were something being called by a master thread it would be something like
Boss_Move_Tick
Boss_Attack_Tick
etc
Quote:
Originally Posted by Super Aids
Let me argue for why I am doing it and since I don't know of any other ways to be doing it better (Perhaps parallel-programming? Not familiar with it really, so I don't know.)
The BaseThread is a multithreading wrapper actually, however normal mobs does not have a thread for themself. Only the bosses, but there would only be a single boss in the map spawned at once. Normal mobs uses the thread the map has, since each map with mobs has a thread, rather than a global thread for the whole server.
The reason why the boss uses multiple threads is because each thread simply does different actions and if I was to use a single thread then one action may delay another action. It's not really a problem when it comes to deadlocks though, since there is not multiple threads accessing the same data they do. No datalocks is needed either since they just take care of the concurrent collections which already takes care of concurrency between threads.
If you know a better way to do it, I'd be more than interested in it, but as of now I do not know a better way.
Perhaps instead of giving each boss the threads then shared threads for the bosses, like with the mobs?
... There's no reason (that I'm aware of anyways) to use more than a couple threads for your entire server. The amount of threads you are using creates more problems than it solves (what exactly do you need that many for to start with?)
I'd recommend a task system. The best way to explain it to those familiar with conquer online would be something like how TQ binaries handle NPCS.
Each task has parameters as well as an optional next task. This way your task collection only contains the currently relevant tasks. You can then process these tasks as they elapse and if there is a next task associated with them then you simply add that new task to the tasks collection.
This allows you to have a potentially unlimited chain of tasks being processed by the server. You can make the system as complicated as you would like.
Another possibility would be how TQ handles threading. There's a 'base thread' for the server which then triggers child threads, each of which have an interval which determines how often they are called. These child threads can then call any actions they need to (some of which may have their own internal tick intervals)
The naming would heavily imply (to me anyways) that they are their own thread loops. I'd expect if they were something being called by a master thread it would be something like
Boss_Move_Tick
Boss_Attack_Tick
etc
... There's no reason (that I'm aware of anyways) to use more than a couple threads for your entire server. The amount of threads you are using creates more problems than it solves (what exactly do you need that many for to start with?)
I'd recommend a task system. The best way to explain it to those familiar with conquer online would be something like how TQ binaries handle NPCS.
Each task has parameters as well as an optional next task. This way your task collection only contains the currently relevant tasks. You can then process these tasks as they elapse and if there is a next task associated with them then you simply add that new task to the tasks collection.
This allows you to have a potentially unlimited chain of tasks being processed by the server. You can make the system as complicated as you would like.
Another possibility would be how TQ handles threading. There's a 'base thread' for the server which then triggers child threads, each of which have an interval which determines how often they are called. These child threads can then call any actions they need to (some of which may have their own internal tick intervals)
AcidCOv3 had a similar system, where you could tell the GenericThread to execute a method and when, like a child - but not in its own loop.
(I'd have to look to remember exactly how it was done, but I remember it being pretty cool)
Want to thank pro4never and Hybrid for the threading thing and I have narrowed it down now and the naming convention has been changed to be similar for it all, as well some other optimization, not sure why I did this stupid stuff in the start *****
PvE-Verkaufsruns (CMs & HC-Raids) 02/14/2013 - World of Warcraft Trading - 3 Replies Hallo zusammen.
Nun auch von uns ein Thread zu Verkaufsruns im PvE.
Das Prinzip kennt ihr: Wir, die bettelarmen Nerds, bieten euch, den Gutbetuchten und Bequemen, die Möglichkeit, gegen einen kleinen Obolus von uns durch aktuellen PvE-Content gezogen zu werden, wobei euer Char Gear, Erfolge und Ähnliches von Wert bekommt.
Wer wir sind:
Wir sind ein bunter Haufen von Spielern, zum Teil aus einigen der besten PvE-Gilden Deutschlands (World Top 15-25), zum Teil aus dem High-Rated...
Oldschool Raids 01/01/2013 - World of Warcraft - 5 Replies Hallo ich habe da mal eine Frage,
gibt es wohl noch auf irgendwelchen Servern Oldschool Gilden?
Die den 60er, 70er und/oder 80er Raids machen oder zusammen PvP?
Danke schonmal im voraus
DK in raids 06/26/2010 - World of Warcraft - 14 Replies I want to know whether a dk can be good for raids.
I am leveling a dk. how should i spec it to be any good in pve? Can it be good at all?
What character for PvP and raids ? 10/27/2009 - Lineage 2 - 0 Replies Hey guys,
What character can be best used for PvP and raids ? And if possible tell me how to play it well.
Solo raids with 2 ppl 04/05/2009 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 9 Replies also ganz einfach:
man braucht:
Einen Blade Dancer mit dance of medusa
Einen level 1 char
Einen Spell singer oder sorcerer fuer freezing skin oder blazing skin
einen pp (aber nicht nötig, aber gut zum rb buffen)
Jetzt mal zum thema: