Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


abeylin

Member Since 04 Jan 2004
Offline Last Active Dec 14 2014 09:24 PM

#5110489 need an algorithm for following a path (curved line)?

Posted by abeylin on 19 November 2013 - 09:56 AM

I am wondering how the game https://play.google.com/store/apps/details?id=com.namcowireless.flightcontrol&hl=en makes planes follow the path drawn by player.

 

Does anyone know of a simple algorithm to do this?

 

I am thinking of a game where there are predefined paths, which is kind of similar to the game I linked, but more like this:

sample.jpg

 

So I want to go from one box to another, but following the paths. Please help. The paths would not be dynamic in my game.

 

edit (not sure if it's better to add post or update original, so doing both):

The paths will not be in terms of any function. The paths are going to represent roads from one point to another. During level creation, I'd define them as makes sense for the level.




#5041301 How to improve a game fps

Posted by abeylin on 09 March 2013 - 05:10 PM

through cutting certain features and optimizing others

The way I read it, is they just cut out some features, and optimized other features.

 

So I don't think they turn on and off features in game as they are needed, but rather they just removed them.

 

I think the lesson is to test all systems together more often than once everything is done. Although this is probably impractical with a really big game where multiple teams are working on very different aspects and have different priorities.  But as a single developer, or if you have a small team, it's probably doable.

 

From my tiny experience of developing games at spare time, I had once terrible performance. My solution to the issue was to cache rotated images instead of recalculating them each frame. I was dealing with png files, and rotating them few degrees. So I had original image at 0 degrees, and added caching of same image at <current> degrees.

 

In my professional experience with enterprise software, you usually design it really really really well. Than you code it really well, code review, performance test. And the performance test has to be a subset of permissible time. So for example if you're supposed to process 100 GB of data per hour, and you used up 30 min in your part, than either you're allowed to spend 50% of time in your area, or you gotta go back and look at design + programming.




#5037140 Hypothetical Problem

Posted by abeylin on 27 February 2013 - 07:40 AM

C# makes a lot of things simple.

I doubt you'd have a significant portion of code that is going to be shared if you do client and server in C++, so I would say rewriting few classes in order to use C# will overall speed up development time.

 

I'd vote against C# on basis of how you cannot control when GC happens, and how it ties your server to windows, but that's not the question you're asking.




#5037137 Linked List Node Corruption Problem

Posted by abeylin on 27 February 2013 - 07:28 AM

I concur with RulerOfNothing.

 

My recommendation would be to not delete data from linked list, basically remove this line: if( delete_func ) delete_func( cur_ptr->data );

 

You mentioned having two lists, if they both point to same data, than linked list code will attempt to delete it twice.  First time it will work, second time the result will be undefined.

 

Normally you would allocate and free resources in same module. Since linked list doesn't allocate data, it wouldn't be freeing it.




PARTNERS