6,448 reputation
11741
bio website
location Tehran, Iran
age 23
visits member for 3 years, 10 months
seen 41 mins ago


Feb
12
comment Possible A* Optimizations
The very reason that you are searching for the path is because your heuristic is not perfect. If it was, you could easily start from the starting node, always choosing the neighbor with lowers heuristic and find the best path with such a naive greedy algorithm. All these path finding algorithms are there to minimize your re-ordering routines, but still whenever you graph gets huge, there will be many re-prioritizing(s) required.
Feb
11
comment Possible A* Optimizations
@MrSnappingTurtle I mean the case, that you've opened a node, but later found some better way to reach it.
Feb
6
comment How Use loop's in cocos2d-x
I guess you meant Sequence::create(delay,runCallback, nullptr). Also personally I prefer using lambda instead of member function: Callfunc::create([this](){speed += 0.3;})
Feb
5
comment Speed dependent arc question
So I'll guess it's something that you should define yourself, so that it looks like real life? In fact the book continued to say, it's just as big you can get, without your animation look unnatural.
Feb
5
comment Speed dependent arc question
Pretty sure that's something that is defined in your own assignment context. And it should mean something like how much it character can rotate safely. Like when driving a car, you can easily rotate it as much is you want, but when you are driving at 90mph, making a hard turn will most likely result in a crash!
Jan
10
comment Is there a way to exclude original sprites in spritepacker that's in asset bundle?
Are you sure that's the problem? I mean, when loading textures, they'll be stored as uncompressed RGB data in memory, maybe that 25MB you are seeing the size of your package uncompressed? to verify this, just multiply width by height by Bytes_Per_Pixel of the texture
Dec
13
comment Isometric graphics with fake perspective
Just an idea, but you can provide your shader with another texture, representing the height of that pixel, and take that information into account
Dec
13
comment Isometric graphics with fake perspective
It's true, assets are othogonal, but then again, you are drawing them on plane. you can skew that plane, so that it's a little further from camera on it's top. Note that with this change, you won't notice a thing as long as your projection matrix is orthogonal, but switching to perspective at this point will probably create the effect you are looking for.
Dec
13
comment Isometric graphics with fake perspective
didn't say switch to 3D assests, I just suggested use a perspective projection matrix instead of orthogonal one, with everything else kept exactly the same
Dec
13
comment Isometric graphics with fake perspective
just an idea, but why don't use a full 3d engine for rendering your isometric view?
Dec
6
comment Rectangle collision in SDL2 partially allowing sliding C++
Why don't you use already available physics engines, like box2d?
Dec
3
comment How can I protect my save data from casual hacking?
@CodeClown The question is mostly about secrecy; but then again, OP doesn't want some advanced algorithm. He just wants to keep casual players away. Also you can develop everything and simply apply encryption in the very final step, just before release.
Nov
25
comment How to optimize my lighting shader?
what about eliminating the if clause? replacing it with an step function?
Oct
26
comment How to determine the distance between a point and a rotated rectangle
also it doesn't need to be rotated around the center, and point in plane will do, as long as you rotate everything (including rectangle itself)
Oct
26
comment How to determine the distance between a point and a rotated rectangle
There is a minor problem with your code, consider this case: the point is exactly at (cx,cy). In this case, dx will become "width/2" and dy will become "height/2". Instead of computing squared distance, you should fix this by some conditions.
Oct
6
comment Moving CCNode with constant speed in cocos2d
what about adding CCMoveBy action? wrapped inside CCRepeatForever?
Sep
19
comment A Star pathfinding algorithm, multiple node set optimization
even if you use all those coordinates as A* nodes there won't be a noticeable performance cost... 135*185 < 150*200 = 30000 ~ 0.002s computation time. Compare that to 0.0167s that you have to render each frame. Also note that Usually it won't even take 0.1ms, I've computed the worst case time.
Aug
15
comment OpenGL Textures have distorted colors on some android devices
I'm not sure, but you might be using some kind of pixel representation that is not supported on those devices.
Aug
12
comment cocos2d-x “immediate mode”?
a) if you are going to use v3.x you should use custom command, either with draw or visit. and personally I prefer draw method since it almost needs no boilerplate code to make compatible with other stuff. b) porting to other systems is the biggest advantage. Also there are lots of other stuff that might help you in way (like textures, audio, debug helpers, ...) but you might take a look at SDL2 too (that's what I've migrated to for just one of my projects which required to run without GUI in some cases). c) As far as I know, there is absolutely no advantage of using scene graph in your case.
Aug
3
comment GLSL Processed Image to OpenGL
it would have been nice, if you threw a link to frame-buffer too.