Jedesmal einen cosinus berechnen und dazu noch eine Fließkommamultiplikation und Division ist wirklich unsexy, das geht einfacher, kürzer und effizienter.
Jedesmal einen cosinus berechnen und dazu noch eine Fließkommamultiplikation und Division ist wirklich unsexy, das geht einfacher, kürzer und effizienter.
Anstatt unnötigen Berechnungen haben wir nun einen einzigen Array-Zugriff.
Rechenpower haben wir heutzutage zwar genug aber das ist kein Grund sie zu verschwenden.
Sehr guter ansatz! Find ich super das jemand mal so etwas macht!
Aber wenn ich dich fragen darf, wieso nicht einfach ein Random von 0.000 bis 1.0? Dürfte eigentlich auch alles für einen machen. Man könnte man aber auch einfach die derzeitige MS nehmen, was aber evtl. Probleme auf sich werfen kann.
Sehr guter ansatz! Find ich super das jemand mal so etwas macht!
Aber wenn ich dich fragen darf, wieso nicht einfach ein Random von 0.000 bis 1.0? Dürfte eigentlich auch alles für einen machen. Man könnte man aber auch einfach die derzeitige MS nehmen, was aber evtl. Probleme auf sich werfen kann.
MFG.
Weil hier die Schadensverringerung durch den Levelunterschied berechnet wird.
In der Funktion steht:
Code:
int nDelta = pInfo->pDefender->GetLevel() - pInfo->pAttacker->GetLevel();
Here's another version. Values are precalculated on start-up. The advantage is that you can modify the table size or the calculation itself without having to manually recalculate the look-up table.
Here's another version. Values are precalculated on start-up. The advantage is that you can modify the table size or the calculation itself without having to manually recalculate the look-up table.
It's allready late, but it really seems like you are having 1 instance of your struct for MAX_OVER_ATK and then refer it to then de-refer it by the array operator. Further afaik template classes are generated at compile time so the argument in the <> brackets are determined at compile time, thus you would have to insert 0...MAX_OVER_ATK-1 for each instance.
The general idea of generating the table at start-up with a function is ofc. possible but i don't see why we would need a template except for making things far more complicated than needed. If i recall right the newer c++ standards even make compile time generation of look-up tables possible by applying the right keywords to the function.
It's allready late, but it really seems like you are having 1 instance of your struct for MAX_OVER_ATK and then refer it to then de-refer it by the array operator. Further afaik template classes are generated at compile time so the argument in the <> brackets are determined at compile time, thus you would have to insert 0...MAX_OVER_ATK-1 for each instance.
I do not need to do that. MaxOverAtkDelta inherits itself. The MaxOverAtkDelta<0> specialization prevents a recursive loop. Each instance generates its own Delta value with a decreasing Index. Due to the way classes and base classes are stored in memory we can simply cast the root class to a float and by using delta as offset we get the correct value.
This translates to only two lines of assembly:
The general idea of generating the table at start-up with a function is ofc. possible but i don't see why we would need a template except for making things far more complicated than needed. If i recall right the newer c++ standards even make compile time generation of look-up tables possible by applying the right keywords to the function.
Templates make the code compact and dynamic. If you want to change MAX_OVER_ATK you only need to modify the const. Everything else is done dynamically.
However you still only have 1 instance of your struct and only specify 2 template arguments (MAX_OVER_ATK and 0). I'm not sure if the other templates will get stored and relying on storage of classes in memory seems dangerous.
There is no need for templates at all, all you need is a array of floats with the right size and a function you call at start-up, for example when the masquerade.prj is read. It has the same functionality is more safe and less confusing. In addition if you want it to be read-only you can create a getter-Function that returns const float* const, the compiler will optimize the call away but the type safety stays.
However you still only have 1 instance of your struct and only specify 2 template arguments (MAX_OVER_ATK and 0). I'm not sure if the other templates will get stored and relying on storage of classes in memory seems dangerous.
I'm not sure if you understand how templates work correctly. Nor what you actually mean with stored. The
Code:
MaxOverAtkDelta<Index - 1>
will generate base classes until the <0> specialization is reached. That's it.
Quote:
Originally Posted by Mognakor
There is no need for templates at all, all you need is a array of floats with the right size and a function you call at start-up, for example when the masquerade.prj is read. It has the same functionality is more safe and less confusing. In addition if you want it to be read-only you can create a getter-Function that returns const float* const, the compiler will optimize the call away but the type safety stays.
I honestly don't see how a simple template like this is confusing to anyone.
I would not put any read calls into other functions in entirely different files so the code stays dynamic and modular.
will do. Obviously it's some recursive initilization but i don't see how it would generate more objects.
Index is decremented by one. Since this changes the original number a new template of MaxOverAtkDelta is created. This is repeated until <0> is reached which is specialized to not have any base class.
Quote:
Originally Posted by Mognakor
In case it works you still need to put a const float Delta=... into the template with <0>.
No. That's not required because Index starts at MAX_OVER_ATK. As you can see I use (Index - 1) for the calculation of Delta. If I'd put the same code into the <0> specialization I would have a negative value.
Source for free for all DO Calc +++ and DO RP calc 09/24/2012 - DarkOrbit - 0 Replies Hello friends
as i get to less time to sit on pc , and im not interested to update this tools at all , im making them open source , well they r simple to create and understand, it can be helpful for new beginners , well , the codes are of my DO Calc +++ and DO Rank Points calc , (created in VS10 , language VB.Net 4.0)
if u want u can add new gates , and new npc and release them again :).
They're only source codes so i suppose no VT needed ,
DO Calc +++
DO RP calc
Thank you ...
[10.09.12] Multihack - leveling, speedup & more 09/12/2012 - Metin2 Hacks, Bots, Cheats, Exploits & Macros - 10 Replies UPDATE 10.09.2012
funktioniert mit der aktuellen version
Littel_Multi_Mod_Tool´s v1.2
Screen:
http://www.bilderhosten.de/bild.php/4207,multihac kmodbildSDWA1.jpg
-
http://img4web.s3.amazonaws.com/tbnl/63E57P.jpg?A WSAccessKeyId=1SC7XPM4CHJWESHW9XG2&Expires=134 7281411&Signature=ppkEPZUtOZiXeLLiUW%2BUuwsWX2 4%3D
Download: File-Upload.net - M2-Hack_10.09.12.rar
Windows 7 SpeedUp 09/01/2011 - Tutorials - 5 Replies 1.) Einmaliges Durchführen nötig: Beende über den Windows-Task-Manager (aufrufbar über + + , alternativ per + + alle unnötige Prozesse, die Windows ausbremsen, da die CPU belastet wird, sofern diese etwas machen, und auf jeden Fall RAM verbraucht wird (was Windows zu unnötig schnellem Auslagern der RAM-Daten auf die Festplatte zwingt, was eine echte Bremse sein kann; Festplatten können bis zu 100x langsamer als der RAM in Sachen Reaktion sein).
2.) Einmaliges Durchführen nötig:...
[Howto] Ultimate Win7 Speedup 03/10/2011 - Tutorials - 6 Replies Inhaltsverzeichnis
Vorwort
Die erste Wahl: SSD
Bios und Treiber
Mehr Ram
Transparenz ausschalten
Unbenötigte Visuelle Effekte
Schreibcache auf USB-Geräten
Unnötige Programme aus dem Autostart nehmen