• Content count

  • Joined

  • Last visited

Community Reputation

163 Neutral

About PantherBoy

  • Rank
  1. A* turning and unit direction

    Thanks snowmanZOMG and IADaveMark, that Chris Jurney article seems very interesting and looks like it discusses exactly what I was after. The bad news is the book is out of print and used copies seem to be retailing upwards of $400 on amazon[img][/img] . The demand for that book must be very high, wish there was an ebook version I could buy. I'm going to have to try and find someone who has it and can lend it me [img][/img]
  2. Pathfinding On Android

    Spreading the pathfinding calculations over multiple frames can also be an easy win
  3. A* turning and unit direction

    Sorry I'm not sure how but I double posted by accident, the other double post has now been deleted
  4. Hello all, I'm currently spending some time trying to improve my pathfinding library and was looking for some ideas on how to deal with direction of units and their turn radius. For example if a unit had its back to the target, a straight line path wouldn't be suitable as returned by A* (assuming no clear path between unit and target) as the unit would have to rotate around, and the turn radius could potentially make it follow a path that touches grid cells that where not in the original calculated clear path and over cells has a blocking obstacle. My original thinking was to factor the direction cost into the heuristic function of the A* algorithm but its getting pretty messy and not very reliable so I thought id ask if others have implemented anything similar, thinks this is the wrong approach and has better ideas or even can point me to any helpful papers/articles. Thanks!
  5. Physics Library for Java (Android)

    Congrats I know how hard a job it is to do that. Like I said there are lots of better java programmers then me :) coming from c its difficult to work with Java and giving up the memory managment - I do disagree about the GC being better then manual management (although thats a big debate im sure), sure its easy to screw up in c but at least you can more easily without spending 2 months optimimise and be more specific by using your own allocators/memory management scheme. It probably would be easier to use a java library such as yours to avoid the hassle of using 2 languages but I think its worth pointing out that there are open source alternatives and box2d is very good i've found. There maybe portability issues with the native code but so far all the android phones use ARM based cpu's - im not sure how the ndk will resolve the issue in future non-ARM android phones flood the market but hoping google have a plan :)
  6. Physics Library for Java (Android)

    I looked at quite a few physics engines (for android) both 2d and 3d implemented in java but most had performance issues - the garbage collector on the phone will cause glitches every few seconds no matter how careful you are with dynamic allocations. I even implemented my own impulse based solver for simple rigid bodies and solid joint and saw the same problem although less frequent even though I was using object pools, there are things in java where you just can't control. (I come from a c and c++ background so there maybe better java programmers but not me and I tried for 2 days). I've not looked at the previous posters engine so can't comment on that but I think the best thing to do for performance is to use the android native sdk (ndk) and run the physics engine in unmanaged code written in c or c++. That way the physics is outside the domain of the garbage collector and runs much much more smooth. (I've done the same for rendering in open gl also). Also another point, my handset (actually most current android handsets i think) the htc hero does not have a fpu so you will get a big performance increase if you dont use floats but fixedpoint instead. The library I used (free 2D physics lib called box2d) allowed me to do this and I am more then happy with performance now.
  7. Suprising C++ feature

    Quote:Original post by phresnel This is a good introduction to the topic: (Vandevoorde, Josuttis) Chapter 9.2.1: Argument Dependend Lookup. Another feature you might find interesting is friend name injection (same book, if interested) :) Thanks, looks like a useful book
  8. I have been programming in C++ many years but I was suprised this code compiled in any standard c++ compiler. [source lang=cpp] namespace MyNameSpace { class T { }; void func(T); } // // // MyNameSpace::T param; int main() { func(param); return 0; } So today I learned something new about how name lookups work in c++.
  9. How to rename std::vector?

    I would also agree just using std::vector. The problem is there is no way as far as I know to have template typedefs. The only trick I can think of is doing something like this template<typename T> struct Array { typedef std::vector<T> MyArray; }; // And use it like this Array<int>::MyArray arrayObj; // // // but isn't this better std::vector<int> arrayObj2; // // // or maybe this typdedef std::vector<int> MyIntArray; MyIntArray arrayObj3;
  10. A better C++ IDE?

    Have you tried RefactorCPP I use this at home but VAX at work, its not as good as VAX but it is free and the refactoring ability is impressive I think
  11. Moving to another build system

    Quote:Original post by the_edd I made my own system for similar reasons. It may or may not be appropriate for your needs, but it sounds like it will fit the bill given your basic description. The build description files ("slamfiles") are incredibly simple and I imagine that they could easily be generated by a script in the many cases. Thanks very much i'll have close look tomorrow morning, certainly looks interesting and worth a go. Quote:Original post by Ravyne Most likely you'll want to maintain your Project and Solution files for debugging purposes. VS has what is really one of the best debuggers around, Stepping through source code, Edit and Continue or heck, just being able to do the debug-fix-run cycle from one place is convenient -- and I'm not sure if, or to what degree, you would lose that going to a completely external system. Its just the build system I would be changing, I still use the Microsoft compiler and visual studio editor and debugger on windows.
  12. Moving to another build system

    The problem though I try to solve is a way to avoid the initial drudge work of setting up these make files that work across the different platforms be it jam, boost jam or even gnu make from the hundreds of vcproj files already in existence. I started writing my own solution in a python script but it looks like a lot of work. So if anyone has any ideas on a better approach I would be eternally great full. :)
  13. Screen Capture In dx9

    Create a new surface to hold your screen data then copy your front buffer to the surface then you can call D3DXSaveSurfaceToFile(...) to save the screen to file. The thing that got me was there is a specific format that you need to use for the surface - i'm pretty sure its A8R8G8B8.
  14. I'm in the process of looking at porting a lot of my native C++ projects to different platforms (Mac and a Ubuntu linux). Currently the code is being modified to be cross platform - pure c++, doesn't use windows sdk, non standard extensions. Anything platform specific is wrapped up in platform defines. As part of this work I want a cross platform build system and start to ditch all my Microsoft .sln files and .vcproj files so I have a unified way of building source code across all platforms. What would be incredibly useful if anyone knows of any tools/scripts that can convert my c++ .sln and vcproj files and create bjam make files, sorting out all the dependency issues for me. Any help would be greatly appreciated! Thanks
  15. My first point of call would be to profile with pix to find out what is happening