#archived-dots

1 messages ยท Page 61 of 1

edgy fulcrum
#

it's somewhat annoying working with Unity Collections when simple things throw exceptions and I'm unable to sanely manage them in jobs...

#

for example, I cannot add to NativeParallelHashSet.ParallelWriter without exceeding the capacity and throwing an exception!

rustic rain
#

I'v been seeing a lot of hiring companies use ECS, but they use Entitas mostly as I remember

rotund token
#

parallel containers can't resize

#

that's how they're safely parallel

edgy fulcrum
#

I want to add and abort if its full

#

I can do it with lists, but not with hashsets mmm

rotund token
#

how do you do it with lists in parallel

#

without a lock

edgy fulcrum
rustic rain
#

do you really need parallel?
Singlecore job usually does better job with relatively small amounts of data

rotund token
#

i have an extension for this already in my library

#

that that doesn't solve your problem

hot basin
#

how to I get a singleton of managed component now?

edgy fulcrum
#

yeah exactly

rotund token
#

life tip is to not do it in parallel

rotund token
rustic rain
#

wait what

#

that's a thing?

rotund token
#

yes

rustic rain
#

I didn't know ๐Ÿ˜…

rotund token
#

there's a whole managedapi

rustic rain
#

I'v been using QueryBuilder

#

holy

edgy fulcrum
#

mmm then I have to use my own interlocked int to figure out the length of the queue

#

its a simple pattern: parallel check ents, select ents that need processing, put them in a queue, process them (but limit the queue to N so we dont have FPS spikes)

hot basin
rotund token
#

swear people don't read the changelog

#

(you're excused Krajca since you're just coming back)

#

but ManagedAPI was half the pre.15 changelog

#

there wasn't much else added

hot basin
#

nah changelog is worth reading when you actively working on it so you know what and where it changes

#

...

#

apparently I was aware of incoming change

#

snippet from another script:

//TODO use SystemAPI.ManagedAPI when it will be available```
rotund token
#

๐Ÿ˜„

rustic rain
#

@rotund token sir, have you worked on localization for UI?
I'm trying to figure out a proper pattern, without too much boilerplate

rotund token
#

urd

#

yes

#

i have localization support using unity localization

rustic rain
#

I have only been working with kind of existing framework that worked like Translate.Key("PhraseNumberX");

#

but I doubt it's a good one

rotund token
#

(btw this comes natively in 2023 so my implementation is basic as i dont want ot invest too much time in it)

#

oh mines like automatic

hot basin
#

do addressables work with ECS?

rotund token
rotund token
#

i based im implementation off this

rustic rain
#

Some unity dev in UI TOolkit channel told me, that they are working on Binding first

#

and then on Localization

rotund token
#

We do have a prototype based on a new bindings feature for UI Toolkit. Unfortunately, it will require Unity 2023 and above as that's the version the feature should land in.

rustic rain
#

๐Ÿค”

#

hopefully Entities will support it

rotund token
#

earlier this week

#

The work is still ongoing with an estimate of landing during the 2023 cycle. We are currently waiting for the UI Toolkit binding improvements to land, once that is completed then we need to apply some changes to the package.

#

anyway yeah my implementation works like above link

rustic rain
#

so you just query over all TextElements?

#

and swap key for value?

rotund token
#

but this is my script

#

that exists in each of my UISystemBase

#

(i havent looked at this in like 2 months so might be a bit dated)

viral sonnet
rotund token
#

they recently said they'll provide a demo with full 1.0 release

#

from my quick look at it

#

you can do a lot of interesting stuff

#

i want to spend a week adding modding support to my game via this and burst loading

#

just need to find the time

hot basin
rotund token
#

enzi replied to you

hot basin
#

oh wow don't know how I missed that

brave field
rustic rain
#

loading 1 entity Prefab on demand = loading 1 subscene with that entity

#

which is already doable and very simple

brave field
rustic rain
brave field
#

๐Ÿ‘€ What I trying to say is since 1.0 introduce baking, you are forced to bake all entities and prefab entities into subscene which also means there's no path for load by demand. Previously before 1.0, I believe most of the people using runtime conversation to achieve this

rotund token
#

I don't think thats really true

#

It had been known for like 1.5+ years pre 1.0 that runtime conversion was on the way out

#

And many experienced users had already transitioned

#

Many grudgingly ๐Ÿ˜†

brave field
#

๐Ÿฅฒ Not really like the current design that baked entity and entity prefab will never escape from subscene. For the use case that need to load certain entity and entity prefab on demand, it's really hard to achieve it. Currently I just dun care and bake and load all of them as one single subscene but I believe it's really bad for loading time and memory

rotund token
#

This I agree with it

rotund token
#

Something I've been researching

#

Seperating assets out

#

It's a problem of prefabs

viral sonnet
#

i also don't have an answer to loading prefabs on demand. seems we have to load the full subscene even when we only want one prefab from the subscene. best would be to introduce a subscene for each prefab but that sounds annoying

brave field
rustic rain
#

I'm not surw how graphics hangles unloading subcene, if you removed scene component from some of it's entities

hot basin
#

I want to say: construct player by hand, but it's a sad solution

viral sonnet
#

i think you need a subscene for each model then

rustic rain
#

But potentially, you could load subscene, then instantiate what you need, remove scene comps from it, unload subcene, register all graphics manually after

viral sonnet
#

maybe that can be automated in the build pipeline of content management

#

yeah or what issue said

#

i think that's better

hot basin
#

yeah that seems most reasonable

#

but still it seems that unity didn't provide a solution for real world case

viral sonnet
#

yeah for world streaming it seems okay though

rustic rain
#

We have critical bugs out here, better fix them first, before going into such niche cases

hot basin
viral sonnet
#

does it still crash as much? haven't checked since the initial release

rustic rain
#

Im talking about material ovverides

hot basin
#

didn't checked it either

#

I was looking for racing demo

stiff mesa
#

Hey everyone. Are Blob Assets still a thing? They are absent from the v1.0 docs.

rustic rain
#

They are a thing

viral sonnet
#

hm, there was a discussion some time ago about getting euler angles from quaternions in burst. not sure if there was any resolution but i kind of need it now. anyone has an idea?

stiff mesa
#

Ok. I've found the doc. Seems like I had a connection issue or something. The search didn't yield any results. Now it does.

hot basin
viral sonnet
#

nice thanks

#

dissapointed it's not included in quaternion. i fully get the problems but to pretend there's no use case is flat out wrong ๐Ÿ˜„

#

copy pasted a lot of SO solutions and none worked. hope those ones are better

hot basin
#

Physics seems to have most missing math function

hot basin
viral sonnet
#

yeah, total goldmine ๐Ÿ˜„

#

nice, bit unexpected that it returns radians but works great

rotund token
hot basin
rotund token
#

So you have all your entity prefabs in a single subscene without assets

viral sonnet
rotund token
#

(this is all in my library as always =D)

viral sonnet
#

can you eleborate on this? i don't think i get the part about weak asset refs

rotund token
#

You don't reference the asset directly

#

You store a guid or however you want to link it

#

And load (and unload) asset on demand when needed

viral sonnet
#

how does that work with baking then?

rotund token
#

I already use weak asset for my entity prefabs

viral sonnet
#

oh i have no doubt that it works. i just don't understand how and why. ๐Ÿ™‚ some kind of missing link

rotund token
#

All my prefabs are stored in an array in a single subscene and I only store the index on other entities (I have a whole complex system around this inspired by eizenhorn)

viral sonnet
#

like where is the entity data saved then

rotund token
#

But you can probably see the issue here

#

Every asset is therefore also stored in this subscene

viral sonnet
#

right, i remember talking about this with you ^^

rotund token
#

If u load this subscene I load all assets tied to any prefab

#

This is basically Lim's issue

viral sonnet
#

wait i'm confused now ๐Ÿ˜„ are you loading the references/guids or the assets?

rotund token
#

