All code and no media makes me…

Typing this from my iPhone as I near the end of my media fast. Have been without tv and without internet (other than my phone. For emergency exceptions, like google, and web comics) for about 3 weeks now. Once I stopped going stir-crazy, I started getting a lot of code written.
Several libraries are now in usable, if somewhat feature-poor, forms. Most of my app foundation code is linked up in gcommon.lib, backed up by scribe.lib and the newest, stockings.lib.
Common includes no new code, mostly things implemented in Jan and Feb, it just packages a lot of the modules I use in almost all of my projects. It includes application classes, some basic (mostly 2d) OpenGL classes like sprites, tilemaps, etc. It also includes general systems, like the event and asset managers.
Scribe provides classes for defining objects as nested collections of properties. Structurally similar to XML, it currently includes simple text and binary readers and writers, with an xml support planned. Includes classes representing files as well, with support for handing out readers or writers of the correct format. Reader and Writer classes all operate on a supplied stream, so impromptu use can operate on stringstreams or any other stream source. At the front-end, includes a factory capable of reproducing any object from it’s descriptor, or generating the descriptor for any given object. What started as a tool for loading text files defining sequences of frames as animations has become one of the most powerful and versatile tools in my toolbox. Still, it is missing a couple of key features. First, while it supports arrays now, it does so as as mixed-type collections with named elements. This is versatile and powerful, but means, for example, a 2d vector is defined as “array pos int x 0 int y 0 end.” A typed array is needed, which would eliminate the need for naming and specifying the type for every element. Second, it needs a XML support.
The latest library, added just this week and with major features still in the works, is the Stockings library. Stockings provides classes for handling udp connections. Automatically handles incoming connections, performs simple handshake before passing off the connection to the app. Exposes a pair of queues, inbox and outbox, which are thread-safe, implementing locks internally on all queue manipulation. Stocking instances run a background thread which handles the sending and receiving, allowing the app to simply throw messages into the outbox and check for them in the inbox. Still very shaky; doesn’t handle most errors very gracefully, but it’s developing nicely.
In the future, going to need classes to provide ssh tcp connections, which will be used exclusively for authentication with a yet-to-be-implemented NodeServer, which will provide 3rd-party authentication and identification services to nodes in a distributed network. Also need to beef up the packet handling; a packet needs to be able to carry multiple messages, and the stocking class should be able to handle this somehow. This could mean a sizable refactor, as currently packets are created, using convenience methods, where they are sent, precluding any chance to merge messages. Might be able to just implement a MultiPacket class, which combines packets, merging headers.
Before the weekend is through, I intend to have a client connecting and moving through the world, streaming all the assets and scene data from the server. Hopefully some form of in-client tile map editing will also be in place as well.
Dunno if anyone would want to read it, but I rather enjoyed writing this rather code-diary-ish entry. Expect more.

Did you like this? Share it:
This entry was posted in Programming and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *