Recent content by tetra20

  1. tetra20

    [suggestion] New Item Decay algorithm

    So I have thought of another idea that uses a little more memory, 1-We will change std::map<Item *, int64_t> reverseItemDecayMap; To std::unordered_map<Item *, int64_t> reverseItemDecayMap; So now we can have access of O(1) on average to any decaying item. 2-Here where the extra memory comes...
  2. tetra20

    [suggestion] New Item Decay algorithm

    #Edit --Not Applicable--
  3. tetra20

    TFS 0.X TFS 0.4 Hp/Mp in Percent on HIGH EXP server with rebirth system.

    If I recall correctly, It shouldn't stop at 21.7kk but 2.14kkk(you are missing a k) and that's probably because servers are limited by int32_t, you should change that to int64_t to avoid overflow.
  4. tetra20

    Top 5 highscores getting a effect

    Back to O(logn) time and O(n) memory 1-when a player logs in,insert both his {level,id} into set 2-when the player logout,erase both his {level,id} from the set now you have best players Added in the list,just iterate in the following way two variables highestLevelFound = 0,timesFound = 0; once...
  5. tetra20

    Top 5 highscores getting a effect

    The first lua code xikini pasted is actually fine for lua(maybe?),It has an order of O(Nlogn) where n is the number of players,which wouldn't lag even if you repeated it every 2 seconds with 10000 players online(probably?) In my own opinion,if you are seeking better time and less memory,this'd...
  6. tetra20

    Add MagicEffect

    what about changing cid to pid :O?
  7. tetra20

    spawn monster

    Time in milliseconds,4200 = 4.2s It takes 4.2s to summon the monster after first flash(a new flash appear each 1.4 second)..you can set it to whatever you want.. Scheduler::getInstance().addEvent(createSchedulerTask( x, boost::bind(&Spawn::spawnMonster, this, spawnId, mType, pos...
  8. tetra20

    Unban Codex NG

    I Didn't know that this Drama is still going on..I'm just gonna state few things. Codex Aka bayview was both right and wrong in the past by telling few people to learn scripting,because those people found it seriously easy to just make a topic and wait for an answer rather than learn how to...
  9. tetra20

    C++ Crash Party TFS 0.4 (8.60)

    the std::find function seems to be behaving correctly.. i suppose it's not actually the problem..looking closely at the gdb.. i found this #7 0x0000555555697df3 in Game::removeCreature (this=0x555555a740a0 <g_game>, creature=0x5555780f6000, [email protected]=true) at game.cpp:1032...
  10. tetra20

    Lua Code Efficiency

    As shitposting,i just meant trying to help.. Being rude or overconfident,that's another story,which is a bad thing..
  11. tetra20

    Lua Code Efficiency

    This part is true,As an example of what you said.. Modulo operation where it depends on the number of digits O(m),it can be brushed as O(1) since most of number dealt with have m <= 18.. Not sure about the rest honestly..
  12. tetra20

    Lua Code Efficiency

    Shitposting is the road to glory(If you never shitposted,you never tried and never had the courage to make a mistake)
  13. tetra20

    Lua Code Efficiency

    Still Something doesn't make sense to me.. When our code had only constant numbers for i = 1, 5 do for j = 1, 5 do print(i, j) end end You said it was O(N^2) So What would an O(1) look like..? In other words,Can you provide me a code including a loop and you call it O(1)?
  14. tetra20

    Lua Code Efficiency

    What you said is true I'll just give my perspective on this matter(cause it's confusing somehow xD) Let this be our code: for i = 1, 5 do for j = 1, 5 do print(i, j) end end Say we run this code t times So in total,we do around t*25 operation..Can you say this is an O(25t)? Ofcourse not,because...
  15. tetra20

    Lua Code Efficiency

    You Dashed away from the point..I said it's O(1) not O(n) Because the size of the array is of constant size.. it's not changing ,each time it's the same operations done for every player,it does N operations but the Time complexity is O(1) and so it the Memory it's O(1) For example,this little...
Top