Pushing forward

Again, a lot of work was done as well as wasted spent on learning, but with no new fancy screenshots to show for it. Client now communicates with server only – Redis is now exclusively available to Node server, implementing cornerstone of multiplayer security. Network performance was also improved by eliminating some unnecessary blocking requests and moving all messages in single round-trip message. Dead reckoning is reintroduced to work along weighing, giving much more fluent and responsive feel to the game. Some management of suspend/resume was implemented. Persistence is functional, so users will continue wherever they logged off. World map was rebuilt, with some rescaling. New city import was made to include more smaller towns totaling over 5000 – only criteria was not to have larger town nearby. After some downtime in Joyent, server was moved to Amazon EC2 – they give great machines for free for a year, you should really check it out.

And yes, builds are ready for Android, iOS, and Win32! Yes, copyrighted senseless and equally unwarranted, but free as in beer. Let me know how if it works on your favorite device.

Well, there goes a month …

A lot of sun, sea, beaches, seafood and wine, and very little development, as predicted. Still, terrain and player collision are implemented and some communications issues solved. Internet connectivity was somewhere in between extremely poor and none whatsoever, which came in quite handy to improve network behavior. Weighted positions on camera and players turned out to look better than plain dead reckoning, and also package size reduced along with it. Simple user control is introduced, swipes left and right set the ships rudder, and it seems to work fine. Some time was spent browsing for interesting sounds, music, and 2D art. I can’t wait to start making things prettier and more fancy. Currently all effort is going to completely moving all Redis operations to server-side, due a) security, b) performance and c) elegance. Up next would be cannon fire action and city docking, which then would be a good time to implement persistence.

To be honest, still no clue of actual game play and game goals, if any specific… I suppose something to do with gold plundered, reputation earned, ships owned, towns visited, achievements unlocked, national pride boosted, guilds formed and teaming up with friends from OpenFeint. No clue. Towns could also be owned I guess, maybe king-of-the-hill style. Technically, also created and destroyed, as well as terrain itself. Probably a bit too much. I could still use a small army of developers, 2d and 3d artists, and at least one marketing drone. :)

And we are online!

Phew. A lot of effort went in, but it seems to be worth it. Server side script does the authentication, login, region subscription, physics, and general world simulation and network updates. Plus a bunch of nonhuman players. It works! Started really slow at 1 tick per second just to be able to keep track of all logs and networking. As a greatest feature ever, dead reckoning was implemented and things look so smooth! Both for translations and rotations. Already at 2Hz you just can’t really tell anymore what refresh rate is. That should leave a lot of bandwidth and CPU time for a lot of players! About packet sizes, I started at 22, and ended up with 28 bytes per visible player, which seems satisfyingly little to me. As much as I would love to start benchmarking, optimizing and yakking about numbers as soon as possible, I will probably leave that for last.  Plenty of things to do next: collisions, controls, player cam. Sounds. I wonder what iPad version will be out by the time all this actually gets done….Either way, I’m off to earned summer break! I might do some work, but again I might not. I will probably just do some envisioning of possible features that would make this game epic!

Sticky marmalade

After some time off from myself and some meditation during holidays, I have decided to stick with Airplay Marmalade. They actually listened and did some repricing, while I came to to the terms that there is no such thing as free lunch, for the billionth time in my life now. Influenced or not by it, I remembered that there is whole other half of the game to be built on server side for our MMORPG, and started looking for best course of action. I found out that there is not really all that much quality reading material on subject floating around, and had to settle for short research papers and case studies. Also looked into existing multiplayer server frameworks but came to conclusion that I don’t really appreciate Windows servers. Even more importantly, I don’t really like to be vendor-locked-in and 3rd party dependent, more times than necessary that is. Besides, their Marmalade integration is not quite complete yet. Each type of online game seems to have it’s own vision of usable network implementation.

So, it is definitely going to be Node. All pre-benchmarks are impressive, syntax known, and coding simple. Also, I like to think that one day I will be able to build in-browser client which would be a nice match. Biggest realization for me was to put all world simulation to server side, and never ever trust the client for anything. I was hoping to avoid this. You see, all server-side resources will be paid by me, while client side will not. As much as I wanted to secure a smart client, it just can’t be done. Clients really need to be just dumb rendering terminals with UI and networking. Luckily, physics will be fairly simple while server centric architecture should reduce bandwidth. Also, I won’t be bothering too much with scaling, since odds are I won’t be needing it, lol! Here are some ad-hoc guesstimates, just so I can be quoted later on, proved dead wrong and fiercely ridiculed:

Around 4-10 Hz server side simulation tick.
Around 1-5 kb total player definition size.
Around 25 bytes per avatar player update packet.
Around 1:10 online/total user ratio.
Around 1000 online users support per server.

Actually I am really curious about last one and naturally I will be pushing this one as high as possible. Now I’m off to specifying messages and protocol and I won’t be back until I see the damn thing move on my screem in jerky and laggy fashion while trying to obey almighty server-side laws of physics! See you all in 10 years or so!

