Tag Info

New answers tagged

3

In my experience with android, it is the garbage collection the kills the performance, not the allocation, although these two are tied hand and hand. As mentioned on the comments, pre-allocation is a way to deal with this issue. This is known as a memory pools. Another similar solution is object pool pattern. An object pool allocates as needed, but does ...


0

Run the game like any other, calculate data on the client side as needed and simply overwrite when you receive packets from the server.


5

tl;dr You control how much data you are willing to process each frame. If a packet is too big, break it into smaller cells and process them one at a time (i.e one each frame). If you get a lot of small packets than split the group into chunks and limit the amount of information processing that is done each frame. The client does not need all the information; ...


1

To answer your question simply: Get list of all the RenderComponents, and a list of all the Movement Components. We assume each component has a field which gives the entity is is a part of. Sort them by entity ID. Obviously, if you keep these lists sorted in the systems themselves, then this is very inexpensive (maintaining the sorting is cheap). ...


1

You could store components two-dimensionally in a list of lists: List<List<PslComponent>> _componentsByType; You use the component type ID as the index into the outer list... List<PslComponent> componentByEntity = _componentsByType[componentTypeId]; ...and then use the entity ID to look up the component of that type on that entity (or ...


0

Don't iterate over all entities and see if they have an interesting components - only iterate over entities that have your interesting component attached. One way is to use a nested dictionary of the following type (no particular language here): components: Dictionary<TypeIdentifier, Dictionary<Int, Component>> This lets you look up the ...


1

I assume that when your network data arrives, its processing diverts enough CPU power to slow down your rendering process. Are you enforcing a constant framerate or are you just rendering frames as fast as you can? Assuming you have a constant framerate, you may chose when your network packets are processed. I mean by that that your websocket event should ...


0

The client is written with JS? If so, than you need to use some kind of async library to make network IO in backgraound. There is RxJS and many other (try google: reactive, async etc.). Also consider switch from JS to CloujeScript: some local guys are using it for kind of tasks you've described.


4

Basically, there will be a mapping from graphics performance level setting (low/medium/high/et cetera) to particular values of a variety of internal knobs and dials in the underlying graphics engine. It can affect almost anything: texture sizes, maximum LOD level, multisample passes, toggling entire features (such as reflection) that often require extensive ...


2

The only way to know for sure is to try both ways, as they can both be faster than each other in different circumstances. The first can be faster because less computation is done, the second can be faster because data is smaller which normally helps avoid costly cache misses. It depends totally on the context. Put another way, I could construct one benchmark ...


8

The real implications in performance here depend 100% on the platform used. Say you have written code as in option 2. When using a statically compiled language such as C++ the compiler will presumable not notice that container.left + offset.x is constant for as long as the object lives and it will not optimize it. When using a language that uses ...



Top 50 recent answers are included