Creating an items table
Today I tried to do a little work on my game but I got stuck on a table which I have been pondering about for a little while now but today it stopped me so I need to address it.
In the game I am working on, players will have items, and will be able to use these items on themselves or others. And these items must be able to have an equation that manipulates the users and the effected players stats. This equation should be able to manipulate multiple stats of each player. I will eventually want to add splash damage but let's start out easy.
So, you have the user who we will call player 1 (p1) and the player that is going to be effected by this item; let's call them player 2 (p2).
Based on this idea I have been able to think of two solutions, one which I ditched almost immediately . But I don't know if the general idea behind this one is any good. So take a look and let me know what you think.
Items table
- id - 1
- name - bardic's staff of unimaginable penetration
- equation - eq{target:10*(p1.str+p1.dex) / p2.def-50}
- target - 0 // 0 = enemy , 1 = allies, 2 = all
As you can see, I am storing the equation in a JSON like object and would simply do a search on the search and replace the bold variables with player 1's and player 2' actually stats. This method I think would allow me to easily keep the equation dynamic and clean.
Now lets look at something like area effects (splash damage, group shields) and how I would go about store such an equation in the table. This example has 3 equations in the equation object but only would be be used at most. I would either use target and others or all but I put all three is just for example.
- equation - eq{target:10*(p1.str+p1.dex) / p2.def-50, others:10*(p1.str+p1.dex) / p2.def-20, all: 10*(p1.str+p1.dex) / p2.def-20}
With this setup I can have multiple equations and multiple stats in either set up. I did have an option 2 which was to bust out all the stats into their own tables but the more I thought about it in comparison to this it just seemed clunky and overly complex for something that shouldn't be that crazy.
Now, to prove to myself that I could actually do this I wrote some a simple script to do such a thing. Right now the script is messier than it needs to be but I wrote it kinda quick just to prove that I can do that I'm talking about here. I will eventually clean it up when I have some time.
But the gist of the script is it hide's the p1.stats and replaces them with actual numbers. This would naturally all come from a database but for the example I just have everything there.
I'd like to apologize in advanced for the lack of formating. I've tried three different highlighters and they break things worse than how they appear here. So till I find a better... sorry >.<
$eq = 10*5 / p1.str + p1.dex / p1.chr;
replaceHoldersWithVals(createStatArr(getHolders($eq)),$eq);
function getHolders($str)
{
$statArr = array();
$pos = 0;
$i = 0;
$len = strlen($str);
while($i != strlen($str))
{
if(stripos($str,"p1",$pos))
{
$pos = stripos($str,"p1",$pos);
array_push($statArr,substr($str,$pos+3,3));
$pos += 6;
}else{
$i = $len;
}
}
return $statArr;
}
function createStatArr($statArr)
{
for($i = 0; $i < count($statArr);$i++)
{
switch($statArr[$i])
{
case "str":
{
$statArr[$i] = array("str"=>10);
break;
}
case "dex":
{
$statArr[$i] = array("dex"=>7);
break;
}
case "chr":
{
$statArr[$i] = array("chr"=>2);
break;
}
}
}
return $statArr;
}
function replaceHoldersWithVals($statArr, $str)
{
$pos = 0;
$len = strlen($str);
for($i = 0; $i < count($statArr);$i++)
{
$str = str_ireplace("p1.".key($statArr[$i]),$statArr[$i][key($statArr[$i])],$str);
}
eval("\$e = $str;");
echo $e;
}
Question : Alliance/Clan systems in PBBGs
Here's a thing I'm gonna try to go with. A weekly or twice a week question, where I present a question, two arguements and give a poll for people to vote on.
So the first question (and one I need the answer for so I can keep moving forward on my own game
) is :
So the question this time is : Do you think players in a position based strategy game should be forced onto teams or should they be allowed to form their now teams?[poll id="3"]
On the one hand, you have forcing players into groups. This forces players to work together as a team to defeat the other side, gives a clear enemy and can have some interesting internal player dynamics as they struggle for power in their groups. It also for the designer/coder gives a solid number of sides to build gameplay around and ensure game balance. But, it limits the freedom of the player, forcing them to work with people in game they may not want to and may stop them from being able to play with their friends.
An example of a game and uses this type of system is StarKingdoms. When you join the game you join a sector with about 20 other people who vote on their leader who has the job of ensure the sectors protection and growth by joining larger alliances and purchasing sector wide upgrades. Another game is FinalEarth which has been closed for ages, but forced players into Axis and Allies teams, allowing for smaller groups to be made with these large alliances. I found this to be my favorite style and the way I'm leaning to on my game but I want to run a few idea's by everyone.
The other side of the coin is allowing players to just join the game and form their own groups. This is a problem for me since I want the game play to be large scale battles and a constant back and forth that I'm not really sure I could achieve with hundreds of small groups.
One of the things that kinda differs in the strategy game compared to others, there is really a limited amount of space and instead of building massive empires you are levying for strategic positions.
But let's assume I picked the option to allow players to create their own groups. You join the game and play for a little while without being a message of a group. After a few days they join one and have all of a sudden need to follow the orders of a leader they may not agree with. You join another and another. You eventually find one but instead of focusing on the point of the game you are just are trying to find a group you can deal with. Or you just join and never join a group, which means you have never played the game in the way I'm intending it to be played.
Let me try to be not so negative and everything works out. The players find groups they like and battle like I intend. You instead of two or three groups, have 10's-100's of small groups battling for position. This could be pretty damn interesting and would make the game very difficult since positions would constantly change hands. It would actually make it almost impossible for one small group to do this I think. I would think that would eventually merge groups to achieve their ends.
And while this could be an interesting idea, I think after all this writing I'm even more strongly leaning towards two or three teams players are forced onto (maybe with the option to reserve a friend slot or two) and then an internal struggle for leadership as the group works towards their common goal no matter who is leading.
But, what do you think? Vote and comment and we'll debate this till we have a solid idea.
PS: It seems I've written about this in the past.... And polled! But I think this is a much better explanation and a good segway for me to get back into blogging by repeating everything I've ever done xD
My agrument for flash in PBBGs
I've been reading a lot lately about how flash is a dying language and how it's not going any where, etc etc. But this has nothing to do with that. This, instead, is a rant about why I think it makes sense to use Flash for PBBGs despite all the feedback I've received in the past saying I'm flat out wrong. So let's hope that I get just as much heat this time ^^
To start lets define PBBG. I believe I have done this is the past but I am far to lazy to look for it and I'm sure I have come a bit further since then anyways in my wondering of programming, web and PBBGs.
PBBG stands for Persistent Browser Based Game. By this definition, a PBBG requires a database for it's persistence and needs to be played using the browser. How does flash not fit within that definition? Flash is a browser plugin. This means it runs within the browser. A flash game differs from a PBBG that uses flash in the sense that a flash game is nothing more (usually) than a stateless game. You play, you quit, you come back and start at the beginning. A PBBG that uses flash is the same as any other PBBG. You join, play and when you come back, the rest of the world has been playing and you start where to left.
So, Flash can be squeezed into the definition. It runs in the browser.
The next thing I got a lot of heat over is that flash is just a bad way to do this type of thing because of reason 'a' or argument 'b'. Sure, it may be a bad way for some since they don't understand as3, but I don't see how JS is any better. Flash will behave the same across all browsers. I don't need to worry about writing my JS or CSS twice to make sure it works. The only thing I need to worry about is if you're on an iPhone or don't have flash installed. But most people have flash installed.
I'm not saying JS is a bad way either. Each have their advantages but flash is what I know best and there are things I can do in flash that I can't do in JS. Also, if you are looking for animation (which I'm not) flash is your ticket, but animation is a lame excuse since we are where talking mostly about next games.
I could defend flash all day, but in the end, I still view flash as a good thing for PBBGs. Please, please, don't take this to mean make you whole damn site in flash. That's not at all what I'm getting at. What I mean is you use flash sparingly and in the appropriate context. If you have a battlefield map, that's a good choice. You have a crazy interactive inventory or crafting section, there's a good spot. I would never suggest you use flash for the whole site.
As I've said in also every post this year (which hasn't been many. I'm sorry for slacking so much. I will try to be better but this is a claim I've made before), I'm gonna start posting again. I'm in the building stages of a game using Zend Framework and Flash. I also will be working hopefully on a few games that fall out of the realm of PBBG, but I will also be talking about those here. One of these games is actually for my day job to boot, so I'm hoping they will let me blog about it ^^
Study : Legends of Zork
Hey everyone,
This is a new thing I'm gonna try to do. Not quite a review since I suck at writing reviews ( I'm sorry @buildingbrowsergames - I am really bad at it. I tried to write a few that I never sent because they were bad). So instead I'm going to do something I think I can do a little better - Play a game, study it's elements, look at what was done well and what wasn't done so well.
So the first game up is a game I've been waiting a few months for and it has finally been released! Legends of Zork. As I'm sure you can guess the game is based loosely of the old Zork games. Yes, the ones where you type "North" to end north. Good times, eh? Anyways, this games is being result by Jolt and backed by EA so I had pretty high expectations. I don't know why I expected so much, but I did and I was rather disappointed. But I will explain myself through this study.
Since we need a place to start, we may as well pick the interface since that's the first thing you see. The UI for this game is pretty simple with a bar of 5 or so links across the top where when you click one you are brought to a page with more related links. This is pretty standard but works well expect in a few places but I will touch on this later. Next you have your character information on the left and despite the icons being slightly confusing, displays all the info you need for the game. And this is a flaw not because it displays everyone but all it really displays is your health, action points remain, gold and points to next level. And below that you have your friends list which is pretty useless. With no benefit to having friends or even an easy way to add them it just ends up being a quick link to your friends profile.
After the UI you have the action points (AP) system the game is based on. Wanna move somewhere? 1 point. Wanna attack something? 1 point. How many points do you get a day? 30. So you see , you have a pretty simple to use and easy to understand system that has worked for many games before. Currently there a few kinks in the system where if you are out adventuring and view your inventory (This is the UI problem I mentioned earlier is) there is no way other than the back button on the browser to go back to where you were. If you try to use the in game menus you can end up losing 3 or 4 action points. Now, whether this is intentional or not is yet to be seen but they have done something else right with the APs.
In game you can buy coconuts. With these coconuts you can buy APs. But the part they did right was that coconuts are just a few dollars. Low enough that I say "If I don't get a coffee today I can get extra turns in game". Too many games charge too much for these perks or make you pay the perks play the game properly. Not Zork.
Let's now take a look at the combat. Oh, the combat system. Such a corner stone for so many games. It seems though that the game play designers for Zork didn't consider this so. The combat here the weakest part of the game. You click explore area. You encounter an enemy. And a random number generator does the rest for you. It shows you a lot of meaningless numbers then whether you have won or loss, your loot, the the option to adventure again or head to your base. Yip-ee.
So what can be done to amend this oversight without changing the existing game too much? I think a good solution for this game since it's attempting to keep simple but would allow for those of us that more some more complexity would be to allow the user at the top of combat to assign 10 combat points to several fields. Fields such as aggression, defense, magic, wait for opening, etc etc. This would allow the players to study their enemies and figure out the best numbers for that enemy depending on their armor/level/class. You could also have a random button or even distribute for players that don't wish to do the combat this way.
So this concludes my first study. Any suggestions or aspects that I should investigate more please feel free to make them. Also, game suggestions for study's would be good. I"m just gonna go through all the games I currently play and do studies on them first so expect to see a TornCity and Renaissance Kingdoms study shortly.
An engine – Planning ahead
I have made it clear in the past that I' m interested in building a game engine and I've finally gotten this project underway with the aid of my co-workers. They will be helping me ensure the engine can be easily scalable and adoptable.
Now, this brings me to a few different crossroads. This engine will be written in AS3 and likely deployed using Flex. And thinking back to a debate we had about whether Flash based games could be called PBBGs, means I may more longer be in that realm for a while. If you ask me, what I hope to build won't likely be considered a PBBG but will be closer to an MMO.It also pushes on the game play elements I have written about in the past and may very well write about in the future. I've been hoping to move the focus of this blog more to the gameplay design part of things anyways, so this may not be a bad thing.
As for the state of the project, it is still in the early stages of planning. We (my workplace) have in the past built a multiplayer flash game using electroserver. We are trying to avoid all the mistakes we made while building that engine to to ensure that this one will be able to be easily adopted to fit our needs. And in the process of trying to ensure this is all well planned out, I have found a piece of software I would like to share with everyone. It's called StarUML. It is an open source UML platform thingy.... Pretty much you can use it to plan out your class, interfaces, inheritance, etc etc. And depending on the language you are working in, it can create all your classes for you (yes, there is an as3 thing for it).
So there's an update on where my latest aspirations are in building a game. I'm hoping in the next few months to complete this engine while I simultaneously work on the game play/store with another co-worker. Hopefully it will all work out and you will in the next few months see some progress on the game front from me.
Gameplay Types – Rounds, sandbox, story
A problem with many games that I have come across is the issue of replayability and length and this issue isn't limited to PBBGs but has been affecting PC and console games for the last few years. But since this is a blog primarily about PBBGs lets explore this aspect in relation to them.
Many games have a limited story due to the difficulty of constantly producing new content. Many games approach this many having 'rounds' (SK, NZ,), where after a few months or after a certain in game event happens, the round resets along with all the characters and everyone start new. Some games don't have a story and just provide a sandbox world where the players run the show (kind of like TC or RK). And then you have games that have a set story with quests and when you finish you're character restarts (like KoL) and you start the game quests again with a 'new' character, often with some new unlocked content.
So which way is the best way to your game? I really have no idea but lets look at the strengths and weaknesses of each type.
First up, round based. A round based game from my experience works best for strategy game. In a strategy game you have a set goal; Defeat your enemies before they defeat you. And because there is a set end and the fact that a strategy game can be enumerated on actions, you can make the game challenging by having players try to defeat each other can achieve high scores before the round ends. And with the knowledge of a set end, players know how long they have before they need to start attacking and defending. Through in factions, round persistent leaderboards and round carry overs, and you have a game that with minimal content changes/additions can continue to be fun for a player for several months. Offering round updates and slight changes each round and the chance for players to show off their achievements from past rounds will help retain players for a long time.
With this style of gameplay, you will likely need to split your development time between features and content. Keeping balance is important here, since you want your players to be able to play the game differently each round and see something different or new.
Next is the sandbox style game. If you are unsure what exactly I mean, think of simcity, or gta where your goal isn't really anything in game but to play and see what you can do. These games can be highly addictive (at least for me anyways) but without regular updates and in game events, they can stagnant quickly. This is because the game itself doesn't direct the players but the players direct each other. As you can see, this format can lead to a lot of player activity until most of the content has been viewed or played through. The more freedom and options provided to the player, often, the better this style of game is.
Let`s look at TornCity and Renaissance Kingdoms; both games have open ended play, the players control the game play, both have limited gameplay, but both still exist and gain new players due the high level of player interaction. This level of player interaction is often difficult to get right in strategy games and even more difficult in quest driven games. So, if you are planning a game that is a sandbox, keep in mind player interaction should be on the top of your list for features and future development.
And finally we have quests driven games. These games are probably the most difficult to keep players playing. This is mainly because everything is game and content driven. Without constant content development these games can quickly lose there appeal. Many games try to solve this by some form of 'ascending', meaning that your character and quests are somehow reset to the beginning and providing you with slightly different content or new avenues you can play. While this can be fun, there is limited playability due to the repetition of content and the lack of player interaction. Sure, many of these games have clans or factions, but much of the time the communication and new elements they add for the player isn't enough to make up for the lack of content.
So with a quest game, almost constant content development is a most. Feature development isn`t as important because the point of the game isn't what you can do, but playing the story.
What do you think? These are simply my opinions and views I have gathered through the last number of years playing web games and would be more than happy to debate or be corrected on any of them ^_^
And on a side note: I know itès be ages since my last post. So if anyone has any suggestions for posts or anything they would like to write about let me know. Fire off an email to bardic(dot)knowledge(at)gmail(dot)com or leave a comment.
I'm a horrible blogger…
Hey all,
Sorry I haven't posted anything new in a while... Like a month I think. I've been mad busy with work and I can actually show ya's: http://dsc.discovery.com/tv/project-earth/game/game.html
Please note I had no hand in the play game design. I'm just a coder on this one. But this has given me quite a bit of experience working with a multiplayer server and as3 coding, which (hopefully) will translate into me eventually creating a flash mmo of some sort.
Taking a quick look at all the pbbg's I've tried in the last month: no new development. I've seen people boosting unique game play, and I have been let down. All I'm finding are clones and a bunch of games where you click fight, you fight, then you level and actually buy new weapons/armor/etc then do it all again.
Sorry for anyone with a game like that, but that's not new or inventive.
On the bright side, I have found a blog that I'd liek to share. This guy posts far more often than me and has some interesting stuff.
http://buildingbrowsergames.com/
And I leave ya with a question. Do you think that PBBGs are stagnating? There's a few really good ones but the majority are clones and poorly done clones at that. We aren't seeing a huge number of new features being thought of/used. And I've seen little to no advancement in gameplay. I may wrong and if I am, someone please show me a game that can prove me wrong ( I know of a few in alpha/betas that aren't open yet that look really cool.. I'm look at you Cameon).
Thinking about why
Don't worry. I'm not gonna get all philosophical on ya's with why we exist, but why I and others, play web games. I have talked about this several times before on this blog, but I want to reapproach it again.
So I have been playing several games online and they are pretty good. Nothing spectacular, but they are enjoyable. Anyways, there flaws are starting to show, particularly in the multiplayer departments. THESE ARE MULITPLAYER GAMES! You think they would put a lot of effort into actually playing and communicating with others. But like most games, these ones drop the ball.
Now here is a game theory question for ya's. Do you 'force'/strongly encourage the player to perform an action, or do you wait until they decide?
Let me elaborate. If you are playing a strategy game online, why attack another player? You steal some resources. But then you are likely to be attacked in return. And you are surely losing resources for attacking/maintaining an army.
But what if you were to give the players a reason to attack the other players. Such as the only way for anyone to get military experience is to do so through attacking, and that experience is needed to develop new, better weapons.
There also needs to be more thought into the point of the game. Too many games I have played where your sole goal is to be the best player in the game, which pretty much equals "whoever spends the most time ingame wins" style gameplay.
Do I have any better idea's of the top of my head? Not relly, but an example would be give the players several different paths to play and allow them to try and reach the top in their now paths (Military, research, Political, etc). Make these paths balanced some how and make it advantageous for players of different paths to work together.
You're still striving to be the best, but it's just cut the gamae population in third and given you a chance to play the way you want to play and would hopefully be worked in such a way that just because you have no life and spend 12 hours a day playing the game doesn't mean you're going to be the best.
So, what are you guys think? Encourage/force cooperation, interaction, conflict, or just wait for the players to decide to do something
Framework for PBBGs? – DB Planning
Good day all.
I don't know if I mentioned it here, but I am looking into creating a framework for PBBGs using PHP. This is not only to help myself create games but to make it easier others to start to create their own games.
What the first problem you think of when you think of making a framework for games? For me it was databases. We all approach these differently, and will want different info to be stored. After a bit of thinking, the easiest way to do something like this would be to put objects of data into the database and have your code know the schema of the info.
Doing some searching it seems Google beat me to the punch with this idea.
http://en.wikipedia.org/wiki/BigTable
So this gives me the impression its plausible to do what I'm thinking, but is it really efficient? Can it be done is such as way so that each call isn't grabbing ALL the info related to a player. The goal would be to return a query then to deserialize it. And not to perform string manipulations on it during the query.
Let me give an example of the problem of having all of ones data in a single object.
You have 5 stats, experiences, weapons, armour, magic, a guild, quests, inventory, gold, friends, mail, an attack history...
I think you start to get the point. That's a large amount of info when you only want your players names and id. I can think of a number of problems for using a large scale solution like bigtable, but is there a way to keep a similar structure on a smaller scale?
To make descent framework for games, the DB needs to be incredibly flexible and this is the only thing that comes to mind when I try to think of a solution.
So for you all DB guru's out there, what are your thoughts? Can it be done? I will try to put more thought into it over the weekend.
Also, does anyone know of any good database stress testing tools?
Can Flash be used for PBBGs?
In short, I think the answer is yes and I will explain myself as I write this post.
This post is in response to a comment by jmucchiello on another post. He has suggested that I write this, and since I have been looking for topics, here it is.
Lets define what a PBBG is.
A persistent browser-based game, or PBBG, is a computer game that satisfies the following two criteria:
- It is browser-based. The game is played over the Internet using only a web browser.
- It is persistent. Progress in the game is achieved over multiple playing sessions.
PBBGs merge the depth and longevity of an application-based game with the accessibility and portability of a browser-based game. PBBG can be spoken as pee-bee for brevity.
And by extension should not involve being continuously connected to the host system