Devana how a browser game is made


beta 1

Beta one is here and it brings the following list of features for you to read.

Transactions now also operate on controllers instead of only specific model methods.
Blacklisting of IPs and emails is now possible.
Users can now blacklist other users and thus not receive messages from them anymore.
I've implemented refunds (as a percentage of the initial cost and all of the required items) when destroying modules, units or components.
A new module (building) type has been added. It increases resource storage values.
Modules now have an "outputResource" attribute that tells the game what resource they will produce, instead of the old method of having a "module" attribute associated with each resource. This allows resources to be produced from different modules.
Modules now have one of the following attributes: "technologies", "components", "units". This allows technologies, components and units to be produced at different modules.
Alliances have been implemented. Users will be able to attack each other only if they are part of an alliance and at war with the alliance of the user they plan to attack. Peace is the default state. After declaring war, both involved parties must agree to a peace proposal to revert back to the peace state.
The combat system is up and running.
Units now have classes which allow them to deal more/less damage to other classes.
Nodes (towns) can be conquered after winning a battle and defeating all defending units.
Various bug fixes.

Here are some screenshots.

combat code alliance






And here are the files: devana-v2_beta-1.
You can also get them from here.
Also, try the live demo.

The next milestone will bring the much talked about addon system (yup, earlier) and resource trading.
I'm bringing addons earlier because I really don't like how the game sends out messages from the core right now. It would seem much more natural as an addon.

See you soon. :)

Filed under: devana 112 Comments

status update

The game is still in the works.
A few things had to be addressed; that's what's been causing the delay of beta 1.

Some code refactoring has been done to further improve the integrity of each database transaction.
A new system has been put in place to ban ips and emails.
Message bans will also be implemented to disable communication with certain users.
When destroying modules, units or components you get their requirements refunded as well as a percentage of the resource cost. This will allow for advanced recycling options within the game.
Some bugs regarding upkeep and storage have been fixed.

Also, the combat system will be tied to the alliance system so that two players cannot attack each other unless they are part of an alliance with which you are at war.
Pacts will be made between alliances so that players in your alliance cannot attack the players in an alliance with whom you are at peace.
A war pact will mean that you can attack any player from that alliance but you cannot trade with them.

More to come soon.

Filed under: devana 29 Comments

alpha 3

Alpha 3 is here along with the following:
- combat simulator;
- improved node view for all 3 factions;
The combat simulator features the full combat function that will be used in the final combat system.
The system features the option to target specific units in the enemy army based on the 3 main attributes. The damage done is proportionally distributed based on the chosen focus. A unit group will receive an X percentage of the total damage, based on the same X percentage that their <focus> attribute has contributed to the total.
Here's an example. If 5 spearmen contribute 47% of the total hp, and the enemy chose "hp" as the focus, then the 5 spearmen will receive 47% of the total damage.

Here are the files: devana2_alpha3

Here's the Devana video trailer:

And here are a few screenshots:

build node_0 node_1 node_2 simulator

Filed under: devana 109 Comments

alpha 2

A little bit late, but with much more content, alpha 2 is here.
So, what's new?

You can now research technologies, craft components and train units.
In game messaging system has been implemented.
The game can now send account activation and password reset emails via the use of PHPMailer.
The "sitter" option has returned. This allows you to login to a friend's account, that has set you as a sitter, and manage his stuff while he's away.
Various bug fixes and code tweaks.
Game resource costs reduced while production and storage values have been increased to allow for a more fast paced experience.

Here is the archive with the sources: devana2_alpha2

And here are a few screenshots.

craft train research messaging



Filed under: devana 42 Comments

image feature enhancement

I've done this web application as a research project for school.
The code uses the new HTML 5 canvas to manipulate image pixels via JavaScript.
Click on "load" then on "filter" to find the high contrast areas in the image and to enhance their visibility.
The "threshold" number is the contrast limit for which the areas are enhanced.
The "enhance ratio" shows by how much the brightness of those areas is increased. Setting this to 1 will disable the enhancement.
The "apply mean" option allows you to replace the active pixel with a mean value of it's high contrast neighbors before the actual enhancement is done.

