Jump to content
  • Advertisement
  • entries
    24
  • comments
    0
  • views
    1459

Project: Fraud Simulator

Markets are done, moving to Service Companies

KrisWolfe

781 views

Huzzah! Not much to really show since everything happens in Debug.Logs and code, but markets are done.

So what can retail agents do? Right now they can choose between restaurants or super markets...both of them have a different lists of goods. The restaurants will have the more complex good types that cost more, and supermarkets will have cheaper goods. Eventually I will have retail agents responding to market conditions and possibly switch Licenses. That's for another time.

When a market has a positive inventory, they will put themselves available to the market. A list will be updated every day in the game that gets the total market share of all the companies, and creates a random list of markets based on that market share. This only happens once per day, and before agents start choosing markets to eat at. If you have 40% market share, you will have a 40% chance of being picked. An agent will come and pick a market, and then either decide on picking the most popular good  available at the market, or the cheapest. Once decided, the market will feed the consumer and exchange cash. The consumer's hunger goes up based on the good and how well the employees are at their job. If a market successfully feeds a customer, their market share goes up, so being good can snowball.

Since this is percentage based on the market share, your market share will go up quickly, but as time goes on, since the change is always a fixed amount, that fixed amount will increase percentage wise less and less. Everyone starts with an integer of 1-10, and it will go up 1 each success. So increase of 10 to 11 is a 10% increase, but a 100 to 101 is a 1% increase.

 

Anyways, I've unit tested it and each part works, and I'm happy with it for now. The player will have the option of just going wherever they want. For now though, we move on to the last type of company. Service Companies.

Service Companies will probably be the meat of the game when all the systems are in place. They aren't going to interact with Goods. They are going to provide services to companies and to the player. Most markets are usually service based.

To get them online and working with my company, I really just want utilities up and running. As companies hire more employees, they will need more utilities or productivity will be hindered.  We will need an ISP utilities which I'm bundling with electricity. They will need IT services to keep everything running. Janitorial services. Mechanics. There will be builders that create more real estate for companies to open more businesses. I will have goods that aren't for eating, but required for construction. Legal services for when I implement a justice system. Accounting services for companies to get their financials straight. Customer service to make sure we don't lose customers. Marketing companies to increase market penetration and market share. Sales forces to get contracts cheaply.

Service companies require experts, and that's basically it. I will eventually put supplies in the game like pens and pencils, but keep it abstract with just a "supplies" account on the ledger, and periodically decrement it. Productivity will suffer if the supplies account isn't kept up.

I have the code architecture in place for service companies, so it should be a simple manner of creating the Licenses and the Job Types for them, and then getting Service Contracts up for their services. Penalize companies if they have a certain number of employees and they don't have required services. Hopefully have that before the weekend is done.

