Jump to content


Photo

php game - need suggestions


  • Please log in to reply
4 replies to this topic

#1 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 27 April 2006 - 11:48 PM

Hi,

Im still slowly working away on a PHPgame and I need some thoughts.

When a player goes to a place to buy/sell commodities the MySQL database holds a base value.

When they come to a particular place to buy/sell I change the buy priced based on how much of the available commodity is there.

So if:
| Amount | Max | Buy | Sell
-----------------------------------------------
Store1 | 500 | 1200 | 45 | 25

Now the way it works is
pseudo

if Amount is <= 10% of Max then 
   Sell price is is 45% less than Buy 
else 
   Sell price is 150% greater than Buy

Should I make a universion buy price and then change it based on the availability of the commodity? So set all stores to a base price of say 50 and then change the store's Buy and Sell price independently??
Right now each store has a set Buy price in the database that varies on me just randomly entering a value :)

Looking for some feedback/suggestions etc

Thanks



#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 28 April 2006 - 01:29 AM

that doesn't really sound like you're asking a question about code but about game mechanics. you are the one who has to decide how you want your game to be played.

but on that note, does each store offer their own independant inventory, or do all stores present stuff from one source (that is, i can go to any of your stores and it shows the same stuff and same quantities)?

also, it depends on how you have your code setup. for example, if you have pens. base price is 10. and you have 3 stores. when you go to a store does it randomly display x amount of pens available, or is there only like 50 pens available between all 3 stores or what?

if you explain exactly how you have it set up then i can make my own suggestion on how you should do it, but again, that's really a gameplay mechanic thing not a technical question.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 28 April 2006 - 02:39 PM

[!--quoteo(post=369427:date=Apr 27 2006, 06:29 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Apr 27 2006, 06:29 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
that doesn't really sound like you're asking a question about code but about game mechanics. you are the one who has to decide how you want your game to be played.

but on that note, does each store offer their own independant inventory, or do all stores present stuff from one source (that is, i can go to any of your stores and it shows the same stuff and same quantities)?

also, it depends on how you have your code setup. for example, if you have pens. base price is 10. and you have 3 stores. when you go to a store does it randomly display x amount of pens available, or is there only like 50 pens available between all 3 stores or what?

if you explain exactly how you have it set up then i can make my own suggestion on how you should do it, but again, that's really a gameplay mechanic thing not a technical question.
[/quote]

Each store has their own amount of inventory. They all sell the same 4 items. But each store has a different inital amount with a different max.

The idea is to be able to go store to store and buy/sell. Like TradeWars2002 if anyone has played that ;)

The idea is that a player can goto one store, buy 30 items, goto another store and the price for them to sell might be better, or worse depending on what that particular store's inventory levels are like. If its better than the previous store they are awarded a little experience. I will hopefully add a way for them to 'haggle' as well to earn them a bit more experience if they are successful.

I guess it is more of a game mechanics question. But I have no idea what forum out there might help with game mechanics ;)

Btw Crayon, how is that game you're working on going? I forgot the URL.


#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 28 April 2006 - 05:17 PM

okay next question: is all this inventory finite or infinite? that is, are there only going to be like 100 pens total in your game, and they just get moved from store to store? or is it more like : store A has pens and pencils in their inventory. when you go to store A, a random amount of pens and pencils are spawned for you to buy, and buy/sell prices are based on that randomly spawned amount?

if it is the first (100 pens total being moved around from store to store) then i suggest making the price calculations universal. or if you wanted to get even more in-depth, here's a scenario for you: let's say that there are 10,000 pens for sale and they are randomly distributed throughout all 4 of your stores. let's say that

store A has 2,000 pens
store B has 4,000 pens
store C has 3,500 pens
store D has 500 pens

so BEST case scenario would be for me to go to store B, buy some pens, and then sell them at store D, right? But I could also purchase at store C and sell at store A for a little bit of profit too. But if there are only 10,000 pens TOTAL at any given time, if one user goes and buys 500 pens then that only makes 9,500 available for you to buy and sell. this should make prices go up overall.

How you actually display everything in your game will determine a huge chunk of your game mechanics. For example, are you planning on the user being able to see prices for all the stores in some kind of quick list, or do they actually have to go from store to store to find out prices?

Having to go from store to store probably won't be very practical if you have inventory randomly spawning and therefore prices being more random. Playing would be more luck of the draw than strategy. Also you would end up having superfluous stores. For instance, if it's all random, may as well hop back and forth between shop A and B until it spawns a good (low) amount and therefore price and then sell, rather than bother with going to store C or D. Or hell, could just keep entering and exiting the same store for that matter.

You could have a finite amount of product (like 10,000 pens), show a list of current prices for each store, but not quantity available, or quantity available but not prices. Or you could have random spawns in each store and it be luck of the draw but give a clue in an overall table like putting description like "Pen sales are HOT at store B" that way even though there is luck of the draw involved people would have a clue that they can grab some pens and maybe get lucky by selling at store B or "Pencil sales are down at store A" then you would have a clue to go buy at store A cuz prices would also be down.

You have to start with what you like, you're personal "style" so to say, then find its balance of strategy and luck and challenge and overall fun. that's what gameplay mechanics is all about.

p.s. - I stopped working on my game a couple months of go. I lost the motivation to do it, mostly for lack of help. it was at [a href=\"http://www.chroniclesofwar.com\" target=\"_blank\"]http://www.chroniclesofwar.com[/a]

also, as far as forums for game mechanics, you might wanna visit the forums of other games, there are always threads where people talk about the game and what could be done better or what sucks or what new feature would be cool. just reading through posts like that might give you ideas or help you better understand what works and what doesn't.

i think that's how most people end up venturing off to make their own game, actually. at least, that's how it was for me, back in the day. I played kings of chaos, mediwar, darkthrone, and thought some of the things were cool but i thought i could do way better (i still think i can :) )
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#5 SharkBait

SharkBait
  • Members
  • PipPipPip
  • Advanced Member
  • 845 posts
  • LocationMetro Vancouver, BC

Posted 28 April 2006 - 09:42 PM

Well each store at the time of create in the database had a current amount, and a max amount.

So when I first logged in before anyone else had:

Store1 had 500 with 1500 max
Store2 had 1200 with 2000 max
Store3 had 700 with 700 max

I just made up some starting amounts along with their maxes (no thought into really). There was no magic number of starting items that was distributed between the stores.

If a store runs out of an item. Then players will be only able to sell items to it untill it gets to a minium on hand before it will start to sell them again. If the store hits the maxium then of course they won't buy anymore.

And not all stores sell the same items. So out of 4 items in total that can be bought/sold a store might have all 4, might have only 2, or might not have any at all to buy/sell. This is also coded in the database. If they have no max amount, they do not buy/sell that particular item.

Its nice to talk to someone about how this can work. I dont work on it as much as I would like to but..

:)

I too playe Kings of Chaos and Darkthrone. Liked the idea of them, but wanted something of my own ;)

There was another game I saw that was done in PHP and Flash... forget what its call though it had a neat style to it.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users