GameDev General

Pages: 1... 4567
closed account (o1vk4iN6)
Those games probably use some client sided hit detection, which really just shifts the lag away from the user and onto anyone else witnessing the shot. I was referring primarily to a server based solution which would make cheating a bit manageable, that is, such that you won't need excessive detection algorithms. Speaking of arrows they are very out of sync in Dark Souls, at least from the recipient standpoint where the arrow misses by a mile but you still take the damage.
Last edited on
Minecraft is my go-to example for client-server logic. All logic is server-side and the client is basically just a rendering engine. Despite the massive amount of data that has to be communicated, lag is generally not too noticeable.

It amazes me when games that don't have to process nearly as much data as Minecraft have lag far worse than that seen in Minecraft.
closed account (o1vk4iN6)
Minecraft is probably the best example of how bad netcode can be. It uses TCP for EVERYTHING because of this sometimes what you actually see is where a player was 5-10 seconds ago. Even if a packet was received with information of a players position say the most current one, if there was a packet representing an older position that has yet been received it will have to wait for that packet before anything happens.

It amazes me when games that don't have to process nearly as much data as Minecraft have lag far worse than that seen in Minecraft.


Maybe you just don't have an eye for it but there is tons of lag, probably worst than most games, just less obvious because everything is client sided (idk where you got everything was server sided from). This is why stuff like fly mod are possible. When you destroy a block ? The client determines what block you are actually hitting which would allow people to destroy blocks miles away. I've even seen people create a mod that allows them to destroy massive areas of a world in an instant all from the client.
I think your information is a bit outdated ;p

On a side note, the networking code was even completely rewritten for 1.7, so my information is also a slight tad outdated.
Last edited on
I always have lag when playing Minecraft on my laptop or desktop, but have none for playing Guild Wars or Final Fantasy XI when I was able to afford the monthly fees.

@xerzi
Yeah, even the lag is visible for the pocket edition of the game. I can't count how many times I've placed doors and the host won't see them while I still will.
Last edited on by closed account z6A9GNh0
I think it was already proven long ago Minecraft is a badly coded game.
There are three kinds of lag:
- Clientside lag: your computer is not powerful to handle what needs to be drawn by the client
- Connection lag: your internet connection is too slow to properly communicate all the information it needs to
- Serverside lag: the server is not powerful enough to handle what needs to be processed for the clients

Connection lag can affect just specific clients or the entire server. Which kind of lag are you referring to, @BHXSpecter?

@Lumpkin: Minecraft is getting some major refactoring in order to support the Plugin API. In fact, they rewrote the render engine for 1.7 and render bugs are pretty much gone (e.g. you can see nether portals through ice and water and stained glass is possible).
@Lumpkin: Minecraft is getting some major refactoring in order to support the Plugin API. In fact, they rewrote the render engine for 1.7 and render bugs are pretty much gone (e.g. you can see nether portals through ice and water and stained glass is possible).
I wasn't aware of that.

Proven wrong once again I guess, ;p
As someone who's done a large amount of modding as an effort to get back into programming, I can confirm that Minecraft's code is in places atrocious, at least as far as 1.6's code goes. In other places it's decent, but otherwise it's bloated, not modular, full of magic numbers, and hackish/convoluted in places.

When Mojang says they changed over half a million lines of MC's code for 1.7, I hope their changes are good changes and that I end up pleasantly surprised. Because somehow I'm not expecting good things.

-Albatross
closed account (o1vk4iN6)
Wouldn't those magic numbers be from decompiling it ? At least I don't think they've released the actual source code just there is a group trying to reverse obfuscate it.

@LB

Yah I haven't played minecraft in a while so my information is relatively old. It's come a long way since they first added netcode that's for sure.
Last edited on
@xerzi
Not necessarily, no. There are plenty of examples of code in Minecraft that uses decompiled and deobfuscated Java enums (notable examples include tool material properties and whether an entity is normal/undead/arachnid).

-Albatross
Last edited on
Java enums are classes, whereas static constants in classes that are used in expressions generally get optimzied away, thus leaving no trace of the actual static constant data members (other than those initialized at runtime).
@LB
All 3 depending on what server I'm on. Though I find it highly odd that I can play games like Guild Wars on my computers but have severe client lag with Minecraft (off and on even with graphics turned down). I booted it up and was surprised because my laptop CPU jumped to 96% when I was sitting on MC and never went below 56%. Sitting with Geany and Chrome (with 4 tabs open) is only running 5-7%. Don't know what the processor runs for Guild Wars, but I don't have lag when playing it, but that may be because of them using two different methods for doing the games.

Both laptop and desktop are 2006 Compaq Presarios, so they are dated and I have no money to buy a new one so my whole problem may just be poor hardware.
Both laptop and desktop are 2006 Compaq Presarios, so they are dated and I have no money to buy a new one so my whole problem may just be poor hardware.
I have a laptop from 2002 that I'm using as a baseline minimum requirement machine.

I can run Minecraft at ~56 fps, so it's not that bad.

Did you try optifine?
@BHXSpecter: The Minecraft render engine should be faster now, but before certain things were notorious for causing lag, e.g. marketplaces with sign-based buy/sell mechanics are a problem because the game isn't meant to handle thousands of signs with text on them being rendered at once.

@Lumpkin: w/o optifine I get 100fps, or 10fps in the aforementioned scenario. With Optifine, I get 50fps normally and 30fps in the aforementioned scenario.
Last edited on
@LB
This is my F3 screen after just creating a new world and letting it sit a minute to make sure CPU is fine. My CPU was running at 93% when this was snapped:

http://prntscr.com/20ocrn

My laptop sucks lol. Sadly, my PC isn't much better.
Last edited on by closed account z6A9GNh0
@Disch
Took me a while to reply but, when I get a new PSU for my PC, I will implement a system similar to that, except that I'm moving the resource loader thread into the resource manager and using template specialisations for the specific managers instead of typedefs, because the resource manager has a pure virtual LoadResource method that does the actual loading (called from the second thread).
So Optifine is a no BHX?
Optifine doesn't make that much of a difference. With optifine I get about 12 to 16 fps.
Did you optimize Optifine's settings?
Pages: 1... 4567