private void InitializeFundamentalIndustry()
    {
        var niches = new NicheType[] {
            NicheType.Tech_SearchEngine,
            NicheType.Tech_OSDesktop,
            NicheType.Tech_Clouds,
            NicheType.Tech_Browser,
            NicheType.Tech_MobileOS,
        };

        AttachNichesToIndustry(IndustryType.Technology, niches);

        var cloud =
            new MarketProfile(AudienceSize.SmallEnterprise, Monetisation.Enterprise, Margin.High, AppComplexity.Hard, NicheSpeed.Year);
        var searchEngine =
            new MarketProfile(AudienceSize.Global, Monetisation.Adverts, Margin.High, AppComplexity.Humongous, NicheSpeed.ThreeYears);
        var desktop =
            new MarketProfile(AudienceSize.Global, Monetisation.Paid, Margin.High, AppComplexity.Humongous, NicheSpeed.ThreeYears);
        var browser =
            new MarketProfile(AudienceSize.Global, Monetisation.Adverts, Margin.High, AppComplexity.Hard, NicheSpeed.Year);

        SetMarkets(NicheType.Tech_OSDesktop, 1980, 2040, desktop);
        SetMarkets(NicheType.Tech_Browser, 1990, 2050, browser);
        SetMarkets(NicheType.Tech_SearchEngine, 1995, 2040, searchEngine);

        SetMarkets(NicheType.Tech_MobileOS, 2005, 2070, desktop);
        SetMarkets(NicheType.Tech_Clouds, 2006, 2050, cloud);
    }
Example #2
0
    void Render()
    {
        var baseForIndustry = new Vector3(350, -350); // Rendering.GetPointPositionOnCircle(0, 1, 0, 1);

        if (currNiche != SelectedNiche)
        {
            foreach (var n in niches)
            {
                Destroy(n.Value);
            }

            foreach (var c in companies)
            {
                Destroy(c.Value);
            }

            niches.Clear();
            companies.Clear();

            currNiche = SelectedNiche;
        }

        RenderMarket(SelectedNiche, 0, 1, baseForIndustry);

        // clean dead companies
        foreach (var c in companies)
        {
            c.Value.SetActive(Companies.Get(Q, c.Key).isAlive);
        }
    }
        public static int GetMarketDemandRisk(GameContext gameContext, NicheType nicheType)
        {
            var phase = GetMarketState(gameContext, nicheType);

            switch (phase)
            {
            case MarketState.Idle:
                return(C.RISKS_DEMAND_MAX);

            case MarketState.Innovation:
                return(C.RISKS_DEMAND_MAX / 2);

            case MarketState.Trending:
                return(C.RISKS_DEMAND_MAX / 5);

            case MarketState.MassGrowth:
            case MarketState.MassUsage:
                return(C.RISKS_DEMAND_MAX / 10);

            case MarketState.Decay:
                return(C.RISKS_DEMAND_MAX / 2);

            case MarketState.Death:
            default:
                return(100);
            }
        }
        public static GameEntity SetMarkets(NicheType nicheType,
                                            int startDate,
                                            int duration,
                                            GameContext gameContext,
                                            MarketProfile settings
                                            )
        {
            var nicheId = GetNicheId(nicheType);

            var clients = GetFullAudience(settings, nicheId);

            var techCost = GetTechCost(settings, nicheId);
            var adCosts  = GetAdCost(settings, nicheId);
            var price    = GetProductPrice(settings, adCosts, nicheId);


            var n = SetNicheCosts(nicheType, price, clients, techCost, adCosts, gameContext);

            Marketing.GetAudienceInfos();

            var positionings = GetStandardPositionings(nicheType);

            var clientsContainer = new Dictionary <int, long>
            {
                [0] = clients
            };

            n.ReplaceNicheSegments(positionings);
            n.ReplaceNicheClientsContainer(clientsContainer);
            n.ReplaceNicheLifecycle(GetYear(startDate), n.nicheLifecycle.Growth, GetYear(duration));
            n.ReplaceNicheBaseProfile(settings);

            return(n);
        }
