Author Topic: Ena Riket!  (Read 1323 times)

Offline Pastpsycho

  • Level 3
  • *
  • Posts: 7
  • Reputation: +0/-0
    • View Profile
Ena Riket!
« on: February 29, 2008, 05:23:59 AM »
Im working on a BG (in swedish) thats got the Project Name Ena riket.
Wich could be translated "Unite the Kingdom" in english...
It will hopefully be up and running in a couple of months...

My gameplan is:  Three small kingdoms, as it once where in sweden. And alot of tribes or alliances that will fight for the Crown of each of thouse 3 small kingdoms, and when one Alliance gain all 3 crowns it will declare them as winners...

My Idea is to make it more or less like Tribalwars (http://www.tribalwars.net), Travian...
But I have some issues that I feel is quite hard to accomplish by myself...


How should I do to get Buildings/Units levelup !?!


My Idea is:
Code: [Select]
CREATE TABLE ena_buildings (
  id_building int(50) NOT NULL auto_increment,
  building_name varchar(50) NOT NULL default '',
  building_level int(50) NOT NULL default '0',

  build_cost_gold int(15) NOT NULL default '0',
  build_cost_wood int(10) NOT NULL default '0',
  build_cost_stone int(10) NOT NULL default '0',
  build_cost_food int(10) NOT NULL default '0',
  build_cost_iron int(10) NOT NULL default '0',

  Build_needed_slaves int(10) NOT NULL default '0',

  PRIMARY KEY  (number)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;


And:

Code: [Select]
INSERT INTO (building_name, building_level, build_cost_gold, build_cost_wood, build_cost_stone, build_cost_food, build_cost_iron, build_needed_slaves)
('l?nghus', 0, 0,     100,     0,    0,    0,    0),
('l?nghus', 1, 0,     150,    50,    0,   50,    2),
('l?nghus', 2, 0,     200,    75,    5,   75,    2),
('l?nghus', 3, 0,     300,   100,   25,  100,    3),
('l?nghus', 4, 0,     400,   150,  100,  150,    4),
('l?nghus', 5, 100,  1000,   300,  300,  300,    8),


But How should I prevent people to skip, lvl. 1 and build lv.3 directly!?!
« Last Edit: February 29, 2008, 07:13:36 AM by Pastpsycho »

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Ena Riket!
« Reply #1 on: February 29, 2008, 07:30:00 AM »
Instead of creating the separate levels as you have done do not think of it as you have 6 different buildings (ie: house level 1, house level 2, ... house level 6) You just have a house building.

Now, figure out a mathematical progression for each house 'level.' You will notice when you get to your testing phases that a mathematical progression works MUCH better for balancing issues than does an arbitrary system such as the one you have created. I advise that if your building provides some sort of numerical benefit, that this number scale parallel with the cost or you'll find that your players will soon discover the most 'cost effective' unit/structure and build that one to the exclusion of all others (which is just not fun). Say, if you do a simple doubling at each level you might have something like:

House
-Adds to population
Population Increase: 2 * level
Gold Required: 10 * level
Wood Required: 25 * level
Stone Required: 5 * level

Thus, a house at each level would have:
House (level 1) +2 10g, 25w, 5s
House (level 2) +4 20g, 50w, 10s
House (level 3) +8 40g, 100w, 20s
House (level 4) +16 80g, 200w, 40s
House (level 5) +32 160g, 400w, 80s
House (level 6) +64 320g, 800w, 160s
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Pastpsycho

  • Level 3
  • *
  • Posts: 7
  • Reputation: +0/-0
    • View Profile
Re: Ena Riket!
« Reply #2 on: February 29, 2008, 03:58:23 PM »
Thanks, that obviously right!!!
That seem to be the right way to build it..

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Ena Riket!
« Reply #3 on: March 04, 2008, 07:57:26 AM »
Glad that I could be of assistance :)
Idiocy - Never underestimate the power of stupid people in large groups.


Offline Pastpsycho

  • Level 3
  • *
  • Posts: 7
  • Reputation: +0/-0
    • View Profile
Re: Ena Riket!
« Reply #4 on: March 05, 2008, 05:59:43 AM »
I will repost in a while when I encounter the next problem...

Offline Pastpsycho

  • Level 3
  • *
  • Posts: 7
  • Reputation: +0/-0
    • View Profile
Re: Ena Riket!
« Reply #5 on: March 27, 2008, 02:38:42 PM »
HOWS IT GOING!!!!
This is what I have managed to create up today.

A brand new loginsystem with some securityissues (i know it would be much faster to google to find one but its seems a bit lazy to do so)...
Anyways these are the files I have done so far:

dbvars.inc
register_funcs.inc
register.php
confirm.php
login_funcs.inc
login.php
forgoten_password.php
email_pass_funcs.inc
changeemail.php
changepass.php
edit_userinfo.php
admin.php

Offline Pastpsycho

  • Level 3
  • *
  • Posts: 7
  • Reputation: +0/-0
    • View Profile
Re: Ena Riket!
« Reply #6 on: March 28, 2008, 05:40:29 AM »
Now Im stuck once again...  -_-
Oh mighty phpprogrammers hear my prayers...

I have checked out the tutorials on bg programming that refered to in another thread (http://community.bbgamezone.net/index.php/topic,533.0.html) and read them a couple of times, but since I want my game to be timebased and not by Tickets/Turns....
I havnt got a clue on how to do this, can anybody help me out with a simple "tutorial"...

Offline JGadrow

  • Level 35
  • **
  • Posts: 1,133
  • Reputation: +23/-2
    • View Profile
Re: Ena Riket!
« Reply #7 on: March 28, 2008, 10:42:35 AM »
Ok, you're using a database for your data. So, you create the illusion of real-time processing.

Say Player A builds building X and building X completes in 10 minutes of real-time.
so you would insert a new record into some sort of construction queue table. The critical component is the timestamp detailing when construction completes.

Anytime something may possibly depend upon that building being constructed accesses the database, have it first construct anything that has finished.

Something like:
Select * from queue_table where completeTime < now();

should give you all the records that need to be constructed. Process those though your construction method and THEN move on to whatever task needs to be performed. In this manner, everything is constructed in a 'just in time' fashion which means you have no performance overhead until it's absolutely necessary.
Idiocy - Never underestimate the power of stupid people in large groups.


 


SimplePortal 2.3.3 © 2008-2010, SimplePortal