Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 23 Mar 2004
Offline Last Active Apr 01 2015 03:57 PM

Posts I've Made

In Topic: Creating a map editor

22 February 2015 - 09:59 AM

The most efficient way is definitely to use an existing editor.


Use an existing level editor - or maybe even just a pixelmap editor or text editor - and then write whatever conversion utilities are needed to produce the data in the format you want.


Some editors already have some mechanism to make plugins - for example, using a high-level language that won't waste your time too much.


Also consider the amount of time it's going to take your content team to build maps.


A feature-rich third party editor with plugins, add-ons, and conversion utilities, is likely to provide a better user experience with less effort, than trying to roll one from scratch.

In Topic: pathfinding on a 2d map

01 February 2015 - 10:46 AM

The "flood fill" algorithm is essentially Dijkstra's. A* is an optimisation of it.


You can use these even if you don't have a regular grid on your ground, just *pretend* that you do have such a regular grid, and run the algorithm anyway. You only need to write a function "can I pass this point", which needs to be conservative enough that your moving units can actually pass that point to its adjacent points without encountering any new obstacles - so the "can I pass this point" function might need to take into account the distance of nearby objects, and return false even if the point itself appears passable.


Anyway, give it a go, and you'll easily get something that works.

In Topic: What to do for debugging

28 January 2015 - 05:23 PM

The overhead of checking your global flag isn't that great, provided you don't do it too often.


But don't make the mistake of doing other expensive processing, even if the debug flag is off. Don't format complicated debug strings, then pass them to a debug function to be ignored. Instead, do the check first, before the formatting.




You might also want to consider enabling post-mortem debugging in your app. How to do this depends on the environment, but it's usually possible to collect some kind of crash dump, and ask the users to send this back, which lets you see what went wrong in a production environment that you can't necessarily replicate. A lot of (e.g. PC) games do this.

In Topic: how to protect mysql strings?

28 January 2015 - 05:19 PM

Don't let the client connect directly to mysql at all, they need to go via a "middle tier" server.


If they connect directly, they'll be able to get the credentials (you can't stop them), then do various attacks (at least Denial of service) against your mysql server. You don't want that.

In Topic: Open world RPG - how to efficiently simulate the whole world?

24 January 2015 - 02:06 PM

I'm going to reply and reiterate a very old maxim - premature optimisation is the root of all evil.


Your goal *may* be to make the "open world RPG" with 2000 NPCs and a zillion zones, etc,


But you might be overestimating the amount of content that you can reasonably create. You might subsequently change the scope of the game to be a bit ... smaller.


So don't do anything. Make a few NPCs work in a small world, and once you're happy with that, then you can expand it as you have additional content.


After all, a game with 2000 NPCs and a zillion zones, is really BORING if you don't have varied, detailed content to go with it.