A new Devana update should be available within 2 weeks.

Filed under: misc 3 Comments

alpha 1

Four score and a very long time ago Devana 2 was only an idea. Now it's becoming reality.

Devana 2 is an open source browser based strategy game developed from the ground up (without any third party code) using OOP (Object Oriented Programming) code in the MVC (Model View Controller) paradigm.
Development has been an on-going process for a long time, with work happening now and then.
Recently, however, things have been getting done on the project.

So, Devana 2 alpha 1. It's here!
Things done so far include:
- basic foundation code (user registration & login; admin panel);
- new game variables to easily turn on/off the main game features (research, build, craft, train, trade);
- new map view icons;
- a working economy (creating buildings and generating resources);
- "devanapedia", a place to view all game assets and their attributes;

Things planned for the next alpha release include:
- complete the coding for queue based features (technology research, component crafting, unit training);
- PM (Private Messaging) system;

There should also be an update regarding the upcoming indiegogo funding campaign.
Development will continue regardless of the outcome of the funding campaign.

Here's the Devana 2 alpha 1 code: devana2_alpha-1
Read the "readMe.txt" file for installation instructions.
Read the "license.txt" and "imageCredits.txt" files for copyright information.
Visit the new facebook page.
Test the game here.
user: test
password: test

And have a happy new year! :)

Also, here are a few screenshots:

devanapedia townView moduleView map emptySlot

Filed under: devana 39 Comments


Happy Holidays, everyone!
Things are coming along nicely. Still slow though.
I've contacted the guys over at to ask if I can use some of their images in Devana 2 and they were ok with it, being open source and all.

So, without any further delay, here are the units for Devana 2.


The last 6 units are mercenary units, so they'll only require gold to be trained. The other units will require resources and items, just like in the previous version of the game.

Filed under: devana 11 Comments

yearly status update

So, it's been over a year. No updates. That sucks.
Work on the game has been done, but it's been an "on/off" situation. Life happens.

Any good news?
As I said, work has been done and I'm close to having a working alpha version of the game with a functional  economy. The goal is to be able to create an account, a town and then start building stuff and have resources flow in.
Many other things have changed, mostly regarding the overall coding philosophy.
When that will be done, an indiegogo funding campaign will be started to complete the game.

The way in which I function is like this: plan things to be ready before a deadline; do nothing until close to the deadline; panic; do all the work.
That being said, I'll do my best to have another update before Christmas.

Filed under: devana 15 Comments


I found this open source game 0 AD and I am seriously thinking of using the buildings and units from it for Devana 2.
I will be using it's map editor to take screenshots of the buildings and units on top of the same tile, from the same angle. Then crop the images and put them in the game.
Problem solved.

I contacted the developers of 0 AD on their forums and not only did they give a prompt answer, they also agreed to me using content from their game as long as I credit their work. The full conversation I had with them is here.
Today I'll be doing the graphic content generation using the map editor from 0 AD. I'll post some of the images here so that you'll have an idea as to what to expect in the game. :)

And here are some of the images I've gathered.

Filed under: devana 99 Comments


I've changed the MySQL storage engine from MyISAM to InnoDB so I can use transactions to provide atomicity to the game's actions. In conjunction with the serializable isolation level they allow me to control concurrent actions performed on the database.

Nodes (towns) can now be created and moved periodically (there is a cool-down timer). The movement feature can be turned on/off according to the game's gameplay conventions. For the default medieval setting of the game this feature will be turned off.
A simple admin panel has been added to allow admin editing of the game's flag variables. They allow core features like login and register to be turned on/off.

And here are the files so far:
Note that the files now come with a license so read that before reading the code.

More work is to be done soon (the following weeks) as I have now got my college degree; I am now officially a computer software engineer. :)

Filed under: devana 34 Comments