gamecache & multiplayer

Darg

Administrator
I've just been wandering through the topics here covering the gamecache and its use in multiplayer maps. One point still has me confused though - when a piece of data is stored in the gamecache in a multiplayer game, on whose computer is the data stored ? Is there an implication that it will save the data to a gamecache on all player's computers?

And likewise, when is comes to retrieving data from a gamecache, from whose computer does it get the data from ?

Do the "SyncStored" functions comes into play here at all? e.g. do you have to use say "SyncStoredBoolean" to sync a bool value across all gamecaches before you can retrieve it again ?

Ta.
 

AceHart

Your Friendly Neighborhood Admin
Triggers run on all comps in the game.
As such, a cache is also created on all comps in the game.

"Sync"ing anything is not needed.
The only use for that I've ever seen is the script that tries to guess the host.
The player that replies the fastest is most likely the host.
Other than that, there's nothing to worry.

Note though that actually saving the cache to disk does not work in multi-player.

Besides, you should be using NewGen and structs, with an attachment system that goes along with it... :p
 

Darg

Administrator
Thanks for that.

I wasn't actually planning to use gamecaches, I was just doing some reading about Newgen and structs etc. when I came across some gamecache discussion.

When I get curious about something, it will usually nag at me until I can get the answer : - )

Actually, while I'm here, perhaps you can help me with my specific problem.

This is an action in GUI (yes it leaks, but this is only an example):

Set someUnitGroup = (Units within 1000.00 of (Position of someUnit) matching ((((Matching unit) belongs to an enemy of (Owner of someOtherUnit)) == True) and (((Matching unit) is alive) == True)))
which looks like this in JASS (after a small amount of cleaning):

JASS:
function IsUnitEnemy takes nothing returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_someOtherUnit)) == true )
endfunction

function IsUnitAlive takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function IsUnitMatching takes nothing returns boolean
    return GetBooleanAnd( IsUnitEnemy (), IsUnitAlive () )
endfunction

function Trig_someTrigger_Actions takes nothing returns nothing
    set udg_TempUnitGroup = GetUnitsInRangeOfLocMatching(1000.00, GetUnitLoc(udg_someUnit), Condition(function IsUnitMatching ))
endfunction


My problem is that, in the function IsUnitEnemy(), I want "udg_someOtherUnit" to be a local not a global. I want this local to be declared in "Trig_someTrigger_Actions" and passed in to the function as a parameter.

e.g.

JASS:
function IsUnitEnemy takes unit someOtherUnit returns boolean
    return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(someOtherUnit)) == true )
endfunction

function IsUnitAlive takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function IsUnitMatching takes unit someOtherUnit returns boolean
    return GetBooleanAnd( IsUnitEnemy (someOtherUnit), IsUnitAlive () )
endfunction

function Trig_someTrigger_Actions takes nothing returns nothing
    local unit someUnit = <getsomeunit>
    set udg_TempUnitGroup = GetUnitsInRangeOfLocMatching(1000.00, GetUnitLoc(udg_someUnit), Condition(function IsUnitMatching(someUnit)))
endfunction


The problem with this code is that "Condition(function IsUnitMatching(someUnit))" is not correct JASS, you cannot pass in parameters this way.

Is there a workaround solution to solve the problem here ?
 

AceHart

Your Friendly Neighborhood Admin
All in one:
return IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(someOtherUnit)) == true and IsUnitAliveBJ(GetFilterUnit()) == true

Then find out what that "bj" is doing, and replace it :p


Well, use a global variable...
set variable = ...
set group = GetUnits...

Those two lines, assuming you put no wait there, are uninterruptible.

If you don't want to create some, use bj_lastCreatedUnit, or the "ghouls" array.
 

Darg

Administrator
LOL

does anything get by you ?

I'm doing it when I've got a spare moment, pretty much seeing where the flow takes me. That's not to say I'm just throwing "whatever" into it, if I'm working on it then I take it seriously. But these things are very time consuming unfortunately.....and I ain't got a lot of that anymore........
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    check out this place apparently it is the best roommate site out there roommates.com lol
  • Varine Varine:
    The homeless people reminded me of New York
  • Varine Varine:
    I'll check it out, my lease expires in like a few months so I need to figure something out.
  • Varine Varine:
    I tried to open a food truck in Sandpoint a few years ago but the city said no, then like two years later they passed new laws to encourage it and gave them all fucking tax breaks and shit. And at that point I didn't have enough money to go buy one so I was way too late to the game once other cities realized they could just bring their existing truck there, or sell their brick and mortar.
  • Varine Varine:
    I do like food trucks though, they're way more fun than restaurants and usually I also get some of that tip money there.
  • Varine Varine:
    Restaurants are really hard if you don't have a back up source of income to fund them sometimes, in my experience most owners either got really really lucky, had existing money that allowed them to buy an already successful one, or they have family money to fall back on for loans. It's few and far between to see very inspiring success stories where the person actually got it through hard work and perseverance. I thought about opening one lots and I always just end up not thinking it'll work. I would much rather just find someone that has that money and go work for them
  • The Helper The Helper:
    i am not talking about opening a brick and mortar I am talking about food trucks though I have seen some brick and mortar mexican places open up during covid that are doing good because there food is awesome!
  • The Helper The Helper:
    Food trucks are killing out here because Bars cannot open unless they sell food and the governor ok'd the use of a food truck in front as serving food
  • The Helper The Helper:
    Just not enough food trucks
  • The Helper The Helper:
    a buddy of mine just opened up a food truck and he is killing it but he is a great cook and has awesome food right in the middle of the pandemic too food trucks are immune to pandemic because they are take out in Texas you will always be able to get take out or delivery
  • The Helper The Helper:
    He is in the different food facebook groups in houston and posts videos of him making his food
  • The Helper The Helper:
    he is killing it
  • jonas jonas:
    @Varine with the restaurants, there surely is a lot of luck and hard work but most restaurants fail because they suck. Flair isn't right, economics not well thought through, food is mediocre or sucks, location is bad, etc. If you're thinking about opening one, make sure you're looking at the stories of those that would be playing at your level, don't let your hopes be dragged down by all the subpar restaurants out there.
  • jonas jonas:
    I'm a bit worried about the future of data science, there's an influx of incompetent people hired by incompetent managers, that can't last. But I'm sure smart data scientists will always be useful and hireable. Same as smart security people.
  • jonas jonas:
    My sister in law worked in a vegan food truck, the owners were also making a killing, added several trucks and opened two restaurants over 5 years
  • Ghan Ghan:
    The CompTIA stuff is pretty much crap unfortunately. The places that ask for those low-level certs aren't likely places you want to work. For IT you really want a degree, but in the meantime you need to figure out some way to learn the skills. Cybersecurity is really hot right now so competition is fierce.
  • tom_mai78101 tom_mai78101:
    I realized I don't have anything much to say, other than "Good luck!". Compared to other places, I'm just very lucky we didn't have a lot of surges of cases coming in.
  • The Helper The Helper:
    My daughter just got back from school at Georgetown TX, outside of Austin and said there were 100 cases in the last week but she also said nobody was wearing a mask anywhere so people mask up and stay safe!
    +2
  • thewrongvine thewrongvine:
    happy thanksgiving folks!
    +1
  • Ralle Ralle:
    PLOOB
  • Varine Varine:
    @Gyah Yeah I figured they aren't particularly valuable, but they'll at the least act as a baseline for some entry level work somewhere.
  • Varine Varine:
    I now see how horribly I spelled @Ghan
  • Varine Varine:
    I had a rough morning
  • The Helper The Helper:
    that field is going to explode and though there is competition there is going to be room for all levels in the coming years imho.
  • tom_mai78101 tom_mai78101:
    Why are we competing for rough mornings? :(

    Members online

    Affiliates

    Hive Workshop
    Top