Powered by glolg
Display Preferences Most Recent Entries Chatterbox Blog Links Site Statistics Category Tags About Me, Myself and Gilbert XML RSS Feed
Wednesday, July 18, 2007 - 00:25 SGT
Posted By: Gilbert

- -
Can or Not

Let's see what's gone this week or so - met up with some old NS pals for sushi and pool, where I chowed down three uncomfortably cold baby squid-like objects. Racked up my T-shirt count after receiving the MILK Run one belatedly while on Project C.A.N., for which I arrived at 0830 hours at Toa Payoh MRT only to start at 10 plus. Then again my group was chockfull of 4O people and we had a deck of cards, so everything turned out fine.

The actual collection itself didn't take long, what with a majority of the residents not responding (which might have been expected, being a lazy Sunday morning and all that). Doing such stuff always reminds me of how a salesman might feel, with long barren periods interrupted by bouts of success. Had a little discussion while on the job, on whether it might be better in some cases to just do "normal" work and donate the proceeds, i.e. if the ends should take precedence over the means. The thirty storey blocks also somehow led me to wonder about just how tall megaskyscrapers like the Taipei 101 and soon-to-be Burj Dubai actually look up close. Strange given that my own block is twenty-five stories high.

Another observation was that the residents appeared to be almost all middle-aged and above or young kiddies, with nary a young adult in sight. Odd.

Originally scheduled to be over at "five or six", we were in fact finished by twelve-plus, including the sorting of the canned food into Halal and non-Halal categories; It was then a long wait for the complementary lunch, but some rounds of bridge, hearts, blackjack and poker helped time to pass.

Some of us then visited Settlers' for a spate of board games, and I finally experienced what Munchkins was all about. I suspect the game would go appreciably faster once we get familiar with the cards, instead of having to read the text each time we come across it. Was recommended a German fish bidding game, and ended the day with a fast-paced dinosaur card-exchanging bone-grabbing game. Don't ask.

Discovered the Cheapass Games publisher, and their founding principle - that providing dice, counters etc with games is like bundling each can with a can-opener - makes a lot of sense to me. Of course, given that almost everyone has access to a printer, the obvious next step is D.I.Y download-and-print with zero delivery costs, if they could just find a way to stop people from redistributing the games for free...

Talking of computer games, Liero (381KB) probably offered me, byte for byte, the most enjoyment (ADOM might run it close, though); Ah, for the days when we used to play it in class, projected on the big screen, during recess and after school. About the only gripe I had about it was that it could only be played in two-player splitscreen hotseat mode. It was a blast with two - imagine what it would be with four or more.

So, with blatant disregard for the scores of Liero-clones on the Web, I did what any bored computer science student would should do: I began writing my own networked version.


BAKA vs. AUTOMAT KALA

The logic behind Liero-like games isn't particularly challenging, and once one gets a basic 2D physics engine going with decent collision detection, it's basically smooth sailing from then on. However, the very attraction of Liero, which is its fast-paced tactical movement and frantic rope swinging, makes it very dependent on the speed that data can be transferred between online players.

My current UDP server-client setup (another reinvented wheel) does most of the processing on the server, which is not much of an issue given the relatively low computational requirements; As with terminals, the clients simply send their keystrokes to the server, which after doing the number crunching passes back the positions of the players and projectiles for the clients to display on screen.


Latent considerations

Now, information is not transferred instantaneously over the Internet. A realistic expectation between two computers within Singapore might be in the region of 20 to 30 ms, including overheads. Thus, in any online real-time game, it is completely unavoidable that all non-server players are 20 or 30 milliseconds behind of the action.

Is this fair? Nope, but it can be made equally bad for everyone by operating at the transfer rate of the slowest client - not that this is an attractive solution. Is it crucial? Perhaps not, depending on the game itself - if the objects in the game travel only a pixel of two (or even less) during those 20-odd milliseconds, i.e. about fifty pixels a second, it would likely not even be noticeable.

Unfortunately, in Liero-like games, it could make a huge difference. A change of direction might mean that a player character is ten pixels to the left instead of ten to the right in that short time, and the correction that the client's screen has to make contributes to suboptimal jerkiness. This cannot be resolved by predictive algorithms moreover, since such algorithms would reduce jitter when they turn out right, but actually worsen jitter if they guess wrongly.

We could make smoothness a priority, like most FPS games in my estimation, in which case what is shown on screen may not be the most accurate representation possible (recall all those headshots in CS which came despite aiming some distance from the head...). This may be good for FPS since one doesn't really see the bullets flying, but in Liero where life and death hangs by a pixel, I would deem it unacceptable.

But all hope is not lost - with the right firewall and router configurations, it should still be playable at pings of 20-30ms or less. Can one lah!


comments (0) - email - share - print - direct link
trackbacks (0) - trackback url


Next: Fouiero v0.40


Related Posts:
My First Portable
Clearly Improved
Of Linux And Graphics Cards
On The Money
Free Awesomeness

Back to top




Copyright © 2006-2025 GLYS. All Rights Reserved.