Example #5
0
    public override string RenderValue()
    {
        NicheType    NicheType    = SelectedNiche;
        IndustryType IndustryType = Markets.GetIndustry(NicheType, Q);

        return(Visuals.Link("Is part of " + Enums.GetFormattedIndustryName(IndustryType) + " industry"));
    }
Example #6
0
    public CompanyTaskExploreMarket(NicheType nicheType)
    {
        CompanyTaskType = CompanyTaskType.ExploreMarket;
        NicheType       = nicheType;

        CompanyId = -1;
    }
Example #7
0
    void RenderMarketName(NicheType nicheType)
    {
        var industryType = Markets.GetIndustry(nicheType, Q);


        var hasCompany          = Companies.HasCompanyOnMarket(MyCompany, nicheType, Q);
        var isInterestingMarket = MyCompany.companyFocus.Niches.Contains(nicheType);

        var marketColorName = Colors.COLOR_MARKET_ATTITUDE_NOT_INTERESTED;

        if (hasCompany)
        {
            marketColorName = Colors.COLOR_MARKET_ATTITUDE_HAS_COMPANY;
        }
        else if (isInterestingMarket)
        {
            marketColorName = Colors.COLOR_MARKET_ATTITUDE_FOCUS_ONLY;
        }


        bool isOurIndustry     = MyCompany.companyFocus.Industries.Contains(industryType);
        var  industryColorName = isOurIndustry ? Colors.COLOR_MARKET_ATTITUDE_HAS_COMPANY : Colors.COLOR_MARKET_ATTITUDE_NOT_INTERESTED;


        var coloredMarket   = Visuals.Colorize(Enums.GetFormattedNicheName(nicheType), marketColorName);
        var coloredIndustry = Visuals.Colorize(Enums.GetFormattedIndustryName(industryType), industryColorName);

        NicheName.text = $"{coloredMarket}\n<i>{coloredIndustry}</i>";
    }
Example #8
0
    public void SetNiche(GameEntity nicheEntity, bool hidePotential = false)
    {
        Niche  = nicheEntity.niche.NicheType;
        nicheE = nicheEntity;

        Render(hidePotential);
    }
        public static GameEntity CreateNicheMockup(NicheType niche, GameContext GameContext)
        {
            var e = GameContext.CreateEntity();

            e.AddNiche(
                niche,
                IndustryType.Communications,
                new List <MarketCompatibility>(),
                new List <NicheType>(),
                NicheType.Com_SocialNetwork
                );

            // TODO duplicate in Iteration.cs
            GetMarketRequirements(GameContext, e);


            e.AddNicheCosts(1, 1, 1, 1);
            e.AddNicheBaseProfile(new MarketProfile {
                AppComplexity    = AppComplexity.Average,
                AudienceSize     = AudienceSize.Million,
                NicheSpeed       = NicheSpeed.Year,
                Margin           = Margin.Mid,
                MonetisationType = Monetisation.Service
            });

            var clientGrowthDictionary = new Dictionary <MarketState, int>
            {
                [MarketState.Idle]       = 0,                                // 0
                [MarketState.Innovation] = UnityEngine.Random.Range(1, 3),   // 2-5            Xt
                [MarketState.Trending]   = UnityEngine.Random.Range(3, 10),  // 4 - 10           5Xt
                [MarketState.MassGrowth] = UnityEngine.Random.Range(10, 15), // 7 - 15            10Xt
                [MarketState.Decay]      = UnityEngine.Random.Range(2, 5),   // 2 - 5 // churn      3Xt-22Xt
                [MarketState.Death]      = 0,                                // churn
            };

            e.AddNicheLifecycle(0, clientGrowthDictionary, 0);

            e.AddNicheState(MarketState.Idle, 0);
            UpdateNicheDuration(e);

            var audiences = Marketing.GetAudienceInfos();

            var positionings = audiences.Select(a => new ProductPositioning
            {
                ID            = 0,
                name          = "",
                marketShare   = 100,
                priceModifier = 1f,
                Loyalties     = audiences.Select(ad => UnityEngine.Random.Range(-10, 10)).ToList(),
                isCompetitive = false,
            })
                               .ToList();

            e.AddNicheClientsContainer(new Dictionary <int, long>());
            e.AddNicheSegments(positionings);
            e.AddSegment(0);

            return(e);
        }
