Archive for the ‘Projects’ Category

Dragon MVC

Saturday, October 31st, 2009

I think the motivation factor is to lessen the scope of the project, so that I can get it done and write the documentation and unit tests for the project. If the scope is limited to just the controllers, database API, and view abstraction, then I can probably get something out in about 3 weeks time instead of trying to do many things at once.

I’m going to aim at keeping the components as separated as possible with some connections between the different parts. The view component is going to be the easiest and quickest to complete since it is just going to use PHP templates. I might finish the documentation for the Views first and complete the unit tests as well, so that the project gets off on a good start.

One component that I’m also going to to include is the plugin API. This will tie in to certain parts of the controllers, views, and DB API. I believe most of the real documentation will go into the database API and how to use that. The controller will also need comprehensive documentation, but just not as much as the database API.

I’m going to give myself a month and a half to complete the project with basically an hour a day on the weekdays and 2 to 4 hours on the weekend. I’m going to focus first on the unit tests and try to get as much of the API designed in unit tests as possible. Everything will have phpdoc inline documentation and have all main documentable elements explained. This will carry on to the DocBook documentation, which will try to explain in human terms how to use the library with examples.

Motivation

By giving myself sprints, I should put out a plan and be working on the project a little bit every day. By giving myself a little to complete and knowing exactly when I’m done, I can actually see the light at the end of the tunnel. By giving myself a deadline of a month and a half, I set forth a goal which I plan on completing.

The plan is to have the project functional before the month and a half, but most likely the majority of the planned features for the DB API will not be finished. The DB component will be the biggest part of the MVC and more time will have to be spent completing it. The foundation of the DB API should be fairly quick to complete and will allow for testing.

Previous Attempt

The previous attempt, I believe, failed because I was attempting to code it to replace WordPress without realizing that the API just isn’t going to be able to do that. After I realized that, I had already written the foundation and realized to get it to where it needed to be, I’ll have to rewrite it. I can still take some of the best parts of that API and apply it to the new API.

Instead, by starting over anyway, this attempt will have the design where I want it from the beginning. I think I’m still going to take some of the best parts of the WordPress DB feature set, including HyperDB code base. I’ve been experimenting with different implementations of what is currently in the code, so it is simple to replace the functionality and still allow it to be extensible.

Database API

The Database API is going to be Active Record and take what I’ve learn from CodeIgniter, ORM, Datamapper, CRUD, BREAD, and various other implementations of DB APIs I’ve done in the past. I’m going to try to correct the mistakes of other implementations and code the DB API to the best of my ability. This will not mean I won’t make mistakes on my own. This will be mostly a learning experience and I’m going to try new things in an attempt to simplify the code and how the code is extended.

My hope is to code the project in such a way to allow for experimenting, but also allow for “correcting” shitty code architecture that will creep in with such experimenting. Not all trials will work out the way they should and the API needs to be flexible enough to accommodate that. The other parts of the code base will not be developed in this fashion and the code will not use “experimental” code.

Possibly Related Posts:


Why I Contributed to WordPress

Thursday, October 29th, 2009

I thought it was interesting when someone made the argument that if plugin authors wanted money, then the developers who contributed the most to the core of what makes WordPress should receive money as well. Well, this might become a reality when and if the WordPress Foundation is ever created. From examples of other Open Source Foundations, usually what happens is that funds are directed to those who contribute in hopes that they will continue to contribute or get new people to contribute full time.

Until the WordPress Foundation is created, if it will ever be and there aren’t any suggestions that it will (that I know of, this is hypothetical), then I don’t think I would even take money even if it was offered. I didn’t jump into the development of WordPress core and fix bugs, because I thought I could make money from it. I seen a problem and decided to fix it, because it would benefit me, that fact that it also benefited other people was a bonus. The most important factor was that it would benefit me. If any of the work I’ve done seemed selfless, then you don’t know me well enough to realize that it was purely selfish reasons.

Not selfish in the way that I desired fame, fortune, or gratitude. Truthfully, I could still care less about that and I think those who seek those things will be sorely disappointed when they find that it doesn’t work that way. I don’t believe it should, but contributors have different motivations. People who work on core are not well known. Well, this is a generalization, I suppose that people know who Dion Helse is and several of the other people.

I suppose the problem is that while I’m not particularly well known, I’m not obscure either. Lorelle has mentioned my name at a few WordCamps (in relation to writing documentation). I have a feeling that many people were wondering about my name, “Who is that?” What I find interesting is that I can go to any given WordCamp and only a few people will know my name. Most know me, not from my work on the core, but for other reasons.

