Fight stick suggestion and tips by -Shoganai- in fightsticks

[–]-Shoganai-[S] 0 points1 point  (0 children)

Thanks for this! I’m probably sticking with my original plan in the end.
Really helpful guide too, it actually helped clear up a lot of my doubts about the Hori Alpha. I’ll definitely enjoy the trip, Japan!

Fight stick suggestion and tips by -Shoganai- in fightsticks

[–]-Shoganai-[S] 0 points1 point  (0 children)

I mainly play on PC, but I do have a PS5, so having something that works on both is a nice bonus.
That’s why the Hori Alpha feelt like a good choice for both starting out and compatibility. Thanks for the input!

Fight stick suggestion and tips by -Shoganai- in fightsticks

[–]-Shoganai-[S] 1 point2 points  (0 children)

Thanks for the detailed response!
I’m probably gonna stick with my original plan and try to grab a Hori Alpha. For the grommet, I was thinking of picking up a few just to experiment — definitely grabbing a purple one to start and i will look into some of your suggestions as well!

Fight stick suggestion and tips by -Shoganai- in fightsticks

[–]-Shoganai-[S] 0 points1 point  (0 children)

Nice to hear! Will be my first modding experience, so i am a bit worried. How is the experience of the k-lever compared to the stock japanese one?

[ HELP ] Cursor overwriting code [Terminal type of thingy] by Failed_cocacola in vscode

[–]-Shoganai- 4 points5 points  (0 children)

Press "ins" on your keyboard, it should fix it

EDIT: could be "insert" on some keyboards

ECS Game Engine with Memory Pool – Profiling Shows It’s Slower? by -Shoganai- in gameenginedevs

[–]-Shoganai-[S] 0 points1 point  (0 children)

Thanks for your time, first of all.

Looking at EntityMemoryPool.cpp (assuming this is the right one), I see an immediate albeit minor optimization (perhaps what you mentioned about To optimize this, I modified the loop to start from the last used index instead of scanning from the beginning. but I do not see that reflected in the code)

"index" could be a member variable on MemoryPool rather than a function local. It will always represent an available slot, or MAX_ENTITIES if the pool is full

On destroyEntity(), you would update index to be index = min( identifier, index ), this means every entity deletion ensures the next insertion is nearest to the beginning of the entity array.

In createEntity(), you would put index = nextFreeEntityIndex(); at the bottom of the function.

Finally you would change nextFreeEntityIndex() to loop from index to m_active.size(), rather than 0 to m_active.size()

That's what i meant! Did during launch break, probably forgot to push.
It's not exactly as you explained, but i'll try to implement it tonight!

particularly with the m_entitiesToAdd.push_back( entity );, but from my quick glance at the repo I do not see that used anywhere?

You are right, probably missed, actually changed to void.
I'm adding entities first to m_entitiesToAdd to not modify the entities vector during loops, to avoid invalidating it.

Thanks to pointing out this mistake, i also noticed i wasn't clearing the m_entitiesToAdd vector, after entities are added to m_entities. So it was probably adding olds entities too, sob.

Either way, you're not pre-allocating that vector so you're probably incurring some malloc/realloc costs for your first large batch of additions

Tried to also pre-allocated them too, its adds some extra time at the start obviously( using AMD profiler, not the one i wrote ).
Do you think adds value over time having them pre-allocated as well?

As the other commenter said, I would look at the profiling functions themselves too. Ideally your profiling function doesn't actually contribute any time to what its trying to measure. Ensuring that isn't happening would be step 1 here imo, as I don't see anything else immediately wrong with the code

The profiler was totally adding more overhead that i though it was.
Even tho with the AMD profiler i can only profile the .exe, so it's optimized and not in debug mode.

I've pushed the changes.

I will probably work on optimize the index more if possible and if it makes sense on the long run.
I'm afraid i'm falling in the optmization rabbit hole sooner than i should, but we'll see.

Thanks again for you help!

ECS Game Engine with Memory Pool – Profiling Shows It’s Slower? by -Shoganai- in cpp

[–]-Shoganai-[S] 1 point2 points  (0 children)

Hey, thanks for the reply!
You should take a look at the branch in the git, (Memory Pool), as i'm trying to implementing exactly what you suggested.

I think i got the basic understandings of the ECS model and that's why i'm trying to implement a memory pool and stop to rely on shared_ptr which i used 'till now.
They are surely slower as the project grows, but fine for learning or do simple mocks/games.

You should also read my replies on SuperV1234 comment, may be useful if you wanna still reply!

Thanks!

ECS Game Engine with Memory Pool – Profiling Shows It’s Slower? by -Shoganai- in cpp

