UDP 打洞

NAT Punchthrough overview
What is NAT?

NAT is short for network address translation. It is used by routers to map addresses behind the router to a single destination address, using different ports. For example, if you have two computers behind a router, but only one ISP, then both computers will use the same IP address, but with different source ports than what the application actually assigned. The router keeps a lookup table of what mappings it provides, so when a remote computer replies it is routed to the correct local computer behind the NAT.
继续阅读“UDP 打洞”

c# PINVOKE传递bool类型的注意事项


c语言中的bool类型是整数(4个字节),c++中是一个字节,pinvoke 中 bool 默认是4个字节。所以c++代码调用c#函数时,传递bool类型就会出现错误。




AOI(area of interest),它是MMO游戏中一个极其重要的概念,主要解决游戏中多人同屏的问题。本文并不打算去讲AOI相关的算法,如九宫格,十字链表,六边形网格之类的具体算法实现,因为此类文章网络上已经有很多了。虽然大多数开发者都接触过AOI,但是我发现其中很多人并没有真正深入领会AOI的本质。因此本文会从设计的角度来阐释什么是AOI,为什么要有AOI,以及如何去设计一个高质量的AOI系统。




This week, I’m going to talk about the different kinds of numbers you see in games and how to classify them. This is going to be important later, because you can’t really know how to balance a game or how to choose the right numbers unless you first know what kinds of numbers you’re dealing with. Sometimes, a balance change is as simple as replacing one kind of number with another, so understanding what kinds of numbers there are and getting an intuition for how they work is something we need to cover before anything else.




What is Game Balance?


I would start by asking the question “what is game balance?” but I answered it in the teaser video already. While perhaps an oversimplification, we can say that game balance is mostly about figuring out what numbers to use in a game.

我会先问一个问题“什么是游戏平衡? ”但我已经在预告片里回答过了。也许过于简单化了,我们可以说游戏的平衡主要是弄清楚在游戏中使用什么数字。