1

I'm working on a multi-player Android game (very simple it is that it doesn't have any game-engine used). The game is based on Java Socket. Four devices will connect the game server and a new thread will manage their session. The game server will server many such sessions (having 4 players each).

What I'm worried about is the testing of this game. I know it is possible to run multiple android emulators, but my development laptop is very limited in capabilities (3 GB RAM, 2 Ghz Intel Core2Duo and on-board Graphics). And I'm already using Ubuntu to develop the game so that I have more user memory available than I'd have with Windows.

Hence, the laptop will burn-to-death on running 4 emulator instances. I don't have access to any android device, neither I have another machine with higher configuration. And I still have to develop and test this game.

P.S. : I'm a CS student, and currently don't work anywhere, and this game is college project, so if there are any paid solutions, I cannot afford it.

What can I do to test the app seamlessly? ability to test even only 4 clients (i.e. only 1 session) would suffice, its alright if I can't simulate real environment with some 10-20 active game sessions (having 4 players each).

2 Answers 2

4

for testing the server you'll need to mock the clients (mock the input and output stream of the socket or the object that parses the input depending on what it easier)

the mocked clients are bots really that do some prearranged moves as they receive the moves of the other players (and send an error when they see something they don't expect)

for testing the client you can mock the server

1
  • Ok, so I'll have to make a "bot" client that runs on laptop itself and does something predetermined, and I run 4 such bots and test the server. And same will be for device where 1 client will be android emulator and rest 3 would be again, desktop programs. Thanks for motivating, I was already planning to do something like this but waited for any expert opinion before I proceed.
    – Kushal
    Jun 10, 2012 at 15:47
0

You should ideally write your classes in such a way you can instantiate multiple clients in the same program instance, and mux the input/outputs accordingly... That's the best way to do this IMHO.

4
  • But would it be feasible in the case of Game Client? which has typical game view, and when one player makes its move, view of rest of the three client updates to reflect the change.
    – Kushal
    Jun 10, 2012 at 10:19
  • Yes, if you've written the game view to be loosely coupled with each client. Technically, you'd always pass the complete game state of current player's player to the view, and cause a complete redraw. Or keep a copy of view for each client, and set the current view as that client's view. It is very doable. Jun 10, 2012 at 10:37
  • I'm designing the game view to be independent of the client but I don't understand how I'd see "four different views all at a same time" on which game is active.
    – Kushal
    Jun 10, 2012 at 11:30
  • keep a flip button that works only in testing mode, and switch between the views instances? Jun 10, 2012 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.