Well, I just got jammed!

In a surprise dick move today, Airplay SDK decided to revoke all free licenses, and suggested we should all just pay up or just drop dead. We have 30 days. To make up for it, they changed their name to Marmalade and put some flashy new icons on their website. Now, I really didn’t mind purchasing the license for Android before publishing (iOS was free), but now price went from $99 to $499. Annually. Or you can get it for $149 if you will have their in app splash screen during loading time. Now still, those are not completely unacceptable terms, but it made a lot of people, including myself, wonder what the terms will change to in next quarter? Luckily I don’t have 10 licensees or 10 years of code written for the damn thing, but this really served as a nice warning as for all “we love indies” packages. They can essentially void any code any company has for their SDK at any point in time! I guess it’s time for some agonizing reappraisal of the whole dev scene.  Not sure what will come next. Another porting? Going native? Or paying up and shutting up. It’s a sad day for indies. And for the Ideaworks. I understand that they are just profit driven company, like any other, but they had so much more going for them. They have big players and large clients, as well as numerous indie user base. Don’t understand why they really needed to do this. We trusted them with time and effort and they used it to gain publicity and popularity. Well played. We should’ve known better, really. It is definitely not a “free as in speech” software. O WebGL, where art thou?

Moving along

Well, they are all just standing there. I need them to move. No problem, speed vector along orientation and on tick position update. But hell, ships are going through the islands, dolphins swimming into walls. Nightmare. I need AI. Possibly with retarded IQ, but still. If you are below the terrain height you should really turn around. Please. That did it. Still far from pretty, but at least you get some illusion of intelligence . What I really want is look ahead vector, rotating animation, and large random angle for them to turn. Will do. Most of the wildlife will be for cosmetic purposes only anyway, and each player will see it’s own “decorations”. No need to keep them synced from game server, and hence AI / physics are done on client side. For player ships, we can’t never trust the client to do such delicate, game critical calculations. We need more wildlife, at least a whale and seagulls. Clouds. Clouds will be essential for gameplay, leave you to it to guess why as well as the names of these islands.

Creation of life

We are making progress. Finally we can add some life into our world. I searched and found some free and “low” poly models. They all needed quite a lot of remastering but eventually found their way into Airplay. I lost much of time to animating the freaking dolphin. No matter what I do to it,  it always ended up looking like it has suffered from some serious genetic disorder disease, and looked like a lump of meat twitching into itself. It was not a pretty sight, actually quite emotionally disturbing even. Finally, I made sure all transformations were applied in Blender, and all bones in skeleton connected and named properly, and then more of some manual Collada editing I made it to work. I’m not looking forward to doing it again. Using similar technique as for trees, for time being, I just thrown them around randomly at see. Ships on surface, dolphins at random depth. Once again, world looks like a better place.

Lights, please

Let there be light. Directional. Rotating. Slowly. From East to West. And we’ll take some ambient light as well, specially some blueish at night. There, I fixed it. Objects from Blender come with normals calculated for each triangle, but our terrain is still flat all day long. So we calculate and normalize all normals for each terrain part dynamically and feed the monster. Now you can actually tell what time of day it is by looking at the shades. Beautiful. While dynamically working on each terrain cut, we might just as well randomly add trees over certain height. We use region related seed for pseudo-random (no such thing as random or is there) function so we always get same random tree pattern. Unfortunately, now I already started to push humble mobile GPU capabilities. Apparently, it is very expensive to call rendering for each object, even more expensive if you are changing materials. So we only use one material, with vertex coloring. Also, I merged all trees into one renderable object. GPU liked that very much, and took me back to 100s fps. You are welcome.

Finaly some 3D imports

And export from Blender and import to Airplay was a bit painful. Needed to change my laptop regional settings, since apparently 1,2 , 3,4 , 5,6 is best exporter could come up with to represent a vector. Genius. Also colors turned floats instead of bytes, but at the end, that’s what open standard is all about. You can open it and you can fix it. Some time I spent on fixing the terrain generation (should the triangles have / or \ hypotenuses), some was spent on making town names appear on screen, and some was spent watching TV. Miraculously, again, I had something to show for it. Coming up next: lighting, animations, trees, ships and dolphins. Also, I need to change that font really bad.

Meet Blender

You may have noticed I have a thing for free “as in speech” software. Yes, it is “free as in beer”, but more importantly, I think that once mastering a GPL tool, you are better off later on. You see, with free software, no one needs to increase the sales of it every year by forcing new and retarded features, flashy and undesirable UI changes, cutting the support for old versions and bloating the size and complexity for no apparent reason. So, Blender. It’s even completely portable! After a while I felt right at home, even though I have never used it before. I plan to build simple low-poly objects of trees, houses, ships, seagulls, dolphins, whales, starfish and maybe we can throw an octopus in it. So there. After a couple of hours I had a tree and few low-poly houses. Enough to get us started.