Jump to content
  • Advertisement
  • entries
  • comments
  • views

Project: Fraud Simulator

Hooking up the player to the Economy



This week I focused on getting the player hooked up to interface with the economy. I've tested what I have with varying amounts of agents, and the numbers popped out about what I would expect, so it appears to be working. I need to capture more statistics later to make sure there's not "other" behavior going on that I don't anticipate, but I'll work on that once I have my player hooked up and I can start messing around with the engine to fine tune the numbers.

This week I also discovered that UI is boring as hell to design, and took a lot longer than I thought it would, specifically getting motivated to work on it.

I learned a lot about input boxes and drop downs. Dropdowns are way more complicated than they appear. I made two screens...one for managing your companies, and the other for placing orders into the market. The UI is not polished. I bought a UI pack for $5 off the Unity market just to have some placeholder art while I'm figuring out exactly what I want. I still don't know what the final product will look like, but as I hook up the systems to each other, I'll go back over them.

Another important concept I'm running into is refactoring. It is actually hard to just say "Ok, this works, I'll come back to it later." I want to refactor my code, but as I'm designing this system to hook the player up to the economy, I'm running into problems that I can only solve by rewriting sections of my economy code. So I need to hold on refactoring code until I have a complete idea of what my code needs. Specifically, I want the player's companies to act a little different than the NPC's. NPC companies have a change to turn their orders into market orders instead of limit orders. I only enter orders for the player when they actually want them. So, I can't just throw the player's companies into the list with the NPC's companies to "get handled." I also want the player to be able to run each part of their company, while the NPC's will require an employee to run parts of their business.

This is nice, because it gave me a chance to run some polymorphism. I had methods become different based on if it was a player or NPC, so it was fun to mess around with that. But eventually I think what's going to happen is that I turn the NPC's to act like player characters, but their actions are handled by a factory design pattern instead of the player object. But that's just something to do for another time.

I've attached my company management screen and my market screen. Right now I just have a button to create a company...the choices right now are a retailer or a producer...the producer always has at least one recipe, and if they have enough employees, they will produce goods. They will then send those goods to a retailer that they have a contract with. On the market screen, we have a bunch of drop downs which allow you to switch markets, choose which company you own that you want to get orders for, choose which recipe, and then see the current contract market for the good selected. Asks are what producers put out, Bids are what retailers put out, and they sell per good sent. Since I'm a producer with an output recipe, the bid options are disabled. I can then put in a market or limit order for contracts, and they will get executed on the next "game turn". It's a little complicated, and I will need an extensive tutorial, or at least make the UI better to read eventually.

And that is currently working. I can acquire contracts and I tested it this weekend.

I wanted to do the same for employees, but then realized I wanted the player to be able to run their business without employees. So, the next step is to now get the scheduler up and running with skills. When you own a company, you will have the "produce recipe" skill pop up and for each hour you spend on this skill, you will produce a certain amount of goods. With a retail store, you can "man the register", and if customers show up you will sell to them.

That highlights another problem I'm running into. I know I want a skilltree, but I'm not sure what to put in the skilltree, or how it works and unlocks. I want skills to be unlockable the more you use them, so that you get better at a job or skill overtime. Right now my plan is to just add them as I'm designing the rest of the game, and I'm like "oh yeah I should have a skill for this."

Another problem I'm running into is that I'm hard coding strings into my code to detect which type of company I have. I think I'm going to have to get a JSON database up and running sooner rather than later, and that can go hand in hand with editors I want hardcoded into the game. I'm thinking I should just create editors now to make skills and types of companies and goods, so that the buyer of my game can also do the same and use the same editors to make whatever skills and companies and goods they want.

Another aspect I've been keeping in mind is to keep this multiplayer ready. I want people to be able to run a company together, specializing in different skills and taking on the market, stealing from each other. I want players to be able to have a job AND a secret company on the side, siphoning funds from the business and sabotaging each other...or they could work together and build a mega corp. I know I will need to do a command design pattern for player actions eventually, so that they don't have all the information available to them to cheat. So for now the player object I'm using is a prefab that I edit, and I only store commands on it to send to the economy...Eventually I will put some code in to validate the commands, but for now I want to get systems up and running.

So this week I will work on the scheduler and some basic skills to get a company up and running and interfacing with the economy. Then likely start working on an editor to add skills, company types, goods, and recipes into the game through the editor instead of just hard coding it into code.





Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Advertisement
  • Blog Entries

  • Similar Content

    • By ashlelia
      Hi all,
      I did a bit of searching around the forum before posting and I couldn't find anything that quite fit my question. A boyfriend and I are working on creating a word game for mobile that would include a grid of multi-color letters, a goal, and boosters to help you achieve the goal. We plan to build in Unity. He's doing the coding, I'm responsible for pretty much everything else (the concept is mine from the jump so lol) and right now my focus is on level design. I am pretty lost on where I would begin with creating the kind of levels I want; each level should have a goal of something like "create five blue words" or "create five blue words of only three letters." Down the line, some may be timed or have turn limits.
      Would this be something that I would have to manually design, or is there a way to generate the goals more dynamically based on particular constraints
    • By SCP-173
      I'm currently working on a 3D mobile game in Unity, and I've basically designed the whole thing already. Problem is, I do not know where to get started on the music/rhythm integration for the game. I'm relatively new to coding in C#, but am pretty comfortable with the Unity workflow having made some games off tutorials to learn C# and Unity. I was wondering if there is anyone who is experienced in or knows about making rhythm-based games who could help me understand the process? My concept is similar to these to just give you an idea of what I'm going towards: https://www.youtube.com/watch?v=RcHzJ5lAdHQ
      I've also read about this software Koreographer while doing research on how to make a rhythm-based game, but I'm hoping that whoever's willing to help can help me achieve some of the neat effects that Koreographer can do without buying and learning the software.
    • By RoKabium Games
      ALPHA TESTERS WANTED! Our PC game "Something Ate My Alien" is starting public testing today! If you would like to test our game, contact us or visit the link below:
      SAMA forums: http://bit.ly/sama-testing
    • By RhinoBladeX2
      hi you my call me rhino would love to chat about blender, gimp and 3d design learning all the time. hope we can be friends I uploaded picture's for everyone 


Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!