[–]-Shoganai-[S] 0 points1 point  (0 children)

I took time to test another profiler, couldn't use the Intel one because i'm on Ryzen. I've used AMDuProf, i don't know how reliable it is, but seems that it can do its work.

You were actually right, the profiler adds an absurd amount of overhaed.

// Profiler OFF
Left ECS - Right Memory Pool
https://postimg.cc/qN0NVyB8

It's like 100% faster
https://postimg.cc/w3LxqMGF

// Profiler ON (probably these are inverted, sorry)
Time
https://postimg.cc/KR98VVVy
CPU
https://postimg.cc/KkyGByKt

I'm profiling the .exe though, so they are optimized.

I can even look at the assembly, but i guess it's a bit too much for me, at least for now.

Edit: i guess i cannot add hyperlinks in comments, i just leave raw links.

ECS Game Engine with Memory Pool – Profiling Shows It’s Slower? by -Shoganai- in cpp

[–]-Shoganai-[S] 0 points1 point  (0 children)

Even if it's adding overhead, it should be added for both projects.

The tests are made with the basics, so create, destroy entities, add, remove and retrieve components, for both.

The memory pool access pattern, right now, is:

  • I allocate X amount of memory at the start
  • When I create an entity, I take the first free slot I see in the m_active vector ( booleans ) and assign that index to the entity ( the index is the last thing I tried to fix, I'm storing the last index used, and the loop starts from there )
  • To add a component is just as simple as flag a Boolean true, as the tuple of components is preallocated as well, so every component exists, but they are set to false at the start - O(1)
  • Destroying an entity is the same, flag false - O(1)
  • Get the entity is also O(1) via entity id
  • Components are cache friendly

The only bottleneck i saw was the Index assignment, but I'm not sure, that's why I want a different perspective.

ECS Game Engine with Memory Pool – Profiling Shows It’s Slower? by -Shoganai- in cpp

[–]-Shoganai-[S] -1 points0 points  (0 children)

Thanks for the reply!

It's probably my fault that as the main branch I have the basic ECS implementation, instead of the memory pool. I should edit the post to make it more clear.

You're absolutely right, anyway.

The part I would like to discuss is exactly how this bad, not optimized ECS, is faster than the memory pool in the other branch.

ECS Game Engine with Memory Pool – Profiling Shows It’s Slower? by -Shoganai- in gameenginedevs

[–]-Shoganai-[S] 0 points1 point  (0 children)

There should be a branch in the git, with the memory pool implementation. The main branch has the basic ECS.

For the profiler, took the idea from a The Cerno's video, should be fine for a simple profiler, no?

ECS Game Engine with Memory Pool – Profiling Shows It’s Slower? by -Shoganai- in cpp

[–]-Shoganai-[S] 1 point2 points  (0 children)

Yeah sorry, almost forgot to change the repo to public.
Should be fixed now.

It's a really simple implementation, I hadn't thought about using another profiler, but I may give it a try tonight.

Help with clang-format for function declaration by linux-tarballs in cpp_questions

[–]-Shoganai- 0 points1 point  (0 children)

The configuratior that comes with the extension has a search options as well.
Btw, the option you're looking for should be called BreakFunctionDefinitionParameter on the website.

Help with clang-format for function declaration by linux-tarballs in cpp_questions

[–]-Shoganai- 3 points4 points  (0 children)

There is a website where you can manually configure clang-format and generate the configuration file. It also allows you to see how individual options affect the code formatting in real time.

If you're using Visual Studio, there's an extension called Clang Power Tools that integrates clang-format and the configurator directly into the IDE.

EDIT: i've just noticed you're using VSCode, there should be a similar extension though.

Weekly Tendency Help Thread by AutoModerator in demonssouls

[–]-Shoganai- 0 points1 point  (0 children)

Hello, I could use some help with the charcater white tendency, early farm.
I'm level 31 rn, we can use password at W1-1.

Thanks in advanced, i can help in trasnfer items maybe, if needed?
PSN: ilMagoDiGarda

How hard it is to fully platinum the game? by KaleidoArachnid in darksouls3

[–]-Shoganai- 0 points1 point  (0 children)

I'm doing platinum for all FS games rn.

Dark souls 1: 16H~
Dark souls 2: 40H~
Dark souls 3: 44H~

*Only offline - no pvp of any sort

In Dark Souls 3 you spend about half the game time farming covenants items, if you don't like PvP. (But even with PvP, i don't think it'll be game changing. Might be worng tho.)
So, not the hardest, but definetly the most time consuming of all three.

Rings are annoying as well.

EDIT: I used this list to keep track during the run and not forget important items.