A Brief Discussion regarding the Technical Aspects of Game!

Everybody has feature ideas, come share yours!
Post Reply

Would you like to see more world-wide player statistics?

Sure
13
100%
Not Really
0
No votes
 
Total votes: 13

dannicker
Regular Poster
Posts: 2
Joined: Tue Sep 30, 2008 5:25 pm

A Brief Discussion regarding the Technical Aspects of Game!

Post by dannicker »

This thread was started in a shameless Game! promotion on the gentoo forums, but I deemed the Game! forum a more suitable resting place.
have you written any documentation on how the engine works?
No, I haven't written any documentation on how the engine works, it's actually pretty simple though.
Simple enough that apparently ...
(Wow, that ended up being a longer post than I expected.)
..you managed to accidentally write some. Here it is for Posterity.

SERVER/CLIENT COMMUNITCATIONS

There's very little passed around in the URL (which is intentional), basically there's always p (player id), z (zone id), and usually a (action), t is (as you guessed) to work around caching, it's set to the timestamp if it's unset, or incremented otherwise. I also set the cache headers, but some clients didn't obey them (I don't recall which now). There's a few cases where there's more in the URL, like the Swap Shop if you're putting something up, similar for the Market and when you're selling multiple items from your inventory. The a variable tends to get overloaded quite a bit, for example, in the Inventory there's a=17 (equip item 17) a=-17 (sell item 17) a=u17 (use/eat item 17) a=es17 (equip set 17) a=rs17 (remove set 17) and so on.

SERVER ACTIONS


Based on the zone id, one of the zone handlers is called, for friendly (non-monster) zones, there's a special handler for each one, whereas for monster zones there's only a single handler which pulls the relevant monster information from the database and places a monster. In both cases the handler both handles any input for that zone and outputs the zone content. This is nice because it keeps everything for a particular zone together.

WEB ACCESSIBILITY

As for compatibility, yes, it'll work in just about any semi-modern browser, plus IE6 (which is neither semi-modern nor a browser, it is an abomination). Even the Wii can play it quite well. The primary limiting factor is screen resolution (and text size), but it should shrink and expand to different resolutions pretty well, you just need to shrink your fonts at smaller resolutions.




QUESTS

Quests are just a row in the database that states the required level, a description of the quest, a description for when you finish the quest, the type of the quest and two integer arguments which get passed to the Quest Master zone handler. There's another table for the quest rewards that stores the quest id, reward type and reward quantity. As for the actual meat of the quest, that's not linked to the quest system per se. For example, the first quest where you get 5 Cans of Spam from the Master Spammers doesn't have any knowledge of where the Master Spammers are or that they drop Cans of Spam, it just knows what's required to consider it complete, there's hints about how to complete the quest in the quest description, which is done manually.

On the Proposition of User Generated Content

So as for having end users making quests, that part is actually pretty simple, there's quite a bit of plumbing around the quest (possibly adding new items, new monsters, new zones, new combinations... etc) which is quite a bit more work than adding the quest, but still not too bad. Initially I just used phpMyAdmin to update the database directly, though since I've added a (relatively crude, because only I use it) admin interface.

However, the main problem is that nobody wants to play a game that's too easy or too hard (at least for more than 5 minutes), and keeping Game! balanced isn't exceptionally easy. Initially I planned out the level progression, the min/max/expected character stats at each level, the expected total amount of gold collected at each level, etc, so that I could plan monster strengths and spell/skill costs in a relatively balanced manner. However, adding new stuff (there actually wasn't any spells or skills initially, for one thing) can throw this for a loop. Also, there's the matter of how long battles take, which is something I didn't account for initially. At higher levels, Fighters used to take a lot of attacks to kill a monster (a dozen or more, but they didn't take a lot of damage each turn, either), which is kinda boring and repetitive, so I added a few passive spells for Fighters that increase their attack and lower their defense, overall making them stronger, but more importantly, speeding up battles tremendously.

The other problem with user generated content... is that you need a lot of users! To put that in perspective, have a look at the posts:views ratio on these forums, you'll notice that there's typically between 10 and 100 views per post, and experience shows that that's a pretty typical ratio of active:passive users. So, if you think about that for a moment, you'll realize that you probably need a very bare minimum of something like 50 concurrent users to actually have forums like these be self sustaining. Game! does have a number of "user generated content" areas, like the Market, the Swap Shop, the Tavern, the Campground, and the forums, but actually getting them to be self sustaining (going from 0 => 50 users) is tricky. Though, the most vexing part about going from 0 => 50 users is that you basically have to go straight from 0 to 50 users, as people usually don't stick around otherwise.

Right now Game! typically has between 10-20 distinct users playing each day which definitely isn't enough to make the forums self-sustaining, for example. The Market has been doing pretty well since the introduction of Bargain Hunter, but that sort of thing isn't as easy to do for the Swap Shop, the Tavern or the forums. So as of late, I've been trying to drum up more interest in Game! via more users (hence this thread). People have proposed a few features in the past that would involve realtime collaboration between a few players, which isn't that hard to do technically, but isn't feasible with a low number of users, because it's pretty rare that they'll both be online at the same time.

So yes and no... I agree that there's (many) more ways to integrated user generated content that I haven't implemented yet, but I'm skeptical of their utility barring a large boost in the active user count.

===================================

A very interesting read. It definitely got me thinking. I've managed to use up my stamina playing the last few days and I've been thinking about the game (from a technical aspect, of course, as I do always) and considering how it works and how it ought to work. I just might have enough half-ideas at this point to justify a bit of typing on my part.

I am interested to know more about what other players are doing in the game, and I think the other players might be too. For a multi-user online game, it's not too terribly apparent that there are more real users out there. For example, at the tavern (an good idea, btw) I haven't run into anyone, but I also have no reason to stay. Bow, when I was young all my friends and I hung out at the coffeehouse. Any given day, a handful of us would be guaranteed to stop in. Sometimes our paths crossed; sometimes the didn't. But in either case, it was a sort of 'check-in' place. People would stop in to see what was going on.

To encourage that sort of behavior, I recommend adding a piece or two of code that collects and presents information about how many people have stopped into the tavern and when the last one was there. You could reset the counts each day when stamina was renewed. (If you collect the right two or three pieces of data, you can probably keep track of things like: how many people had stopped in; what the average number of visitors was; and even what percentage of players stop in or the average days between visits, something like that.

the wise sage could display many stats if a little data gets updated during the appropriate routines. For example: While returning stamina to 100% at midnight, why not calculate the difference between the player's current stamina and 100, and add it to a running total of stamina used?

You could also potentially calculate a % of stamina used - but it'd be important to start with the date of implementation rather than character creation date). This would give a decent metric for most committed players in the game, which would be interesting to see at the Wise Sage.

I certainly encourage you to consider adding a wise sage section that shows 'most active' and 'most slothful' users, ranked by % stamina used since the more recent of character creation or implementation of stamina statistics collection . This gives committed players a chance to show up as noteworthy characters regardless of experience level, which in turn gives them a chance to be listed publicly. (in turn, everyone who abandons characters will have their characters turn up as 'most slothful').

Sounds like a pretty easy feature, and I bet people would really get a kick out of it. Comparisons between players takes the games in the direction of 'online communities' which can interact with themselves enough to sustain interest.

I like that it has the count of players, but I think you should put it at the top so that everyone reads it. It's easy to miss way down there at the bottom. I also think you should count, while you're counting players, all players that have used any of their stamina (a pretty simple query modification) so that you can show how many characters have taken action so far today.

There are many other options, of course, and if you need somebody to help code in the stats generation, you should let me know. These modifications are pretty easy to make and don't require much thinking, and totally avoid the problem of balancing things out.

Could you show more information about a player on the 'leader boards'? Could you make their personal stats, current equipment, pets ... things like that? The inventory items all have fun little drop-downs that show such things. How difficult would it be to add something like that to the users?

If such a thing were to exist, you could let users upload their own avatar images. I for one want to draw a poorly rendered image of _my_ character, just like those of my enemies! That would require an upload
mechanism, but something like that could be built in relative short order.

Speaking of greater information, I don't have a lot of experience (because rux didnt' give me any pets prematurely, like I asked him) but i have a ghost now, and I can't see anything about it. I wish that I could see it's stats or something. I don't know what exactly it does, whether it increases my fighting abilities or what, but having it with me has no apparent results other than it slowly deriving experience from thE setting in the 'pets' menu that brings it with me.

I wish pets were a bigger part of the action. In some games, NPCs in the party are able to take actions like attacking and defending just like the player - as you are no doubt aware. Of course, you are also probably aware that this would be a lot of work to implement.

Well, I think that's about enough rambling for now. I hope it gets your mind going, and that this thread can become a more technical features request page.

I wish to end the post with an offer of a little bit of programming assistance. I do LAMP work semi-professionally and would love to dig through the code, glance at your to-do list, maybe get a few items checked off. You should consider giving me a read-only FTP account or something.

In conclusion, good work on the game, I love what you've done with it, and I look forward to using up my stamina points again today, maybe even reaching level 10 if I don't die too much : ).

Regards,

Dan (dannicker)
User avatar
Mad Merlin
Site Admin
Posts: 752
Joined: Sun Aug 14, 2005 10:41 pm
Contact:

Re: A Brief Discussion regarding the Technical Aspects of Ga

Post by Mad Merlin »

dannicker wrote:This thread was started in a shameless Game! promotion on the gentoo forums, but I deemed the Game! forum a more suitable resting place.
have you written any documentation on how the engine works?
No, I haven't written any documentation on how the engine works, it's actually pretty simple though.
Simple enough that apparently ...
(Wow, that ended up being a longer post than I expected.)
..you managed to accidentally write some. Here it is for Posterity.

SERVER/CLIENT COMMUNITCATIONS

There's very little passed around in the URL (which is intentional), basically there's always p (player id), z (zone id), and usually a (action), t is (as you guessed) to work around caching, it's set to the timestamp if it's unset, or incremented otherwise. I also set the cache headers, but some clients didn't obey them (I don't recall which now). There's a few cases where there's more in the URL, like the Swap Shop if you're putting something up, similar for the Market and when you're selling multiple items from your inventory. The a variable tends to get overloaded quite a bit, for example, in the Inventory there's a=17 (equip item 17) a=-17 (sell item 17) a=u17 (use/eat item 17) a=es17 (equip set 17) a=rs17 (remove set 17) and so on.

SERVER ACTIONS


Based on the zone id, one of the zone handlers is called, for friendly (non-monster) zones, there's a special handler for each one, whereas for monster zones there's only a single handler which pulls the relevant monster information from the database and places a monster. In both cases the handler both handles any input for that zone and outputs the zone content. This is nice because it keeps everything for a particular zone together.

WEB ACCESSIBILITY

As for compatibility, yes, it'll work in just about any semi-modern browser, plus IE6 (which is neither semi-modern nor a browser, it is an abomination). Even the Wii can play it quite well. The primary limiting factor is screen resolution (and text size), but it should shrink and expand to different resolutions pretty well, you just need to shrink your fonts at smaller resolutions.




QUESTS

Quests are just a row in the database that states the required level, a description of the quest, a description for when you finish the quest, the type of the quest and two integer arguments which get passed to the Quest Master zone handler. There's another table for the quest rewards that stores the quest id, reward type and reward quantity. As for the actual meat of the quest, that's not linked to the quest system per se. For example, the first quest where you get 5 Cans of Spam from the Master Spammers doesn't have any knowledge of where the Master Spammers are or that they drop Cans of Spam, it just knows what's required to consider it complete, there's hints about how to complete the quest in the quest description, which is done manually.

On the Proposition of User Generated Content

So as for having end users making quests, that part is actually pretty simple, there's quite a bit of plumbing around the quest (possibly adding new items, new monsters, new zones, new combinations... etc) which is quite a bit more work than adding the quest, but still not too bad. Initially I just used phpMyAdmin to update the database directly, though since I've added a (relatively crude, because only I use it) admin interface.

However, the main problem is that nobody wants to play a game that's too easy or too hard (at least for more than 5 minutes), and keeping Game! balanced isn't exceptionally easy. Initially I planned out the level progression, the min/max/expected character stats at each level, the expected total amount of gold collected at each level, etc, so that I could plan monster strengths and spell/skill costs in a relatively balanced manner. However, adding new stuff (there actually wasn't any spells or skills initially, for one thing) can throw this for a loop. Also, there's the matter of how long battles take, which is something I didn't account for initially. At higher levels, Fighters used to take a lot of attacks to kill a monster (a dozen or more, but they didn't take a lot of damage each turn, either), which is kinda boring and repetitive, so I added a few passive spells for Fighters that increase their attack and lower their defense, overall making them stronger, but more importantly, speeding up battles tremendously.

The other problem with user generated content... is that you need a lot of users! To put that in perspective, have a look at the posts:views ratio on these forums, you'll notice that there's typically between 10 and 100 views per post, and experience shows that that's a pretty typical ratio of active:passive users. So, if you think about that for a moment, you'll realize that you probably need a very bare minimum of something like 50 concurrent users to actually have forums like these be self sustaining. Game! does have a number of "user generated content" areas, like the Market, the Swap Shop, the Tavern, the Campground, and the forums, but actually getting them to be self sustaining (going from 0 => 50 users) is tricky. Though, the most vexing part about going from 0 => 50 users is that you basically have to go straight from 0 to 50 users, as people usually don't stick around otherwise.

Right now Game! typically has between 10-20 distinct users playing each day which definitely isn't enough to make the forums self-sustaining, for example. The Market has been doing pretty well since the introduction of Bargain Hunter, but that sort of thing isn't as easy to do for the Swap Shop, the Tavern or the forums. So as of late, I've been trying to drum up more interest in Game! via more users (hence this thread). People have proposed a few features in the past that would involve realtime collaboration between a few players, which isn't that hard to do technically, but isn't feasible with a low number of users, because it's pretty rare that they'll both be online at the same time.

So yes and no... I agree that there's (many) more ways to integrated user generated content that I haven't implemented yet, but I'm skeptical of their utility barring a large boost in the active user count.

===================================

A very interesting read. It definitely got me thinking. I've managed to use up my stamina playing the last few days and I've been thinking about the game (from a technical aspect, of course, as I do always) and considering how it works and how it ought to work. I just might have enough half-ideas at this point to justify a bit of typing on my part.

I am interested to know more about what other players are doing in the game, and I think the other players might be too. For a multi-user online game, it's not too terribly apparent that there are more real users out there. For example, at the tavern (an good idea, btw) I haven't run into anyone, but I also have no reason to stay. Bow, when I was young all my friends and I hung out at the coffeehouse. Any given day, a handful of us would be guaranteed to stop in. Sometimes our paths crossed; sometimes the didn't. But in either case, it was a sort of 'check-in' place. People would stop in to see what was going on.

To encourage that sort of behavior, I recommend adding a piece or two of code that collects and presents information about how many people have stopped into the tavern and when the last one was there. You could reset the counts each day when stamina was renewed. (If you collect the right two or three pieces of data, you can probably keep track of things like: how many people had stopped in; what the average number of visitors was; and even what percentage of players stop in or the average days between visits, something like that.

the wise sage could display many stats if a little data gets updated during the appropriate routines. For example: While returning stamina to 100% at midnight, why not calculate the difference between the player's current stamina and 100, and add it to a running total of stamina used?

You could also potentially calculate a % of stamina used - but it'd be important to start with the date of implementation rather than character creation date). This would give a decent metric for most committed players in the game, which would be interesting to see at the Wise Sage.

I certainly encourage you to consider adding a wise sage section that shows 'most active' and 'most slothful' users, ranked by % stamina used since the more recent of character creation or implementation of stamina statistics collection . This gives committed players a chance to show up as noteworthy characters regardless of experience level, which in turn gives them a chance to be listed publicly. (in turn, everyone who abandons characters will have their characters turn up as 'most slothful').

Sounds like a pretty easy feature, and I bet people would really get a kick out of it. Comparisons between players takes the games in the direction of 'online communities' which can interact with themselves enough to sustain interest.

I like that it has the count of players, but I think you should put it at the top so that everyone reads it. It's easy to miss way down there at the bottom. I also think you should count, while you're counting players, all players that have used any of their stamina (a pretty simple query modification) so that you can show how many characters have taken action so far today.

There are many other options, of course, and if you need somebody to help code in the stats generation, you should let me know. These modifications are pretty easy to make and don't require much thinking, and totally avoid the problem of balancing things out.

Could you show more information about a player on the 'leader boards'? Could you make their personal stats, current equipment, pets ... things like that? The inventory items all have fun little drop-downs that show such things. How difficult would it be to add something like that to the users?

If such a thing were to exist, you could let users upload their own avatar images. I for one want to draw a poorly rendered image of _my_ character, just like those of my enemies! That would require an upload
mechanism, but something like that could be built in relative short order.

Speaking of greater information, I don't have a lot of experience (because rux didnt' give me any pets prematurely, like I asked him) but i have a ghost now, and I can't see anything about it. I wish that I could see it's stats or something. I don't know what exactly it does, whether it increases my fighting abilities or what, but having it with me has no apparent results other than it slowly deriving experience from thE setting in the 'pets' menu that brings it with me.

I wish pets were a bigger part of the action. In some games, NPCs in the party are able to take actions like attacking and defending just like the player - as you are no doubt aware. Of course, you are also probably aware that this would be a lot of work to implement.

Well, I think that's about enough rambling for now. I hope it gets your mind going, and that this thread can become a more technical features request page.

I wish to end the post with an offer of a little bit of programming assistance. I do LAMP work semi-professionally and would love to dig through the code, glance at your to-do list, maybe get a few items checked off. You should consider giving me a read-only FTP account or something.

In conclusion, good work on the game, I love what you've done with it, and I look forward to using up my stamina points again today, maybe even reaching level 10 if I don't die too much : ).

Regards,

Dan (dannicker)
Most of this is done now. I think the main thing that's left is the more detailed character profiles. I overhauled the dialog functionality quite a bit in preparation of this, I'm just debating on what I should and shouldn't include in a character's profile before I actually add them.

As for pets, it's by design that they don't say what they do, you're supposed to experiment and find out for yourself (that's part of the fun!). Most of them help you out in battle, and there's a message when they do, so it's certainly not a hunt in the dark.

Sorry for the delay, I wanted to implement most of this before replying, it just took longer than I expected... (I've actually had this reply tab open with a partial reply since the day you replied).
dannicker
Regular Poster
Posts: 2
Joined: Tue Sep 30, 2008 5:25 pm

Post by dannicker »

I like what you've done. The player stats for stamina usage are as interesting as I had thought! A running average would be nice too, but somewhat harder to implement.

The telepathy thing is great because it gives the player a modicum of interaction and at least inter-awareness of other current players.

I like the ajax enhancement to the market. May I suggest you do the same for inventory selling?

New popup windows (like those in a set description) pop up in new windows rather than popping up in new popups. Not sure it it's a bug, but if not, consider it a feature request.
User avatar
Mad Merlin
Site Admin
Posts: 752
Joined: Sun Aug 14, 2005 10:41 pm
Contact:

Post by Mad Merlin »

dannicker wrote:I like what you've done. The player stats for stamina usage are as interesting as I had thought! A running average would be nice too, but somewhat harder to implement.

The telepathy thing is great because it gives the player a modicum of interaction and at least inter-awareness of other current players.

I like the ajax enhancement to the market. May I suggest you do the same for inventory selling?

New popup windows (like those in a set description) pop up in new windows rather than popping up in new popups. Not sure it it's a bug, but if not, consider it a feature request.
Actually, as a product of tracking the current day stamina usage (because you need to account for food), it also keeps the stats for all previous days, so running averages could be added without much trouble. A related stat that could be interesting is the overall busiest day for any player (it would likely drive prices up quite a bit on the most nourishing food too), the top 10 could show the busiest day for each player.

As for AJAXing the inventory as well, that's trickier than it is for the Market. Basically, in the inventory when you sell something, it's quite possible that you still have more of that item left, so you're left with the issue of where to put the notification (because you can't just replace the item's spot in your inventory like you can in the Market). You can put it in the usual place dynamically, but that'll push the entire item list down all of the sudden, and most people probably won't see it up there (so they won't know why the list moved down either), because they'll be scrolled down.

Having said that, I do have plans for the inventory as well. What I'll probably do is add a checkbox for each item in the list, and then add a list of commands you can do with the selected items (sell all, sell n of each, sell all but n of each, combine the first 2 selected, put up at the Market*), which is arguably more useful than importing something similar to the Market.

* This deserves a little more explanation. Right now selling stuff at the Market is a little tedious as you have to pick items one by one and you have to set prices manually for each one. I'm thinking of adding a "remember this price?" option along with a (player adjustable) default markup %, plus a page where you can view and edit "your" item values. Then you could sell something (or, indeed, everything in your inventory) on the Market with a single click, and it'd either pick your remembered price, or use your default markup %. You could also go into the Market and toss out an item for a specific one-off price (unticking the "remember this price?") and not have to worry about it clobbering your stored price. In conjunction with this, I've also had the Market start tracking all the items that pass through it (as of a few days ago), and I'll implement some cool reports so players can see this information soon. I imagine it'll be useful for setting prices and seeing which items sell the most.

For the popups in popups, yes, that's a relic of the old popup system, I forgot about that until you mentioned it (I did a major overhaul of how that's done when I added the animations, it's actually less Javascript, less markup, popups can float out from anywhere, they dynamically expand up or down now, etc). I should fix that now. I'm tempted to enhance the popups a bit more too, possibly so they're movable via dragging, and they could also stand to have an outline, primarily for when they're stacked on top of eachother.
User avatar
Smasher
Regular Poster
Posts: 13
Joined: Thu Feb 05, 2009 3:22 pm
Location: Game!

Post by Smasher »

This was a really fascinating read.

Are you interested in adding any more developers? I would love to help out here and there, as I have worked on several php projects in the past and would love to help with additions here and there.

I like the idea of adding player interaction, and i understand the issue of needing more players to make it worthwhile. I think that one of the neatest aspects of Game is the open market system, and I think it would be neat to expand that somehow.

Thanks for the great work and for the great Game!
I like to crush stuff!
User avatar
Mad Merlin
Site Admin
Posts: 752
Joined: Sun Aug 14, 2005 10:41 pm
Contact:

Post by Mad Merlin »

Smasher wrote:This was a really fascinating read.

Are you interested in adding any more developers? I would love to help out here and there, as I have worked on several php projects in the past and would love to help with additions here and there.

I like the idea of adding player interaction, and i understand the issue of needing more players to make it worthwhile. I think that one of the neatest aspects of Game is the open market system, and I think it would be neat to expand that somehow.

Thanks for the great work and for the great Game!
It might surprise you, but writing code isn't really much of a bottleneck for Game!, actually deciding on what to write and how to take care of all the little details usually takes longer than writing the code involved.

The other big time sink is content creation, which is one reason why user generated content is a pretty neat idea. There's a number of smaller things that add up as well, like attempting to promote Game! (not much point in creating something if nobody knows about it...), reading and posting in the forums, IRC (#game! on irc.freenode.net, of course), etc.

All in all, I'd say the best way to help out is also the easiest, just tell your friends about Game!
Post Reply