Example #10
0
        public static long GetMarketSegmentPotential(GameContext GameContext, NicheType nicheType, int segmentId)
        {
            var niche = GetNiche(GameContext, nicheType);

            var segmentShare = GetSegmentMarketShare(GameContext, nicheType, segmentId);

            return(GetMarketPotential(niche) * segmentShare / 100);
        }
Example #11
0
    public NotificationMessageCompanyFocusChange(int CompanyId, bool Added, NicheType nicheType)
    {
        NotificationType = NotificationType.CompanyFocusChange;

        this.CompanyId = CompanyId;
        this.Added     = Added;
        this.NicheType = nicheType;
    }
Example #12
0
        public static float GetSegmentProductPrice(GameContext gameContext, NicheType nicheType, int segmentId)
        {
            var priceModifier = GetPositioningPriceModifier(gameContext, nicheType, segmentId);

            var baseIncome = GetBaseProductPrice(nicheType, gameContext);

            return(baseIncome * priceModifier);
        }
Example #13
0
    public void ReplaceProduct(NicheType newNiche, int newConcept)
    {
        var index     = GameComponentsLookup.Product;
        var component = (ProductComponent)CreateComponent(index, typeof(ProductComponent));

        component.Niche   = newNiche;
        component.Concept = newConcept;
        ReplaceComponent(index, component);
    }
Example #14
0
    GameObject GetMarketObject(NicheType niche)
    {
        if (!niches.ContainsKey(niche))
        {
            niches[niche] = Instantiate(NichePrefab, transform);
        }

        return(niches[niche]);
    }
Example #15
0
        public static bool IsInSphereOfInterest(GameEntity company, NicheType niche)
        {
            if (!company.hasCompanyFocus)
            {
                return(false);
            }

            return(company.companyFocus.Niches.Contains(niche));
        }
    public override void Execute()
    {
        NicheType nicheType = Popup.NicheType;

        var id = Companies.CreateProductAndAttachItToGroup(Q, nicheType, MyCompany);

        NotificationUtils.ClosePopup(Q);
        NotificationUtils.AddPopup(Q, new PopupMessageCreateApp(id));
    }
    void OccupyNiche(NicheType n, GameEntity managingCompany)
    {
        var hasCandidates = TryToAcquireCompany(n, managingCompany);

        if (!hasCandidates)
        {
            CreateCompanyOnMarket(n, managingCompany);
        }
    }
Example #18
0
    public void SetNiche(NicheType nicheType)
    {
        NicheType = nicheType;

        StartCampaignButton.SetNiche(nicheType, Input);

        Input.Select();
        Input.ActivateInputField();
    }
Example #19
0
        public static void RemoveFromSphereOfInfluence(NicheType nicheType, GameEntity company, GameContext gameContext)
        {
            var focus  = company.companyFocus;
            var niches = focus.Niches.Remove(nicheType);

            NotifyAboutCompanyFocusChange(gameContext, company.company.Id, false, nicheType);

            company.ReplaceCompanyFocus(focus.Niches, focus.Industries);
        }
Example #20
0
        public static bool SendInspirationPopup(GameContext gameContext, NicheType nicheType)
        {
            if (Companies.IsInPlayerSphereOfInterest(nicheType, gameContext))
            {
                AddPopup(gameContext, new PopupMessageMarketInspiration(nicheType));
                return(true);
            }

            return(false);
        }
Example #21
0
    public void SetEntity(NicheType nicheType)
    {
        NicheType = nicheType;

        var exp = SelectedHuman.humanSkills.Expertise[NicheType];

        ProgressBar.SetValue(exp, 100);

        LinkToNiche.SetNiche(NicheType);
        LinkToNiche.gameObject.GetComponent <Text>().text = Enums.GetFormattedNicheName(NicheType);
    }
Example #22
0
        public static GameEntity Get(GameContext context, NicheType nicheType)
        {
            var e = Array.Find(GetNiches(context), n => n.niche.NicheType == nicheType);

            if (e == null)
            {
                e = CreateNicheMockup(nicheType, context);
            }

            return(e);
        }
Example #23
0
    GameEntity GenerateProductCompany(string name, NicheType nicheType)
    {
        var product = Companies.GenerateProductCompany(Q, name, nicheType);

        var niche        = Markets.Get(Q, product);
        var startCapital = Markets.GetStartCapital(niche, Q) * Random.Range(150, 200) / 100;

        Companies.SetResources(product, startCapital, "start capital in game restore");

        return(product);
    }
Example #24
0
        public static bool InspirationToPlayer(NicheType nicheType, GameContext gameContext)
        {
            var inspirationChance = 6;

            if (inspirationChance > Random.Range(0, 100))
            {
                return(NotificationUtils.SendInspirationPopup(gameContext, nicheType));
            }

            return(false);
        }
Example #25
0
        public static bool IsInPlayerSphereOfInterest(NicheType nicheType, GameContext gameContext)
        {
            var player = GetPlayerCompany(gameContext);

            if (player == null)
            {
                return(false);
            }

            return(IsInSphereOfInterest(player, nicheType));
        }
Example #26
0
    float GetMarketScale(NicheType niche)
    {
        var marketSize = Markets.GetMarketSize(Q, niche);

        if (marketSize < 0)
        {
            marketSize = 1000;
        }

        return(Mathf.Clamp(Mathf.Log10(marketSize) / 4f, 0.8f, 2.5f));
    }
Example #27
0
        public static GameEntity AutoGenerateProductCompany(NicheType nicheType, GameContext gameContext)
        {
            var playersOnMarket = Markets.GetCompetitorsAmount(nicheType, gameContext);

            var c = GenerateProductCompany(gameContext, Enums.GetFormattedNicheName(nicheType) + " " + playersOnMarket, nicheType);

            AutoFillShareholders(gameContext, c, true);
            //SetFounderAmbitionDueToMarketSize(c, gameContext);

            return(c);
        }
Example #28
0
        public static GameEntity GetPotentialMarketLeader(GameContext context, NicheType niche)
        {
            var list = GetProductsOnMarket(context, niche)
                       .OrderByDescending(p => Products.GetInnovationChance(p, context) * 100 + (int)p.branding.BrandPower);

            if (list.Count() == 0)
            {
                return(null);
            }

            return(list.First());
        }
Example #29
0
    void RenderCompanies(NicheType niche, GameObject m)
    {
        var competitors = Markets.GetProductsOnMarket(Q, niche, true);

        var marketPosition = m.transform.localPosition;
        var count          = competitors.Count();

        for (var i = 0; i < count; i++)
        {
            RenderCompany(competitors[i], i, count, marketPosition);
        }
    }
    public void ReplaceNiche(NicheType newNicheType, IndustryType newIndustryType, System.Collections.Generic.List <MarketCompatibility> newMarketCompatibilities, System.Collections.Generic.List <NicheType> newCompetingNiches, NicheType newParent)
    {
        var index     = GameComponentsLookup.Niche;
        var component = (NicheComponent)CreateComponent(index, typeof(NicheComponent));

        component.NicheType             = newNicheType;
        component.IndustryType          = newIndustryType;
        component.MarketCompatibilities = newMarketCompatibilities;
        component.CompetingNiches       = newCompetingNiches;
        component.Parent = newParent;
        ReplaceComponent(index, component);
    }