I think that is funny, I set out to create change and I only changed anything by attempting it myself and even that wasn’t my original goal. Whether or not I changed anything else is debatable. Working on a project can be enjoyable, but expecting fame or money just isn’t going to happen, unless you put yourself out there doing other things. By the end of next year, hardly anyone is going to know my name.

I suppose that is the cycle, except for the more veteran members.

Possibly Related Posts:


DragonU DB Component

Sunday, July 19th, 2009

The concept is fairly simple and helps me develop the component a great deal quicker than originally planned. I had originally planned to have a master DB object that handled all of the major features through a fluent interface. The point now, is that I want to do that, yes, but I want to simplify the code even more.

The problem before was that the scope was too great for me to develop and because it was massive, I had problem testing and seeing where the end was. I have difficulty programming like that. The way I like to problem is by building something that I can understand in my head. If I can’t understand how it all works, then I become depressed, because it is a great deal harder to see where you are out, if where you are going is off in the distance and over the horizon.

The solution now is to create the DB component in smaller chunks. In this way, I can improve the chucks over time and add new features by adding new chucks. There will of course, be problems with this solution, in that it will require refactoring in the future that may break backwards compatibility. I think of course, that to do so, will mean to increment the version. So everyone that uses version 1.x.x will always have compatibility with those versions. When new features are added, nothing will be removed that will break older versions.

Well, right now, version 1 hasn’t been released, so I feel as if I can do whatever I want. Just that I hope to get version 1 out the door sometime in a month or two, but most likely it will probably be sometime early next year.

DragonU DB Connection

The DB Connection object will have several parts and may rely on a config later on. The point is that when the config is added, it won’t require any work to be done to this object it will just rest on top of the DB components, so instead of building the DB connection objects manually as you will have to do when it is finished, you will have a configuration file that you can create the connections and manage them through that.

The purpose of this object is to store the PDO or PDO wrapper for MySQLi and MySQL extensions. The PDO Wrapper object will be developed later, however, the point is to allow PDO, since the API is standard and allows for many DBMS access through it. The PDO wrapper object will be an extra “feature” to allow for other extensions to work with the DB functionality.

After the PDO object or PDO wrapper Object is stored and connected, it will store that connection for the reminder of execution. So you can only have one connection per DB Connection object. If you need more than you need to create multiple DB Connection objects. However, the main library code will only use one DB Connection object for processing.

The code for this will be extremely simple. The connection can be created by either passing a PDO or PDO Wrapper object (it has its own method), passing a DSN string which will be used to create either a PDO (if the extension exists for the DB type) or PDO Wrapper object, or Resource or DB object for the ones that are supported. When the DB connection has been completed, the only other process is to pass the PDO object to the code base that will use it.

DragonU DB Connection Cluster

This works like the DragonU DB Connection object, but instead of passing the PDO object, it will instead pass itself which will in turn iterate certain calls to all DB connections. It will cycle through SELECT queries for each DB connection object in a dumb load balancing fashion.

The purpose of this container feature, is to use multiple connections for selecting and to keep all of the connections synced by passing queries to each of the connections. It makes more sense to use the DBMS cluster feature for most DBMS, but for some reason the feature in MySQL just plain sucks. Until they get it fixed, it will make a bit more sense to use this sort of emulation for the clustering, unless you have a lot of DB servers.

I could probably extend the feature set in the future, but I don’t want to get too far into what the DBMS does better. It is just a simple solution to what some DBMS makes more difficult and asinine than it needs to be. This is all it should be.

DragonU DB Main Component

This is the object that will manage take the DB Connection or DB Connection Cluster object and what other developers will work off of. It will be more of a factory than do any work and will be set up to allow for fluent interface usage. By keeping the main class stupid, it should be simple to add new features to it by what amounts to just “opening the door” to the feature.

DragonU DB Scheme Component

I’m still not exactly sure how I’m going to implement this. I think the simplest way is to create a loader which handles the inclusion of the scheme and passes the functionality, however, I’m thinking of another way to do it. Perhaps the simplest way, is to have the CRUD scheme to where it builds based on the SQL for the DBMS and methods. There can also be an abstract class which handles the non-SQL specific code and the Scheme will just need to implement the code to handle the create, retrieve, update, and delete methods. The problem with this, is that it will require modification whenever new methods are added and not all DBMS has the same SQL.

