Sunday, July 23, 2017

A game testing idea


Testing games takes a lot of effort. We need tools to make that easier.

The android sdk has a command line tool called adb for communicating with the devices. In Unreal tournament there was a console window for giving cheat codes.

From these premises I got an idea of LAN based testing for games. The result was that I could make 
DebugConnectionManager (DCM).

Here you can find the source code for DCM Server and Client: GitHub Repository

For games, it is useful for cheat code based game testing.
Provided we know the I.P. address of the machine in which the
game is running, we can send commands to control the behavior
of the game from an another machine.

The trick here is a normal TCP/IP socket connection based protocol and
a delegate mapping mechanism inside the game for mapping
a command string with arguments to a member function of the game object.

A mapping request like
DebugConnectionManager.addRule("health",updateHealth) will
map a command "health" with a function updateHealth.

When the game receives the commands with arguments, the mapped
functions are called with the arguments. This behavior will change the
game properties.

e.g.
"infinite-health",
"all-weapons"
"switch-to-level 12"
"pause enemies"


Information for those who interested in using it

Read the README.md that comes with the source code to build the server in Unity3d.

You can build windows/linux/mac command line clients from client.c or download, install and use the android client

Disable firewall in the client and server machines. Note down the ipv4 address of the server machine for connecting.

Connect to port: 64000. Both server and client should be in the same network.

I have tested it in WiFi network with server running in Windows 11 and client in Android.

I had to turn off McAfee Live Safe and allow all ports inbound and outbound access in Windows Defender.

I recommend what is my ip address tool (playstore link) for getting the ip address of the android phone or tablet.