Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 28 Nov 2010
Offline Last Active Yesterday, 09:12 PM

#4997780 What Sorts of Algorithms and Data Structures are Useful to Game Programmers?

Posted by Postie on 05 November 2012 - 05:10 PM

In my opinion its more important to know that other data structures and algorithms exist, and that using an array (or a list) will normally work, but there are often data structures much better for the task at hand. The trick is recognising those situations.

Be aware of data structures, but you don't need to go around implementing them until you actually have a use for it.

#4994875 What does it mean to "be creative"? And how does one "be creative...

Posted by Postie on 28 October 2012 - 06:10 PM

I like to think of creativity as thinking without boundaries. John Cleese did a good talk about the topic that you might consider checking out:

That said, in regard to your meeting, it sounds like the other 3 were on the same page about the idea, but it wasn't really your thing? I wouldn't call that a "lack of creativity", it's more a "lack of passion for the idea". One of the others probably should have done the idea development and it sounds like a cop out to say you're not creative and then kick you out to be honest.

#4986569 File Formats for 3D Game Performance

Posted by Postie on 03 October 2012 - 04:38 PM

Having written a loader for the 3ds format I heartily recommend avoiding it if possible. It's an old format with limitations that might cause you problems over a newer format.

For example: 1) All filenames are in 8.3 format, and saving a .max file into .3ds normally truncates the filenames if they are longer than 8.3, which can lead to loss of data if you have a prefix. (Learnt that one the hard way).
2) The maximum number of vertices per object is 65536, which might be a problem depending on how high resolution your meshes are.

My current project uses .obj files because they are easy to parse, pretty much every modeller can save them, and I'm still early in development. Pretty soon I'll have to start using a format with more features such as collada, since .obj doesn't support bones or keyframes etc. But my plan is to convert the collada files into my own format during a resource build phase as others have suggested.

#4984568 Minimal Path Problem

Posted by Postie on 27 September 2012 - 08:38 PM

I'm struggling to follow your reasoning as to why you have to look backwards to determine the cost of the path going forwards. If your weights are done correctly, getting to node D includes the cost of getting to any of the previous nodes that made up the path. Unless your movement along the terrain can cause a landslide that affects the path ahead I don't follow your line of thinking.

Are your weights taking into account the full cost of traversing the node, such as slope, softness of terrain etc or are they just taking into account the distance?

#4983073 [Solved] Bad scrolling / inaccuracy building.

Posted by Postie on 23 September 2012 - 07:42 PM

Your problem is likely when you convert your mouse position to your integer multiples of 32.

For values greater than 0, doing (int)value/32 will work ok. But for values less than 0 it will be a problem. For example, if value is -16, the division will give you -0.5, which is rounded down to 0. So all values between -31 and +31 will map to 0. What you really need is to use the floor() function instead of casting it as an int, this will cause -0.5 to be rounded to -1, which is correct.

#4982629 So. That Calculus Thing.

Posted by Postie on 22 September 2012 - 05:28 AM

Part of knowing what an equation means is recognising the notation and knowing what each of the symbols stands for. You don't necessarily have to be a calculus wizard to read and then implement an equation. The part where it gets difficult (and requires formal maths knowledge) is proper understanding of the equation and then taking that knowledge and extending it or adapting it for another purpose.

Also, I'm surprised no one has mentioned trigonometry. Even in 2D its used an awful lot.

#4981496 i made a critical error, life has no try catch?

Posted by Postie on 18 September 2012 - 07:07 PM

Two months invested in something which is possibly going to be discontinued at some point in the future is hardly something to be concerned about. From two perspectives:

1) Two months in the grand scheme of things isn't very much time. After two months of intense study you're still barely scratching the surface.
2) In computer science every new thing is built on something old. Language syntax and API's may become obsolete, but the core concepts of programming and the skills associated with them don't. API knowledge isn't the mark of a good programmer, anyone can use google.