I believe, that by assigning Schemes to CRUD, BREAD, etc that it will simplify the DB SQL for majority of people and work on all of the DBMS that there is a Scheme class. The developers who want to take advantage of the specific SQL features of the DBMS will still be able to use the Scheme component to allow for that as well.

The point is to focus on the API for developers to use and not on the Database specifics. That should be up to the developer of the library to design and setup for the user of said library. So be a bit more clear, the user of the API should never interact with this layer at all and only the layer either directly above the DB or however many layers separates the user of the library from the DB.

Another key feature will be the way to extend the Scheme dynamically. The point of this is to keep from creating a new class to add functionality, but add functionality through external callable that will be managed externally through a plugin specific to the Scheme functionality.

DragonU DB CRUD Component

The most basics of DB access is the CRUD pattern. I’m going to include it for the simple purpose of easing the usage of the DB component. If the developer wants to develop their code using CRUD, then this will allow them to do so. I’m most interested in seeing how many developers use what pattern. The problem of which is that I’d need to have many people actually use the DB component to get statistics.

The CRUD component will include more than just create(), retrieve(), update(), and delete(). The experiment is to see how people use the fluent interface, so there will be extra methods.

  • The table() method to specify which table to use.
  • A where() method to chain the where for updating and deletion.
  • A select() method for chaining or selecting what to retrieve.
  • A limit() method to limit retrieval, updating, and deleting.

There will be other methods, which the scheme class will have to support, but shouldn’t extend to the full SQL language. The bits that are needed are to restrict what is retrieved, what is deleted, and what is updated. Extending it further than that is a waste of time to develop for CRUD.

DragonU DB BREAD Component

BREAD is works exactly like CRUD, except you have different and more methods to work off of. The methods are browse(), retrieve(), edit(), add(), and delete(). There difference from CRUD is that the retrieve is both for one or many, whereas the browse() in BREAD is for many and the retrieve in BREAD is for one and only one. The BREAD edit() works exactly like update() in CRUD. The BREAD add() works exactly like create() in CRUD. The delete() methods are the same for both CRUD and BREAD.

The advantage of BREAD over CRUD is in the retrieval. I suppose is arguable whether two methods is better than one. It will be up to the developer to decide whether to use CRUD or BREAD. As it is mainly up to their preference for either one.

Other Patterns

Other patterns will be added as well over time. That is the nice part of the component. I’m not really tied into implementing it in one way or refactoring to allow for more patterns to be added. It is just faster to focus on a few things to get the initial functionality working and usable in projects, instead of having to wait until the majority of it is finished before using the library.

Other Functionality

The functionality covered in this post is just a small part of what most DB component packages offer, so yes, as the DragonU library is developed, more features will be added. It is just better to work off a base that allows it to be done easily and doesn’t require that it all be done at the same time.

Possibly Related Posts:


Working On My WordPress Plugins

Tuesday, June 16th, 2009

