Been working on the guilds page for my game and thus far had no problem.
But now I got stuck on the researches script.
What I do have is a donation page ,where guild members can donate an x amount of gold and another page called researches where guild members with a high rank can research different upgrades from which all members will benefit.
The thing is that the researches will have different prices and everytime you do a research,the next level will have its price higher and so on...
I couldnt think of a good way of doing it,so I made 2 tables inside the database :
Code: Select all
researches:
id tinyint(2)
name varchar(30)
description varchar(255)
cost int(9)
level tinyint(2)
image varchar(100)
researched:
pid int(6) (pid=the id of the guild that made this research)
name varchar(30)
description varchar(255)
cost int(9)
level tinyint(2)
image varchar(100) So what I thought of,is to show all researches on a page(that werent researched before)(for instance if I have 2 upgrades..attack and defense,and did attack before,now it will show attack lvl 2 and defense lvl 1) and add a RESEARCH button for all upgrades and when clicked, it would insert the current upgrade inside the "researched" table,and change the lvl and price of the next upgrade of the same type.
In essence I could do most of this stuff but I really dont got a starting point for the price & level change of the upgrades.
I noticed that in most browser based rts games they used a varbinary database type for the price/construction time/level of the current building and so on.
Eg:for price it would be something like this(20-40-60-80-100-120-140-160-180-200)..and then proly use an array to get the values.
But how could I make an interaction between the research's price and lvl?
Any hints regarding this ideea or any other research system would be greatly appreciated.
Alexander,