Announcement

Collapse
No announcement yet.

Database Game Coding?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Database Game Coding?

    Hi. I was wondering if anyone could offer any advice on where I should look for information on this-

    I am attempting to code a simulation of a business' sales.

    The code needs to generate sales probability data based on certain factors that are different weighted variables. Basically, the business' products will be weighted to appeal to certain demographic groups in different amounts based on the amount of advertising, and quality of development, and release date of development.

    I'd like to see if anyone has posted any source code on this somewhere on the internet that I could reference to see said algorithms? An internet search has turned up a few false leads (leading to dead sites). But nothing substantative.

    The type of database I'm trying to build is modified similar to the one determining sales data in Hollywood Mogul (which is based on many adjustable factors- like Advertising, Quality of Actors, Quality of the Studio, etc.) and I'd like to build my simulation around similar logic.

    Games I have in mind as inspiration while coding my project are:

    - Hollywood Mogul 2 (which is amazing.)
    - ChartWars 3 (which was coded in VB and runs like a bear; thus encouraging me NOT to code in VB.)
    - Tycoon-Style Games
    - Mogul-Style Games (including Baseball Mogul)

    I've already spent around 40+ hours coding the basic framework and identifying variables. At this point, what I could use some guidance at is a formula for creating realistic relational positioning of coding elements.

    The simulation is being coded in Delphi/Pascal.

    Thanks,
    DC.
    -->Visit CGN!
    -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

  • #2
    Oh, and a practical example.

    For example:

    I want to figure out a good mathematical way of stating this:

    "If this is a hit and it has 100% QUALITY level, then all other factors being equal, it will sell 500,000 copies."

    MOST things are probably only going to be 80% QUALITY level, and all other factors being equal, they will probably sell around 250,000 copies.

    If ADVERTISING is increased, a good QUALITY product could sell about 1 million copies.

    if the product appeals to a certain demographic, it might be able to move even more copies.

    There is feasibly no upper limit to sales, but the distribution should range from around:

    MOST sell 20,000-70,000 copies.
    GOOD ones sell 100,000-500,000 copies
    HUGE HITS sell 1,000,000-3,000,000 copies.
    ONE IN A THOUSAND sells 5M+ copies.
    -->Visit CGN!
    -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

    Comment


    • #3
      Hmm, that's certainly an interesting question. I wouldn't know anything about currently existing code, but the theory should not be particularly complicated.

      I would think the simplest way to deal with that is via direct proportion weighting. Each record would have a 'final weight', which would be a combination of other weights, based on your criteria; determine the net effect on sales, and then create a percentage increase/decrease as a result, to be multiplied in.

      In your example, for example, you could have:

      Record:
      QUAL_WT: 2 (100% quality)
      DEMO_WT: 1.25 for this particular demographic
      ADV_WT: 1.5

      FINAL_WT: 2*1.25*1.5 = 3.75
      3.75*(base sales) = sales, so if 250k is base sales, then this will sell almost a million copies.

      Another example:
      QUAL_WT: .5 (60% quality)
      DEMO_WT: 0.8 (low appeal to this demographic)
      ADV_WT: 1 (no advertising)
      FINAL_WT: .5*.8*1 or 0.4
      Base Sales*0.4 = 100k

      Some would have high numbers in one and lower in another. You would have to work out the exact weights based on your desired results, of course. In particular, how you combine them is important; you can just multiply them, but then a high weight and a low weight even out precisely, which may not be beneficial; but if you calculate the weights taking this into account, then you can ameliorate this problem.

      The advantage this gives you is a huge degree of control over your factors, and a solid degree of separation of them from the rest of the program; you simply have a function to calculate each weight and create from it a percentage of increased/decreased sales, and then apply it. (In a game, of course, you need a random number at some point; presumably at the end, after you have created your weights.) It also would allow you to create different demo_wt, for example, for different populations; since one demographic might like it a lot, and one less, you'd want one for each demographic (or, even, a different weight for each type of demographic, say a 'male_wt' that is 1+male_wt for males and 1-male_wt for females [or the inverse of course]; an income_wt that factors based on your income, etc, and then you combine them together to form the demo_wt and then the final_wt that, when multiplied by the random number, gives you your actual sales.

      To actually calculate those weights, of course, you'd probably want to just monkey around with the numbers yourself in an excel spreadsheet or something. You can use logarithmic functions, square/sqrt, and linear relationships, depending on how much effect you want. Set up some examples, determine what you think the final weight should be based on those test data, and then ... make it fit You could do a curve fitting regression or something if you're mathematically inclined, I imagine.
      <Reverend> IRC is just multiplayer notepad.
      I like your SNOOPY POSTER! - While you Wait quote.

      Comment


      • #4
        As a non-coder in this age i'm not sure, but maybe you can find the info at one of these sites:

        GameDev.net is your resource for game development with forums, tutorials, blogs, projects, portfolios, news, and more.


        http://www.flipcode.com/archives/ (shame they closed this!)

        The main directory I use for these is:

        Award-winning specialists in Game Jobs. Animators, Artists, Programmers, Producers, Game & Audio Designers, Mobile Developers, and Marketing.


        It will involve a bit of trawling(and a few dead links like GDSE), but I'm sure I've come across the kind of things you were asking about? Good luck!

        Comment


        • #5
          Thanks a lot for the advice snoopy, I'll try out substituting numbers in a spreadsheet and running some graphical simulations... If you're interested when I'm finished, I could send you a copy of the program.

          And also thanks El_Cid for the links!

          -DC.
          -->Visit CGN!
          -->"Production! More Production! Production creates Wealth! Production creates more Jobs!"-Wendell Willkie -1944

          Comment

          Working...
          X