Jump to content
  • Advertisement
  • entries
    26
  • comments
    0
  • views
    1709

Project: Fraud Simulator

Differentiating NPC and Player agents

KrisWolfe

783 views

The refactoring of the market code is trucking along. I've learned so much about C# and programming since I first wrote it, and my design has changed since then, so I'm using the old pseudocode as my template while rewriting the class itself. It's not really hard. My new code looks like this:

NewMarketCode.JPG.4ff67ccd01d42ecd9514a255a6e8bf01.JPG

Compared to my old code where I would loop through the agents List and then loop through all the companies that the agents owned...now that's handled internally to the class itself:

OldMarketCode.thumb.JPG.4e728b8746cf086e9ee1fdc022f7951b.JPG

This solves one of the things that was rubbing me wrong while coding. I hate casting. It feels so wrong. Now, instead of telling the market code which type of company it is, the company itself would know what type of company it is and just do what it needs to be done. The function "Beginning of Day" will be different for each type of company. The only thing it really needs is the properties from the market class, which I pass along in the call to the internal functions.

So now we have this delegation of tasks to internal classes. I ran into an issue with the "GetAJob" function. Before, it was just abstracted out to the companies to decide what the job was. But with an actual economy rolling along, we're going to need to differentiate them. We also want NPC's to have different productivity based on how well they are at the job.

We start with the simplest type of companies. Producers. These are your iron mines, or farms, or anything that creates goods from "nothing". In the real world, we have mineral rights and finite resources, but I don't think I really want to go into that. So my base company will just create goods, with their only costs being utilities, rent and salaries. No licenses, no natural finite resources, no fertilizer. Just creating goods from nothing.

So, we need a job type of "Good Maker". I don't want to differentiate industries at this level. I want you to just start up a company, it has to buy a recipe from lets say the government, and then start making whatever good that recipe calls for. So the job is just to execute whatever recipe we have. So what if we have two recipes? I think I'm just going to disable that option, force the player to buy a second company if they want a different recipe. It doesn't really add much to "fun" or the economy if one company can have multiple recipes. Besides, in the real world you want to focus on core competencies anyways.

So right now, the recipes require a certain amount of employees. Once you've hit that threshold, it starts producing the good. What I want is that the more employees you have, the faster you create goods. The better an employee is at creating goods, the more goods they make, and so on. Is it realistic to make 0.1 of a good everyday? Why yes, it is...in manufacturing companies, they have three inventory accounts: Raw materials, work in progress, and finished goods. So half a good would be a good that is halfway through the conversion process in the work in progress inventory account. So it makes sense.

So you keep hiring employees while it's profitable. What if an NPC doesn't have the skill required? Well it's created in the skill set and they start earning hours. Their productivity will be a function of how many hours they've spent on that skill.

So now back to the function "GetAJob". What do we want an NPC that doesn't have a skill to do? In the real world, most people just get a job in their best skill. But that's not always true. Sometimes people just want to do something new. So we want a chance for an NPC to go and get a job for something he's not really qualified for...maybe lie on the resume. You know, all going back to "committing Fraud". So what I think I'm going to have to do with NPC's, is that they don't actually check the skill of the NPC that they're hiring. People can slip through the cracks. And this allows for chaos in the skill system, allowing NPC's to have all kinds of skills instead of just whatever skill I assign them on initiation. I want to think of NPC's like loot...they have 2-6 different skills, and they can roll higher productivity on skills, and eventually earn higher skills through hard work anyways. Or, god forbid, a lowly entry position employee somehow getting to be CEO of a company.

So the market decides demand, and NPC's will adjust their asking salaries on how that goes. Businesses will also be evaluating their NPC's, and if they aren't profitable, they'll likely be fired. Layoff's and what not, which should be pretty easy with producers. You check what the market price for a good is, you can easily calculate the marginal cost of each employee, and if they're unprofitable fire them.

So we have this balance of NPC's getting one over on the companies that hire them by obtaining a salary that they might not deserve, and companies periodically checking the marginal cost of those employees.

But now, we have our first branch off between NPC's and players. None of this really applies to players. They're not going to get randomly assigned skills. The player choose what job they want to do, and begin earning hours in that job. We will also have free time to work on skills and get better to be more hireable. I don't want the player to be forced into owning companies, they can just work for businesses and focus on their skills and leisure time.

So now we need NPC Skills, NPC Skill Database, and NPC Agents that are different from player agents. Interesting stuff. Looking forward to getting this up and running.




