#archived-dots

1 messages ยท Page 170 of 1

dusky wind
#

They said "soon" two years ago

dull copper
#

it was supposed to arrive 2 years ago

trail burrow
#

yeah i dont think they are going to do it

dull copper
#

and now they've hidden all dots packages except burst ๐Ÿ˜„

minor sluice
#

haha, I think I heard in a talk from 2 years that it was a "priority" or something ^^

dull copper
#

I think they could do it but I wouldn't hold my breath

hollow sorrel
#

i think one of the burst devs said it's not a priority for this year anymore

dull copper
#

it's one of those "new ui" timelines

hollow sorrel
#

so wouldn't expect it any time soon

dull copper
#

yeah

trail burrow
#

joachim said "its still planned" a month ago or so

#

which means few years from now, if ever

dull copper
#

years, definitely

#

or year+ at least

#

even if they say it's on the table next, it doesn't mean it'll happen

#

(but atm it's postponed)

minor sluice
#

for quantum and in your libraries james, how is data object to visual object/state coupling handled?

or is that all up to the user in quantum?

sorry if I ask some things twice here, but that's such a good opportunity, it feels like I can't let that pass

dull copper
#

btw, most of the physics engines out there are deterministic on same platform

dusky wind
#

@minor sluice Backroll has no notion of rendering.

trail burrow
#

@minor sluice we have a framework to hook to prefabs in unity if yo want, but it snot required, you can do w/e u want

dull copper
#

but main reason why Unity Physics (package) would be interesting here is because no states

dusky wind
#

That's up to the developer to handle.

dull copper
#

when you do rollback on cached physics engine, you can say goodbye to determinism

minor sluice
#

ah okay, thanks!
for quantum, I guess no out of the box solution for non-persistent objects then?

dull copper
#

you simply can't make deterministic rollback and resim with stock physx for example

trail burrow
#

@minor sluice what fdo u mean? non persistent obj?

minor sluice
#

like projectiles

dusky wind
#

I think they have pooling for that

trail burrow
#

yeah we have an built in solutions that handles eveyrthing

minor sluice
#

because it could be that a projectile spawn was detected but it was a false input positive

trail burrow
#

including that case

#

and all that shit

#

we even have full integration with unitys scene system, you can drop prefabs and shit in the scenem with colliders and everything and just play and its deterministic

dull copper
#

even when you read transform (and also when you set transform) to physx bodies it goes through floating point math, which can always be lossy, you can't guarantee physx sets same values internally as they were when you read them initially

dusky wind
#

@minor sluice for the test that I've been doing with ECS, it saves the entire world state

dull copper
#

that on top of the caching stuff

trail burrow
#

we have a default hookup for dynamic objects, etc. and all that ofc

dusky wind
#

so that includes projectiles and the like.

trail burrow
#

but you CAN make your own if u want

minor sluice
trail burrow
#

we have a similar system, slightly more sophisticated but you're not that far off

#

we have ability to do 'cancellations' of invalid visual predictions to remove it gracefully

minor sluice
#

awesome!

hmmhh, the ecs thing,
since the rending also just depends on component data with ecs, could that mean you don't have a lot of special code to handle render state separately?

trail burrow
#

like if you incorrectly spawn a frost blizzard magic effect, you can have it 'fizzle out' instead of just pop vanish, etc.

dusky wind
#

The render state just has a reference to the mesh/material

#

it's a pointer

trail burrow
#

we have all of those things built in proper hooks for cancellecing incorrect predictions, etc.

dusky wind
#

If you have coupled GameObjects to render it, obviously you'll need to handle the removal there.

trail burrow
#

@minor sluice i mean, i have built systems that poll entire world state every frame and draw the world using draw instanced calsl

#

and i have systems which coupled with game objects

#

it all depends on the game, but the default system in quantum uses gameobjects and pooling, because that allows easy hooking for prefabs, etc.

#

that people are used to using

#

its not always about what is the most insane efficient, but also what people are used to working with

minor sluice
#

makes sense

trail burrow
#

espc for products sold to customers

minor sluice
#

Also james, did you experiment with hooking up animators to the ecs state yet or do you handle it separately?
in my game, there are no state transitions for animations, so I pretty much just apply the animation state hash and the normalized time from the world data to the visuals,

but I was also wondering if one could allow some transitions, just to make it look smoother visually - even if the visuals don't line up with the hitbox animation data for short times. (maybe a bad idea?)

trail burrow
#

depends on the game if that is valid or not

#

for a fighting game i would never do visual transitions that dont match game state

#

espc if its like a 2D or 2.5D game

minor sluice
#

yeah, true,
it's not commonly done, but for example, I was thinking about things like: IK on slopes that are purely visual etc. the state transitions might be a bit too much after all

hollow sorrel
#

1 view
wow we're the first

minor sluice
#

how many players does hellfire support in one match? footage looks super smooth

trail burrow
#

lol random video i found

#

@minor sluice i have no idea never played it ๐Ÿ˜„

#

8 i think?

#

its an arena shooter

#

so not like a BR

minor sluice
#

haha,
but always good to see your product(s) being used in decent projects.
it's really cool for a mobile game

tardy spoke
trail burrow
#

yeah its pretty nice for a mobile game

tardy spoke
#

Seems nice and easy

violet cosmos
#

Yah, that's what I was doing for my "prefab world" tests

hollow sorrel
#

speaking of player count how much does player count matter in deterministic rollback
since you're just syncing inputs doesn't that mean 10 players -> 50 players would scale pretty well since you're not really simulating much more and bandwidth should be pretty low too

trail burrow
#

@hollow sorrel only for bandwidth really

#

quantum supports up to 64 players atm

#

(ulong, 64 bits...)

#

thats being raised to 128

hollow sorrel
#

oo

trail burrow
#

we have a few 32 player mobile games

#

but want to raise this limit.. for other reasons

hollow sorrel
#

deterministic rollback mmo when

trail burrow
#

whistle

hollow sorrel
#

ohyea how's your little experiment going

#

๐Ÿ˜›

trail burrow
#

you mean my mega threaded mmo backend thing?

hollow sorrel
#

ye

trail burrow
#

it worked out pretty well in the end

#

not done anything of it tho

hollow sorrel
#

ahh

trail burrow
#

it allows for full threading of entire world, "for free"

#

but a lot of trade-offs

#

for free here refers to no mental overhead, mostly

hollow sorrel
#

was this also rollback or not

trail burrow
#

nah this is just fwd

#

normal stuff

#

no predict rollback

hollow sorrel
#

ahyea

safe lintel
#

anyone done tests on how much performance there is to be gained from manual ordering of your systems vs just letting unity figure it out?

trail burrow
#

@hollow sorrel not like im gonna predict/rollback 20k players with half a million npcs lol

#

it's like a few 100 mb of memory

#

๐Ÿ˜„

hollow sorrel
#

lmao fair

#

@safe lintel systems ordering only happens at the start so i doubt it matters much
unless you're talking about job dependencies

dusky wind
#

@minor sluice mine doesn't have transitions too

#

we have our own state graph + animations

trail burrow
#

fighting game players are a special breed which dont like visual fluff ๐Ÿ˜„

dusky wind
#

If anything, we add transition states

#

Instead of Idle -> Jump

#

we have Idle -> JumpStart -> Jump

trail burrow
#

yeah but no automatically 'blended' transitions i think is what fm talked about right?

#

where it blends between two states

dusky wind
#

and there's a hard coded 1-2 frames of interpolation

#

just to smooth things out

minor sluice
#

good to know!

separate animations and deterministic transitions if possible are certainly a better solution. (usually it is just like you said - a simple animation for the specific transition)

yeah, so what was interesting for me to see - also in the netherrealm talk - the users preferred fast snapping to the "real" state, which can introduce those teleportation effects, instead of having visual interpolation that might take just a few frames to catch up.

#

I think I'd be the same too, as fast as possible to the real state is preferred

trail burrow
#

for a fighting game i think i would err on the side of snapping as much as possible, and build the game around that, and then add visual flair if needed later on

#

for other types of games... other rules apply

minor sluice
#

I was thinking about

  1. just visual IK for feet positioning on slopes for example. hitbox data would still be as if standing on flat ground
  2. visual animation transitions between certain kinds of states, but with the hitbox data not having those transitions, to make the visual experience just a bit smoother (this is probably a bad idea)
trail burrow
#

if its like a 1 or 2 frame interp like james said i think is fine for 2.

#

but i would still start without any of that and add it as visual polish later

minor sluice
#

certainly a good idea ๐Ÿ‘

hollow sorrel
#

i wouldn't fuck with fighting game players
they're the kind that will memorize exactly how many frames your animations take and throw a fit if your hitbox slightly doesn't match the view

#

hell there's even this one site where they record input delay for each fighting game and if it's more than 2 frames your game is bad

trail burrow
#

on the topic of fighting games

#

@hollow sorrel yeah fighting game players are crazy ๐Ÿ˜„

#

they're even worse than fps players

minor sluice
#

this game reminds me of fantasy strike, from the vfx touches.

the thing with fighting games- they are often a niche market (if you are not a multi million dollar IP) and for competitive games, the players can be very demanding.
Wide character variety - big amount of characters and matchups - excellent netcode - excellent animations/visuals.

trail burrow
#

yeah very demanding audience

minor sluice
#

One interesting game was slap city,

it did super well, was priced pretty low, had alright-ish models and animations. you could see that it was on the rather low budget side.

and has a competitive scene too. So I think for wider appeal, having the casual player base as target is a very good idea

#

I wanted to ask one more important (for me) question:

FixedMath.net handles overflows and underflows on fixed point operations.
Is that necessary? or can I rely that across different compilers/architectures, integer overflow is handled the same way?

#

because if not, that would be a massive issue. haha

trail burrow
#

don't use that, it's really not good for games at least

#

im sure its technically correct fixed point math

#

but it's slow as fuck

#

and not viable for games

minor sluice
#

I used fixedmath as base for my type, or rather changed things (like the 60+ lines for multiplication down to 1 line)

like, with fixed point calculations for division and multiplication - if you don't have BigInts for holding intermediate results, you can encounter overflows.

trail burrow
#

you dont need to care about that

#

if you re using the one-line mul/div

#

just stay inside usable range

#

which is -16k to +16k

minor sluice
#

and I just wanted to know if a simple approach like

AxB = A*B >> fractionBits;
is fine.

oh, that's awesome, thanks!

trail burrow
#

assuming 64 bit integer

minor sluice
#

yep

trail burrow
#

yes, that's fine

minor sluice
#

I think I have.. Q39.24 , but my areas in the game are also rather small.
maybe I'll change to Q.47.16. I think that is what quantum uses right?

#

also, thanks a lot!

trail burrow
#

Q48.16 is the way to go

minor sluice
#

I don't think there would be issues with small distances yeah,
should probably try that then ๐Ÿ™‚

trail burrow
#

@stiff skiff hey there :p

#

ninja-reaction

stiff skiff
#

Aloha, I was told there is an interesting networking discussion going on haha

trail burrow
#

๐Ÿ˜„

#

@minor sluice about things like cos/sin/tan/acos/atan/asin/sqrt/pwr/exp etc.

#

look up table is easiest, but it's not perfect

minor sluice
#

was surprised on the discussion too ^^

and .. I kinda have the assumption that fholm is right about the unity roadmap, but it would be a nice surprise if they can deliver this time. haha.

foor those operations, (at least for the trigonometry methods), I think I have still the lookup tables,

for sqrt/exp, it is iteration based still. Pretty much I didn't make a lot of changes to fixedMath, other than reducing code in existing methods (like the simplest ways to do the base calculations, getting rid of bigInts etc.) and changing the fraction bits.

#

another thing I remember, apparently some people told me that a lot of the performance overhead they encounter comes from just allocating the fixed point structs that are only wrappers around int64.

but the problem is that if you operated directly on int64 all the time, one really has to be careful and readability suffers a lot - and it would take more (complex) code

I wonder how games with higher performance requirements handle this, or maybe I'm missing something

trail burrow
#

@minor sluice we solved this by hand inlining... everything

#

literally everything

minor sluice
#

but good to know! sounds like pain though, haha

trail burrow
#

and yes its a HUGE overhead otherwise

minor sluice
#

are there any tricks you had to keep it more readable, or to make the separation easier (what is actually an int and what is a variable for a fixed point?)

trail burrow
#
    public static Boolean TriangleContainsPoint(FPVector3 pt, FPVector3 t0, FPVector3 t1, FPVector3 t2)
    {
      //return TriangleContainsPoint(pt.XZ, t0.XZ, t1.XZ, t2.XZ);
      Boolean b1, b2, b3;

      b1 = (((pt.X.RawValue - t1.X.RawValue) * (t0.Z.RawValue - t1.Z.RawValue)) >> FPLut.PRECISION) - (((t0.X.RawValue - t1.X.RawValue) * (pt.Z.RawValue - t1.Z.RawValue)) >> FPLut.PRECISION) < FP.RAW_ZERO;
      b2 = (((pt.X.RawValue - t2.X.RawValue) * (t1.Z.RawValue - t2.Z.RawValue)) >> FPLut.PRECISION) - (((t1.X.RawValue - t2.X.RawValue) * (pt.Z.RawValue - t2.Z.RawValue)) >> FPLut.PRECISION) < FP.RAW_ZERO;
      b3 = (((pt.X.RawValue - t0.X.RawValue) * (t2.Z.RawValue - t0.Z.RawValue)) >> FPLut.PRECISION) - (((t2.X.RawValue - t0.X.RawValue) * (pt.Z.RawValue - t0.Z.RawValue)) >> FPLut.PRECISION) < FP.RAW_ZERO;

      return (b1 == b2) && (b2 == b3);
    }
#

this is how it looks

dusky wind
trail burrow
#

@dusky wind thats based on my (very old) library ๐Ÿ˜›

dusky wind
#

But is your library open source?

minor sluice
#

ahhh,
so you inline / raw value access it within the methods, but you can still use the methods with the regular structs. good idea!

@ james, that is the fixed point lib that you use?

trail burrow
#

@dusky wind huh?

stiff skiff
#

@trail burrow are you networking the FPVector using varints?

trail burrow
#

@stiff skiff we dont need to send many ๐Ÿ™‚

dusky wind
#

@minor sluice Not yet, but soon.

stiff skiff
#

I wish we didn't have to send many haha

minor sluice
#

oh, great ๐Ÿ™‚

dusky wind
#

@trail burrow is said library open source? Can I clone it down and use it in my game with a FOSS license?

trail burrow
#

no? what im very confused

dusky wind
#

Part of the reason we're using this library is because it's FOSS.

trail burrow
#

i just said that library linked, is based on my code, which i sent to the guy who made it... that's all

hollow sorrel
#

๐Ÿ˜…

dusky wind
#

OK great. Glad they made it public for other devs to use.

trail burrow
#

idk the % so not gonna say anything

hollow sorrel
#

that's kinda weird that it shows up on github then

minor sluice
#

that's interesting, so that library is under MIT

#

does that mean that's alright or.. not? since it is so heavily "based" on the other code base

trail burrow
#

ยฏ_(ใƒ„)_/ยฏ

#

i dont know lol

minor sluice
#

๐Ÿ˜… oh, well.

hollow sorrel
#

i mean strictly speaking if someone sends you code it's still copyrighted, kinda weird to see it pop up on github if he didn't ask to make it public

dusky wind
#

I mean, unless @trail burrow provides proof that he wrote the majority of it before this was published, there's no legal quandry here.

trail burrow
#

@dusky wind i, mean i do.. very much have proof lol

#

but its not like it matters

#

i know he put it on github

#

and its fine

#

and i even helped him with some stuff

minor sluice
#

I doubt someone would pursue others for using it but.. would still be nice to have safety on it ^^

trail burrow
#

all i said was "oh cool this is my old lib"

dusky wind
#

Then great. Wished more stuff like this was FOSS.

trail burrow
#

ah he left this discord, no matter

#

hes a nice guy, talk to him almost every day on a private server ๐Ÿ˜›

#

nowhere did i say anything about the license, i share a lot of code in that private discord relating to determinism

#

you guys started talking about licenseing ๐Ÿ˜›

dusky wind
#

It's an important part of managing FOSS libraries.

#

This included.

trail burrow
#

i suppose, the library is solid tho

dusky wind
#

it is missing a 4x4 matrix implementation though.

trail burrow
#

and quaternion

#

i think we have 2x2, 3x3 and 4x4 matrices

#

and quat ofc

minor sluice
#

I once got to talk with a dev from TrueSync, about the usage of the physics engine part,
they said it's fine for me to still use it,

but admittedly, it is a lot different to reuse something in an FOSS library than just in a finished product (like what my intention for it is)

trail burrow
#

@minor sluice thats erick (or jeff possibly), my colleague/friend

#

true syncs physics is a ported version of some xisting library right?

#

i dont remember it

minor sluice
#

can't recall his name but I think it was from the server of Dragon Slayers that we got to talk, and I think he is on the dev team there too.

ported, yes. I think it was.. actually let me look it up - Farseer physics for the 2d part

trail burrow
#

yeah they were converted

#

to use fp libs

minor sluice
#

and Jitter for 3d,

but even with the far more performant fixed point, the 3d implementation was still far too slow for me (luckily my game only plays on a 2d plane too, so not sure why I even tried the 2d physics in the first place ^^ - I think the penetration and collision results looked more stable or something)

trail burrow
#

yeah, it doesnt work

#

to port like that

#

it has to be custom bjuilt

minor sluice
#

so quantum has its physics written completely from the ground up?

trail burrow
#

yes both 2d and 3d

#

this is like 6 month sold so its improved a lot even since then

#

this is still in the old 1.x version of quantum even

#

that video

#

but i dont have a recent vid on this computer ๐Ÿ˜„

minor sluice
#

interesting. Where there one of a few specific libraries you borrowed concepts or approaches from mainly?
or was it like an internal design decision for all major aspects of the engine?

trail burrow
#

@minor sluice everything is custom, even core things like the broadphases for the physics engines were invented by us

dull copper
#

vehicle physics is kinda endless rabbit hole if you really dig into it but basic principles are somewhat the same when you build things (unless you go for pure arcade vehicles - then you can fake a ton of things)

minor sluice
#

oh wow

trail burrow
#

several of the math algorithms we use are custom invented due to precision problems with fixed point

minor sluice
#

sounds like a big challenge

trail burrow
#

yes, well two guys with PhDs in maths invented those algos ๐Ÿ˜›

#

i did invent the broadphase for the physics engines tho

#

@dull copper Yeah waht you see above is pretty old, we have some fairly new stuff which is much more realistic

#

and much tighter in terms of control over parameters, etc.

dull copper
#

ah I wasn't judging that video, just making a point that any vehicle physics implementation that's aimed at simulating individual wheels will have somewhat similar base implementation (vehicle dynamics wise anyway)

trail burrow
#

yeh its a fairly complex system

#

with wheels, suspensions, gear box, engine, etc.

#

all properly simulated

#

and yes its a fkn rabithole

dull copper
#

it is

#

I've done this particular thing for years, I know people who have done it for decade+ and still struggle with it ๐Ÿ˜„

#

any proper vehicle sim out there is a result of years long iteration cycles (usually decade+, not even kidding)

trail burrow
#

yeah we got some dedicated ppl doing this now

#

specific only vechicle sim

hollow sorrel
#

that simulate time ๐Ÿ˜ฑ

#

0.001

trail burrow
#

๐Ÿ˜„

#

i have no idea the speed the above sample runs at

#

never looked into it, that is old stuff on an old branch now

dull copper
#

if you don't do broadphase/collisions every step, you can afford to have crazy high physics frequencies for the physics bodies

trail burrow
#

@hollow sorrel i cant even say if that time is for the entire sim or a sub-part, they might have hijacked that to showsome other sub-part thing

#

i have no clue, legit

#

had no involvement in it

dull copper
#

my old naive 3d physics solver ran double precision float vehicle physics at 10kHz

trail burrow
#

i doubt its for entire sim as 0.001 is insane fast

dull copper
#

without any ridiculous optimizations, MT, SIMD etc

#

I could have never done collisions at that rate

hollow sorrel
#

ah

dull copper
#

I've never tried this with Burst, should do a lot better, those figures were from c++

trail burrow
#

for most mp games, the important part about determinism

#

is that you dont need to network anything

#

that is really the key thing, for most customers we find

#

in that they don't need a network engineer or multiplayer coder, etc. to do anything

#

or need to account for any of the usual crap you need to deal with

#

as the game basically network itself

#

it makes everything so easy to reason about and think about

#

yes you have to handle prediction errors, visually, but that's a small price to pay

#

that is the killer feature, yes predict rollback itself is great for some gametypes also

#

but thats an added bonus

#

not the main sellingpoint

minor sluice
#

for deterministic rollback vs. non determinism,

I think it might be alright - for most server authoritative games - to not be deterministic on the clients end if the world state is small enough so that it can be send via updates within a frame or so.

if there was a reported state divergence, the server could just resent the information about what ran out of sync, even if that might be more or less continuously

dusky wind
#

So for my use case of a fighting game

#

determinism is set via identical starting conditoins

#

But for a FPS

#

or a game where users can join/leave whenever.

vagrant surge
#

@trail burrow what did you choose for broadphase?

dusky wind
#

How do you handle those cases deterministically?

vagrant surge
#

for somes system i helped create for pubg, we went with a extremelly dumbass hash grid. Its what worked best with simplest code

trail burrow
#

@dusky wind we have full join/leave/re-join/drop in existing match, etc.

dusky wind
#

Yeah I'm asking how, not if it is supported.

lusty otter
#

If I set a job struct member to be [ReadOnly] but still modifies it, will it affect the original copy?

trail burrow
#

including joining with new data, etc.

dusky wind
minor sluice
#

I thought that for rollback netcode fighting games, it might be possible to join the game whenever too, if you have a way to send a serialized world state snapshot to the new user,
for some reason (maybe because a lot of games have too much data), deterministic multiplayer games don't allow joining during already running matches

trail burrow
#

@vagrant surge we used a non-persistent SAP that uses radix sort to detect collisions

#

which is multi-threaded ofc

dusky wind
#

@minor sluice that makes sense for a small game state, yeah

minor sluice
#

does the readonly attribute even work to prevent a field from a regular struct to be changed? I don't think that's how it works?

trail burrow
#

dont use readonly

#

at all

#

it causes perf issues in all kinds of weird places

#

in .net runtime/mono

lusty otter
#

For bursted job?

dusky wind
#

I think he's talking about the Unity C# jobs ReadOnly attribute

minor sluice
#

maybe I misunderstood the question and it was meant the member of the job struct, not the component data struct probably

lusty otter
#

Yeah

minor sluice
#

if you modify it, why do you set it readonly in the first place?

dusky wind
#

Also, I tend to still use readonly modifiers in non critical path locations as well

lusty otter
#

In my case I need to temporarily reorder the array for the job itself, obviously I could just make a copy.

minor sluice
#

wait,
fholm, so you suggest that it is better to just not use it, whether in Entity forEach queries nor in job structs, and it actually isn't that beneficial for performance even if you only read from a collection?

#

or is it still beneficial but has some specific weird behaviours?

dusky wind
#

Entity.ForEach do use it

#

the scheduling is dependent on knowledge of read/write vs readonly

trail burrow
#

i meant the readonly keyword

#

for structs/fields

#

srry for the confusion

manic aurora
#

yeah definitely use [ReadOnly] lol

dusky wind
#

It has a negative performance impact in the editor for thread safety checks

trail burrow
#

i know fk all about unity ecs/dots/etc.

dusky wind
#

but that's conditionally compiled away in release builds

minor sluice
#

I think if you want to have a second array with modified order, you need to make a copy ๐Ÿค”

ah okay. Never saw that in structs, I think for a good reason.
readonly in structs sounds odd, I guess this would be a forced way to make the struct really immutable?

lusty otter
#

I'm not exactly sure how things work, either:

  1. Job always copies input to a new location, and with [ReadOnly] it won't copy back when the job is done. In that case I can just modify it without repercussion.
  2. [ReadyOnly] will just pass the pointer and assume its pointed memory won't be modified. In that case I would just need to make a temporary copy.
dusky wind
#

@minor sluice there are readonly structs

mint iron
#

i think in is the new way to do it instead of [readonly] though right?

dusky wind
#

which are meant for immutable value types

vagrant surge
#

@trail burrow nifty stuff

lusty otter
#

Yeah, but I'm just using plain job system without ECS.

minor sluice
#

for example, native arrays are just pointers to unmanaged memory afaik,
so if you pass a native array, you still operate on the same data as before.

dusky wind
#

built more for web server use cases than games though

#

@mint iron it is if you need to read it

#

if you just want to add it to the query, you'll need to use the fluent API to add it

#

@minor sluice correction: pointer, type, and length ๐Ÿ˜

lusty otter
#

What's the easiest way to make a copy of NativeArray?

dusky wind
#

there's a constructor that takes another native array, and an allocator

lusty otter
#

Oh derp

#

LOL

minor sluice
#

my first thought is that I think what burrito wants do to doesn't work, I can't say for sure though,
I think a copy of the array sounds like the logical solution though

lusty otter
#

Yeah I'm just going to do that instead.

dusky wind
#

worst case, make a new one and use CopyTo

manic aurora
#

you need the copy afaik; i don't think ReadOnly does anything other than prevent scheduling mishaps wrt read/write

lusty otter
#

I recall reading that jobs make a local copy of the input so I just thought if [ReadOnly] works by not copying it back then it would basically serve as a temporary copy itself.

trail burrow
#

the make a local copy of the job struct itself

#

not the pointers they point to

dusky wind
#

no, that'd be too expensive for large arrays

#

and odd semantics for other non-linear structures like NativeHashMaps, etc.

minor sluice
#

passing large arrays by content copy notlikecatgoogly

trail burrow
#

thats how it worked in first version of dots tho

#

where they copied all memory

#

from the chunks

#

wasnt it?

#

they gave up on that quick af tho

dusky wind
#

Not to my knowledge.

minor sluice
#

haha, no idea how it worked ^^

manic aurora
#

yeah if that was true, it was before my time

dusky wind
#

And I was using C# Jobs since it came out in the 2018.2 beta

lusty otter
#

Yeah I don't think copying a large memory is a good idea for my case

trail burrow
#

i dont mean for the general case, but for the case when in interacted with ecs components, etc.

lusty otter
#

I'm just going to make an array of indexes and sort that.

trail burrow
#

afaik they copied the chunk memory into linear blocks and then back again in some case

#

i can dig it up, but i know it worked like that, not anymore tho

hollow sorrel
#

ye before they started to use struct ref

manic aurora
#

ooh i see what you mean, yeah, i forgot about being happy about that feature ^

#

needed to hear "ref" lol

trail burrow
#

@dusky wind @minor sluice @hollow sorrel thanks for the great conversation today, take care!

minor sluice
#

same, have a good day wave

zinc plinth
#

is there a way to "pause" a World loop ?

dusky wind
#

@zinc plinth remove it from the PlayerLoop

#

or set all of it's systems to Enabled = false

zinc plinth
#

more meant pause/play mid update

#

but guess it's just too stupid

dusky wind
#

could you clarify what you mean by that?

zinc plinth
#

I wanted to wait on an async operation before continuing through the loop (Addressables)

dusky wind
#

I'd disable the entire loop mid execution then

#

but that 's going to be difficult to resume at the right spot

#

unless you intend on freezing the game

#

while things load

zinc plinth
#

I guess I don't mind if I start over at start of loop

dusky wind
#

I'd just loop through the systems in the world and disable all of them in a system

#

then when Addressables is loaded, reenable them

hollow sorrel
#

yea that's prob simplest way

#

you don't have to loop everything, just the toplevel groups like simulationgroup and everything underneath will be disabled too

zinc plinth
#

wouldn't just using Remove/AddWorldToCurrentPlayerLoop be better ?

#

ho but I need to stop the current frame too

#

so yea need to stop the systems

#

this system will only run (fully) once at the start of the game anyway

hollow sorrel
#

fiddling with playerloop should work too but dunno if that's really better, don't see why not tho

#

but pausing mid world sounds kinda weird

#

why does it have to pause loop to wait on an addressable?

#

not saying you shouldn't, just curious

zinc plinth
#

I think my code might explode if I the init logic gets split into multiple frames, didn't test it tho

#

so yea, the bad reason

hollow sorrel
#

lol

#

relatable

zinc plinth
#

need to try to put some kind of wait before I set the loaded bool to true and see if anything explodes

toxic mural
#

Isn't there a [RequireSingletonForUpdate] or something you can put on a system?
You could configure the necessary systems to be suppressed until your Addressables are done loading as flagged by a singleton component

#

imo ejecting mid-update is too out of band

wheat stump
#

IS UI builder / UI toolkit ECS based

toxic mural
#

no, I don't think

wheat stump
#

Ok @toxic mural

#

Thanks

toxic mural
#

You can use it along side ECS but you have to connect them yourself, like pulling data from a system and setting label.text = mysystem.GetEntityCount()

wheat stump
#

Gotcha @toxic mural Thanks

zinc plinth
#

I finally made my init workflow work with addressables loading time whenlifegetsatyou

wheat stump
#

Is UI toolkit used to create in game Screens?

safe lintel
#

ui toolkit is the replacement for all gui stuff, its not complete but its intended to be better than all the past ui systems(i cant even remember all of their names).

wheat stump
#

@safe lintel Can i use it as a replacement of canvas

tardy spoke
wheat stump
#

@tardy spoke

#

Thanks again

tardy spoke
#

๐Ÿ‘

wheat stump
#

When I am importing the UIERuntime packages I am getting lot of errors

#

that many functions doesn't exist

#

Can anyone tell the solution for that

solid flume
#

What ECS library would you recommend, considering I'm looking more for architectural benefits and any performance improvements are an addon.

#

I was thinking Entitas

vagrant surge
#

Entitas is fine

#

but.. just give the different libs for a spin

#

and compare them for your needs

near copper
#

@solid flume check Svelto.ECS out as well

deft stump
#

alright

#

the bullet hell game is now up

twin raven
#

What is that?

deft stump
twin raven
#

Interesting! Thanks, I will definitely take a look later in Unity:)

stone osprey
#

is there a way to check if a entity has a buffer ?

#

Get buffer returns a exception :/

mint iron
#

i think u can use has component and if so get the buffer and check the length. whats the exception

stone osprey
#

@mint iron Thanks, im gonna try that... it just tells me that theres not such a buffer attached

mint iron
#

mmm im not 100% sure it would work, because i guess the element is an IBufferElementData rather than IComonentData

#

and im guessing HasComponent<DynamicBuffer<Element>> wouldnt work either

zinc plinth
#

to check for a buffer you just do HasComponent<Element>

dusky wind
#

In Hybrid, are transforms synced between entities and GameObjects bidirectionally?

#

If I move a converted but not destroyed GameObject

#

Say via Animation

#

Does the entity get moved?

mint iron
#

i think only if you used AddHybridComponent

dusky wind
#

On the transform?

mint iron
#

in conversion. eg

public class EpicCameraAuthoring : MonoBehaviour, IConvertGameObjectToEntity
{
  public Camera theCamera;
  public void Convert(Entity entity, EntityManager dstManager, GameObjectConversionSystem conversionSystem)
  {
    conversionSystem.AddHybridComponent(theCamera);
  }
}
#

then you're declaring that you want an entity sync'd with a game object. and ECS will spawn a gameObject for it when it gets created as part of the subscene

dusky wind
#

So Transforms don't get special treatment?

#

Oh ok

#

I have been mostly dealing with pure ECS and am not too familiar with the Hybrid mechanisms yet

violet cosmos
#

@dusky wind I'm going to ditch Hybrid, I think

mint iron
#

this one is fairly recently added, and there's been a few attempts in the past but they were shall we say, sub optimal

violet cosmos
#

There's too many problems with the tooling and workflow

deft stump
#

everything is suboptimal

dusky wind
#

Until DOTS fully supports skinned meshes, animation, and cloth physics

#

I don't have a choice

violet cosmos
#

So, I'm going to go pure ECS and Unity Physics (for specific isolated systems). But, I have thought about writing a sync Monobehavior

#

But, my latest line of thinking is to make mostly headless systems in ECS... Ones that have very little input/output to GOs

#

And fully ditch Hybrid and all its associated problems

mint iron
#

anyone tried using pure playables/mixers etc for animation in Unity ECS?

dusky wind
#

They still write out to GOs

#

I already am using Playables to drive my animation

violet cosmos
#

@dusky wind what are you trying to accomplish?

dusky wind
#

Fighting game

#

Smash bros like

#

Hitboxes are attached to animated bones

violet cosmos
#

GO.Update runs before ECS simulation. LateUpdate runs after. Just saying ;)

dusky wind
#

I'm manually ticking everything

#

I have a master GO manager that individually enables and calls Update on the relevant systems

#

Already needed to do this to get rollback working

violet cosmos
#

What's the downside? It is mixing and making some code annoying to grokk... But, what's the issue?

#

I need to learn too :)

dusky wind
#

I haven't had any 100% blockers yet

#

Right now it's reading the player state and ID out of ECS and into Playables

#

Evaluating a Playable graph

#

Then reading the transform information back into ECS

#

If it isn't being handled automatically, I'll have to manually do it.

violet cosmos
#

Yeah, that's my current line of thinking too. Then I can have things like FinalIK/Timeline, and other things that aren't ECS.... But ECS handles specific systems that I can break down into mostly homogeneous structures

Like, my weapons system, which is a raycasting nightmare

dusky wind
#

My use case is very structured and homegrown already

violet cosmos
#

LateUpdate is where any changes would be in my mind

dusky wind
#

My main concern is that Mecanim isn't compiled with FloatMode.Strict

#

Which will throw a wrench in my determinism requirements

coarse turtle
#

so with AddHybridComponent the transform data is strictly driven by entities

dusky wind
#

So if I converted the hierarchy while it's A or T posed

#

It'd overwrite the animation?

coarse turtle
#

Yep

dusky wind
#

Is TransformAccesssHandle still available?

#

Or whatever it's called

coarse turtle
#

It's a 1 way road pretty much. I remember trying to manipulate it, but it's the CompanionGameObjectUpdateTransformSystem will copy the LTW -> GO Transform

#

Yeah TransformAccessArray is still available

dusky wind
#

Interesting

#

So I need this to be done in SimulationSystemGroup

#

If I evaluate the graph in Simulation

#

Read out the data into Entities

#

Then it will be written back during ConversionGameObject... System, which is in PresentationSystemGroup

#

It's highly roundabout

#

And performance wise highly questionable

#

But it could work

violet cosmos
#

Well, I think if you have thousands of things, yeah... But a hundred or so?

That updating the Transform happens one place or another

minor sluice
#

@ james,
in my game I basically bake hitbox data from animations.
So the animations play once in the editor and hitbox transforms are recorded with a certain framerate, in the game, time is stepped in the manual loop, transform positions/rotations interpolated based on the recorded animation data if required

dusky wind
#

I have 8 characters with a bone hierarchy of maybe 90 or so bones

#

This shouldn't be a huge blocker

#

@minor sluice I'm handling hitboxes separately

#

It's just dependent on bone positions

minor sluice
#

so all that's then left is to just apply the animation state and normalized time to the animator, driven by the logic.
animator/playables have no influence on actual game simulation.
hmmhh, but are there specific requirements for your bone positions?

#

I just write the bone positions from animations that have hitboxes into data stores with fixed points

#

or the fixed point raw value

dusky wind
#

I guess that can be sampled ahead of time

#

But I do have some oddities due to some unique game factors

minor sluice
#

yeah,
hmmhh, I basically had an editor script that goes over all my animator states and writes the results of the recorded bone transforms of all animations in a file

dusky wind
#

Like slowing/stopping time

#

And scaling characters

#

Doing hard bakes will need to factor those in mind

minor sluice
#

hmmhh, I could see that scaling might be an issue as it would require going up and down the transforms in hierarchical manner which might be quite expensive,
don't see the time as an issue,

but for the scaling, tbh, my game doesn't account for that

#

for the sub time steps, I basically just do linear interpolation between the recorded positions (I think initially I just applied the last full valid frame if there was a subtime step)

#

although,
if the game is fully 2d in logic, and say the pivot point were the feet,
positions are stored locally to their feet position, wouldn't it be as simple as doing:

globalPosition = globalFeetPosition + recordedLocalBonePosition * scaling; ?

dusky wind
#

I'm mostly concerned with editor workflow for my designers, haha

#

The bakes seem like they would take a while and doing it before every Playmode launch seems, expensive

minor sluice
#

oh right,
how many people are usually contributing with models and animations? totally forgot about that part ^^

I see that it can take quite a while to do, before every playmode launch seems unreasonable, but maybe..

well not sure how you handle adding or changing animations for existing characters from designers (never used playables yet).
but maybe something like a button that triggers the baking process for a selected character?

#

or a process that detects if animations on a character were adjusted? and then triggers it?

#

like a dirty flag

dusky wind
#

Several, I think we have 4-5 people on it right now

minor sluice
#

ah nice

coarse turtle
#

you can probably stick w/ ConvertAndInject although idk when they'll remove that ๐Ÿค”

dusky wind
#

What does that allow?

coarse turtle
#

Entity -> GameObject, but if you add a tag you can copy from GameObject -> Entity

#

I forgot the tag's name but it's like CopyFromGameObjectToEntity or something like that

#

so you can still get that gameobject-esque workflow without the companion link

dusky wind
#

I'm not planning on moving to 202x.y until DOTS animations are supported 100% so this should work in the interim.

violet cosmos
#

That's part of Hybrid, the Convert process

#

It takes a long time too

#

Oh, sorry I misread

coarse turtle
#

I can't remember exactly, but ConvertAndInject most likely doesn't convert children so you may need to store that/link that manually if you need children gameObjects as entities

violet cosmos
#

I need to not chat until the first coffee is fully consumed ๐Ÿ˜†

dusky wind
#

@coarse turtle unfortunate

deft stump
#

it also take a huge perf hit.
I tried it with Sprite renderer and just moving it around

#

hoo boy debugging the problem was a roller coaster

#

@violet cosmos I thought you were abandoning dots?

minor sluice
#

like james said above, I wouldn't consider going full ecs for a fighting game either until there are proper skinned mesh render, animation etc. solutions

#

but since in many deterministic sim games, the logic is completely separated from the visuals for good reason, I think it's reasonable to try either a full ecs animation or at least something that doesn't depend on internal unity event flow, and just sync the visuals up in a separate step

#

I'm also wondering if someone has or tries to reimplement or do a deterministic physics engine with dots supports, and how that performance would be.

violet cosmos
#

@deft stump no, I'm abandoning the shit show that is Hybrid

I'm going to make my ability system in GO, but convert a current system into pure ECS later. I also have two other systems that would benefit from pure ECS

#

My problems all stemmed from trying to make Hybrid into a tenable workflow for what I need. But, at it's current state, Hybrid only works for specific use cases

#

Basically... Level by level, or megacity

tardy spoke
#

I don't even know what exactly hybrid means.

#

Is that just anything that uses the conversion systems from GO's?

deft stump
#

it seems that you can reference GO components into ECS (which is normally illegal)

tardy spoke
#

Yeah, I do it constantly in my shit box code ๐Ÿ™‚

deft stump
#

I thought the hybrid approach as just to use Convert To Entity component and the Authored ICD's, I didn't know it had this feature! XD

#

I was using it before with the sprite renderer (didn't know at the time), but the perf hit was massive

#

so I said, I'm gonna author everything from now on! and you know GWovoRaphiXD

tardy spoke
#

Yeah, I'm mostly on ECS because I know I'm going to have some main systems that are computationally expensive (10,000 AI zombies or something that I want to do fun AI experiments on, namely), but my main systems, just to get the project moving quicker reference GO's ALL the time.

violet cosmos
#

Hybrid ECS is a set of tooling for converting GOs and Prefabs into something you can use for ECS. It also has a serialization and deserialization tool chain that's called SubScene

There's also the Hybrid Renderer which is responsible for getting entities into the render stream

#

Those things are all teh suck right now

deft stump
#

In all honesty, I dont need ECS for my game.
at any 1 time, there's going to be a max of... 12 sprites all mucking around

#

I just do it because I just hate OOP XD

opaque ledge
#

OOP is easier than ECS

#

runs away and hides

deft stump
#

๐Ÿ—ก๏ธ

violet cosmos
#

It is, actually. The current GO workflow is far far more robust to make things quickly. And it's not just because I'm used to it, it's because there's a lot of tooling and a well refined workflow in the editor

#

In the conversation of ECS, and especially Hybrid.... It seems very few people talk about what a real world workflow looks like

Right now in Pure ECS it's "roll your own"

#

Or... Maybe that's all we talk about, really.... Because there isn't an established workflow ๐Ÿค”

deft stump
#

we have

trail burrow
#

In unity atm the OOP workflow is vastly superior to the ECS 'workflow'

dire crown
#

ECS workflow is held together by scotch tape and bubblegum

#

the demos for sure are

trail burrow
#

@dire crown you mean the "lets build something cool people get excited about and then drop it like a hot potato" code dumps on github? yeah ๐Ÿ˜„

dire crown
#

yeah ๐Ÿ˜ฆ

#

i was excited at first, started to think of the bottlenecks in my previous games and how DOTS will unlock all of that

deft stump
#

@trail burrow in the current state of ECS, when do you think unity will get their shit together?

dire crown
#

but it is not even close to being ready. i would have better luck rolling my own engine

trail burrow
#

@deft stump 3-4 years from now, if they don't backtrack and go all on improving GO/MB system, deprecate the ECS but keep jobs+burst around./

#

my bet is still on that, last

vagrant surge
#

my bet is on full backtrack

trail burrow
#

yeah

#

jobs+burst is pretty good, not THE best, but it's generally pretty fast and usable

#

but the ecs is just... ughhhhh

vagrant surge
#

im absolutely seeing them fully backtracing from ECS for "gameplay", and leave it mostly for tryhard optimization stuff, hidden as "expert mode"

trail burrow
#

yup

#

that's my bet also

dire crown
#

i don't see anything wrong with that. in most cases ECS is overkill

deft stump
#

I hope they dont...
or pray for the impossible and make ECS open source

#

if they backtrack... hoo boy, i'mma learn game engine development.

dire crown
#

well i hope they make the core of the engine operate in ECS

vagrant surge
#

its pretty nice as an architectural pattern. The change from having logic in comps vs centralized in systems is pretty huge

#

but if they add 99999 workflow barriers....

dire crown
#

but keeping a more understandable OO approach around isn't a bad thing. ECS is another tool in the belt

vagrant surge
#

@deft stump OurMachinery is on beta atm, they have full ECS

#

tho its pure C

#

and they havent cared much about higher level logic stuff

#

so its very barebones

#

awesome blog btw

violet cosmos
#

I still think ECS, by itself is still useful, with caveats...

  1. You have (or can) setup a bunch of homogeneous entities
  2. You need to structure your code to run in an organized manner

If you look at ECS as just a data container and an organized Jobs/Task system with those caveats, it's not so bad

trail burrow
#

@vagrant surge i mean it looks cool and all, but another engine, built by a small team... hard pass for now

#

afaik they even live close-ish to where i live

vagrant surge
#

@trail burrow i have the beta and ive tinkered a bit. Big issue is that stuff is very much nontrivial and there is about 0 docs

#

couse beta and all that

#

but i think they have an amazing solid base there

#

the engine is 25 megabytes

deft stump
#

I'll look into it

vagrant surge
#

the entire thing is also as modular as they advertise

deft stump
#

not a C guy but hey, learning is doing XD

vagrant surge
#

they have samples where they ignore the entire engine and just grab the "render api" module + the "windowing" module to create an standalone app

#

and a sample where they implement a terrain system (basic one) as a plugin

#

literally everything is plugins, its nuts

#

they use more or less the same ecs approach as unity

#

with the archetype stuff

#

not sure if they do chunks tho

#

one idea they have in the ECS (that unity doesnt have) which i find very interesting is the concept of "phantom" components, components which dont exist

#

instead of registering a component type as a struct (the usual)

#

you can register just a "added to entity" and "removed to entity" callbacks

#

and then store the actual data yourself

#

and it all still works with all of the matching and similar ECS logic

trail burrow
#

OurMachinery is cool but yeah... it's a nothingburger so far since small team, new engine, etc. give it like 5-6 years then it might be something

vagrant surge
#

its very niche too

#

too advanced for noobs

#

might be useful for people who want more of a framework to build an engine on top, of people who want to create a 3d app or visualization type stuff

amber flicker
#

As I'm not sure who's reading this - I for one don't agree with everything being said here. 'shit-show' etc is pretty strong. I personally think it's some nice ui, tools and bugfixes away from being a nice workflow, let alone useable. It's clearly going to take a longer time than any of us would want but I think the fundamental concept that Unity arrived at (that you want a different editor/authoring representation of your data to what the computer wants at runtime) is fairly sound. I dunno, just trying to add a bit of balance. ยฏ_(ใƒ„)_/ยฏ

safe lintel
#

Agreed with timboc, got everything working in my dots fps, whats blocking me is needing more dots packages like sound, anim and pathfinding to transition to pure ecs but hybrid is fairly easy. Id just rather not use any UnityEngine.Component for anything ๐Ÿ˜…

opaque ledge
#

whats blocking me is my entities arent being rendered in mobile build ๐Ÿ˜ญ

tardy spoke
#

ECS 0.13 not running when built to VR was my blocker, but I haven't tried 0.14 yet. ๐Ÿคž

#

Someone should make a minimum working example of "iterating" over a certain number of entities over a frame for the wiki! โค๏ธ

I take it you need to do grab an entityQuery and get a count of their indexes or something, just not sure what the easiest way is. I'm hoping you don't literally have to like make a nativeHashMap to hold an indice per each entity's actual index location. There must be a "quicker" approach to something this common/simple?

I noticed in IJobChunk or whatever that system is that it had a "first" parameter or something similar which I'm guessing is specifically used for this kind of thing?

violet cosmos
#

Right now for DOTS, only Pure ECS and Jobs work for me. I'm super curious about transitioning to Unity Physics package BUT... If it's anything like Hybrid I might have to bow out of that and keep things Pure ECS and roll my own entity injection/reading

amber flicker
#

@tardy spoke didn't really follow what you're trying to do... it sounds like Entities.ForEach but I'm guessing not?

coarse turtle
#

the first index is the first entity's index in the particular archetype chunk ๐Ÿค”

tardy spoke
#

If I was a researcher/scientists I would do a thesis on ECS systems and processing entities over frame counts, and I would make global variables to "slow" the systems down until there is a noticeable change in behaviour "IE the enemies now seem stupid because they don't change direction to face you quick enough", I bet you could get MASSIVE performance boosts.

#

@coarse turtle hmm, well if you can also get the last that would work?

#

@amber flicker yeah

#

@amber flicker entities forEach but say I have 100 entities and I want to only process 10 per frame (assume what i'm doing is mad computationally expensive and unnecessary per frame).

amber flicker
#

ah I see

#

(I think) easiest is something like a nativeQueue that you push and pop - probably the more sophisticated version is a NativeStream

deft stump
#

imo for now i'll put a pause on ECS on my game.
the goal right now is to make a shippable game.
i'll just update everything to ECS once the game is out for 2 months (force the users to dowload a new version of the game)

#

XD

#

yo guys! can't play the new event coz you need to redownload the game! XD

tardy spoke
#

@amber flicker there's no built in helpers for any of that stuff? That seems really surprising to me. Maybe the OH of scheduling the systems in general offsets the performance savings of the idea in a lot of cases.

#

Cause out of my 15 systems, I have very few that actually need to update the entities 72 times a second, haha.

amber flicker
#

You're right that it's a common concept and something a lot of people think about. That said, I struggle to envisage what a 'general solution' looks like for something like that. Especially something more simple than push/popping a queue

violet cosmos
#

I think setting a local flag and then returning

Also, in the OnUpdate you can return before declaring the ForEach... Say, by waiting some time

tardy spoke
#

Yeah, I'll have to see what using the queue looks like, I just assume they could include it as a hidden somewhere in the SystemBase or something where you're like

.IterationPercentage(10).Schedule() and that would run it on 10% chunks of all the entities it gets in the query per frame. I dunno if that's possible, but that'd be a dream hahah

coarse turtle
#

yeah the last index is first + chunk.Count @tardy spoke

violet cosmos
#

That's something better for Jobs IMHO

tardy spoke
#

@coarse turtle awesome. Does SystemBase get access to "first" in any way or is that just IJobChunk and the job classes?

#

@violet cosmos SystemBase just is a job though? With the boilerplate abstracted out?

Or do you mean "deal with it in a different manner using jobs"

violet cosmos
#

No, it's forced to complete

tardy spoke
#

Oh, right

coarse turtle
#

uhh idk about SystemBase Entities.ForEach. Maybe if you can grab the ArchetypeChunks (you can probably try to wrap that in an IJobParallelFor)

violet cosmos
#

Deal with it in a different manner with Jobs, then you can control when it's run in the frame lifecycle

#

You can schedule with ECS if needed, but... Then you're locked into that scope

amber flicker
#

well.. keep in mind you have to worry about your queue growing too fast and other issues no matter what you do. A dumb (because it wouldn't be guaranteed to hit all entities at the same rate - or worse - so you'd only want to use it with entities that don't change archetype at all) technique could be to use an IJobChunk and early out on every chunk index that isn't the index(s) you want to process that frame.

solid flume
#

Whats the difference between different ECS plugins like entitas and svelto.ecs

tardy spoke
#

@amber flicker I have a lot of systems where that wouldn't be a concern. Some even where the number wouldn't even ever change.

amber flicker
#

in that case, it could be a good candidate for a SCD (Shared Component Data) - very easy to batch process a set of entities at once that way

tardy spoke
#

Hmm interesting

#

Yeah I'm trying to come up with a "generalized" solution that is easy to implement, not necessarily the optimal solution

#

since it takes me so long to optimize things I'm really a fan of the "see the actual performance and only optimize what's necessary" approach haha

coarse turtle
#

Whats the difference between different ECS plugins like entitas and svelto.ecs
@solid flume likely API design/workflow - you can probably look at Svelto's blogs to see a peek of how the intended workflow is

solid flume
#

I'm favouring entitas just because it looks better documented with more tutorials

amber flicker
#

you just add an SCD with say batchIndex = 0 for the first 100 entities, batchIndex = 1 for the next 100. Then in your job you do e.g. (pseudo code) SetSharedComponentDataFilter( batchIndex = 0)

tardy spoke
#

And also a solution that would be nice for the wiki

#

That gets the "concept" across and someone can get started with it, and a good programmer would be able to take it a lot further

coarse turtle
#

yeah svelto's ecs doesn't have many docs, he does have a few sample repos you can look at to deconstruct

tardy spoke
#

@amber flicker that approach is interesting. ๐Ÿ˜„

#

What if it had a system that dynamically set ALL the SCD batches?

#

The system "counts" the entity queries and then sets them to the desired "percent" or number?

#

The only trick is if you have two systems that want to batch at different rates, there's only the one "state" component hmm

amber flicker
#

sure - not the fastest operation but you presumably wouldn't need to do it frequently

tardy spoke
#

Yeah exactly, run it once a second

amber flicker
#

you want to be a bit careful with SCDs as they can lower your chunk utilisation (and hence slow things down) - if you're using them for in the order of 100 you're probably fine, if it's ~10 you may start to lose more than you gain at some point

#

for different update rates you can e.g. do for( int i = start; i < start + numBatchesToProcessThisFrame; i++) job.SetFilter(i); job.Run() or whatever

tardy spoke
#

but to get started and keep things easy, a method on a SystemBase class that gets the count (which you could do "OnStart") and caches it for iteration would be cool.

Then could run on the SystemBase method on a timer something that updates that entityCount number every 1 seconds for a naive approach. A lot of boiler plate, but could work, no?

#

The SCD approach is cool, especially if a System was updating the SCD's and applying them to new entities it found so you could batch in percentages or something

#

That almost sounds like an asset that could be sold on the store if it was robust enough haha

amber flicker
#

I don't think you need to extend SystemBase or anything. Also fwiw I would think about entities or chunks processed per frame rather than time. Just my opinion. And likely no less than one chunk a frame generally. Depends on what you're doing ofc. Premature optimisation and all that when you're not even using burst right? ๐Ÿ˜„

tardy spoke
#

Haha, it's kind of just research because I know I'll likely need it for the 10,000 zombies when it comes to their AI / decision making

#

but maybe not since the server will have some serious power, and it's the one calculating those behaviours

amber flicker
#

Need to get my first two assets finished before thinking of a third but honestly once written out I wouldn't expect this to be more than 100 loc.

deft stump
#

btw, are you gonna author your own AI in ECS alex?

#

or use a pre-existing solution and have it interface with ecs stuff (if at all possible?)?

tardy spoke
#

@deft stump yeah, it'll be System rule based reactive AI I imagine. That's the easiest way I can think of to do it.

I would love to experiment with some ML stuff though - like to me it would be far more interesting to have an MMORPG that incorporates the enemies actually learning, but that ramps the complexity way, way up. And also makes the gameplay experience very unpredictable haha. I bet the zombies would gather in clumps and run into the cities and just camp spawns, hahaha.

#

@amber flicker For me it'll be 1000 lines of code. Which people buying it from the asset store will LOVE since it's like getting more "value". ๐Ÿ˜‰

#

$10 for a measly 100 lines of code!? Please.

amber flicker
#

I'll just compile it into a dll ๐Ÿคฃ

tardy spoke
#

Also my bro has his masters in ML so maybe I can entice him to just make some sweet AI for it.

#

Zombie simulations are probably like catnip to ML people

coarse turtle
#

or just model a swarm mechanic ๐Ÿ‘€

vagrant surge
#

@tardy spoke ive done similar things of the staggered execution

#

but one thing i found is that naive approaches wont work

#

just iterating system unti say N = 100 and then stopping wont work, because when you add and remove entities, shit can get fuckd

#

really what worked the best were 2 approaches. One approach where i had a "counter", and when the counter reaches 0, the stuff does the full logic. Else it does nothing

#

and another where it split by archetype

#

when objects were being created, they would be added a tag component either A or B

#

and each frame, you executed the system on entities with A, or entities with B

#

the A + B approached quite well. You need ot make sure that its well distributed (similar number of entities)

#

and even then stuff can artifact a bit

#

another thing that does work is that there are just systems that execute less time.. total

#

for example 10 times a second, not 60

#

but you need to be careful as it can hitch

tardy spoke
#

Interesting, what do you mean by "hitch"?

#

The timer approach I have implemented already across some Systems, but I'm just looking for a solution when I start getting into the AI systems as you know they're going to be pretty expensive, and realistically do not need to be updated each frame

#

but also may just be TOO much processing for a single frame

#

So the A/B split could do it in short order probably for just the one system.

amber flicker
#

I wouldn't be surprised if you want a priority system (agents closest) and e.g. a pathing solution that can take variable time.

tardy spoke
#

Yeah, of course. Those will be interesting/fun optimizations to make.

You could for example on execute the AI once per every 2 seconds on every AI that isn't seen by a player.

#

The system of even figuring out which zombies the players can see could get computationally complex though, etc.

#

Because it's the server that would be calculating that, and say you have 1000 players and 10k zombies, granted it would just be straight math distance checks, but I could still see that causing a hiccup if the computation isn't spread out over some frames

#

I have zero clue how I'm going to do a pathing system since I haven't fiddled with them before, and because the map is 20km squared (but at least now it's broken up into much smaller subscenes). I tried to bake lighting on the 20km map and Unity blew up, so I expected the same from navMeshes... but maybe now with the smaller subScenes I can use them.

opaque ledge
#

lmao please no

tardy spoke
#

As I said, I know nothing of how AI's navigate / move around so I don't even know the correct approach. Literally know nothing about it yet. ๐Ÿคทโ€โ™‚๏ธ

opaque ledge
#

navigating is one thing, 20km^2 is whole another ๐Ÿ˜„

#

i think those kind of things are 'faked' like you make everything slow including camera movement, so it would fake that distance between units are a lot

#

(i think)

tardy spoke
#

Interesting. I took the much easier solution of moving the entire world around the player ๐Ÿคฆโ€โ™‚๏ธ

#

To keep them at the origin lol (otherwise floating point errors get visually crazy, especially on VR)

#

Then the server does a reverse translation of their "actual" world position.. you know, the easy way! ๐Ÿ˜Ž

#

And the map is actually 20km in size haha

#

but broken up into like 250m subscenes

#

that stream based on player proximity

opaque ledge
#

what about dividing your map into scenes or even subscenes(not sure if they can hold lightdata)

#

thats how mega thingie done right ?

tardy spoke
#

That video shows it in a test scene, I just haven't brought it all back into the "real world" yet, haha.

#

I haven't tried baking light into a subscene either. Would be interesting to try.

#

I'm hesitant to even bother with lighting at all, even baked, as I think I want to maximize poly counts as much as possible and do interesting detail with polygons and vertex colors to give the game a unique look. Get a bunch of artists in there to "paint" the world via vertex colors. They could theoretically even paint the shadows in.

deft stump
#

I wonder if I need to add the scene dependency cache into git lfs?

coarse turtle
#

I excluded it for the time being ๐Ÿค”

solid flume
#

@deft stump do you have experience with using git. Because its been giving me a headache for a long time

tardy spoke
#

Also it's going to be painful to make 300 subscenes or whatever and put each tile into one hahaha

safe lintel
#

painting shadows for a huge streaming world sounds like hell ๐Ÿ˜…

tardy spoke
#

Haha, totally. I'm talking about literally trying to get like 100 "painters" to do it. Make a video tutorial to teach them how to paint in the editor and assign them specific subscenes and let them rip

#

I probably won't actually do that, but it would give the game a neat look.

safe lintel
#

100 people gonna have their own unique approach and different rates of learning, id look into ways to automating rather than trying to wrangle 100 people to do something consistently

tardy spoke
#

... what makes you think I want it to be consistent?

#

lol

#

I want it to be interesting

#

Consistency is boring!

safe lintel
#

art by committee is always "interesting" ๐Ÿคช

tardy spoke
#

You'll notice I always spec in the easiest approach. ๐Ÿ™‚

deft stump
#

@deft stump do you have experience with using git. Because its been giving me a headache for a long time
@solid flume i say im experienced. What you want to do?

solid flume
#

I committed a 256 mb file from a package, now it won't push

deft stump
#

to github?

solid flume
#

I have 45 commits locally waiting to get pushed

#

Git, yea

#

I have git lfs

#

The github plugin for unity knows it

#

I tried using git lfs push origin master

deft stump
#

github doesn't accept 100mb files if the files aren't lfs'ed

solid flume
#

How do I make it lfsed or just remove it from the commit

deft stump
#

lemme get this straight so far.
-> you have an existing repo.
-> your latest, or at least one of those 45 commits, has a 256mb file in it.
-> you tried pushing but github gives you the middle finger.
-> you have git lfs, but you haven't migrated the big files to git lfs right?

solid flume
#

Yea

#

I just leave the git stuff to the plugin usually

#

Just press the commit/push buttons

deft stump
#

do you have a team working with you?

solid flume
#

Nope

#

I'm all alone ๐Ÿ˜ข

deft stump
#

alright. lemme pull up my cheat sheet, I dont want to give wrong commands here.
Do you know how to use powershell, gitbash, or cmd, for git?

solid flume
#

Yea I can type stuff into big black boxes

#

(I have the git bash thingy)

deft stump
#

okay, can you open one up

solid flume
#

Done

#

I'm in the project directory

deft stump
#

oh nice, that skips alot of steps. lol.
git lfs install
git lfs migrate import --include="*.(whatever file type)"
OPTIONAL if you want multiple file-types:
git lfs migrate import --include="*.(whatever file type),*.(whatever file type)"
git push -f //essentially you rewrote your entire history needs to forced pushed.

#

just to be clear this is all in one branch right?

solid flume
#

Yep

deft stump
#

alright

solid flume
#

Gonna have to find this file type

#

The * needs to be there right?

deft stump
#

if it's ANY file with the file type, yes.
but you can be specific if you want

#

argh, I forgot quotes!

solid flume
#

I don't remember the file type so I pushed and am waiting for an error to pop up

#

I didn't put in any commands apart from git lfs install, which took like 0.5s to run so no harm done

vagrant surge
#

@tardy spoke stuff can hitch because lets say you have systems A B C, all of them expensive

#

A runs every 2 frames, B every 3 frames, C every 4 frames

#

every 12 frames all 3 systems will run, and if they are heavy, you can easily get a frame that is significantly slower than the other ones

#

so you need to make sure that some frames A executes, other frames B executes, but never both at once

deft stump
#

@solid flume easy way to check is to git lfs migrate info shows the types that are very big in your repo (although they're consolidated) + how many are they.

solid flume
#

Oh

#

I'll try that thanks

#

It only needs to be above 100mb for github to cry about it right? Anything under is fine?

deft stump
#

yup

#

it'll throw a warning if above 50mb but it'll still push

solid flume
#

Do you know where I can learn this stuff from?

#

I want to shift off of relying on the plugin, because often it feels like the scripts it runs in the background slows down the editor

#

And it doesn't always detect changes instantly

#

It pushed without errors

#

Thanks a lot

deft stump
#

one thing about migration, is that it's dangerous if you don't have exclude, include.
every damn file will be lfs'ed. and lfs won't warn you because of it

#

took me painful 3 days to fix my repo

solid flume
#

There are downsides to just lfsing everything? Because I've wondered for a while why that isn't a thing

violet cosmos
#

I'm putting my code into a separate repo that excludes binary assets. Those get backed up to Backblaze B2. I check in Unity code via Visual Studio

In house packages are in a separate folder that I use GitKraken to manage

deft stump
#

don't quote me on this,
the downside of lfs'ing everything is if you have a 50 mb psd file, and you made a 1byte change, lfs won't commit that specific change, it would actually make a new version of the lfs object, ergo another 50mb psd file.

so if you lfs everything your whatever gb of unity project will actually grow in size per commit!

violet cosmos
#

@deft stump No, SVN/CVS store the deltas. Git stores the whole thing

deft stump
#

really?

#

color me, corrected

violet cosmos
#

Neither is... bad per se

deft stump
#

then... what the hell does git lfs do dammit!? I know it replaces the files to be pointer to a thing but... if it stores the whole thing, then it's essentially just git XD

violet cosmos
#

Just different ways of doing it. I do kind of miss SVN though

#

I think Git LFS just stores that the binary file was changed. It doesn't actually store the file

#

"...with text pointers inside Git, while storing the file contents on a remote server like GitHub.com or GitHub Enterprise."

#

It just delegates the actual file storage somewhere else

#

But, lets you see what files changed as part of a commit. It's... kind of wonky, there's gotchas IIRC

deft stump
#

Yeah, that's the pointer file I talked about.
So if I have a 50mb file, committed it, changed 1 byte of it, committed it again.
then it essentially has 2 versions of that 50mb file, ergo 100 mb!

#

or is git lfs made jsut for easier checkouts? and smaller repo size?

violet cosmos
#

On the LFS server, possibly. I don't know if there's good tools for cleaning that up

#

I really just go with dumping the files and saving MyFile01.psd MyFile01.1.psd MyFile01.2.psd etc in a "Sources" folder. Game specific assets are organized in a similar, yet separate tree, like GameNameAssets

#

I just do it for simplicity sake, and really do want to improve it... but that's later when I'm getting in "pipeline" mode

solid flume
#

So using git just increases my project size continually?

tardy spoke
violet cosmos
#

AFAIK, just means "runs it now"

#

So, would be useful if say.... That was your first ForEach and you were initializing some data in a local variable that you use in subsequent ForEach below

tardy spoke
#

Yeah, just seeing if there's a way for a system that just initializes something to just "disable" the system afterwards, but there doesn't seem to be. I think this approach is actually what you're supposed to do? Haha

#

Just kinda leave the system living forever even though it was just used for init?

hollow sorrel
#

does entities.foreach work in onstartrunning? if so that might be simpler but not sure if codegen accepts that

tardy spoke
#

@hollow sorrel I could check, but I imagine what you'll run into in that case is some entities may not have been initialized yet etc

#

but maybe not, I don't know much about the order of the ECS systems

hollow sorrel
#

sorry meant onstartrunning instead of oncreate, which just runs the first time the system updates

tardy spoke
#

Oh, and another thing is the Update() method has to be implemented anyway since it's an interface so I'm not sure what the savings are besides just that bool if check lol

violet cosmos
#

Why not just run OnCreate?

#

Then it's never run again

#

Maybe Entities are empty, not sure about that particular lifecycle

hollow sorrel
#

yea you'd leave onupdate empty. wouldn't be a performance save at all, but i think reading the code flow would be simpler from someone who didn't write it

#

since you can assume that code is only meant to run once

#

without reading an extra bool that may or may not be set elsewhere during its lifetime

tardy spoke
#

Noice

violet cosmos
#

Yup, that's much clearer to it's intent

tardy spoke
#

Yeah way better

safe lintel
#

on start running may be called more than once

#

imo i would add like a Spawn tag to that entity/archetype, then have that system query those components + spawn tag, remove spawntag and then it wouldnt run anymore on that particular entity.

tardy spoke
#

Under what conditions?

#

Yeah, I had that before except I have two systems that affect that entity in an initialization way... could put them into one system, but that's kinda weird since they're not really related

safe lintel
#

onstart running starts any time a query match is found

#

lets say you temporarily disable an entity fitting PhysicsMass and Rotation via Disabled, its removed from the query and then later remove Disabled, OnStartRunning will process it again as the entity has been reenabled.

#

unless you want it to work like that

#

if a system doesnt have entities to process, theres no(or close to zero) overhead, you shouldnt worry about a system with onupdate logic with zero entities to process

hollow sorrel
#

whaat

#

didn't know that but that makes sense

tardy spoke
#

So the bool way is best, then?

#

for ensuring no weird things happen?

safe lintel
#

just use a tag component

tardy spoke
#

I can't in this case because I have two discrete systems, unless I wanted to use two tags

safe lintel
#

shouldnt really keep state in the systems, but the entities' components

tardy spoke
#

but then what if I have 3 or 4, haha

hollow sorrel
#

could use a singleton component and require that query if you don't want to set tags
basically same thing tho

tardy spoke
#

I just don't see the large benefit over the bool approach? Tags also require an ECB etc

safe lintel
#

well keeping a bool in the system is kinda like reverting to monobehaviour practises, where your systems are intermingled with data, you can do it but its a bit against the grain. not that it doesnt work, monobehaviours still work just fine in that way too ๐Ÿ™‚

tardy spoke
#

Hmmm

hollow sorrel
#

it's kinda weird case because i can't think of a scenario where you use an entities.foreach that only runs once in the entire lifetime of your game and then never again
closest thing i can think of is that the precondition is "game start" in which case you'd still use a query in case you want to restart your game from main menu right

tardy spoke
#

look at my systems. One locks physics inverse intertia on start. Where would you put that logic ideally? It's from a converted game object

hollow sorrel
#

oh i thought that was just some placeholder code
wouldn't that only work for entities that happen to exist from the start

safe lintel
#

is it that weird? every conversion system is this workflow

hollow sorrel
#

anyway what i meant was the precondition is hardly ever "only run once forever", "initialize" is still a precondition that's worth being "data" instead of part of a system (imo)

tardy spoke
#

yeah, where SHOULD that data live in an ECS system? Or does it live outside of it? Haha

#

I have a few initialization systems that will have to pull data from a server, IE PlayerLastSpawn point etc

rancid geode
#

Is this still our favourite way of running a System only once?
@tardy spoke I prefer to do:

protected override void OnUpdate()
{
    // do stuff
    Enabled = false;
}
tardy spoke
#

Does that work? Hahaha

#

That seems good

rancid geode
#

it worked on 0.11

#

unless they changed something, should work still

tardy spoke
#

I'll check it out!

rancid geode
#

this enables the system to run again by enabling it again when needed

#

seems like it was most intended for debugging, but doesn't seem to be an editor-only stuff

tardy spoke
#

Hmmm interesting

opaque ledge
#

can i put a monobehaviour to a gameobject and put that to a subscene ๐Ÿค”

tardy spoke
#

Pretty sure they get stripped when I tried it

coarse turtle
#

no - Unity starts throwing warnings in the console if you tried that

opaque ledge
#

ah alright, thanks

tardy spoke
#

I bet you could hold a class component that holds a reference to a monobehaviour @opaque ledge

coarse turtle
#

does the subscene serialize and generate a binary data of all the struct's blittable data?

#

I haven't tried the managed class in subscene approach yet ๐Ÿค”

tardy spoke
#

F***ed if I know. But it seems to work. ๐Ÿคทโ€โ™‚๏ธ

coarse turtle
#

i also wondered how they were able to serialize RenderMesh with the managed references ๐Ÿค”

hollow sorrel
#

i think managed components in subscenes get properly serialized too, even if they reference meshes
not sure how they do it

#

yea that

coarse turtle
#

neat ๐Ÿ‘€

#

I think I can finally start using subscenes more actively lol

tardy spoke
hollow sorrel
#

they just added asset deduplication in 0.14 too
so if you have same asset across multiple scenes it should only serialize once instead of per scene
haven't tested that yet tho

tardy spoke
#

Using "IConvertGameObjectToEntity"

#

@rancid geode Update loop Enabled = false; worked though

opaque ledge
#

@tardy spoke my use case is, i am making a 2 nativehashmap
1 nativehash map is, ID to EntityPrefab, 2 nativehashmap is ID to ShipData, to make that i am using serialized dictionary with Odin serializer and put Ship Scriptable objects as keys and Gameobject prefabs as value, then i create those 2 nativehashmap in Convert Method and stash them to Shared Static

#

would that work if i put that script to subscene ?

tardy spoke
#

No idea? All I know is managed ICD seems to work fine referring to an SO and survives loading/unloading of the subscene

#

No clue how Odin's stuff works

opaque ledge
#

well i guess i will try, i mean its an authoring component

#

you know actually nvm, i dont want to see Unity's error and get sad

tardy spoke
#

hahaha

#

Sometimes ECS will surprise ya and actually work. She's a fickle mistress.

#

However, what @hollow sorrel has said has made me question my architecture...

If all the data is supposed to already be initialized before the ECS system starts running, and I have to load it off of a server (I don't yet, but that's the plan)... but I'm storing it in NativeHashMaps that are maintained by a System that I inject into other Systems that need the game state ๐Ÿค”

lusty otter
#

Does Burst Inspector lag for you guys as well?

#

I thought one of the updates fixed it, it's still basically unusable.

violet cosmos
#

@tardy spoke write out the whole timeline... What happens when

You might also benefit from injecting the system and then having it clean up

#

The current paradigm is to load all the data into a staging world, initialize it there, then move the whole world (you have to plan to move everything due to API restrictions)

#

That's why the editor has "Conversion World" and SubScene has 4 worlds it makes to stream data in (one per frame)

tardy spoke
#

Good to know, I still haven't looked into the additional world stuff yet

violet cosmos
#

It's pretty easy. Make a world, assign systems that are marked up in specific groups and have to do not auto inject flag (forgot what that was). Have a MonoBehaviour tick it

tardy spoke
#

Any good vids or documentation on it?

violet cosmos
#

๐Ÿ˜†

#
{
    public SubScene SceneToLoad;

    private World PrefabWorld;
    private SceneSystem PrefabSceneSystem;
    private SceneSystem WorldSceneSystem;

    public bool MoveEntity = false;

    private void Awake()
    {
        PrefabWorld = new World("PrefabWorld");

        PrefabSceneSystem = PrefabWorld.AddSystem(new SceneSystem());
        WorldSceneSystem = World.DefaultGameObjectInjectionWorld.GetExistingSystem<SceneSystem>();
    }

    public void Start()
    {
        if (SceneToLoad != null)
            LoadScene();
    }

    private void Update()
    {
        PrefabWorld.GetExistingSystem<SceneSystem>().Update();
    }

    public void LoadScene()
    {
        PrefabSceneSystem.LoadSceneAsync(SceneToLoad.SceneGUID); //, new SceneSystem.LoadParameters { Flags = SceneLoadFlags. });
    }
}```
#

Something along those lines

tardy spoke
#

And somehow you can move stuff from there to the regular world

violet cosmos
#

It's all or nothing if you want the complete tree

#

There's other Move commands, but at least for Hybrid components they leave lots of hanging bullshit that it conveniently forgets to copy. Might work better in a pure ECS system though

tardy spoke
violet cosmos
#

If you're using Hybrid's SubScene loader, you can also inject systems into that world, you know

tardy spoke
#

@violet cosmos yeah I'll look into creating some kind of staging world stuff, I'm thinking I'll need a bunch of that sort of thing down the road to keep the project clean.

hollow sorrel
#

that's a big map

tardy spoke
#

20km squared son

violet cosmos
#

Yah, I tried with a PrefabWorld, but really got frustrated at copying Hybrid entities. In theory worked great though, just Hybrid effed it up

hollow sorrel
#

rip ur server

#

simulating 20km at once

tardy spoke
#

It's SpatialOS's problem. ๐Ÿคทโ€โ™‚๏ธ We'll put 'em to the test.

#

@hollow sorrel hence why earlier I was asking how to defer systems to certain numbers of entities per frame, hahaha.

hollow sorrel
#

ah i see

tardy spoke
#

Yeah, most MMORPGs apparently tick at 10 times a second probably for exactly that reason

#

Server death.

#

It's going to be painful though. 20km squared with the player at the origin, loading subscenes on the fly while the server figures out the inverse of the locations of enemies (ideally I'd like a zillion zombies just for fun) for all the player's current world positions... 10 times a second... the end result will probably be a server on fire.

proven minnow
#

Something is causing my dots scene to stop about a second after start, and then spin in application.updatescene for about 5 seconds. I can't find this in my personal profiling- any recommendations?

hollow sorrel
#

dunno but maybe try deep profiling

#

in other news wow i never realized how difficult it is to have unity run at a fixed tickrate
my fixed tick runs at 60fps but if you do the same for application.targetframerate the actual result is more like 59 fps so on average one tick will simulate twice per second causing microstutters

vagrant surge
#

@tardy spoke world of warcraft did 2 ticks a second

#

classic wow

tardy spoke
#

Haha that's crazy

vagrant surge
#

they upped it

#

i believe its 10 ticks a second now

#

but even better

#

battlefield 4

#

was 10 ticks a second on launch

#

for a shooter

#

straight up hilarious

#

it was bad enough that everyone realized that the server ran super slow

#

as that latency (100 ms) would get added on top of the lag, so the total delay was insane on everything

tardy spoke
#

Woah, 10 ticks on a shooter... that's wild

#

Might be more fun for noobs because your skill would definitely matter less hahaha

safe lintel
#

@proven minnow no suggestions but I noticed a bit of the same thing with the latest packages

tardy spoke
#

The subscenes are having some interesting issues with complicated nested prefabs, but maybe it's just the particular Synty model I'm using

#

Gonna update to newest hybrid renderer and stuff and try.

hollow sorrel
#

@tardy spoke what did you use to make your game world?

#

the terrain etc

tardy spoke
#

Satellite hieghtmaps of the earth which I combined in photoshop, imported into unity as terrain heightmap, exported back out to obj, blender to make it low poly and cut into sections.

The colors are just temp vertex colors for my orientation and stuff, but they also do reflect the "climate" of the land for that area of the map. Wintery, desert, etc.

#

@hollow sorrel

I just took the most interesting areas of the Earth I could find and blended them together. It's a good enough base for what I need, haha.

#

The white section on the color map is the lower left section there.

hollow sorrel
#

hah that's an interesting process

#

neat

tardy spoke
tardy spoke
#

Was going to do a test build to see if entities works on Oculus Quest again but it's not liking some UnityEditor stuff I have in there... is there some way to access a scriptable objects GUID in a way that doesn't use the asset editor?

I guess I could just generate them but think that would "destabilize" them quite a bit to using their actual internal GUID.

amber flicker
#

Yikes whatโ€™s that code doing? ๐Ÿ˜…

tardy spoke
#

It was my attempt at accessing an SO's GUID haha. It worked. I was so happy.

amber flicker
#

But why do you need it?

tardy spoke
#

I assumed down the line to sync the quest GUID's to the server to avoid resetting everyone's progress every new version lol

amber flicker
#

Also fyi you could probably do similar using AssetDatabase.GetGUIDFromAsset(this); (something like that from memory

tardy spoke
#

Anyway, it only needed to run that once in the editor when the new SO was created so I wasn't too concerned, but anyway... now I'm not sure what to do. ๐Ÿค” Almost like I need the SO to call something that hands it's GUID back to it... but that seems a bit cray.

amber flicker
#

Anyway, yea you want to be avoiding all this editor only code for runtime. In addition you need to be careful that you don't serialize something extra in the editor namespace - it won't like that.

#

I think the normal way to do this is to serialize the id - and there's not much point in reusing the file's guid - probably just create a new hash. Basically what I do at any rate.

tardy spoke
#

Riiiiight.

#

I think I just understood the point of serializing shit for the first time. ๐Ÿค”

#

The issue being that the "onEnable" can be called more than once though, resetting the GUID

#

It gets called upon creation, and upon clicking it in the project or something weird

amber flicker
#

so.. I think DOTS timeline does something like this: cs [SerializeField, HideInInspector] Unity.Entities.Hash128 _Hash = GenerateDefaultGuid(); public Unity.Entities.Hash128 Hash => _Hash; static unsafe Unity.Entities.Hash128 GenerateDefaultGuid() { var guid = System.Guid.NewGuid(); var hash = new Unity.Entities.Hash128(); hash = *(Unity.Entities.Hash128*)&guid; return hash; } - there may be better solutions but I took a leaf from Unity

#

it requires unsafe so doesn't look pretty

tardy spoke
#

I like to live dangerously

#

What's the reason for hashing it exactly? Something to do with serialization?

#

speedier lookup

amber flicker
#

it's basically synonymous with guid in this context - just a unique uint4

tardy spoke
#

Interesting

amber flicker
#

honestly that's really not very intuitive code but will result in a unique id that's serialized per ScriptableObject that you can easily use at runtime via mySO.Hash

tardy spoke
#

It doesn't need to live in OnEnable if it's just called by a class field, does it?

amber flicker
#

correct - which is important so the hash doesn't get regenerated

dusky wind
#

I've written so much unsafe code while using ECS

#

Nothing like an editor crash to spice up your development

amber flicker
#

*seasoned with a sprinkling of unsafe โœจ

tardy spoke
deft stump
#

True programmers go unsafe

tardy spoke
#

Don't even know what safe is anymore

tardy spoke
#

Hmm Entities appears to still not be working on Oculus Quest builds. Not a big surprise as not many changes in the 0.14 update.... ooh wait, there's a new android platform... thing.

tardy spoke
tardy spoke
safe lintel
#

you need to use the new buildconfiguration tools

#

so its a scriptable object that has build config options, otherwise subscenes wont work, sec loading unity

#

Assets>Create>Build one of the options here

#

there is an example of it somewhere in the official entities samples repo

tardy spoke
#

Yeah, I've been trying both

safe lintel
#

try adding the "classic scripting settings"

#

its changed a bit since then(its buildconfiguration not buildsettings) so not sure about that little bit

tardy spoke
#

@safe lintel good news is ECS is at least working now, but oddly the game doesn't quite seem to be haha. My test ECS cube rotates and it doesn't crash though.

safe lintel
#

what part isnt working?

tardy spoke
#

ohhh wait

#

I might know what's happening

violet cosmos
#

Also @tardy spoke you need to be using an SRP to use Hybrid Renderer V2

tardy spoke
#

@violet cosmos yeah I'm on URP

safe lintel
#

ugh got my own build issues, test project not building on ci but works fine from unity ๐Ÿ˜ฉ

tardy spoke
#

Does anyone have Use Incremental GC checked off? It sounds like a nice feature

#

This may be the one that finally works! Fingers crossed ๐Ÿคž

#

I can't believe I'm going to have to load my APK from Sidequest all the time to make sure it works on the Quest lolol

safe lintel
#

I use it but it has never made a difference for me for building

tardy spoke
#

@safe lintel thanks man, it all works.

Man the Quest has no balls. It did admirable on loading the subscene but on 180k vertex colored tris with no lighting it bogged down to like 40 FPS, haha... doesn't that seem a bit unreasonably low, even for a "phone"? @violet cosmos

#

Yes, that's a lot of tris, but there's no texture data or anything on them at all. or lighting.