Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How does Minecraft PC deal so good with items?

Comments in 'Plugin Development' started by MyNameIsTriXz, May 17, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    I know, this question sounds a bit weird, but how does it work so good on MCPC? Because there are many gamemodes where items do drop very often and are sometimes about about 300 item (entities) in one world, where MCPE server will lagg so much, because there are about 300 entities on one point... Why is MCPC dealing so good with item entity lagg and MCPE not?
  2. Driesboy1
    Offline

    Driesboy1 Active Member

    Joined:
    Oct 28, 2015
    Posts:
    102
    Minecraft User:
    Driesboy
    mcpe server in php and mcpc is java!
  3. PocketKiller
    Offline

    PocketKiller Notable Member

    Joined:
    Jul 20, 2015
    Posts:
    741
    This software is written in PHP, and PHP is slower than Java, and if you mean Bukkit, it IS written in Java.
    HotFireyDeath likes this.
  4. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    But its not like PHP can't handle 300 entities or your software SHOULD be coded in java to avoid such problems.
  5. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    The PC server software is faster and more efficient for a number of reasons:

    • Most of the server software for PC is based directly on Mojang's code which is already optimised
    • Java is able to run in an optimised VM whereas PHP has to run as a slow, ugly interpreted language (although, Facebook has made remedies for this)
    • Memory and thread management is years better on Java than it is on PHP. PocketMine depends on external libraries to account for the downfalls of PHP. It also ends up having to make changes to the core PHP configuration just to make things work as intended.
    • PocketMine itself isn't well optimised -- maybe someone will try and work on this with HHVM
    That said, stating that the reason is PHP is the reason for entity lag very misleading. Although the performance that you will get with PocketMine will be incomparable with other languages, there are still optimizations that can be made to deal with major performance issues. For example, by skipping or queueing entity ticks so not all 300 entities have to be updated in one tick.
    MyNameIsTriXz likes this.
  6. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Ah thanks, would it be a good idea to write an MCPE server software in C++ (like MCPE is written in)?
  7. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    The MCPE Android .apk is written in .so format.
    The main system of MCPE and physics is written in 6.2 MB
  8. DC4CODE
    Offline

    DC4CODE Active Member

    Joined:
    Nov 19, 2015
    Posts:
    64
    Minecraft User:
    dxdsc9349
    Interesting Question
  9. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    Nope.

    The .so extension is just a file used to notate a shared library on Linux-like systems, like dynamic link libraries (DLLs) on Windows.

    All the native game code is compiled down to the shared object file, the rest of the code is just extra packaging specifically for Android.

    You have direct control over memory with native C/C++ code so yes in many regards you can make a highly performant server without worrying about things like garbage collection in other languages.
  10. Muqsit
    Offline

    Muqsit Active Member

    Joined:
    Sep 9, 2015
    Posts:
    175
    Minecraft User:
    Muqsit
    But I think you might be violating Mojang's EULA if you're linking your C++ software coding directly from the source/game (just like Bukkit does). You should code each and everything separately like PocketMine.

    (You'll only be violating if you're going to do a business out of Mojang's code)
  11. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    LMFAO do you know what you are talking about? o_O .so is just a shared library/object, not a language. It is not exactly all of the MCPE's code!
  12. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    And why just don't handle the "dropped" items yourself? You probably know who needs to see them and you probably don't need to save them either
  13. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Also, it depends on the language version you use, and the optimization you make for your server... Using a lot of random plugins can harm the performance of your server. Also, keep in mind the settings given to the server and the performance of your hosting machine, and the internet speed too! ;)
    Muqsit likes this.
  14. Survingo
    Offline

    Survingo Active Member

    Joined:
    Dec 6, 2015
    Posts:
    221
    IT'S JUST A PRANK BRO

Share This Page

Advertisement