PHP, Zend Framework and Other Crazy Stuff
Archive for December, 2006
AJAX for Alien Assault Traders
Dec 20th
A quick referral to Panama Jack’s blog where he discusses implementing a new AATraders template for 0.30 of the popular PHP space strategy and trading game. The new template uses AJAX, well with HTML rather than XML, to offer some options to resize each section of the interface as a user pleases, while remembering these choices with small CSS snippets stored server side.
It’s stuff like this that gives AJAX a good name – it improves upon what already exists, in a manner separate from the previous templates so it’s entirely optional. I know my own Astrum Futura is AJAX heavy, but PJ proves you don’t need a massive amount of work to leverage some AJAX tweaks for useability.
More on http://panamajack.aatraders.com.
Pádraic’s Open Source Projects 2007
Dec 18th
2006 was the first year since University I have had some real quality time to commit to some projects. So I decided to put together a small list of projects I will contribute my time towards – such things take time of course. As of this month, I’ve settled on the main three.
1. Astrum Futura
2. Quantum Game Library
3. Devnetstore
This is not an exclusive list – I will continue my lesser roles in maintaining SimpleTest, and making infrequent contributions to those projects I regularly use like ADOdb-Lite. I also contribute to non-PHP projects, and that also will continue.
But the above three will be the ones which hold my attention most often and for longer.
Astrum Futura will be a PHP5 open source strategy game playable through a browser with an AJAX interface. I’ve talked it to death previously – so go dig up previous blog posts if curious. It is being built atop the Zend Framework – which incidentally just saw 0.60 released!
The Quantum Game Library is a collection of independent classes being added to by myself and Jacob Santos. Its aim is to be a reuseable library for future and current game projects we might undertake. All too often, PHP games have quite a few areas in common: mapping, authentication, application bridging, artifcial intelligence approximations, etc. which are redone in every project all the time. The QGL will offer a GPL licensed alternative to reinventing those wheels.
Devnetstore, which I will blog about in more detail in the new year, is an undertaking by members of the PHP Developers’ Network forums to create an open source ecommerce application. I had two motivations for joining. Firstly, I would really enjoy working with these people since we’ve been interacting on a forum and learning from each other for a long time (im my case well over two years). Secondly, the members have a common set of goals which make sense, are achievable, and which they want to see implemented using the current best practices the community advocates. Thirdly, I can’t develop just games all year. ![]()
Devnetwork forums have always had a focus on helping developers learn, and this project is no exception. It’s something anyone learning advanced PHP while contributing source will find an invaluable experience once it takes off. It’s not everyday you get to follow a best practice focused project from startup, through execution, to an initial release, with a medium sized team.
Between AF, the QGL and DNS I should have a pleasantly busy contributing period in store for me in 2007.
P.S. The list of links at the top of my blog have been updated to reflect these projects. ![]()
AF Planning Now Public
Dec 6th
I’m generally of the opinion that privacy in open source developer discussions is the root of a lot of evils. Without public scrutiny you discourage the formation of new ideas, you leave people blind to how development takes place, and rob them of the opportunity to offer what feedback they wish to.
Since the Astrum Futura project is now underway and we have secured a name, sourceforge listing and opened the public repository for source code, we have now recategorised nearly all our earlier private planning discussions into the public forum space.
http://forums.astrumfutura.com
You can find all previous discussions categorised by topic in the Specific Planning Forums section below Technical Support. For the curious, we are maintaining a few private forums mainly for internal use for purely private topics only the internal developers could possibly find useful. Anything of public value will wind up in the public so no worry there.
Behind the Scenes: Astrum Futura Development
Dec 4th
The first part of the title is a small dig at something we’re currently working on rectifying in the immediate future. Over the next day or two, the Astrum Futura forums will see a large expansion as the currently private planning forums are stripped of any clearly private material and made public. This should offer people in the future to post comments and suggestions based on past and current planning discussions.
A roundup of other stuff
.
Jan Gundlach, who has followed Quantum Star SE for a long time, has signed up as our German Translator, bringing the current team to four members. This will give the ability to poke and prod Jan’s mind on how to make AF more localisation friendly. We have been discussing on the AF International Forums, how to add regional support for languages, dates and numbers, and more deliberate input validation. The point made here shows regex can be difficult since it’s not obvious which PHP installations would have Unicode support compiled in.
Jacob Santos, has just committed some basic structure for the future Quantum Game Library (QGL) AI component. The immediately useful part of this will be the pathfinding algorithms. I gather I need to get some work finished on Hex map maths (coordinate position and distance calculations mainly) so a Heuristic can be measured. For those not in the know, a Heuristic is the cost of following a specific path in an attempt to reach a specific target. The simplest Heuristic is distance. The less distance to the target we’re attempting to find a path to, the less costly the currently selected path is, and the more weighting that path gains in the algorithm.
Hades meanwhile has posted an internal proposal titled "Player Retention". The subtitle is more descriptive… It’s a proposal to implement what we’re calling Player Banding. In very brief terms, a player who attempts to attack another player will face a Band penalty. If the defending players score (I’m summarising here, the score is not a simple points addup) is 25% of the attackers, than the attacker is penalised. The banding currently proposed reduces the penal cost as the band difference narrows. Attacking a 75% player would have no cost. The aim of the system is to prevent the problem of "Newbie Bashing", the practice where large powerful players continually show a preference for attacking smaller players who recently joined the game.
As for myself, I usually get stuck with some grunt work
. I did some developing over the weekend mainly to get Sessions shared properly between the Controller and View layers. Although passing Sessions from Controller to View is easy, it’s also highly repetitive, so a Zend_View subclass using Zend_Registry was added. Sessions are currently abstracted by the Zend_Session class. I have a few issues here since a lot of functionality is handled by Zend_Session_Core, which is mainly a list of static methods. I’ll need to subclass Zend_Session to avoid spreading Zend_Session_Core references too much which would make it difficult to replace the class use if required.
The early weekend also saw the svn commit of a Phing build process file. It’s a simple version that copies the current code to a source directory and creates gzip and zip archives to be distributed. Santos suggested we add a daily svn build for download, so this should do the trick nicely requiring only a simple shell script to navigate to a build directory, issue a "phing dist" command, and copy the distributables to the daily location.
Lastly, I’d like to note Ron Harwood (Blacknova Traders), myself and Santos had a discussion in the comments section of this blog. Ron raised the suggestion of using XUL to create an interface to the game. It’s an interesting idea I might persue in the future. The game as it stands in planning, is aimed at focusing on serving a data format like JSON or XML rather than HTML, making it easy to replace the frontend interface without any major consequences. Ideally the game only serves HTML for the initial template for any given section, making use of future requests to serve only data which the client uses to update the page using the Javascript DOM.
Absidon Support for Astrum Futura
Dec 1st
One of the things every open source project strives for is meeting the expectations of a group of people with similar needs, requirements and goals. When successful, a project can gain a lot of benefits from more hands committing code to the repository to the influx of new ideas and perspectives.
As announced on his blog, Jacob Santos, who leads a group of PHP game developers under the Absidon flag, has decided to add additional support to the Astrum Futura effort. He touches on a few of the core reasons for doing so.
The goal of Astrum Futura is grand, but will have a lot more developers in which to achieve that goal. Astrum Futura as a game won’t exactly be what I want in a few of my other games, but the backend and some elements of the front end will used in each of the projects. It doesn’t make sense to continuously create the same thing over and over again.
The goal of Astrum Futura as stated is to create a professional level PHP application. That it’s a game shouldn’t lose it any brownie points on that front
. Behind the AF front lies the areas Jacob mentions above.
AF makes use of the newly formed Quantum Game Library (QGL) project, an independent collection of classes focused on solving common gameplay problems in PHP. Santos has already undertaken to work towards a contribution to the library focusing on AI tasks such as Pathfinding, Fuzzy Logic and Neural Networks. He also has a future proposal to submit for a common Mod/Plugin component. The benefits of this library is its potential for reuse in future games, whether they be developed by the current AF team or the Absidon team. AF is also built on the Zend Framework, which offers a structural standard to code to (and another common point between game applications).
It doesn’t necessarily stop there though. AF is working on a few levels; implementing an AJAX interface, focusing on Javascript development, using a non-compiling system for translations, creating a kitted out build process using Phing, and a few others. It’s a highly structured environment to develop in and the response over the last month by the developers (including of course Santos) has been a few cuts above my usual experiences.
Jacob, continues his blog post with a quick summary of the Absidon projects. There’s quite a collection of game projects from the Absidon stable: Mecha Asylum, Battle Machines, Heat of the Race and Earth 3045. On a personal level I like Earth 3045, which is a planet based strategy and management style game. It’s geared towards an AJAX interface and will implement AI features. He also outlines the future AI and Mod proposals for the QGL (Quantum Game Library) AF utilises.
I’d like to thank Jacob for his contributions to the AF forum and the QGL source over the past few weeks. He’s taken the lead in a few areas and helped ramp up the project’s internal activity. That AF is a project whose design and focus on good practice is enabling other projects share in the open source benefits is rewarding for the whole development team.
You can catch Santos’ regular blog posts over on his personal blog – http://www.santosj.name
