Tag Info

Hot answers tagged

3

You need to set to NPC a new target once in a while (e.g. each 5sec) and move it towards the target each tick little by little. Then it will be smooth. To avoid sharp turns upon setting a new target, you can mix target positions between old and new target for a second or two. Additionally, you might want to Google for "Steering behavior"


2

The most effective way to improve collision check speed is to decrease the number of entities that needs to be checked against. Spatial partitioning such as octree helps but you can make further improvements. Suppose if currently you have one big list of collidables contains objects and bullets and in each collision check step you are looping through all ...


2

I don't know what RawImage exactly is here, but once you access pixel data of a Volatile or BufferedImage in Java you lose hardware acceleration. So even if these images were stored in vram before you called renderImage, they will no longer be once you access the underlying pixel array.


2

When you really want to get good performance, implement it in hardware using pixel shaders. The graphic cards GPU is optimized for performing the same operation on lots and lots of values in parallel, so it does so really quick. When you don't want to learn GPU programming, there are many libraries available which implement many common blend effects in ...


1

Check out this blog entry on fixing your timestep. Essentially the advice here is to use a loop where you draw as much as you can until a fixed threshold of time has passed, then update. Here is the recommended game loop; double t = 0.0; double dt = 0.01; double currentTime = hires_time_in_seconds(); double accumulator = 0.0; State previous; State ...


1

Your canCollideWith method should be so that s1.canCollideWith(s2) == s2.canCollideWith(s1)I think. If not it means that collision will differ according to your array order. And if both return the same results you can test that only once. Then in your code, you give two differents definitions of your canCollideWith method canCollideWith(Sprite) and ...


1

I had forgotten to ask for a depth buffer when creating my window: Before: Display.create(new PixelFormat(4,0,0,4)); After Display.create(new PixelFormat(4,24,0,4));



Only top voted, non community-wiki answers of a minimum length are eligible