Hello,
Im looking at creating a standards complient, cross platform, browser based game for my final year project for uni... I've been looking at some online games a fair bit recently and am a bit unsure as to how some aspects of them work (im a bit of a Javascript novice!).
could anyone enlighten me, via pseudo code or just a brief description:
How do the buildings get upgraded in a basic game like Ikarium or Travian?
I assume the building levels are held in a database, against a specific city ID... once the upgrade process starts the cities resources are changed and a counter starts... once finished the level of the building changes, an update is performed on the database and new functions are enabled at that building based on its level... ?
i've researched javascript counters which are passed a date and time, down to the second.. the script then counts the Days, Hours, Minutes, Seconds until it reaches 0... the bit that confuses me is, how does the clients machine know, when completion is... would i be correct in saying the completion date is calculated in advance using something like previous levels build time * 1.2... stored in the database... requested... passed into the counter and the counter presented to the user?
the more i think about the whole process, especially 'battle reports' the more im starting to think i've bitten off more than i can chew.
thanks
Im looking at creating a standards complient, cross platform, browser based game for my final year project for uni... I've been looking at some online games a fair bit recently and am a bit unsure as to how some aspects of them work (im a bit of a Javascript novice!).
could anyone enlighten me, via pseudo code or just a brief description:
How do the buildings get upgraded in a basic game like Ikarium or Travian?
I assume the building levels are held in a database, against a specific city ID... once the upgrade process starts the cities resources are changed and a counter starts... once finished the level of the building changes, an update is performed on the database and new functions are enabled at that building based on its level... ?
i've researched javascript counters which are passed a date and time, down to the second.. the script then counts the Days, Hours, Minutes, Seconds until it reaches 0... the bit that confuses me is, how does the clients machine know, when completion is... would i be correct in saying the completion date is calculated in advance using something like previous levels build time * 1.2... stored in the database... requested... passed into the counter and the counter presented to the user?
the more i think about the whole process, especially 'battle reports' the more im starting to think i've bitten off more than i can chew.
thanks
