06 February 2008

Opioid2D Version Control

I've been reading a lot about distributed version control systems lately, and have come to the conclusion that the development of Opioid2D would benefit from lot of the features available in them. I code on several PCs and e.g. my laptop is often cut off from the net when I travel. Distributed version control like Bazaar would make it easy to retain version history while offline and then merge the revisions to the online repository when regaining net connectivity. I'm also going to be doing some major refactoring of the C++ internals, and I think the distributed model of "branch per feature/bugfix" would make things a lot easier.

The one thing that worries me is that Subversion is something that is familiar to almost all developers, so it is easy for anyone interested in O2D to grab the SVN trunk. Distributed version control systems, however, don't seem to be as widely used or even known. I looked at several different solutions, and Bazaar is currently my top choice because it seemed to have the lowest barrier to entry with decent documentation and support for Linux, Windows and MacOSX. Mercurial was a close contender, especially since TortoiseHg seems more mature than TortoiseBzr at this point, but after giving them both a try, I slightly prefer using Bazaar (and its quick-start guide was a lot more comprehensive).

Another good thing about Bazaar compared to SVN is that I could publish the repository via a standard web hosting service and thus put it on the same server that contains the Opioid2D web pages. I'm currently renting a virtual server to run svnd in, and it hasn't been very reliable (nor cheap enough to justify the mediocre up-times).

7 Comments:

Blogger Zorbicon Heptis said...

Well, however we can get it, it's helpful to see whats going on in your code. Bazaar seems easy enough.

I was wondering if there was a way you could put a flag in (on the python side):

(from display.cpp)
namespace opi2d
{
void _init_gl()
{FUNC
glClearColor(0,0,0,0);
...
glShadeModel(GL_SMOOTH); <---to disable blend?
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

...or is it possible to disable blending as it is right now?

Also, the function utils.multiline lacked some functionality that was included in its sister functions:

def multiline(font, lines, color=(255,255,255), antialias=True, border=False, bordcol=(0,0,0)):

I added these so that one has more control over the rendering of the text (the functionality was already there but hidden in the fn). I suppose that the border color could also act as the flag for activating it (bordcol = False, bordcol = (255,255,255)).

I'm using this for simple dialog text, and have coupled it with a function that makes the mouth of the ent move according to the string it is 'saying'. I'm in the process of experimenting with the MS speech bindings to pywin for synthetic speech. The voice sucks, however, and the program freezes while speaking, so I don't think I'll use it in the end.

Anyhow, looking forward to your integration of box2d and any other additional features you are working on. When can we expect Alpha 7???

10 February, 2008 23:43  
Blogger shang said...

By blend disabling, is your goal to make sprites scale and rotate without filtering? That's a setting that's controlled individually per each OpenGL texture, and will be part of the public API in the future (along with other additions that let power-users have more control over texture details.

Alpha 7 will probably be rather far in the future, since the current alpha 6 doesn't have any critical faults (barring the possible memory leak issues that I haven't had the time to track down yet). I'm going to release Alpha 6 patch 4 and so on for bug fixes, but actual new features will be available only via the "experimental" branch in Bazaar. The point of the experimental branch is that I'm free to break backwards compatibility as much as needed to fit in larger new features. After the new features have stabilized, I can spend the additional time to improve backwards compatibility and merge them into the main branch (and release a new alpha).

11 February, 2008 20:15  
Blogger Zorbicon Heptis said...

Yes, pretty much. The fact that the borders of tiles when blended (along the adges of pixes with an alpha against those with an alpha of zero) are visibly lighter makes the divisions between images more obvious. Since most of the objects are composite and have alpha in my project, this becomes annoying, because the visibly separate objects detract from the 'whole'. I want a pixelated effect anyway, as that is part of the design (lo-fi).

Can't wait for some new features to play with.

12 February, 2008 05:28  
Blogger shang said...

I coded a quick fix for that light "halo" between transparent and non-transparent pixels. You can try

bzr get http://opioid-interactive.com/opioid2d/bzr/experimental

and see how it looks in your project.

14 February, 2008 17:52  
Blogger shang said...

Hmm, the URL gets cut off. The last part of the path should be "experimental"

14 February, 2008 17:53  
Blogger Zorbicon Heptis said...

After I install the experimental version, I get a py parachute seg fault when I try to run my stuff.

Seems to be related to my (crappy) map and object structures, I guess I'll just have to figure it out.

The display pops up for a second and it appears the halos are gone, though, so thanks for that! :)

Also, I'm starting work on some fns/modules to facilitate putting Sprites into a shelf or buzhug db's. I'll send it to you when it works right. Could be useful for many different types of games.

16 February, 2008 06:35  
Blogger shang said...

Pull a new version from the experimental branch. I think I just fixed the issue that was causing your game to crash.

16 February, 2008 13:19  

Post a Comment

<< Home