Devana how a browser game is made


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 Leave a comment
Comments (39) Trackbacks (0)
  1. Hey, I’m happy to read something from you and your project :)

    I’ll take a look on your work, but I#m sure you made it very professional 😉

    Maybe I’ll code the PM-system today :)

    • Hope you like it.
      Also, I’m doing this all by myself for now. It’s more of a personal challenge to finish it without any third party code.

      • Okay, it’s your decision 😉

        But I have some questions respectively a few criticisms, dude:

        Why can I found as many town I want?

        Why can I choose the faction of every new town?

        Do you think it’s a good idea that every user can choose his/her coords of the town by himself/herself?

        I wanted to build the gold mine and an error has occurred, but in my townoverview it works?
        (on every building I want to build an error occured, but it will build ôÒ)

        What does the link “move” do? can i move the whole village?

        These were my first impressions of the gameplay.. now I start to have a look on your code :)

        • 1. This can be limited via game settings. Most of the game settings are located in the “core/game.php” file.
          2. This is a personal design choice. If you tie the faction to the user account, what do you do with conquered towns? Do they swap over to your faction? That’s not very practical.
          The idea here was to have everything tied to a town.
          3. Yup. Also, this can be limited by editing the town creation page.
          I’m a strong believer in having things as open and with as many options as possible because freedom fuels creativity.
          4. What error? Give the details and it’ll get fixed. This is actually the purpose of these releases, to get the bugs fixed and to improve the game via user feedback.
          5. Yup. You can move the node (town) every X hours. There is a cooldown associated with every town. This option can be turned off from the settings of course.
          It’s purpose was that of having different game types in the future. For example, instead of having a town, you can have a capital ship that can move around the map and create smaller fighter-type ships.
          Devana 2 is designed to be an engine for browser based strategy games.

  2. nice but I miss old village picture and attack option (

  3. It’s nice to hear that, thanks )

    PHP Version 5.3.3 PhpMyAdmin 3.4.1 MySQL-Client-Version: 5.0.77 = NULL ERRORS FOUND

  4. Nice job! I liked more the other map, that is only what i dont like in this version

  5. I remove workers from work and they disappear …

    • Yup, the setModule function in core.php wasn’t updating the values properly.
      Here is the new function code:

      public function setModule($slotId)
      global $db, $game;
      $db->query(‘start transaction’);
      $result=$db->query(‘select * from modules where node=”‘.$this->data[‘id’].'” and slot=”‘.$slotId.'”‘);
      if (isset($module[‘module’]))
      if ($module[‘module’]>-1)
      $result=$db->query(‘select * from resources where node=”‘.$this->data[‘id’].'” and id=”‘.$game[‘modules’][$this->data[‘faction’]][$module[‘module’]][‘input’].'”‘);
      if ($resource[‘value’]+$module[‘input’]>=$this->modules[$slotId][‘input’])
      if ($this->modules[$slotId][‘input’]< =$game['modules'][$this->data[‘faction’]][$module[‘module’]][‘maxInput’])
      $db->query(‘update resources set value=value+’.$module[‘input’].’-‘.$this->modules[$slotId][‘input’].’ where node=”‘.$this->data[‘id’].'” and id=”‘.$resource[‘id’].'”‘);
      if (!$db->affected_rows()) $ok=0;
      $db->query(‘update modules set input=”‘.$this->modules[$slotId][‘input’].'” where node=”‘.$this->data[‘id’].'” and slot=”‘.$slotId.'”‘);
      if (!$db->affected_rows()) $ok=0;
      if ($ok) $status=’done';
      else $status=’error';
      else $status=’maxInputExceeded';
      else $status=’notEnoughResources';
      else $status=’emptySlot';
      else $status=’noSlot';
      return $status;

  6. Move option doesn’t work.

  7. My Laboratory doesn’t work.

  8. Oh my god, so good.
    I’ll start testing every part I can find and return with feedback’s.

  9. Hello.~
    My English is no good.
    I’m visit first time .
    This Web game is very good. ^^
    During playing some error.

    1. Logout click ->Warning: Cannot modify header information – headers already sent by (output started at C:\APM_Setup\htdocs\devana\core\core.php:1) in C:\APM_Setup\htdocs\devana\logout.php on line 12

    2.only is english. How can UTF-8?

  10. 2.only is english. How can UTF-8?


  11. Some error.

    1. After Login
    -> Warning: Cannot modify header information – headers already sent by (output started at C:\APM_Setup\htdocs\devana\core\core.php:1) in C:\APM_Setup\htdocs\devana\login.php on line 38

    Warning: Cannot modify header information – headers already sent by (output started at C:\APM_Setup\htdocs\devana\core\core.php:1) in C:\APM_Setup\htdocs\devana\login.php on line 39

    Warning: Cannot modify header information – headers already sent by (output started at C:\APM_Setup\htdocs\devana\core\core.php:1) in C:\APM_Setup\htdocs\devana\login.php on line 41

    • It’s weird. I’m not getting any of those errors.
      It seems that only some of you are getting them.
      I’m coding & testing the game on the latest version of xampp (1.8) and everything is working perfectly.
      Try to update your version.
      Maybe you have some odd settings, I really cannot tell.

  12. Some modify in index.php

    [Line 41 in index.php]
    header(“Location: index.php”);

    echo “location.href=’index.php'”;

  13. Some modify in logout.php
    [Line 12 in index.php]
    header(“Location: index.php”);

    echo “location.href=’index.php’”;

  14. I’m found the BUG.
    First. Laboratory was constructed
    Second. Can not view the Laboratory.

    • There is no code for the laboratory view yet. Nor is there for any of the other buildings.
      There is only code for the resource producing buildings.
      The laboratory, barracks, … will be viewable on the next alpha release.

  15. Using xampp 1.7.4.
    All is working well, I think there are no problems so far.

    Its hard to figure how the whole map looks overall unless the grid.png is posted with coordinates.

  16. I found the BUG.
    During the construction,
    if click the Building, Construction is completed.

  17. Felicitari! 😀 Azi maine apare versiunea 3 😀

  18. Hey man,
    you did a pretty awesome job! I took your code and modefyed it a little bit. For example i used colorbox to display buildingsettings and options, that makes it a lot easier for users to navigate.

    I’m looking forward to see the next step/version.

    • Oh ya and i added a german translation. I know you want to do it all by your own, but if you want to use my translation, just let me know.

      • Translations would be great. More words/phrases will be added so translating it now just doesn’t make sense.
        I only know English and Romanian at a “good enough to write well” level, so German & other translations would be very appreciated once the game is done.

  19. HI devland.

    Cool to see that Devana is back in development. Really great! Already offered, but I too could help with the german translation.

    Could you turn up the gamespeed on the demo for a quicker testing ?

    And for the roadmap: Is the architecture built in a way that Devana 2.0 can easily be “templated” ?

    Kind regards

    • Yup, the game does support templates.
      If you download the code you’ll find the “templates” folder. There you’ll find the “default” folder which holds the default template.
      Adding others will allow users to pick the one they want from the account panel.

  20. In the alpha 2 version you add the ranking and Levels for users?

    • The game doesn’t use levels for anything. There is no “level up”.
      As for ranks, there will be statistics, lots of statistics, but towards the end of development.

  21. For when the next version?

Leave a comment

No trackbacks yet.