A related anecdote: 15 years ago the only programming languages I knew were C and QuickBASIC. I started a new job using visual basic. After 3 years I moved to a new job where the language of choice was Delphi. And then more recently I took up C#. I don't consider anything I learnt in any of the previous languages a wasted effort, even though arguably C, BASIC, Visual Basic and Delphi are "dead" - in terms of new project uptake. I'm a far better (and more adaptable) programmer now for having taken the journey through all those languages than if I've stuck with just one thing for 15 years.

#4976668 Generating Large Maps Using Libnoise (Limits?)

Posted by Postie on 04 September 2012 - 09:18 PM

Basically, each client just generates the area of the world immediately surrounding that player, while the server has to generate the area(s) surrounding each/all players.

...Also ensuring that the map generation process is deterministic.

#4976250 Generating Large Maps Using Libnoise (Limits?)

Posted by Postie on 03 September 2012 - 06:56 PM

Another option is to generate smaller maps and then stitch them together in some fashion. If your stitching is decent enough you can effectively generate an infinite world. Games like Minecraft break the world into chunks, which are streamed to and from the disk as required. If your terrain generator is creating these chunks for you at the start it makes their dynamic loading much easier.

#4975595 Point To Polygon

Posted by Postie on 01 September 2012 - 06:23 PM

A simple polygon you can make from a collection of points is a convex hull. The advantage of this is there is a unique solution for the set of input points, but it discards any points that are internal to the polygon. There are quite a few different algorithms for calculating a convex hull (of varying complexity and performance), so have a quick google and find an algorithm that is up to your level of expertise.


If you need to include all vertices, the polygon is going to be a concave hull, and you start to run into problems. Unless you know there are definite constraints on the way the vertices link up, like say a maximum distance or angle between vertices, you quickly discover there are many solutions for even a small number of vertices, doubly so if you allow self-intersection.


#4969671 Getting Cube You Are Looking At (Voxel Engine).

Posted by Postie on 14 August 2012 - 07:15 PM

You need to use a technique called ray casting. From the position of the player's eye (centre of the viewport) and your camera's direction vector you create a ray and then test that against your geometry to determine where it intersects.

#4966586 "Seeding" Multiplayer Games?

Posted by Postie on 06 August 2012 - 01:21 AM

The difference between torrents and multiplayer games is that in the case of a torrent, the data doesn't change, so the seed data can be passed around as quick or slow as it likes. A multi-player game by definition is being affected by its players, so the game state is constantly changing. There's just no simple way for that game state to be passed around in a peer to peer fashion that is either timely or accurate.

#4965075 Obscuring the game code

Posted by Postie on 31 July 2012 - 09:56 PM

Minecraft was inspired by another project called Infiniminer which was abandoned by it's creator about a month after release due to losing control of his own source code.

Quoted from RockPaperShotgun:
“I stopped working on Infiniminer when the source code was leaked. It was totally my fault, as that’s what I get for releasing an un-obfuscated .NET assembly, but it nevertheless enabled hackers to create hacked clients and players upset with my balancing decisions to fork and write their own clients and servers.”

So it's worth doing some really basic obfuscation and making sure you don't release debug builds. Also, listening to your community and getting them involved will eliminate the need for them to build their own stuff based off your work.

#4963812 Achieving oldschool platformer physics

Posted by Postie on 27 July 2012 - 06:33 PM

Essentially what you're asking is: How do you make a game act as though it doesn't use a physics engine.

Easy. Don't use a physics engine. Adjust the velocity/position of the objects directly, don't factor in acceleration or mass or friction or any of the other physics related parameters.

I realize that, but I really don't want to start handling collisions, so I am wondering if you can force Box2D to be less "physicy" Posted Image

Fair enough, though it may be easier to write a simple sprite-based 2d collision detection system than trying to wrangle Box2D to work less like a proper physics engine.

#4963810 Preventing Chaos in your game code

Posted by Postie on 27 July 2012 - 06:26 PM

First things first. Does it work? If not, get it working. Then think about refactoring.

A good metric for determining if refactoring is required is if the code makes sense to you at a glance a few weeks or months later. You can often overlook obvious design flaws when the code is fresh in your mind.

IMHO, it's better to code an imperfect solution and then improve it later (if you have time) than spending hours agonising over producing the perfect design first time. I know this because I'm guilty of it all the time.