Now funny enough, hybrid entities don't have this issue

rotund token
#

Entities in other subscenes reference prefabs by a key

#

So other subscenes don't also make a copy of these assets

#

Anyway, need a way to decouple assets from a subscene

#

I could use addressable or content management

#

My first pass would probably be to bake 1 prefab per subscene for content delivery

viral sonnet
#

that was also my first idea ^^

rotund token
#

Addressable has an option to put everything in same bundle but build them into seperate bundles

#

This would make work flow much easier

#

If I didn't need to make 1555 different physical subscenes

#

But I haven't looked at it and possible tooling enough to know what's possible

viral sonnet
#

yeah that must be handled by the build pipeline

rotund token
#

Yeah that sample doesn't really do what I want atm

#

For the most part in just kind is putting this problem to the side for now while the tooling is improved

#

It's kind of important to build a project upon

#

But I think it you make your instantiation and destruction pipelined flexible enough you should be able to swap it out later

#

๐Ÿคž

viral sonnet
#

true, it just looks complex enough from the method calls that we would be able to build a proper pipeline

rotund token
#

I remember years of mess work project had adding addressables at a later date though

viral sonnet
#

you'd have to screw something up majorly to not be able to change the asset/build pipeline

#

hm, open for suggestions. i really dislike OOP style, can't change a value without initializing other values. but that means no caching and some more calculations. currently i'm thinking about this to optimize calculating a math.length every frame. worth it? ๐Ÿ™‚

rotund token
#

Going from synchronous to asynchronous is pretty application changing

rotund token
#

The dedicated hardware for this is very fast

#

Sure if you can avoid it and use sq version you definitely should

#

But you can crunch a lot of distance calcs before it'll be your bottleneck

viral sonnet
#

nothing about sqrt. it's more for convenience that an offset vector can be changed without any trouble

rotund token
#

Ok maybe I missed the problem

viral sonnet
#

length is needed and cached usually. having a changefilter would be overkill but also possible

#

but i'm probably overthinking this hehe

#

eh change filter it is ๐Ÿ˜„ why not

viral sonnet
#

the best investment i ever made. buying a mouse with replaceable switches. they always break and end in double clicks.

rotund token
#

i just bought a mouse that has switches that don't break ^_^'

#

i break mouse wheels instead

viral sonnet
#

new design? how can they be unbreakable? ๐Ÿ˜„

rotund token
#

in 25 years cant say i've ever broken the broken the mouse click

#

just the scroll wheel on all of them ๐Ÿ˜

#

always gunk up the the button stops working

viral sonnet
#

what the ... ๐Ÿ˜„ i have gone through 1-2 mice at least a year because of broken buttons. maybe they fk up european mice haha

#

mostly were logitech and steelseries

rotund token
#

interesting i mostly buy wireless logitech

#

wonder if theres some relation with grip

#

feb 2013 logitech g602
may 2015 logitech g602 free replacement due to wireless issue
june 2020 logitech g604 lightspeed (was not impressed with how fast i broke the scroll wheel + side buttons on this)
may 2021 logitech g502 lightspeed

#

this 502 has been flawless

#

really like it

viral sonnet
#

never had any of that series. my mice always have cable. grip shouldn't matter much. i've investigated this issue some time ago and the result was bad switches with mostly wrong voltage from manufacturers. though on the topic of grip, my clicks are mostly in the back half. small hands ^^

rotund token
#

i was thinking more palm vs claw vs fingertip grip

#

no idea if it'd matter

#

maybe your just unlucky, or i'm just lucky

#

i use my mouse a lot since i work from home as well

viral sonnet
#

no it's really a thing here. my gaming friends also have this problem a lot.

rotund token
#

don't you have warranties?

#

EU has decent consumer laws

pliant pike
#

I have to have an ambidextrous mouse because I switch from left to right handed

rotund token
#

logitech has always been good to me for warranty replacement

#

may 2015 logitech g602 free replacement due to wireless issue

#

they gave me a full new mouse even though it was 6 months out of warranty

viral sonnet
#

it's usually a hassle. i had free replacements that also broke

pliant pike
#

yeah I've heard logitech are the best with replacements

rotund token
#

i replaced a set of speakers 3 times with logitech and eventually 3 years later the store was like, do you just want your money back

#

we cbf processing this warranty again

#

(this was probably 12 years ago now)

#

when i replaced this mouse it was so weird

#

the support was like, yep we'll send you a new mouse

#

we just need a picture of your current mouse destroyed

#

i'm like what

#

am i being trolled

#

i didn't take a hammer to it, instead I manually dismantled every piece down to the internals and took a picture of that

#

so in theory i could rebuild it if needed

viral sonnet
#

lol

pliant pike
#

๐Ÿ˜†

rotund token
#

it was a very interesting experience though getting to look at all the internals

viral sonnet
#

btw. i've missed the train on cheap 3080s. instead of the price lowering it goes up now since the 4x series hit.

rotund token
#

yeah

#

nvidea quietly increased the rrp on all 3000 series cards

viral sonnet
#

i thought that was beginning of 2022 when they did that?

pliant pike
#

unlucky I managed to get at the original 3080 rrp and glad I did

rotund token
#

3080 is still the best selling gpu from nvidia atm

#

followed by 4090

#

no one wants 4080s

pliant pike
#

yeah the prices are just stupidly insane now

viral sonnet
#

and even less the 4070 ti

pliant pike
#

Its going to effect the PC gaming market

viral sonnet
#

yeah it's beyond stupid when compared to a ps5 or whichever xbox model has rtx capabilities

#

mid range cards were always around 300 euro. good luck getting that today

rotund token
#

yeah i paid like $300 AUD which would be what 200 euro for my 1060

#

time to be console gamer

pliant pike
#

minimum price now for a decent card is like 600

#

much longer of these prices and the PC market will be in serious decline

viral sonnet
#

i mean, the price for midrange cards is around the ballpark but if you look at 3060 vs 3080. the 3060 has like half the performance

rotund token
#

3440x1440 1060 gaming

#

what's that? 20fps woo

#

spent my whole budget on cpu

misty wedge
#

I wanted to upgrade during black friday but everything was still so expensive

#

1080 still going strong

viral sonnet
#

1080 club kicking

rotund token
#

not sure about rest of world but black friday in australia is

#

2 weeks beforehand put everything up 20%

#

then take 20% off

#

sales

pliant pike
#

I've still got my 1080 as backup

misty wedge
#

yeah I feel it's similar in germany

#

prices were "ok"

#

but 650โ‚ฌ is a lot of money

viral sonnet
#

650 for what? a 3080?

misty wedge
#

I wish

rotund token
#

i can nearly fly to germany for that

misty wedge
#

3070 I think?

#

might even have been a 3060

pliant pike
#

and they are superseded after a couple of years

misty wedge
#

3080 is like 850โ‚ฌ+

viral sonnet
#

same in austria. 800 was the lowest price ever

misty wedge
viral sonnet
#

people still buying. that part i don't understand ๐Ÿ˜„

misty wedge
#

I also don't feel like I'm playing a lot of stuff atm that needs a strong gpu

rotund token
#

i think the cheapest 3080 in aus hit $999aud

#

which would be 645euro

viral sonnet
#

same. i have not even one title which supports rtx

rotund token
#

we have a very competitive pc parts market

#

(though our goods tax is also only 10% so you need to factor that in)

viral sonnet
#

eu too but ... i dunno what happened

#

it's just gpus though. cpu/memory has good prices

misty wedge
#

yeah I recently bought everything else new besides the gpu and prices were ok

#

all in all still expensive though

#

PSU still going strong though jamcat

rotund token
#

i have a quiet a few year old psu now

#

but it was one of hte first platinum ones

#

probably actually broke even now

#

but im not sure it's good enough for a 4090 ๐Ÿ˜ฆ

misty wedge
#

yeah this one is gold I think, and also really old

rotund token
#

die shrinks are meant to reduce power...

misty wedge
#

its only 650W, no way can I put in a 3000+ series

#

I ran a benchmark on the 13700k and it peaked at 300W

viral sonnet
#

with electricity prices you'll be glad you don't have a larger psu ๐Ÿ˜„

rotund token
#

oh i got so lucky

#

i locked in my electricity prices for 13 months

#

before they blew up

#

i'm currently paying like half what the average price in aus is atm

#

got this till like july then it's going to be pain

viral sonnet
#

sooner or later it hits everyone -.-

#

insane what's going on. like the world going to shit in slow motion

rotund token
#

Doesn't feel that slow

viral sonnet
#

best thing that could happen when companies pay for electricity when you are in home office ๐Ÿ˜…

#

kind of makes you think what it'll mean for media. tv, pcs, consoles take up a huge fraction of the bill

misty wedge
rotund token
#

can you adopt me

misty wedge
#

if you cook once a week its a deal

rotund token
#

I cook 7 times a week

#

I can reduce it to 1

misty wedge
#

epic

viral sonnet
#

haha

misty wedge
#

@rotund token I ordered some vegemite online recently

#

am I at least a small percentage australian now

rotund token
#

You qualify for citizenship now

misty wedge
#

I was surprised it's not really a thing in germany, since it's made from the leftovers of brewing(?)

#

and you might not know this, but germans drink a lot of beer

viral sonnet
#

probably doesn't fit in the german reinheitsgebot of beer ๐Ÿ˜„

misty wedge
#

after googling I found this, which seems similar

#

but I've literally never seen it being sold anywhere

rotund token
#

That does not look like Vegemite

#

Looks like gravy

misty wedge
#

It's yeast extract ๐Ÿคทโ€โ™€๏ธ

#

I also ordered some marmite with the vegemite and was amazed that they tasted completely differently, with different consistency

rotund token
#

Yep

#

People often compare them but they are quite different

#

ok some actual dots talk

#

netcode prediction scares me

#

i don't mean implementing it

#

i mean the implications of it

misty wedge
#

what are the implications

rotund token
#

let me quote the documentation

#
/// per simulation frame, every single time the client receives a new snapshot (see <see cref="ClientServerTickRate.NetworkTickRate"/>
/// and <see cref="ClientServerTickRate.SimulationTickRate"/>). This is called "rollback and re-simulation".</b></para>
/// <para>Thesdlation prediction group ticks also get more frequent at higher pings.
/// I.e. Simplified: A 200ms client will likely re-simulate roughly x2 more frames than a 100ms connection, with caveats.
/// And note: The number of predicted, re-simulated frames can easily reach double digits. Thus, systems in this group
/// must be exceptionally fast, and are likely your CPU "hot path".
/// <i>To help mitigate this, take a look at prediction group batching here <see cref="ClientTickRate.MaxPredictionStepBatchSizeRepeatedTick"/>.</i></para>
/// <para>Pragmatically: This group contains most of the game simulation (or, at least, all simulation that should be "predicted"```
misty wedge
#

oh you mean from a performance standpoint?

rotund token
#

yep

misty wedge
#

yes, when doing ping tests it's definitely noticable

rotund token
#

yep ping ruins your fps

misty wedge
#

It's a tradeoff I guess, also not every game will need it

rotund token
#

further down

#

Pay particular attention to the systems that run in this group to keep your performance in check.

#

vs above This group contains most of the game simulation

#

=S

misty wedge
#

๐Ÿ˜…

rotund token
misty wedge
#

I think it depends, if it's not a "fast paced" game it probably wouldn't need it

rotund token
#

just not this level of accurate prediction

#

you don't want a game where you make an action/walk/etc and it is delayed 200ms

#

that's so 2010

viral sonnet
#

prediction is a must for any multiplayer game

rotund token
#

(turn based and stuff ones are fine)

misty wedge
#

^

rotund token
#

but i've been looking at implementing click to move character controller

#

and to make this predictive, i'd need synchronize my navmesh to clients (done)

#

then my pathfinding system

#

and my ORCA simulation for character avoidance

#

and while these are exceptionally fast in their own right

#

running them 10 times a frame is never going to be fast

misty wedge
#

they'd only run for a very small amount of entities on the client though right?

rotund token
#

if anyones benchmarked this, a single predictive physics object in a small static world running 10 frames

#

in netcode causes huge spikes at 200ms

misty wedge
#

is it like an RTS type thing? or do you have a "main character" you control by clicking?

#

I feel like a lot of networked games still just sync the player position as client authoritive and just leave the remainder server simulated to work around this, but that also has a lot of issues

rotund token
rotund token
#

you can't change ghost owner

#

i want to be able to take control of any ghost atm

misty wedge
#

yeah I saw that a few days back

rotund token
#

i mean it's not even an uncommon feature

#

mind control

misty wedge
#

yeah I find it strange that's still not possible

rotund token
#

my game will probably be fine if i don't use any prediction at all

#

and just make it interpolated

#

click to move games don't have as big an issue as wasd

#

poe even uses lockstep

#

but you play d3 vs poe and d3 movement feels so much nicer because of its prediction

misty wedge
#

huh, didn't know that

#

it it nonpredictive lockstep then?

rotund token
#

(poe does have a predictive mode and its how the game first launched, but no one except really poor internet quality players use it since they introduced lockstep in ~2013 because it desyncs really badly over time)

misty wedge
#

I'm still not 100% sure what parts I want to make predictive and which ones I just don't care about because it's too much hassle and the performance impact

#

I don't think I'm ever going to predict AI on the clients for example, it's just too much work

rotund token
#

i don't think theres any reason to predict that

#

or in general really predict anything but local player and causes of its actions

#

but the player tends to do the most things

misty wedge
#

yeah but for example if you swing your weapon and the enemy AI isn't predicted their position will be incorrect to what you saw

#

not a huge issue but an example of where it would desync

rotund token
#

yeah it's always an interesting thing

#

but prediction will always desync

misty wedge
#

yeah

rotund token
#

even if you were predicting the AI

misty wedge
#

I don't think it's a big issue

rotund token
#

it doesn't mean you predicted right

#

so is it even better

misty wedge
#

I think the delay is by far the most important thing

rotund token
#

if i did go fuck it

#

interpolated only

#

would make so many things so much easier ^_^'

misty wedge
#

I'm not even sure if I want to predict my projectiles

#

the ability system is predicted, and that spawns projectiles, but I'm not sure if I should make those client predicted or not

#

I guess it would feel a bit better, but I haven't messed with predictive spawning yet

rotund token
#

it feels bad if you shoot and your bullets dont come out straight away

misty wedge
#

probably

#

jammed gun

rotund token
#

but yeah style of game also matters

misty wedge
#

make it a feature

#

It's a 2d topdown rpg

#

but more medieval so no guns atm

rotund token
#

just send off the bullet ping earlier than it should be

#

๐Ÿ˜„

misty wedge
#

๐Ÿ˜…

#

predicting into the future

#

gets stunned on the server and the bullet disappears

rotund token
#

i do wish it was less focused on shooters/car games i guess

#

but i think this is just, that's what AAA studios like making

#

but the majority of users are going to be building rpgs, survival games and simulations

#

which to me netcode just doesn't handle well yet

misty wedge
#

I've enjoyed working with it for the top down stuff, I think it also lends itself well, a lot of things are a lot simpler

rotund token
#

i like the goals of it

misty wedge
#

e.g. no need to sync stuff in the "distance" because you have no projected view

rotund token
#

and how they make things like prediction much simpler

misty wedge
#

yeah definitely

#

if the prediction wasn't part of the framework I never would have bothered and done client side movement

#

which iirc is also what netcode for gameobjects does

#

haven't looked at that a lot yet though

rotund token
#

yeah no interest

#

except in it taking from netcode for entities

misty wedge
#

I used mirror a bit for some time

#

and DOTSNET

#

and UNET

#

๐Ÿ˜…

rotund token
#

we wrote our own network at work

misty wedge
#

and the horror that was unity 5.6 "networking"

rotund token
#

do not recommend

#

(i didnt write it but i've inherited fixing it)

misty wedge
#

that doesn't sound great ๐Ÿ™ƒ

rotund token
#

my new rule is dont use a network package without a minimum of 5 devs maintaining it

misty wedge
#

that still seems like a low number

#

but I guess it depends a lot on complexity and resources

rotund token
#

(and how complete it already is?)

misty wedge
#

definitely

#

i was really productive yesterday

#

I made a monocle

#

now its time to sleep

rotund token
#

cool art

#

love to see what the rest of it looks like

misty wedge
#

thanks, it has the minimum amount of pixels to be recognized as an object

#

I'm replacing a lot of the art atm so it's not very pretty right now

#

I did a lot of render refactoring the last few days

rotund token
#

better than my capsules

misty wedge
#

moving everything to actual hybrid components

rotund token
#

i should just make a game called capsule

#

and that's the player controller

#

and build the entire story around it

#

how you never fit in school because you had no arms and all your friends did

misty wedge
#

sounds like an interesting concept

#

I think there's a lot of merit to very minimalistic games, people often underestimate it

#

I saw something really cool recently, let me see if I can find it

#

This is an in progress version of Void Sols: a minimalist, top-down souls-like. This short experience contains one zone, a small collection of items and weapons and one boss. We want to hear your feedback on this game, to help us decide if we will continue to develop it into a larger experience.Souls-Like CombatLearn enemy attack patterns, manag...

โ–ถ Play video
#

I thought it was a very well executed "minimalistic" artstyle

#

since everything is pretty much just a polygon, but it still looks nice imo

rotund token
#

add glow to anything

#

and it looks good

misty wedge
#

yep, pretty much

rotund token
#

valheim definitely the game recently i've been most inspired by

#

not the pixel art, but just how much more important ambience and post processing is than graphics

misty wedge
#

yeah definitely

#

there's a really cool youtube channel that does a lot of interesting "pixel art-esque but it's actually 3d" stuff that goes way over my head, let me see if I can find it

#

I really like the style

#

the models are 3d so it's modeling work though which would destroy me

rotund token
#

i just don't do any graphic work

misty wedge
#

yep, same

rotund token
#

if i had a game ever progress far along enough that it was a serious thing

#

i'd just have convince a studio to pick it up

misty wedge
#

all of the sprites in my project are just small bits put together at runtime

#

well not that "small" really, the sword e.g. is 4 parts

misty wedge
#

I'm not sure if it's me but I feel like recently a lot of games have released that were extremely buggy or very feature light, but looked really good

rotund token
#

I'm more into writing libraries anyway than making actual games

#

I just use games as a test bench

#

I prefer to find people who want to use my libraries and be my test dummies

misty wedge
#

haha

#

I wish I was good enough to write libraries people would want to use ๐Ÿ˜…

#

but I guess that's what happens if you never actually work in the field in a professional way

#

even now doing DOTS stuff I feel like I've "unlearned" 80% of the monobehaviour stuff I used during the last few years on small hobby stuff

viral sonnet
#

never heard of this. i'd guess, if it's any good they just copy it.

misty wedge
#

but if it's an interesting concept and the prototype has already been built, why not pick it up?

rotund token
misty wedge
#

I guess it depends on the contracts both parties are interested in

rotund token
#

but yes it wouldn't be pitching an idea to a studio

#

it would be hey, here's a near complete game it just needs audio/visuals etc

#

dont pitch ideas

#

they will be stolen used

#

i mean also it doesn't need to be picked up by a studio the alternative is source funding to pay for the completion

#

but either way, it would need to be a product

misty wedge
#

I think making a playable prototype and then making art for a small vertical slice and crowdfunding that could also work

#

not really a novel concept after all ๐Ÿ˜…

misty wedge
rotund token
#

don't think i've seen an ad since 2010

#

except once around 2016 where i reinstalled PC and watched a youtube

#

and was shocked it had ads and thought this was a brand new feature

misty wedge
#

I get reddit ads on my phone when im on the pooper

#

not sure why pihole doesn't get rid of those

rotund token
#

i use Relay

#

greatest client

misty wedge
#

yeah I should really switch off the official one

#

I saw a post recently that it has like a billion tracking features

rotund token
#

i used relay before reddit even had an official one

viral sonnet
#

Rif is also okay

misty wedge
#

twitter has recently become unusable for me, I don't know what went wrong

rotund token
#

"Day in the Life of a Japanese Game Designer"
hey it's unity!

misty wedge
#

I keep getting random spam bot push notifications

rotund token
#

(some random youtube im watching atm)

misty wedge
#

haha

rotund token
#

oh they're using a recent version of unity with the annoying experiemental packages in use bar

#

and they're using an experimental package!

misty wedge
#

I watched a dev stream for rogue trader, which is also being developed in unity, and I had to chuckle when the shot they took of the dev had the unity console in view full of error messages

viral sonnet
rotund token
#

๐Ÿ˜„

misty wedge
#

yep, but they had the console popped out so it was actually multiple errors!

#

don't think that's ever happened to me before...

rotund token
#

hmm this girl uses like dual window unity

#

i need a 3rd monitor

misty wedge
#

do it, it is the best

rotund token
#

i have an ultrawide

#

and if i buy a new ultrawide

#

i'll have 2 ultrawides =S

misty wedge
#

I have an ultrawide and two normal wides

rotund token
#

i cant fit a 38" 34" + something else

#

i really should give up on this 38" idea

#

im not sure i can even fit that anymore

misty wedge
#

tbf I don't use the third monitor for a lot of useful stuff

#

usually just an entire monitor for the profiler or the scene

misty wedge
#

mine is 34" and I feel it's already pretty big

#

only really annoying thing about it is that a lot of game still refuse to support ultrawides

#

looking at you elden ring >_>

rotund token
#

but mines pretty old now

#

i got one of the first ones so its only 60hz

#

i'd love an upgrade

#

but its like, the cost of a 3080!

misty wedge
#

that's because your 3080s are too cheap

rotund token
#

or monitors too expensive

#

like $1600-2000

misty wedge
#

damn

#

I bought a pretty cheap one a year-ish ago and am pretty happy with it

brave field
# rotund token If u load this subscene I load all assets tied to any prefab

๐Ÿ‘€ Actually this is not my issue that currently I use addressables to solve it. The main reason I need load to load entity prefab on demand is because I use dots netcode that it will process all the loaded ghost entity prefab. If the subscene I loaded has 10000 ghost entity prefab then it will process all the 10000 ghost entity prefab no matter what. lol

rustic rain
#

I don't know, as I never worked with it

#

but sounds kinda bad if it does

rotund token
#

what do you mean netcode is processing prefabs?

brave field
rotund token
#

yeah

#

but these have the Prefab tag

#

so dont appear in queries for systems unless very explicitly requested

#

so what is netcode doing with them?

brave field
rotund token
#

yeah only ghost collection system uses it

#

i'm not really seeing the issue with that?

brave field
rotund token
#

hmm mobile

#

yeah ok

#

not a huge fan of what netcode is doing here looking at code

#

rebuilds this list every frame

#

it seems they could just build it once

brave field
rotund token
#

and only rebuild on order version changed

rotund token
#

but it's basically doing this on server

{
    using var ghostEntities = m_RegisterGhostTypesQuery.ToEntityArray(Allocator.Temp);
    using var ghostTypes = m_RegisterGhostTypesQuery.ToComponentDataArray<GhostTypeComponent>(Allocator.Temp);
    var ghostCollectionList = ghostCollectionFromEntity[collectionSingleton];

    if (state.WorldUnmanaged.IsServer())
    {
        // The server adds all ghost prefabs to the ghost collection if they are not already there
        for (int i = 0; i < ghostEntities.Length; i++)
        {
            var ent = ghostEntities[i];
            var ghostType = ghostTypes[i];

            TrySetupInsideCollection(ghostCollectionList, ghostType, ent, out var isInCollection);
            if (!isInCollection)
            {
                // The #if is there because the variables passed to the conditional method are protected by an #if
#if NETCODE_DEBUG
                ValidatePrefabGUID(ent, ghostType, codePrefabs, ghostTypeFromEntity);
#endif
                ghostCollectionList.Add(new GhostCollectionPrefab {GhostType = ghostType, GhostPrefab = ent});
            }
        }
    }```
brave field
rotund token
#

yeah it does something different as client though

#

(there's also no reason this couldn't be done in a job instead of on main thread as far as i can tell)

#

i might just rewrite this system to be a lot faster at some point if i ever run into issues

brave field
rotund token
#

hopefully

rustic rain
#

do you just recreate UILocalization?

rotund token
#

it subscribes to an event

rustic rain
#

you fully switch table with within one object?

rotund token
#

this event fires when tables change

#

which happen when you change language

rustic rain
#

๐Ÿค”

#

I guess it's some kind of Package feature

#

I'm still going through tutorial

rotund token
#

but yeah i haven't really touched this in a few months as i said before

#

i just built the proof of concept at the time to make sure this was something i could work on

#

mostly hanging for 2023

#

whenever its added

#

even if it hits 2024 thats not big deal for me

rustic rain
rotund token
#

localization does

#

it has this whole smart string thing

#

you can put logic inside the localization strings

rustic rain
#

I mean

#

your script

rotund token
#

totally does

rustic rain
#

hm

rotund token
#

but its kind of separate to this script

rustic rain
#

I get it, as I need to feed my own values to it

#

I'm figuring out how to manage this

#

I thought about using binding-path string field for this

rotund token
#

but yeah smart strings are really strong

#

if you haven't got to them yet in your tutorial stuff

#

have a read

#

to give yourself ideas of what is possible

#

but yeah i am far from an expert on this

#

i don't do much front end work at work, i mostly assign this to others

#

so i have a decent understanding of what is possible but not necessarily the fine details of implementation - this is just stuff i try to learn and expand in my own project

rustic rain
#

I'm mostly talking about your script though ๐Ÿ˜…

rotund token
#

yeah but this was just a 30min proof of concept

#

i think i linked what it was based off

#

it's probably a good starting point but it should be expanded a lot

#

it definitely has some flaws atm

#

all keys need to be in the same table

hushed lichen
#

I'm struggling to load in a subscene after unloading it, in 0.51.
Can anyone help? It's for a university project with deadline on Monday ๐Ÿ˜…

rotund token
#

How are you leading and unloading

#

And what's going wrong

hushed lichen
rotund token
#

I never really did / do it this way

#

I load via manually adding / removing the component

#

But I'm still not sure what part you're having issue with

#

You say after unloading it which implies it was loaded at some point

#

So how did you load it originally

#

And how are you unloading it

#

Unfortunately I was just on my way to bed so I won't be able to hang around and debug this with you

#

Feel free to ping me in this channel in like 7 hours if someone else hasn't helped you

hushed lichen
#

So the subscene initially is just part of the scene, so loading in instantiation by default.
Unloading it is using SceneSystem.UnloadScene(sceneEntity)

rustic rain
#

subscene is serialized entity data

#

what you have in scene is monob which basically points to that data

#

the mode how it loads is up to you

hybrid jay
#

Do you use the World Allocator for native containers now? is it instead of using Persistent so you don't need to dispose manually?

#

i seem to remember someone saying something about them here before

#

Ah it replaces TempJob

#

That should be added to the docs somewhere

#

Ok nvm that breaks my code

#

var positionsArray = new NativeArray<PositionData>((int)amountOfSystems, state.WorldUpdateAllocator);

#
ArgumentException: Use CollectionHelper.CreateNativeArray for custom allocator
Parameter name: allocator
Unity.Collections.NativeArray`1[T].CheckAllocateArguments (System.Int32 length, Unity.Collections.Allocator allocator) (at <44569b2d1c974b5eb5e85c3450cfe46d>:0)
Unity.Collections.NativeArray`1[T].Allocate (System.Int32 length, Unity.Collections.Allocator allocator, Unity.Collections.NativeArray`1[T]& array) (at <44569b2d1c974b5eb5e85c3450cfe46d>:0)
Unity.Collections.NativeArray`1[T]..ctor (System.Int32 length, Unity.Collections.Allocator allocator, Unity.Collections.NativeArrayOptions options) (at <44569b2d1c974b5eb5e85c3450cfe46d>:0)
#

Works fine with my code that uses NativeMultiHashMap, just not this NativeArray

hollow jolt
#

how do we mult quaternions with vectors in the math package ?

mystic mountain
#

Why can't MonoBehaviors be in editor only assembly so I can separate the Baking and Runtime properly? ๐Ÿค”

mystic mountain
hollow jolt
#

thanks

viral sonnet
#

ah editor only, hm yeah i remember having some problem with it myself

rotund token
#

But I don't think you can mark editor only in the tick box

#

But in the required defines of the asmdef you can add UNITY_EDITOR

rustic rain
#

figured it the hard way ๐Ÿ˜…

mystic mountain
# rustic rain figured it the hard way ๐Ÿ˜…

Same.. Saw some DOTS package had editor assemblies with folder of "Authoring" but they only had bakers in them and had the Authoring components in "Runtime" assembly & folder ๐Ÿ™ƒ Spent a few hours trying to figure out why my scripts suddenly failed to load in inspector.

rotund token
#

will be stripped in builds but will exist during the subscene baking step

rustic rain
rotund token
#

yeah it's nice being able to apply it to entire assembly

#

however unity 22.1f1 has broken this pattern of including in debug builds

#

i really need to make a bug report on this

#

i need it fixed ๐Ÿ˜ฌ

viral sonnet
#

and here I thought, hey cool, easy color cycling

#

UnsafeUtility.As<int, ColorIndex>(ref colorIndex) you can't stop me!

hybrid jay
#

SystemAPI.HasComponent<T> works in IJobEntity right? and does some code gen to do the look up?

#

It's not erroring for me

viral sonnet
#

hm, afaik, no, it's for ISystem and SystemBase

hybrid jay
#

the comment on it is a bit confusing

viral sonnet
#

you'd need to look at the generated source code. maybe it does

hybrid jay
#
/// When iterating over a set of entities via <see cref="IJobEntity"/> or <see cref="SystemAPI.Query{T}"/>, avoid using this method with the
/// current entity in the set. It is generally faster to change your entity query methods to avoid
/// optional components; this may require a different construction to handle each combination of optional and non-optional components.
#

But then right at the bottom

#

/// <remarks> Not working in IJobEntity, Utility methods, and Aspects </remarks>

viral sonnet
#

well, there you go ๐Ÿ™‚

hybrid jay
#

but the first one implies that it works

viral sonnet
#

you can iterate on entities without a job

hybrid jay
#

via <see cref="IJobEntity"/>

viral sonnet
#

oh wait, yeah

#

@proud jackal could tell us what's up with that

#

anyway, usually you'd use ComponentLookup in a job to find out if an entity has a certain component

hybrid jay
#

yeah i was just tinkering around

#

It would be handly if it could be code gen'd

proud jackal
#

Well just comes to show that plans change ๐Ÿ˜† SystemAPI is in fact only supported in ISystems and SystemBase :3

hybrid jay
#

cool thx

viral sonnet
#

ComponentLookup can be code gen'd with SystemAPI.GetComponentLookup<T>. safes on boilerplate code. then in the job just use componentLookup.HasComponent(entity)

rotund token
#

optional aspect buffers when dani ^_^

viral sonnet
#

yes

hybrid jay
#

nice

viral sonnet
#

Dani has done amazing work on reducing the boilerplate code via SystemAPI methods

#

same goes for GetComponentTypeHandle

rotund token
#

pretty sure i deleted like 30% of my code

viral sonnet
#

hehe, yeah, some systems only have a few lines now. it's really cool

gusty comet
#

Is there a way to do something like SystemAPI.Query from inside a Monobehavior?

rustic rain
#

no

hybrid jay
#

pretty sure that works

rustic rain
gusty comet
#

I'd like to iterate over some entities

hybrid jay
#

oh right

#

yeah sorry, havent used the foreach much

gusty comet
#

That's okay

rustic rain
gusty comet
#

If it helps, I only want to do the SystemAPI.Query once

#

Alright, I'll move the code back to SystemBase's OnCreate then

#

But it kinda breaks encapsulation

#

But I don't see any other alternative

rustic rain
#

if you are doing ECS, any game logic should come from systems

rotund token
viral sonnet
#

in a MB you'd build a query with var query = entityManager.CreateEntityQuery(ComponentType.ReadOnly<T>());

#

can be cached just fine

rotund token
#

but yeah, systemapi is just generating code for you - you can just write it by hand yourself if you need the behaviour in a MB

gusty comet
#

ohhhhh okay

proud jackal
rotund token
#

๐Ÿ˜ฆ

#

sadge

#

had this brilliant idea for my AI data management but i ran into this tiny problem

#

not all AI have the same buffers

#

oh well, if it comes eventually i'll add it eventually!

#

enough other things to look at atm

viral sonnet
proud jackal
# rotund token sadge

Yee.. Then again you never know! I'm just keeping it safe.. Something something don't want people to depend on it.. I was also sure i wouldn't get IJobEntityBeginEndChunk in. Yet look where we are xD

gusty comet
#

I'll do the querying in a system, store it in the system, and access it from the Monobehavior then

gusty comet
#

I made an AI system similar to GOAP, but it's really clunky.

rotund token
#

im also so glad you added the end chunk part

#

i didn't even consider this but i had a really good use of it a few days ago

rotund token
#
            {
                this.navMeshQueries = new NativeArray<NavMeshQuery>(this.NavMeshWorlds.WorldsLength, Allocator.Temp);
                for (byte i = 0; i < this.navMeshQueries.Length; i++)
                {
                    this.navMeshQueries[i] = this.NavMeshWorlds[i].CreateQuery(2048, Allocator.Temp);
                }

                return true;
            }

            public void OnChunkEnd(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useEnabledMask, in v128 chunkEnabledMask, bool chunkWasExecuted)
            {
                for (var i = 0; i < this.navMeshQueries.Length; i++)
                {
                    this.navMeshQueries[i].Dispose();
                }
            }```
#

๐Ÿ‘Œ โ™ฅ๏ธ

proud jackal
#

Biggest problem is i need to remember to go in and change the ordering. As version numbers are still updated no matter if it is true or not.

rotund token
#

(before someone mentions it, you might think its weird you see a Temp and it's disposing - it's releasing native memory my navmesh is written in c++)

proud jackal
#

Oh interesting

rotund token
#

oh it's just a wrapper to recast/detour

#

i've slowly being porting individual blocks to burst

#

but was way too much effort to do that to the entire library up front it's huge

#

works really well though

proud jackal
#

Guess you're leveraging Burst playing nicely with DLLs?

gusty comet
#

Is there also an equivalent to SystemAPI.GetComponentLookup<LocalToWorld>(true) inside of a Monoebhavior?

#

Autogen keeps getting in the way

rotund token
#

where all these Recast methods are extern calls

#

this is all in a burst job

#

but i can go in and replace each of these extern calls 1 at a time

#

with code written in burst

#

as i find time

#

and it's very easy to compare results if i make a mistake

proud jackal
rotund token
#

oh random question Dani while you're here
SystemAPI in an ISystem method requires ref SystemState state on the method right
But in a SystemBase it requires it to just be a non-static method

proud jackal
#

Indeed

rotund token
#

is there a chance we can have support for
method(ref SystemState state)
in a systembase

gusty comet
rotund token
#

so i can share the same static method between systembase and ISystem

rotund token
gusty comet
#

Right, I should've mentioned I'm trying to schedule a job from a Monoebahvior that uses ComponentLookup

#

I'll just move it to a system anyway

#

Another design fiasco caused by OOP thinking ๐Ÿ˜…

rotund token
gusty comet
#

I'll just use a system for now

proud jackal
rotund token
#

the tldr of what I wanted it for dani was I have this, non-sexy not code generated, ClientAPI/ServerAPI

    /// <summary> API to be used on the client for managing game state, UI and input. </summary>
    public static partial class ClientAPI
    {
        /// <summary> Disables a specific client state. </summary>
        /// <param name="systemState"> The owning system state. </param>
        /// <param name="name"> The client state to set. </param>
        public static void StateSet(ref SystemState systemState, FixedString32Bytes name)
        {
            var state = K<ClientStates>.NameToKey(name);
            systemState.EntityManager.GetSingleton<BLDebug>(false).Debug($"ClientState set to {name}");
            systemState.EntityManager.SetSingleton(new ClientState { Value = new BitArray256 { [state] = true } });
        }```
#

so I've had to implement it with custom extensions to EntityManager instead of using SystemAPI

proud jackal
#

Ohh gotcha

rotund token
#

basically how i manage UI, input, game states in my client world

proud jackal
#

And how did you wanna call it in SystemBase? As we do expose .CheckedStateRef

rotund token
#

yeah

#

i pass CheckedStateRef when using SystemBase

#

i basically just want, if method has SystemState passed in, is it possible to use that instead of CheckedStateRef

#

because these are static methods so when used from a SystemBase, SystemAPI can't find CheckedStateRef itself

#

it's not a huge deal, i've worked around it fine

viral sonnet
#

is there any good explaination for this. open subscene leads to this error: InvalidOperationException: GetSingleton<FixedTickSystem+Singleton>() requires that exactly one FixedTickSystem+Singleton exist that match this query, but there are 0. Unity.Entities.EntityQueryImpl.GetSingleton[T] () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities/Iterators/EntityQuery.cs:1417) Unity.Entities.EntityQuery.GetSingleton[T] () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities/Iterators/EntityQuery.cs:2598) ThirdPersonPlayerFixedStepControlSystem.OnUpdate (Unity.Entities.SystemState& state) (at Assets/Rival_StandardCharacters/ThirdPerson/Scripts/ThirdPersonPlayerSystems.cs:100) closed is fine.

proud jackal
rotund token
#

its not really switching here though, static methods with SystemAPI are just not supported in SystemBase atm

proud jackal
rotund token
#

basically, i want support for static methods by allowing the user to manually pass in SystemState

rotund token
rotund token
viral sonnet
#

could have been me ๐Ÿ˜„ ok, load ordering. got it. was just wondering why this works in a closed subscene. usually my things break when i have a closed subscene and not the other way around

#

just 1 frame but the graphic for the capsule isn't updated then so there's something else going wrong then

#

capsule stands on the starting point and doesnt move

rotund token
#

when you open a subscene everything is deleted for a few frames while it re-loads async
I actually have a system to auto pause my simulation updates when a subscene is opened until it's done loading to avoid issues like this

viral sonnet
#

this is for Rival so pinging @signal phoenix for it ๐Ÿ™‚

proud jackal
rotund token
#

oh i know, it'd be doing the exact same thing i'm doing

#

i just wouldn't need internal access and custom entity manager methods

proud jackal
#

True true.

rotund token
#

the other annoyance is that if you do something like

        {
            systemState.GetEntityQuery().SetSingleton();
        }```
#

it yells at you to use SystemAPI because you are accessing a query in an OnUpdate

#

but i can't use SystemAPI because it's not allowed

#

so the dependency is never added to the system if you use EM

proud jackal
#

Haha yeahhhh.. well it does heavily want you to pass in the query instead xD

rotund token
#

obviously this would be terrible practice for constant calls

#

but this is only used on full game transitions

#

clicking options button or something

#

so performance isn't my concern, usability is

#

anyway low on any priority list, just a slight inconsistency that bothered me

#

maybe at some point I'll figure out this code gen wizardry and generate this with code gen and pass in the query instead

#

wonder if there's magic where you can code gen SystemAPI calls ๐Ÿค”

proud jackal
#

It's a little sad but i guess if usability is the name then SourceGen is the game. While SourceGen is not my favorite piece of tech for good API design (i personally do like explicitness) it does help with usability.

proud jackal
proud jackal
rotund token
#

i wonder why

hybrid jay
#

Don't you just hate it when you get a burst error with no helpful info

#

(0,0): Burst error BC1091: External and internal calls are not allowed inside static constructors: Interop.BCrypt.BCryptGenRandom(System.IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags)

rotund token
#

ok

#

so i ran into this a year ago

#

let me remember what it was

hybrid jay
#

And the rest of the stack trace is just all the compiling jobs

rotund token
#

I think it is
HashCode

#

or whatever the new .net hashing functions are

hybrid jay
#

ah, i'll see if i used it anywhere

viral sonnet
rotund token
#

i had a chat with neil henning (sadly I think he's left Unity now) about this error

viral sonnet
#

capsule graphics still doesn't get updated though with open subscene ๐Ÿคทโ€โ™‚๏ธ

hybrid jay
rotund token
#

unfortunately the channel that this was discussed in has been removed

#

so i can't pull up the reasoning for this breaking

rotund token
hybrid jay
#

is there a burst hashcode then?

rotund token
#

do not click this use System.HashCode button

hybrid jay
#

ah, you can just ignore it

rotund token
#

i.e.
do this

        {
            unchecked
            {
                return (this.Value1 * 397) ^ this.Value2;
            }
        }```
not this
```        public override int GetHashCode()
        {
            return HashCode.Combine(this.Value1, this.Value2);
        }```
hybrid jay
#

oh

#

ok thx

rotund token
#

if this is your issue you're kind of lucky i'm on, i don't think many people would have run into this, you probably would have been banging your head against a wall for a while

hybrid jay
#

it's combining a int2 and an int, is casting the int to int2 ok?

rotund token
#

as you say, the error message is very vague

rotund token
#
        public int Test2;
        
        public override int GetHashCode()
        {
            unchecked
            {
                return (this.Test.GetHashCode() * 397) ^ this.Test2;
            }
        }```
same pattern works
#

your ide should be able to just generate this hash function for you though

#

VS might generate it slightly differently (different primes)

hybrid jay
#

ah, yeah that works

#

Oh had more burst errors

#
        [BurstCompile]
        public void OnCreate(ref SystemState state)
        {
            var query = SystemAPI.QueryBuilder().WithAll<PlanetSpawnedTag>().Build();
            state.RequireAnyForUpdate(query);
        }
#

That should be burst compatible right?

rotund token
#

yes

hybrid jay
#

But unless i'm being stupid the compiler is taking the wrong function?

rotund token
#

oh

hybrid jay
#

It's not using that one ^

#

even though it should

rotund token
#

you're using wrong method

#

state.RequireForUpdate(query)

hybrid jay
#

ah lol

rotund token
#
        public void RequireAnyForUpdate(params EntityQuery[] queries)```
#

any of update takes an array

hybrid jay
#

does that work the same as the Any one?

#

oh right that actually makes sense

rotund token
#

any just lets you pass in a bunch of queries

#

if you only have 1 query it won't be different

hybrid jay
#

i didnt connect the Any to the array

rotund token
#

if you do need RequireAnyForUpdate there is a nativearray version that is burst compatible

hybrid jay
#

I wonder if you could make a IDE extension to underline all the non burst compatible functions (or if they just have [ExcludeFromBurstCompatTesting] ) when they are used inside a method with the [BurstCompatible] attribute on

#

Might be able to make one as well to detect when SystemAPI is used outside of ISystem and SystemBase

rotund token
#

rider already does this

#

at least partially

hybrid jay
#

does it? i've never noticed lol

rotund token
#

yeah its some advanced analysis

#

and its only on very specific things

#

like new class or something

#

but its something they're thinking of anyway

hybrid jay
#

would be helpful for new users and people like me who can't read

rotund token
#

turn on this, it's off by default i think

hybrid jay
#

humm it is already on

rotund token
#

yeah my point exactly

#

doesn't catch much atm

#

but it is a feature they have put some time in and hopefully in future gets more support!

viral sonnet
#

i was nearly going insane with vectors going in the wrong direction. then i tried changing some variables

rotund token
#

o_O

viral sonnet
#

the pain of porting ๐Ÿ˜„

#

i have to find out why the camera controller thinks the offset is obscured and changes directions

#

99% case it's a backface hit on the player capsule because the error is only when the offset is inside the capsule

rotund token
#

i always mix this up
is it unity physics that hits backfaces or the default physics

#

they have different behaviours here from memory

viral sonnet
#

unity physics does backface hits

#

tripping me up big time

#

backface hits makes no sense if you ask me

#

yeah, filtering that fixed the problem. i need a routine to filter those backface hits. haven't figured it out yet with minimal math. i would need a dot product for every hit. :/

rotund token
#

i think i just had an ignore collider collector

#

that simply removed the player from being hit

#

or using custom physics tags

#

was another idea i had but havent tried

viral sonnet
#

yeah, a collector is also what i'm using

#

port goes pretty well so far. follow cam without any camera input. (still have to fix some stutters)

tribal pollen
#

Sorry if this is dumb but i'm having a brain fart and can't figure this out.
I have an Entity (which there is only one, ie singleton.) and I'm trying to add to it's DynamicBuffer from a lamba function, so I can only use basic EntityManager options...

viral sonnet
#

wdym with lambda function? Entities.ForEach?

tribal pollen
#

no, basically a monobehavior. Actually it's a system where i'm registering an event for later

viral sonnet
#

where are you stuck? just get the DynamicBuffer

tribal pollen
#

Trying to query or look it up...

viral sonnet
#
            where T : unmanaged
        {
            var query = entityManager.CreateEntityQuery(ComponentType.ReadOnly<T>());

            var entity = query.GetSingletonEntity();
            query.Dispose();

            return entity;
        }```
#

then get the DB from the entity via EM

tribal pollen
#

i had that query too, and i was trying to convert it to a component array... which i couldn't for a buffer. and hence my brainfart.
thanks

viral sonnet
#

get the entity then use entityManager.GetBuffer<T>(entity)

#

then you can add whatever you want

#

(though i don't recommend it as it interferes with any scheduled jobs)

tribal pollen
#

it's spawned from user interactions anyways, have to be on the mainthread up to this point.

#

Thanks for the help. Appreciate it ๐Ÿ™‚

viral sonnet
#

np, you can gather the inputs on main thread and then use the data in scheduled jobs. leaves the main thread unblocked.

tribal pollen
#

yeah this is one of the event functions that will be run on certain user interactions. I'm just registering it now, and it adds the data to the buffer (which i was struggling to grab) and then the systems handle the rest

#

so basically its run as a response to a user action event, and then just puts data on my entity for the systems to handle

gusty comet
#

Does using SystemAPI.Query in OnCreate() not return anything because the entities haven't been baked yet? Am I supposed to do that in OnStartRunning()?

viral sonnet
#

they are likely baked but the subscene hasn't been loaded yet

#

make sure the subscene has been loaded beforehand

hybrid jay
#

Anyone know how WithAny<> for a query works when you have two. e.g. .WithAny<>().WithAny<>()
Does it mean any of those components or needs at least one from each? as i need the second case.
Basically (x || y || z || V) vs (x || y) && (z || V)

gusty comet
#

The entities have been loaded and I confirmed it in the entity inspector. However, this code block inside of OnCreate always thinks there aren't any entities

foreach(var (prefab, model) in SystemAPI.Query<AnimationModelPrefabComponent>().WithEntityAccess())
            {
                Debug.Log("one");
                var prefabInstance = prefab.Instance;
                ModelMappings.TryAdd(prefabInstance, new List<Entity>());

                var models = ModelMappings[prefabInstance];
                models.Add(model);
            }
#

The entities are also there at runtime

#

I should also mention that AnimationModelPrefabComponent is a ComponentObject, basically a class IComponentData

hybrid jay
gusty comet
#

Here's its definition


    public sealed class AnimationModelPrefabComponent : IComponentData
    {
        public GPUICrowdPrefab Instance;
    }
gusty comet
#

So OnUpdate and then disable the system after running once?

hybrid jay
#

or add a tag component to those objects after which blocks the foreach running on them? Probably safer than relying on a single frame update

gusty comet
#

I'm currently supposed to delete them after they've served their purpose

viral sonnet
hybrid jay
#

cool, thought so. I can work around it

gusty comet
#

It's definitely been loaded before I even press play

#

The entity inspector shows the components

#

Unless it takes some time for them to load?

viral sonnet
#

it does ๐Ÿ˜‰

gusty comet
#

Ok. That scares me since that means that there's no reliable way of performing setup operations on baked netities just once

#

Do you have any suggestions?

signal phoenix
#

@viral sonnet not sure if it's been answered above, but the FixedTickSingleton error is because the First/ThirdPersonPlayerSystem are missing a RequireForUpdate<FixedTickSystem.Singleton>(); in their OnCreate. Looks like sometimes things happen in an order where the singleton is created before, but sometimes it doesn't. This'll be fixed in next update

viral sonnet
# gusty comet Do you have any suggestions?

there are more involved ways. what i do in those cases is to have a CharacterSubSceneLoaded comp in the subscene. that way i know when that singleton comp is available the scene has been loaded. then i move all code form OnCreate to OnUpdate and have a RequireForUpdate<CharacterSubSceneLoaded>() for the system

viral sonnet
signal phoenix
#

yeah that's just something that happens with any moving object when subscene is opened, as far as I know. They just stay where they were originally placed at bake time I believe

viral sonnet
#

hm, do you know any way to fix that?

gusty comet
#

Do all subscenes load before the first Start callback in Monobehaviors?

#

Or are they completely asynchronous?

viral sonnet
#

afaik, they are async. Start wouldn't be reliable

gusty comet
#

Okay. Strangely enough, other system's OnCreate are properly picking up entities through other methods like GetEntityQuery and EntityQuery.CalculateEntityCount

#

Are those methods different in any way?

#

It's just SystemAPI.Query that's behaving strangely

viral sonnet
#

it totally depends on load timings. i had the case where i got entities with subscene open but not with subscenes closed.

#

if you get them or not is random then. another case was that i got all entities with burst disabled. because everything was slower

gusty comet
#

That means I have to refactor a lot of code. The simplest solution would be to somehow block the main thread until all Subscenes have loaded

#

I'm willing to take the loading time

#

Is there a method for that?

viral sonnet
#

then you'd have to manually create all systems

#

because they initialize no matter what

gusty comet
#

I think I'm doing something wrong by trying to perform initialization operations outside of baking

viral sonnet
#

you could also disable all systems and move your code to OnStartRunning but this all feels like patchwork

gusty comet
#

This is all because I need Entities to call Monobehaviors at some point in the setup process. However, those non-subscene Monoebhaviors do not exist in Subscenes

viral sonnet
#

if you can move the init process to baking you should

gusty comet
#

Okay. That's hard when I need some singleton Monobehaviors outside of the Subscene to help out in the setup process

viral sonnet
#

yeah, with MBs that won't work then in baking

#

it's a daunting process but you'll get over it

gusty comet
#

Do Baking systems allow performing operations on the baked entities, or does it have to use Monobehaviors as input?

#

Like the Baker<Authoring> performs the isolated setup, and then the baker systems consolidates the converted entities and perform World-wide operations

viral sonnet
#

you can do a lot with baking systems. most MB code will work for it

gusty comet
#

Oh, so you can query for MBs inside of Baking systems?

viral sonnet
#

sure

#

you can also the same in Bakers

#

you are still in MB land in this stage

#

GetComponent, getting parents, etc...

gusty comet
#

Right, I see the solution now. I'll not change anything inside the Baker classes, but write Baking systems to perform any operations that involve every entity of some type

#

Thanks!

viral sonnet
#

good luck ๐Ÿ™‚

tribal pollen
viral sonnet
#

hm, the method is only intended for IComponentData. how do you call it?

#

though on second thought DynamicBuffer<...> should also work

tribal pollen
#

I think I fixed that issue. Had to include state.RequireForUpdate in my Oncreate

#

other stuff isn't working now, so i can't say it works for sure though lol

gusty comet
#

Do Systems with the [WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)] attribute exist at runtime?

viral sonnet
#

no

gusty comet
#

Wasn't there a special [UpdateInGroup()] for Baking systems that allows you to create new Entities that end up in the desetination world?

#

Not only that, but inside the baking system, whatever entities I create through EntityManager.CreateEntity() aren't showing up

viral sonnet
#

adding entities works a bit different in baking systems. ```foreach (var (_, entity) in SystemAPI
.Query<Add_EntityTest>()
.WithOptions(EntityQueryOptions.IncludePrefab | EntityQueryOptions.IncludeDisabledEntities)
.WithEntityAccess())
{
var sceneSection = state.EntityManager.GetSharedComponent<SceneSection>(entity);
//UnityEngine.Debug.Log(sceneSection.SceneGUID);

            var newEnt = ecb.CreateEntity();
            ecb.SetName(newEnt, "testEnt");
            ecb.AddComponent(newEnt, new FixedStructTest.FixedStruct());
            ecb.AddSharedComponent(newEnt, new SceneSection { SceneGUID = sceneSection.SceneGUID, Section = 0 });
        }``` here's how it works
#

the basic gist is that it needs a SceneSection comp so it can be associated with a subscene

gusty comet
#

Ok, I'll try it out. Thank you for your support!

#

Is there a cleaner way to obtain SceneSection?

#

Also, does the baking system inherit from SystemBase or BakingSystem?

viral sonnet
#

it can be ISystem or SystemBase

#

only [WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)] tags it as a baking system

viral sonnet
#

btw there's also CreateAdditionalEntity in bakers which is a lot easier to use

gusty comet
#

Alright, I'll make an empty Authoring whose sole purpose is to provide its Baker an entity with the right component

#

Thanks!

gusty comet
#

I want to set this entity's componenet

World.DefaultGameObjectInjectionWorld.EntityManager.SetComponentData<TargetPosition>(entity, new TargetPosition { value = new float3(50, 50, 50) });

is this the way to do it

rustic rain
#

this is really ugly and "hacky" way to do it, but yes, that will do.

gusty comet
#

what's the better way

rustic rain
#

depends on use case

#

but it definetely will come from System

#

I recommend going through entities manual at first

#

too much info about how it works

gusty comet
#

link please?

tawdry mulch
#

anyone know how to convert from unity physics to havok physics? the guide recommends to use their PhysicsSample project lmao

rotund token
#

you shouldn't really need to do anything except install the package

#

and then select it from the drop down on the settings script

#

which i'll find the name of in a second

tawdry mulch
#

so if i just add the Physics Body component, it will automatically use Havok as long as I have it installed?

rotund token
#

yes

tawdry mulch
#

okay thank you ๐Ÿ™‚

#

dumb question but i couldn't find the answer anywhere except one reddit comment. do we still put the rigidbody component on entities?

rotund token
#

In Unity Physics there are 2 components
Physics Shape
Physics Body

tawdry mulch
#

is there a ECS equivalent of colliders?

rotund token
#

Physics Shape has all the collider stuff + more

#

If you don't put a body on, by default it will be a static collider