Page 1 of 1

Population[title WIP!]

Posted: Thu Jan 10, 2013 4:19 am
by Ark
Hi everyone, i've decided to make my entry with a pbbg! I've always found pbbg's to be special and really fun, and i've always had the desire to make one and that lead me to halls tutorials and this awesome commnity.

So enough of that.

A. Working name of Game

Population (may change in future).

B. Technology behind the game.

- Node.js: with other node packages such as socket.io, mongo-lite and momentJs

- ImpactJS html5 engine: I find it way easier drawing things on the canvas element, instead of using lots of divs and nesting imgs or text inside of them and impact is just simply amazing.

- MongoDB: As my database

- PHP: will use very little though, for now it's just for the login/authentification stuff.

C: Story

Coming soon!

D: Some features

- A full browser multiplayer game.
- Dyamic interface with no refreshing the page.
- RTS like game with lots of action.
- lots of resources from apples to gold which you can exchange with your allies and some are necessary for building powerful units!
- real time combat system which can be crucial on decisive battles. You could be fighting a huge battle against your enemies and calling you allies for reinforcement can change history.
- momentum: is a bonus value that will make your armies stronger, and you can only increase it by winning battles and crushing enemies, but you can lose it by losing a battle.
- Alliances: you can team up with 2, 10 or more allies to take over the lone and weak ones.
- fog of war. Working hard on this, but hopefully, will be implemented.

Some features may change and some may be added!

If any great feature or idea just came to your mind right now, go ahead and feel free to comment it. The game is made from scratch and there're lots of things that could be added.

Working on a playable alpha so stay tuned!

Re: Population[title WIP!]

Posted: Thu Jan 10, 2013 5:23 pm
by Torax
Sounds like a great layout. Good luck

Re: Population[title WIP!]

Posted: Thu Jan 10, 2013 6:52 pm
by Ark
Thanks! i'll work hard on this game.

Re: Population[title WIP!]

Posted: Fri Jan 11, 2013 1:40 pm
by janiksxxl
Could be interesting. Wish You to succeed.

Re: Population[title WIP!]

Posted: Fri Jan 11, 2013 2:46 pm
by hallsofvallhalla
Good luck!

Re: Population[title WIP!]

Posted: Mon Jan 14, 2013 6:31 pm
by Ringmaster
Nice to see Node JS and Mongo on your list.
Good Luck

Re: Population[title WIP!]

Posted: Mon Jan 21, 2013 2:06 am
by Callan S.
How's progress on the game going?

Re: Population[title WIP!]

Posted: Tue Jan 22, 2013 6:14 pm
by Ark
Hi community, I haven't updated this post but the game is progressing. Thanks ringmaster those technologies are great ^^. Thanks callan for the reminder, here's the progress so far!

Devlog 1

So far so good, managed to get things from paper to the browser

Image

already got to manage to center your city to the camera and understand mongodb.

Mongo it's pretty easy. This is a pretty simple registration and authentification code.

Code: Select all

if($_POST['intro'] == 'register') {
            $user = mysql_real_escape_string($_POST['username']);
            $pass = mysql_real_escape_string($_POST['password']);
            $pass2 = mysql_real_escape_string($_POST['password2']);

            $m = new Mongo();
            $db = $m->population;
            $playerInfoColl = $db->playerinfo;

            if($playerInfoColl->findOne( array(
                    "name" => $user
                ))) {
                die('The name is already taken');
            }

            if($pass != $pass2) {
                die('passwords doesn\'t match');
            }

            $document = array(
                    "name" => $user,
                    "password" => $pass
                );
            $playerInfoColl->insert($document);

            $randPosX = mt_rand(0, 1200);
            $randPosY = mt_rand(0, 1200);
            $cityName = $user . '\'s city';
            require_once 'functions.php';
            $entityId = randId(8);
            $document = array(
                    'cityName' => $cityName,
                    'cityOwner' => $user,
                    'cityPos' => array(
                            'x' => $randPosX,
                            'y' => $randPosY
                        ),
                    'cityGold' => 500,
                    'entityId' => $entityId,
                    'capital' => true,
                    'entity' => 'EntityCity'
                );
            $citiesColl = $db->cities;
            $citiesColl->insert($document);

            echo '<script type=\'text/javascript\'> alert(\'register complete\') </script>';
            // go to game.php ?
        }
        else {
            $user = mysql_real_escape_string($_POST['username']);
            $pass = mysql_real_escape_string($_POST['password']);

            $m = new Mongo();
            $db = $m->population;
            $playerInfoColl = $db->playerinfo;

            if($playerInfoColl->findOne( array(
                    "name" => $user,
                    "password" => $pass
                ))) {
                session_start();
                $_SESSION['player'] = $user;
                echo 'login success';
                header("Refresh: 2; url='game.php'");
            }
            else {
                echo 'login failed';
            }
        }
    }
 
Mongodb simplicity makes it great, instead of tables they're collections. And you don't need to create a database beforehand, the database will only be created if you store data in it.

Also for the example above you need php_mongo extension installed on your php (A special thanks to Elvar for showing me mongo and helping me installing).

Would write more but i'm in a hurry, more progress will come!

Bye and thanks for reading.

Re: Population[title WIP!]

Posted: Tue Jan 22, 2013 8:52 pm
by hallsofvallhalla
great update.

Re: Population[title WIP!]

Posted: Sat Feb 02, 2013 5:54 am
by Jackolantern
Glad to see some nice updates, and I like that you posted some images of your work :)