I’ve been working on several of my old WordPress plugins for the past couple of days. I’m also developing a new plugin. Well, I have plans to develop two or three more, but I’m going to focus on just the one and the old ones for now.

  1. Alternative Mailer

    I developed this plugin to work with Swift Mailer and replace the old (at the time) PHPMailer class. However, it sort of just feel to the wayside and I haven’t worked on it for a long, long time. I’m going to go back and add in TLS and SSL support as well as attempt to automatically pull out the attachments and put them in Swift Mailer. This will probably be a couple of days before I complete it.

  2. Auto Scheduler

    This will auto queue posts after a certain number that is set by the administrator and, or editor roles. After I do this, I might work on a stack, where the first post is moved up the schedule and the recent post is moved to the front. I think the FIFO is what most people will want. I’m planning on adding it to my web site and I’m thinking of adding another feature to where it doesn’t block certain categories or tags.

    This plugin should only take about a day (4 hours) to complete. There are only going to be about three or four options. First option will be to enable the plugin (by setting the number per hour, per day, or per week. The next will be the amount of time to offset the posts schedule. So basically, if you have a number per hour, the offset will be for the next three posts within the next hour. So if you set the offset for 10 minutes, then the next 3 posts will be on the hour, 10 minutes after the hour, 20 minutes after the hour and if another comes in, then it will be the next hour on the hour.

    So on and so on. If the limit is 3 per week, and there are 12 written in that week, then posts 4-6 on week 2, posts 7-9 on week 3, 10-12 on week 4. If the offset is 2 days, then one will be on Sunday, the next on Tuesday, and the final one on Thursday. I’m going to also base the weekly on the start of the week. So if the start of the week is Monday, then it will be Monday, Wednesday, Friday.

Possibly Related Posts:


Hurray! I’m Back!

Tuesday, May 19th, 2009

My traffic has basically decreased to about 0, but I’m planning on writing some more for Planet PHP, so that might pull in some traffic. Also, www.santosj.name is redirecting to jacobsantos.com (no www).

My Goals

  1. Design my own theme based off of the WP Framework theme.

    Well, I have been wanting to design my own theme for pictures and what not for a while now, the default theme is well, not all that great since everyone is used to it. I want more space for pictures. I want to have a lower area for widgets that will be on every page. I want to design a few plugins so that I can add description and keywords to every page.

    Also, I want to display excerpts instead of the full content. I’ll be using the excerpts functionality more instead, but it grows tiresome to have to scroll as much as people do.

  2. Bring Absidongames.com and Dragonu.net Back Up

    These sites hardly get any traffic at all, but I’m going to be working on Dragonu.net soon and I’ll be using AbsidonGames.com as I develop the game engine and PBBG. The goal is not so much to work on these sites, but to get them to where they no longer suck to look at, so that means rewriting some of the content and creating templates for the sites.

  3. Backups

    One problem I’ve always had, was that I never did any backups of any server I was on. Now, luckily I never had a problem where I lost everything. I had all of the files on my system anyway, except for the database scheme, which I regret, because while I have all of my old sites, I’d have to rebuild the scheme from the code and I’m not looking forward to that.

    Therefore, sometime this week, I’m going to be backing up certain files (repositories mostly and configuration files) and databases. I’m debating whether I’ll want to backup the configuration files, I think I am, since why not, it is just one extra line anyway. As well as the cron jobs. I could rewrite them, but I tend to forget things over time and it is handy to have old configuration files around to look at what I did and how it worked.

  4. WordPress PHP Extension

    I’m on Linux now, so I have easier access to strace to see where I screwed up or where the screw ups are. The goal is to get back into development sometime after the development on Battle Machines stabilizes. It takes a while to get the game engine foundation built, before the project(s) really take off, so it is slightly difficult to work on projects, because of the appearance of nothing being done.

    Which, awesomely, the PHP extension is already started and the foundation is already built, I just need to tweak and develop based on what is already there. I still want to benchmark the benefits of the extension verses PHP userland WordPress library.

    I think what is holding me back is that I want to develop for the next generation of code. It’d be interesting to build a new API and then just have backwards compatibility. The problem with this, is that such an API is better written in userland first to develop the design defects out.

  5. Battle Machines

    I guess you could already say I have started development on it. Kind of. The problem is that I’m using the Yii Framework. Which I’m not familiar with, so it is slower development, and also I’m more of a visual kind of person, so I like to see what is happening while I do it and well, I need to do a bit more work before that happens.

    I’m not exactly happy with the directory structure, but I’m going to wait until I have a working application with Yii Framework before I jump into the code and see about working on ways to work around the directory structure. I hope to develop Battle Machines as an experiment with it and then take what I learn from it and apply it to the game engine development. Well, actually, I’m probably going to continue development using the Battle Machines code base, until which time I find a better way to develop the game engine code base using Yii Framework.

  6. Subversion

    I still need to write the post-commit scripts and test them. I also need to setup the cron jobs to upgrade WordPress, as well as the plugins.

Possibly Related Posts:


Working on Quantum Game Library and moving CorePress to QGL

Thursday, February 19th, 2009

I’m really, really anxious to get the browser game sites up and running again. It has been too long and I’m starting to worry that the other developers that have been building it will come and break my legs. I haven’t been a really good host for the past 3 months and I need to change that. Well, I’m going to start with Battle Machines and work my way down the line.

I’m not going to concern myself with building the game engine at this moment and just focus on the getting the games up and running. I will try to base the game code off of each other. So when I start the next project after Battle Machines, I’m going to use as much code as possible from Battle Machines to start the next project. I’m going to continue this and hopefully, by the time I’m done, I’ll have a semi-working game engine. Finally, after the games are back up, I’m going to go back and work off of that code to build a foundation for which to rewrite the finished games and add in features I’ve hadn’t had time to develop.

The focus will also be open source and the Quantum Game Library. I envision that I’ll be rewriting a lot of the code and refactoring. The code I’ll be rewriting, I’m going to place in the QGL for later. It will be one of the ways I’m going to be enforcing reuse between the projects. Getting the game source code out there under AGPLv3 should be a way to enforce changes being sent back to the main project and getting the code out there in other people’s hands. I just want the source to be as professional as possible before I do that.

I’m currently doing some cleaning up of the code. The manual is going to be using another engine, so either PhD or some other easy one. I think PhD works great and is very easy to install on both Windows and Linux. So I’m focusing on that and then I’ll have to revamp the test case system. I’m going to switch over to using PHPUnit and working phpUnderControl software support in there. This should make the process very easy and will hopefully be automated through CruiseControl. Should be interesting.

I’m going to try to get it to where the tests are written in a way that tell me how many components are finished and at what level. Right now the components are that are ready to be moved from CorePress to QGL don’t have enough test cases written for them. I need to drill that down, but I’m more than likely going to focus on the DB component and get that working and then focus on the old code and updating the test cases for them.

Ohloh is going to suck at the moment, because it will have a very large dip of code, but I think that is good at the moment, it will improve the statistics. I think I should have a lot of the old code converted over the weekend.

The components that are completed need to have the amount of test cases and quality of test cases improved. I’m also going to focus on that, but it is easy to lose track of the finish line when you have inline documentation, manual documentation, test cases, and refactoring and component writing. The goal is to focus on the core and DB and current old code to get them ready, so if the library had to be used tomorrow, it would be ready.

I removed the AI code, because really, the code there wasn’t fully functional. I’m going to revisit it, but the graphing really needs to be addressed better to enable the path finding algorithms to be better. I’ll most definitely revisit the AI parts of the library to seriously improve the level of it. It is a lot of work really, so it will have to be after everything else is done.

After the old code is refactored, unit tests rewritten, and manual and inline documentation improved and updated, then I’m going to focus on some other components I had planned for CorePress. The focus is to keep QGL license as New-BSD as much as possible. Therefore, the focus has shifted from providing an alternative companion from WordPress, to redeveloping the concepts that are in WordPress and applying them to the library in a way that doesn’t suck. I like the way WordPress does some code, but other parts of the WordPress library are somewhat awful.

That said, only the components that are needed to fulfill the current projects are going to be worked on. This means the Plugin component, the template, news, and commenting. Categories, tags, etc won’t be addressed until later. I’m not attempting to recreate a blogging platform, just need some posts and commenting. Also a templating system that is actually quite cool.

That said, not everything will be done over the weekend or even next weekend. It is going to take several weeks to finish everything and get everything where it needs to be. I want to start off with a project done right and not have to go back and complete such details. I want to be able to tell people, “Look at QGL, that is how the game and the game engine should be done.” I hope that by providing a good, clean example, others that I develop with will follow suit. Either that, or I won’t have to field so many questions when other developers start working with QGL.

Also, I’m not much of a writer when the topic is really boring like when writing technical manuals. It is akin to someone scratching their nails on a blackboard over and over again.

Possibly Related Posts:


CorePress: The Experiment

Monday, January 19th, 2009

The truth is, I don’t like the direction that BackPress is going. I think it suffers or is going to suffer from the Blob anti-pattern that a lot of object-oriented WordPress plugins follow. Whether that will ultimately be the case, it is sort of already seen with the Taxonomy BackPress implementation.

The point is, I want to set an example of how it should be done, if the person writing the example had about 10 more years writing objects and coding using object-oriented patterns. I’m just winging it people! I’ll fail, it is a given. I do wish to prove what a rough of what it should look like. That said, the developers behind BackPress and bbPress are far more experienced than I am. It is a wonder however why the objects aren’t better designed. Take the Roles and Capabilities class API, it is well done. The purpose of the objects are well defined and abstracted.

I think the point is of differing opinions and practices of what objects should encompass. I believe that objects should serve a single purpose and everything outside of its scope should be in its own class. You can take this too far and create too many objects which while they are well abstracted would probably better serve as functions.

That can be another problem. On one hand, if you create a God object, then all the user has to do is use that one object, but it also can’t be used for anything else. It can only be used for its one purpose and you can’t easily take out the installer portions and use them for other projects. On the other hand, if you create too many objects, you have an unwarranted complexity and without documentation, no one knows how to combine the classes to create a concrete application.

I tend to implement on the latter than the former, whether for better or worse. I’m not yet into UML, so my coding tends to involve a lot of refactoring. Therefore, I’m going to try to release version 1.0 as quickly as possible, that way the API is locked and only bug fixes will be applied. In that way, I can see what problems arose with the design of the classes and understand where I went wrong for the version 2.0 refactor release. When I release version 2.0, I’m not going to worry about backwards compatibility, so that I can get rid of the problem areas that do quite suck.

The principles of the development of CorePress is as follows:

  1. Test-Driven Development.

    The API is not going to be released (as final), unless every component has at least 90% code coverage. In this way, many of the known use cases will be covered and edge cases and unknown use cases can easily be covered on top of the current code coverage. It should provide a great deal of additional stability and that is important for a library that no one is going to use except me.

    Also, test-driven development techniques will be used to help design the library to be as easy as possible. I think it is better to find problems with the design before most of the class code is written.

  2. Documentation and Developer Manual.

    Documentation is important for a library, because if the developer doesn’t know how to use your library, then they most likely won’t bother to use it. All of the code is going to have inline documentation describing the purpose. There will also be a Developer Manual with sections for each of the components, detailing the use cases and examples of how to use the components. I think with both of the two documentation, the API and manual will go a long way to help those that choose to use the library, when it is ready to be used.

  3. Licensing

    Well, part of the problem is that either WordPress does the job too well for me to rewrite it or I’m not skilled enough to write it well enough anyway. Therefore, I am going to be using parts of the WordPress library that will be clearly documented as such and licensed under the GPL. This won’t stop most of the library from being New-BSD licensed. The important API parts will be New-BSD and hopefully, I can write the security layers to protect the API from hackers without digging my paws into the WordPress code. If I need to, those sections will be independent from the CorePress library.

I plan on releasing 0.1 version at the end of February, so whatever components are complete at that point will be released, with the exception that the DB, Plugin, and HTTP components must be completed. If those components aren’t complete at that time, then I’ll have to push the date back. I believe that I’ll have those three components done before the end of this month, so I’m not so much worried about it, but completed also includes documentation and I haven’t started the developers manual yet.

Oh yeah, I’m going to base the Developers Manual off of the docblocks in the code, so I’ll just improve on the current inline documentation and add examples and better explanations in some cases.

Possibly Related Posts:


CorePress Repository on Google Code

Wednesday, January 14th, 2009

The New-BSD WordPress Library I’m writing is now on Google Code, and I have a name for it, called CorePress. The name is tentative, because it matches too closely with the other -Presses, I want a new name for it, but that will probably come later. Right now the code name for it is CorePress. If I get enough completed to where I can release 0.5 version, then I’ll think about changing the name again.

I’ve been working pretty much about four hours a day on the library, unit tests, and documentation. I think the good news is that if I do the inline documentation correctly, then I can output the phpdoc docblocks in DocBook format and then edit the XML from there. The goal is to provide a detailed guide on how to use the library. I suppose I can also use the unit tests as examples as well, depending on how involved the examples are. I’ll also need to write a working plugin and theme for the developer guide on how to use the library.

I don’t suppose I’ll be finished for another month or two. The DB portions are coming along nicely. However, they are hardly complete. That said, I don’t suppose I’ll have everything working in version 0.1. There will be a lot of missing pieces and a lot of patch work as I find what the best way to design the library is. I envision rewriting sections that were poorly thought out. I think it would be good. Something that couldn’t be done with the official library shouldn’t really hinder me with the development of the library. The reason is that, for one, the library is alpha, so nothing is tied down as of yet, and two, not that many people use it, well at this point, no one uses it, so I don’t have to worry about an user base getting upset about API changes.

I have plans for each alpha version leading up to the stable release. This isn’t an exact milestone per say and subject to change. I think I’m going to continue develop as much as possible until the end of this month. I may not release 0.1 (I will tag it when I get to that point), but not create a release. Creating a release to me is providing a PHP 5.2 version. The more classes and code I write the longer it will take for each release to backport the library to PHP 5.2.x. It will be good practice at this the end of this month to do so.

It is actually a lot of fun, because I get to play with PHP 5.3, which is still in alpha. I also get to do a lot of experimental classes and put together a fluid interface pattern library. I also get to look at the adapter pattern some more. I’m going to explore the controller pattern in the library, because there are already so many libraries which do that already.

Possibly Related Posts:


Writing WordPress New-BSD Library

Sunday, January 11th, 2009

I think after all of the complaining about how WordPress is GPL and all themes and plugins that use the WordPress library is GPL, I think a solution would be to write a library that everyone can use GPL free. The library will have a clause, which will say that all commercial entities using the library will be required to pay me a sum of money in order to use the library in their projects. So actually, it will be dual-licensed, or tri-licensed.

The first license will of course be the New BSD license, which basically gives everyone the right to use the Library with almost no exceptions for anything. That license will be for those using the project for free projects or for commercial projects that won’t be distributed. The second license will be for distributed commercial projects, like premium themes and plugins that wish to have an End User Agreement prohibiting the user from redistributing the theme or plugin. The third will be LGPLv2 and up, if WordPress ever wanted to use the library and distribute it, but I doubt that possibility. However, it could apply to any GPLv2 or GPLv3 project.

I think part of the issue is that library is under the same license as the application WordPress. Therefore all code that links to it, has to also be compatible to GPL. This means that it doesn’t restrict the user that isn’t in the GPL. The clause to restrict Commercial entities shouldn’t really apply since their license will not be GPL anyway. The licenses that work with GPL, namely the New-BSD and LGPL can be used without restriction. So if the project was GPL, then it would have to use one of the two, and it couldn’t be the one with the commercial clause. It also means that the user will be able to take full advantage of the GPL, which means redistribution and selling it. If a commercial project wants to protects their rights, they’ll use the library, or write their own.

Regardless, I think there are a lot of code in WordPress, which is done right and is almost impossible to reproduce without copying the code. Personally, I’m not going to rewrite the entire WordPress library. I’m just going to focus on the parts that Plugins and Themes use the most. I’m also going to focus on other components to experiment on how they could be improved for optimization.

Oh yeah, I’m also writing the library to where it will be fully unit tested, where applicable and with documentation. The progress is pretty slow with that, but it is worth it. It allows me to see in real time how far I need to go and how much I’ve accomplished.

The project is new, and right the repository is local to my machine. I’m going to put it up on the Google Code, when I get to the point where it can be reasonably be used in applications. Oh yeah, I’m writing the library for PHP 5.3, I’m going to backport it to PHP 5.2.x, but it won’t be available on PHP4. Right now, there aren’t any hosts that are using PHP5.3, because it hasn’t been released. I want to see what it would look like using the top of the line PHP code.

I’m going to be posting more about the library. Well, I suppose I should have a disclaimer, I might not complete the library depending on what happens. It is going to be a lot of work, so I might not have the motivation to complete it. However, I’m going to spend as much time as I can get to it where it needs to be. At that point either someone else can take it on or I can work with some one on it.

Possibly Related Posts:


Mecha Asylum Design Document

Tuesday, December 30th, 2008

The current game is a little convoluted and broken, which means it is unplayable until I rewrite it. I’m going to focus on a minimal feature set for the next version to get the game playable and improve the quality of the features. By keeping a small feature set, I can know ahead what features I should complete and how long each feature will take. Also I’ll know when I’m finished with the project.

This time I’m not going to open the game until I’m completely finished and the game works after testing and acceptance test cases are completed. In order to improve the quality, a lot more testing is going to be done for this game and all of the games I make in the future. It will take longer, but focusing on improving the quality before players bring it up should improve the reputation of the games.

Story

The main setting and story line will change. The game will take place on an alien planet, the soldiers from different fractions crash landed and need to rebuild their fleet to get home. The other fractions aren’t going to make it easy for the others. The players will need to regroup, rebuild, and fight off the enemy to escape the planet and head back home.

Focus Points

The focus points will be territory, soldiers, research, and buildings. These will be tied together and balanced, so that the meek aren’t completely overrun by the strong. There will also be time limits and the success condition will happen over several months.

I want the game to last long enough to where new players that joined late can learn the game, group with people and appreciate the game long enough to where when the next game comes along they can just jump in and start as soon as possible. They might not win, but they’ll have the opportunity soon. I also don’t want the game to be over soon enough to where none of the players had enough time to accomplish the objectives and enjoy the game.

Territory

Research items used to escape the planet will appear at different locations. Only when the fraction has captured the research item can the item eventually be used to escape. This will mean that a grid based system will need to be used in order to coordinate where the research items and what land the fractions hold.

LandThe Grid structure of the game will limit the amount of land the players will be able to fight over and hopefully should limit the amount of players are in the game. I believe I’m going to have a main grid that covers the planet, sort of like latitude and longitude. Then sub grid coordinates with those and so on. The containers will be big enough to hold the player and a number of buildings.

This will mean that one piece of land is actually an square acre or larger depending on the amount of buildings I finally allow. Actually, I think I’m going to do it in sq. miles and sq. kilometers.

This should allow for quick access to where players are currently and I won’t actually have to populate the entire planet with coordinates. By calculating the distance, I can figure out how long it will take for one player to attack another. At the most, since the database table could grow to be very large, or at least the coordinate table with many rows. It won’t take that much space since the most the table will have is numeric values with one of those pointing to the player which holds that piece of territory.

There will also be mining to harvest precious materials in order to pay for mecha suits, buildings, and research. The amount of mines will only be preset for the initial land of each player. Captured land will be randomly generated and will remain until the game cycle is complete.

When the land is destroyed only the buildings on that land will be destroyed or captured.

Soldiers

The mecha suits from the previous game will be used in this game as well. The mecha suits will gain attributes that will be able to be extended, so that balancing can happen quickly. Since there are only going to be five mecha types, the base attributes might be hard coded with the modifiers held in the database.

The mecha suits will be built from buildings, and require men that will also grow depending on the amount of food, research, and housing. Housing is another type of building that can be constructed.

The different suits have different capabilities that allow for different maneuvering, strengths and weaknesses. Some of the land types will not be able to bring down the flying types, no land to air missiles. The strength and weakness ratio will be dealt with the Rock-Paper-Scissors usage. This will improve the balance and prevent one player from building one type to rule all. That said, there is still one type that is all powerful, but will be extremely expensive.

The attributes will be about four or five to start out, but I can envision that future versions having more. The difficulty is that the more attributes the harder it is to balance the game. I don’t think more than 10 will ever be used, but that will decide upon later and depending on the game play.

There will also be a mechanical device that will spy, thief, and capture land/buildings. This device, called a probe, will not have any attack capabilities, but will have other purpose during the game to help find the main research items.

Research

Research will be very important and I will build a tree much like the grid idea. The Research will have dependencies, amount of time to complete, and materials. I’ll create the tree after the component is completed and think of what will go into the tree after it is complete.

The feature seems to be easy to create, but it will be difficult and time consuming thinking of all of the research items.

Buildings

There will be different types of buildings for different purposes. The list below has them all:

  1. Housing

    Used for the amount of men will be available. Housing will be needed and when these are destroyed, then the available mecha suits can not be used beyond the amount of men available. Will also double as food suppliers, because there won’t be a food building type.

  2. Mecha Manufacturing

    Builds the mecha suits. I’m undecided, if one building will build one mecha suit, or if the building can be queued to build all suits for one type at at time. I’m going with the former, but the latter will allow for greater flexibility.

  3. Research

    These types of buildings will be required for research, there will be different research buildings. There will also be one main building for improving the research speed and level.

There will not be much macro-managing with the buildings, so besides the research buildings, there won’t be many buildings to develop items.

New Player Protection

The game will employ “New Player Protection” to keep stronger players from attacking new players. This will be based on the strength of the player and as long as the player doesn’t attack anyone else. This should allow for new players to grow and learn the game without being harassed by other stronger players.

When the player has graduated from this status, there will be ranges for attacking. This is only in the event that the game reaches enough players that each range has enough players within it. I’m going to try to develop the ranges to where it is dynamic and allows for recalculating the ranges based on growth and the amount of players.

Game Cycles

The game cycles will continue until all of the research items are collected and a single fraction has collected all of the pieces needed. The research items will not exist all at the start of the game. I want to allow the game to continue for at least two or three months before all of the needed items are available.

There will be more than one research item available of the most basic items, which will be available at the start of the game. Other ones will become increasingly rare as the game goes on. The first couple of cycles will probably require that the research items be “dropped” near the territories of the players, so that they can be found within the five or six month hard limit, where the game will automatically recycle whether or not anyone “won.”

Collecting all of the research items is the win condition and required of the players to track the components down. This will force players to try to collect as much territory as possible.

Possible Modules

Modules are game components, which can hopefully be used on other games. If developed correctly, these modules below can be used in future and past projects. They will be developed separated and updated on all of the games, since they aren’t tied to any single game code.

The games will be developed around modular components to reuse as much code as possible. Each game will have separate components that won’t or can’t be used elsewhere, but as much code as possible will be transferred to the Quantum Game Library as possible.

There will be the code that will exist in QGL and the plugin code for the game engine that will use the QGL code. The code that isn’t dependent on a database will be committed to QGL and the code that does rely on the database will not be part of the QGL.

  1. Territory Grid
  2. New Player Protection
  3. Research Tree

Possibly Related Posts: