#I have a question on dynamic buffers

1 messages · Page 1 of 1 (latest)

formal crow
#

My question is:

I declare a dynamicbuffer <EntityDefferedRef> buffer stored in my singleton GameBoardModel attached to playerEntity also stored in GameBoardModel singleton:
GameBoardModel.dynRef = GameBoardModel.entityManager.AddBuffer<EntityDeferredRef>(GameBoardModel.playerEntity);

In EntityCommandBuffer ecb:

I add to the buffer :
ecb.AppendToBuffer(constantine.PARALLEL_PARKING_DROP_ITEM, GameBoardModel.playerEntity, new EntityDeferredRef
{} ) ;

I use ecb.AppendToBuffer, but I see no 'RemoveBuffer' or 'RemoveBufferAt' or 'clear entire dynamic buffer'

I need to remove items from the buffer and it doesn't matter how efficient, it's a small buffer of 0-4 objects normally.

Thanks,

And any reason to get rid of chat? There's plenty of forums out there for dots/ecs but no good chat anymore.

harsh abyss
#

#1064581837055348857 is where we are now permitted to chat it up. Also SetBuffer clears a buffer and returns the buffer

formal crow
#

I think dots/ecs doesn't let you modify buffer arrays like this, you gotta rebuild them completely

#

So on my GameBoardModel.playerEntity, I believe I have to ... SetBuffer?

#

Then I can add the buffers one at a time that I wanted.

harsh abyss
#

Strictly ECB, you have the options provided because the ECB actually does the task whenever its playback is. I assume you are trying to complete this in a job, in which case if you know its safe you can pass the buffer itself to the scheduled job but you may run into safety issues with parallel and other race condition issues.

formal crow
#

I assume you are trying to complete this in a job -> No, both jobs,systems, and monobehaviors

#

At the moment, I can use ANY solution

#

I think maybe it's called removeComponent

#

To remove a buffer

#

removeComponent then addbuffer

#

It's strange to even name it addbuffer when it could just be addComponent at that point

#

Maybe I'm confused on poor naming conventions of DOTS

#

how do I remove a buffer completely?

#

Do I use removeComponent?

harsh abyss
#

There is some information with ECB and a buffer interaction. From what you said it sounds like ECB.SetBuffer is what you want to clear the buffer

formal crow
#

thank you, that's it, poor naming conventions

#

You need to ADDBUFFER, but REMOVECOMPONENT

#

why is is named ADDBUFFER AT ALL?

#

Should be ADDCOMPONENT

#

Or there should be a corresponding REMOVEBUFFER

#

That was my confusion, just poor DOTS/ECS naming conventions, and that's fine, it's still inbeta

mellow tiger
#

weeeelll

#

it's close enough to not beta that it will likely not be fixed for 1.0

formal crow
#

hey this is a good forum post, I'm sure I'm not the only one stumped on this one

#

I've been grinding gears for a while on this, lolz

mellow tiger
#

we were aware of various issues like that but prioritized shipping over fixing them, because renaming creates a ton of churn and we weren't too confident for a lot of them that we could improve them that much

formal crow
#

Thank you Enraged

formal crow
formal crow
mellow tiger
#

❤️ thanks!

formal crow
#

I was actually going to code parallel processing for scripts if you didn't have this tech... And your tech applies to gameobjects entities themselves!

#

I really don't think some of you understand what kind of achievement DOTS/ECS is, but it's been a dream since the 90s at least

#

Not until we hit the 3ish ghz clockspeed limit did anyone even want to try to multi core, and until you multicore it didn't make sense.

#

Then just 1-3 extra cores, and windows secondary systems ran on em

#

But now that we're up to 8-32 cores, soon to see 256+

#

We needed to do stop sandbagging on mankind's most difficult coding structure: Parallel coding

#

You guys hit it literally out of the park, everyone should know this. They'll know as Unity games start being seen as the ones with the best FPS with most objects on screen

#

Take care guys, it is a triumph.

mellow tiger
#

well geez thanks! i'll paste this to the team as i'm sure it will warm their hearts 🤗

formal crow
#

start a fire for a man, he's warm for a day

#

set a man on fire, he's warm the rest of his life

#

I can authoritatively say that coding in general is tough than rocket science, having done both... And DOTS/ECS is groundbreaking stuff humanity never did, far tougher than rocket science... You guys are like the next moonlanding crew, and if you're frustrated it ain't easy, remember no one's been able to do it before you.

#

DOTS/ECS is a few orders of magnitude harder than rocket science, it's okay to be frustrated, just know this is big, really really big. Okay, gonna go back to coding,.

mellow tiger
#

we appreciate it! and we hope you continue to feel this way as you continue to work with it 🙂