PBBG Basics
August 19, 2008 – 8:00 amIn this article, I will explain the basics of how PBBGs work.
One basic, essential component of games are forms. HTML forms. They provide a simple-to-use interface for the user to interact with the game. Forms allow the player to register, login, buy units, allocate resources, etc. by sending information from the player to the server. Interaction can also be done with links (sending data through URL parameters), AJAX, and more, but forms are probably the most common.
Forms are used to add or make changes to the player, whatever they control, and maybe global game variables. These changes are the backbone of the gameplay, and provide the user with control/choice, and gives the server some information to work with.
There are two common ways that this information is used. One way is that the player submits forms, and that submitted information changes certain variables. They might also be able to submit commands, which will be performed on the next tick. That’s right, I’m talking about tick-based games. Ticks occur in time intervals, and on each tick, the server takes all the new data (that the player changed) and calculates the result for everybody all in one go. The tick will also execute the commands submitted by the player (eg. build a house). In this way, changes to the entire game world happen on the tick, while individual changes to player data happen when the players submit forms.
Another way is that the information is used immediately, and a result is shown to the user. These are generally real-time games. For example, a user selects which units they want to send to attack another player, and submit the form. The server takes that information, processes it, and displays the result to the player on the next page without any delay.
This poses a problem. In tick-based games, the ’speed’ of the game and of the players is limited by the ticks. Players can only do so much in one tick that they need to wait until the next tick before they have resources available again. This keeps the game at a steady pace, and allows slower players a chance to keep up with the others. However, in a real-time game, players can keep playing without any limits. To restrict players, many games use ‘turns’. Every action in the game takes up a number of turns, and when their turns are used up, they need to wait until they have more turns. (Turns are usually given/recharged in time intervals, similar to ticks.)
Another way to limit the speed of the game is to put a cost on certain actions, and introduce currency/resources. If particular actions use up resources, and resources are not infinite, then those actions are also limited.

9 Responses to “PBBG Basics”
Nice article!
I think the integral part of PBBG games is missing though; and in my opinion that’s player interaction. The simplistic style in terms of technology and presentation compared to client games allow PBBGs to very easily become a MMOPBBG (what a terrible acronym) and this is a main reasons why PBBGs are fun.
Now the question is are we implying MMO when we say PBBG?
Keep up the good work!
Sebastian
By Sebastian on Aug 19, 2008
Very nice, I’ve been interested in these articles and I’m looking forward to more. I’m pretty new to the whole idea of a PBBG game so this site is pretty helpful.
By Matt on Aug 23, 2008
Nice website! I’m interested in a tick-based game - any ideas on how to implement it in SQL?
By Anon on Sep 3, 2008
more specifically, how do we store the work queues in DB?
By Anon on Sep 3, 2008
Great post. Just loved it.
Not to mention this is a great blog.
Keep it up!
By Richand on Sep 12, 2008
Hi,
I didn’t find any other way of contacting you, so I decided to leave a comment.
I have started a project to make an up to date list of browser games with some additional features. The idea behind the system is that, instead of submitting your game to various websites, you just put an XML on your server with all the details. This way, websites can fetch the latest information from your game.
I’m trying to convince game developers and site owners to implement our system. If a lot of games support the information API, more game websites will use the provided data.
This data is available for other websites aswell, like GalaxyNews.de, BG24, etc. I am trying to convince these site owners to use our system, so that instead of contacting 57 sites to update my game, I just have to change my XML.
But that’s not it. We have added support for ranking data, server data and straight OpenID login. This way, OpenID providers can make a “one click login” button to make your players join even faster.
Please take a look at our site:
http://www.browser-games-hub.org/
Adding your game only takes a few minutes. The more games we have, the more websites will use the API.
Ps.: Feel free to contact me for more questions and feel free to write an article about this new system
By Thijs on Sep 20, 2008
Hi
Great blog, good post.
Looking at developing a tick based game soon so you’ve provided some valuable information.
I’m certainly looking forward to future posts.
By Free PBBG on Sep 23, 2008
Greetings, I like the blog and was interested in any more technical entries that might be added later. In particular I am tackling the subject on how to help stop cheating in browser games. In my game I have been working on how to keep item generation from leading to infinite items. I’ll keep an eye on this and see if you have any posts later on.
By Eudaemon on Oct 14, 2008
Recently been working on a new game and I do like the concept of a refilling energy bar, and each action costing X energy. Only in the testing stages but it’s working out quite nicely and is giving a nice real-time unrestricted feel.
By ShavenLunatic on Oct 29, 2008