But the goods and contracts are all interacting and moving. Once I have Service companies up I will work on how the player is going to interact with all of this, and start polishing the UI and art to get it ready for Alpha!




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 DevJarmo
      Hello,
      I’m a network developer looking for part-time/hobby C# projects destined for public release—Indie or Small Team Work preferred.
      PM with project info and any links you have, I’ll take a look and get back to you as soon as practical.
       
      Jarmo
    • By RoKabium Games
      There are several ways of boosting the health bar of the Alien while exploring. Heart crystals gives you the biggest boosts and the rare blue ones give the highest top-up of them all.
    • By kensarto
      Getting a bit desperate, not knowing what to do as this is a topic I've only just dipped my feet into and so far attempts at getting assistance directly on the Unity Scripting forum has proved fruitless and attempting the gamedev reddit failed because of my decisions in how I tried to share the project while it was on the first page of results. 

      https://drive.google.com/drive/folders/1so24aSUCRWSRynpEo8ZLGNdKHkncQ589?usp=sharing

      Above is a link to my unity project. It is a bit muddled up as I have been messing around with it for a while now, but amongst the assets are a series of scripts which should produce a path finding effect. Essentially a Seeker finds the most efficient route, while avoiding obstacles to the target and then follows the nodes to reach the target.

      The issue I am having is that while for the most part it sticks to the grid, after a short time it will move itself from the centre of each tile/node and will deviate to the point where it doesn't even reach the target before it stops completely.

      The goal is to have a Runescape style of movement, click on the tile walk to that tile and stop, and development of anything resembling a game can't begin until I can safely move a player around accurately.

      If someone could tell me what is wrong with the scripts (I suspect the unit.cs script personally but can't confirm) and how to fix it so that it works as intended that would be great. So far the only advice I've been given is to use Debug.Log on different values to make sure they look right, which I already did to check the waypoints are being represented correctly (which they are) among other things.

      https://www.youtube.com/watch?v=HtdQOSfpRc8&feature=youtu.be

      I have also attached a youtube video showing how it will arbitrarily sit perfectly on the target in the centre of the tile and not do that under different conditions.
    • By LuisFer Ruelas
      I´m trying to upload an aws bucket but I got this error :
      Exception ocurred during uploading: Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.
        at Amazon.Runtime.Internal.UnityRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x0000e] in <bcd90127d6ba43f0a6549cfab9c38753>:0
        at Amazon.S3.AmazonS3Client.ProcessPostResponse (System.IAsyncResult result) [0x0001c] in <ea4aaa89494447eea8cc56857faf4272>:0
      UnityEngine.Debug:Log(Object)
      <>c:<UploadToS3>b__10_0(AmazonServiceResult`2) (at Assets/Scripts/AWSManager.cs:86)
      Amazon.S3.<>c__DisplayClass7_0:<PostObjectAsync>b__0(AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions)
      Amazon.Runtime.Internal.UnityMainThreadDispatcher:ProcessRequests()
      Amazon.Runtime.Internal.UnityMainThreadDispatcher:Update()
      Here´s my code, can anybody help ?
      using UnityEngine;
      using System.Collections;
      using UnityEngine.UI;
      using Amazon.S3;
      using Amazon.S3.Model;
      using Amazon.Runtime;
      using System.IO;
      using System;
      using Amazon.S3.Util;
      using System.Collections.Generic;
      using Amazon.CognitoIdentity;
      using Amazon;
      using Facebook.Unity;
      public class AWSManager : MonoBehaviour
      {
      private static AWSManager _instance;
      public static AWSManager Instance {
      get {
      if (_instance == null){
      Debug.LogError("AWS Manager is null");
      }
      return _instance;
      }
      }
      public string S3Region = RegionEndpoint.USEast2.SystemName;
      private RegionEndpoint _S3Region {
      get { return RegionEndpoint.GetBySystemName(S3Region); }
      }
      private AmazonS3Client _s3Client;
      public AmazonS3Client S3Client {
      get {
      if (_s3Client == null){
      _s3Client = new AmazonS3Client(new CognitoAWSCredentials (
      "us-east-2:0267fa51-2e5f-44d5-80e3-f812fdc5ed20", //Identity Pool ID
      RegionEndpoint.USEast2 //Region
      ), _S3Region);
      }
      return _s3Client;
      }
      }
      private void Awake(){
      _instance = this;
      UnityInitializer.AttachToGameObject(this.gameObject);
      AWSConfigs.HttpClient = AWSConfigs.HttpClientOption.UnityWebRequest;
      // ResultText is a label used for displaying status information
      S3Client.ListBucketsAsync(new ListBucketsRequest(), (responseObject) =>
      {
      if (responseObject.Exception == null)
      {
      responseObject.Response.Buckets.ForEach((s3b) =>
      {
      print ("Bucket Name: " + s3b.BucketName);
      });
      }
      else
      {
      print ("AWS Error: " + responseObject.Exception);
      }
      });
      }
      public void UploadToS3(string fileName){
      FileStream stream = new FileStream(fileName,
      FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
      PostObjectRequest request = new PostObjectRequest(){
      Bucket = "reservacionfiles",
      Key = fileName,
      InputStream = stream,
      CannedACL = S3CannedACL.Private,
      Region = _S3Region
      };
      S3Client.PostObjectAsync(request, (responseObj) => {
      if (responseObj.Exception == null) {
      Debug.Log ("Successfully posted to bucket");
      } else {
      Debug.Log ("Exception ocurred during uploading: " + responseObj.Exception);
      }
      });
      }
      }
      I´m trying to upload an aws bucket but I got this error : Exception ocurred during uploading: Amazon.Runtime.Internal.HttpErrorResponseException: Exception of type 'Amazon.Runtime.Internal.HttpErrorResponseException' was thrown.   at Amazon.Runtime.Internal.UnityRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x0000e] in <bcd90127d6ba43f0a6549cfab9c38753>:0   at Amazon.S3.AmazonS3Client.ProcessPostResponse (System.IAsyncResult result) [0x0001c] in <ea4aaa89494447eea8cc56857faf4272>:0 UnityEngine.Debug:Log(Object) <>c:<UploadToS3>b__10_0(AmazonServiceResult`2) (at Assets/Scripts/AWSManager.cs:86) Amazon.S3.<>c__DisplayClass7_0:<PostObjectAsync>b__0(AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions) Amazon.Runtime.Internal.UnityMainThreadDispatcher:ProcessRequests() Amazon.Runtime.Internal.UnityMainThreadDispatcher:Update()   Here´s my code, can anybody help ?   using UnityEngine; using System.Collections; using UnityEngine.UI; using Amazon.S3; using Amazon.S3.Model; using Amazon.Runtime; using System.IO; using System; using Amazon.S3.Util; using System.Collections.Generic; using Amazon.CognitoIdentity; using Amazon; using Facebook.Unity;   public class AWSManager : MonoBehaviour { private static AWSManager _instance; public static AWSManager Instance { get { if (_instance == null){ Debug.LogError("AWS Manager is null"); } return _instance; } }   public string S3Region = RegionEndpoint.USEast2.SystemName; private RegionEndpoint _S3Region { get { return RegionEndpoint.GetBySystemName(S3Region); } }   private AmazonS3Client _s3Client; public AmazonS3Client S3Client { get { if (_s3Client == null){ _s3Client = new AmazonS3Client(new CognitoAWSCredentials ( "us-east-2:0267fa51-2e5f-44d5-80e3-f812fdc5ed20", //Identity Pool ID RegionEndpoint.USEast2 //Region ), _S3Region); } return _s3Client; } }   private void Awake(){   _instance = this;   UnityInitializer.AttachToGameObject(this.gameObject); AWSConfigs.HttpClient = AWSConfigs.HttpClientOption.UnityWebRequest;   // ResultText is a label used for displaying status information S3Client.ListBucketsAsync(new ListBucketsRequest(), (responseObject) => { if (responseObject.Exception == null) { responseObject.Response.Buckets.ForEach((s3b) => { print ("Bucket Name: " + s3b.BucketName); }); } else { print ("AWS Error: " + responseObject.Exception); } });   }   public void UploadToS3(string fileName){ FileStream stream = new FileStream(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);   PostObjectRequest request = new PostObjectRequest(){ Bucket = "reservacionfiles", Key = fileName, InputStream = stream, CannedACL = S3CannedACL.Private, Region = _S3Region };   S3Client.PostObjectAsync(request, (responseObj) => { if (responseObj.Exception == null) { Debug.Log ("Successfully posted to bucket"); } else { Debug.Log ("Exception ocurred during uploading: " + responseObj.Exception); } }); } }
  • 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!