0 Comments


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 kensarto
      I'm looking for pointers before I get started developing one from scratch, I do not have, or plan to spend money on other peoples scripts or products to import into my project which means I can neither see how they do it, nor use their systems directly. As such, this will be entirely hand written to match what I need.

      The specifications are as follows:
      Unique Actors that prompt different conversations, whether that be an NPC conversation, or the interaction with a work station and selecting options. Branching conversation paths (and therefore a method of storing variables to short and long term store flags for different states) Localised scripts.  I do not want to have 3 or 4 different scripts on every object just for this, it would be optimal in my opinion to have a single dialog manager script, but i will be happy if i have to include an "actor" script on the different NPCs along with that. UI (arguably the easiest of the requirements that will sort itself out when I've got everything else working over time) Is there anything obvious I'm missing about functional requirements, non-functional requirements? What is the best place to get started?
    • By Titanomachy Studios
      Project Name: Condors Vs. Ocelots
      Team Size: 15ish
      Genre: Strategy RPG
      Engine: Unity
      Roles Available:
      3D Artists - generalist or hardsurface w/textures
      2D Artists - Characters, World, and UI
      C# developer/engineer(s)
      Social Media/Marketing/Community Manager
      If you feel as if you can offer the team something more that isn’t listed, we are always open to making an exception, just send your resume/portfolio to us!
      Project Length: Currently planning on release Q1 2020.
      Compensation: Rev-share
      Project Status: Vertical slice is done and iteration development has begun.
      Send emails to careers@titanomachystudios.com
       
      Must speak English and have access to a Mic.
       
      Our store page can be found here, https://play.google.com/store/apps/developer?id=Titanomachy+Studios
      Our website here,
      http://titanomachystudios.com/#/
       
      Project Story: Condors and Ocelots have been at war for generations. Battles have left some settlements in ruins. Others teem with refugees. Even away from the fighting, towns and villages suffer from having their fighting-age citizens lured away or conscripted by one faction or the other. Players control their armies and try to wipe out their opponents! Use terrain, abilities and pure cowardice if need be to achieve victory for your faction!
    • By RoKabium Games
      The Riverine design looking like a snake didn’t work very well with the animation so we re-designed this creature to look more like a colourful caterpillar type of animal.
    • By intenscia
      mod.io is an cross platform mod service created by the team behind ModDB.com and IndieDB.com. It can be integrated in-game using the  REST API, C/C++ SDK or engine plugins (if available) Unity is ready and Unreal Engine is in development.
      Features include:
      Platform agnostic (support 1 click mod installs on Steam, Epic Games Store, Discord, GOG, itch.io and even consoles in the future) Clientless (mod.io has no other dependencies and works behind the scenes in your game) Embeddable web app UI, so you can integrate your mod community anywhere Powerful search, filtering and tagging of mods Moderation and reporting systems built-in Steps to getting mod.io integrated:
      Add your game to our test environment or production Read our API documentation for an overview of how mod.io works Choose an Engine Plugin, API or SDK to integrate mod.io into your game and mod making tools Ready to launch? Add your game to our production environment then let's discuss promoting your release Need help? Our team is available on Discord to assist and our getting started guide has more information for you  
       
      Benefits of using mod.io:
      mod.io offers the same core functionality as Steamworks Workshop (1 click mod installs in-game), plus mod hosting, moderation and all of the critical pieces needed. Where we differ is our approach to modding and the flexibility a REST API offers. For example: 
      Our API is not dependent on a client or SDK, allowing you to run mod.io in many places such as your homepage and launchers Designing a good mod browsing UI is hard, our plugins ship with a UI built in to save you a lot of effort and help your mods stand out We don’t apply rules globally, so if you want to enable patronage, sales or other experimental features, reach out to discuss Our platform is built by the super experienced ModDB.com team and is continually improving for your benefit Your community can consume the mod.io API to build modding fan sites or discord bots if they want Large studios and publishers:
      A private white label option is available to license, if you want a fully featured mod-platform that you can control and host in-house. Contact us to discuss.
      Find out more:
      Visit mod.io | About us | Add your game | Chat on Discord
      These screenshots are from our Unity plugin:




    • By INTwindwolf
      THE PROJECT

      INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War.
      Please note that all of our current positions are remote work. You will not be required to travel.
      For more information about us, follow the links listed below.
      INT Official website
      IndieDB page
      Also follow social media platforms for the latest news regarding our projects.
      Facebook
      Twitter
      CURRENT OPEN POSITIONS
      Website Manager
      3D Character Modeler
      3D Environment Modeler
      3D Animator
      Unity Engine Programmer
      REVENUE-SHARE
      The project is marching increasingly closer to be ready for our crowd-funding campaign. Being an Indie team we do not have the creative restrictions often imposed by publishers or other third parties. We are extremely conscientious of our work and continuously uphold a high level of quality throughout our project.
      We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Your understanding is dearly appreciated.
      TO APPLY
      Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net
      Thank you for your time! Please feel free to contact me via the email provided should you have any questions or are interested to apply for this position. We look forward to hearing from you!
      John Shen
      HR Lead
      Starboard Games LLC
  • Advertisement
×

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!