Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 28 Nov 2010
Offline Last Active Jan 23 2015 06:50 AM

#5195322 Where It all begins

Posted by Postie on 29 November 2014 - 04:12 AM

I'm a Software Development student at the University Of South Australia *Waves*.



Whoa.. a local on gamedev? *Waves back* 


If you are competent in 3 languages, its time to pick one of those and start a small game project. A lot of people on these forums recommend pong or something similarly simple, and though it sounds patronising, pong introduces you to most of the core concepts you'll encounter in any game. Eg: taking input from the player, drawing to the screen and the all important game loop.


Robert Nystrom's recent book "Game Programming Patterns" has some great stuff in it if you're transitioning from traditional software development to games. There's a free version hosted on his site at: http://gameprogrammingpatterns.com/contents.html but it is also available in various eBook formats as well as print.

#5194388 Funniest line of code ever ?

Posted by Postie on 24 November 2014 - 06:12 AM

This snippet comes courtesy of some healthcare related development I'm involved in: 


if (staff.StaffType != null && !staff.Staff.StaffTypes.Any(st => st.StaffType.Id == staff.StaffType.Id))

staff.Staff.StaffTypes.Add(new StaffStaffType(staff.Staff, staff.StaffType));




Reminded me of the "Spam Spam Spam..." Monty Python skit.

#5194223 Game Maker v1.3 Code Crashes Game

Posted by Postie on 22 November 2014 - 10:46 PM

A program becoming unresponsive is quite different to crashing. What you've described sounds more like an infinite loop. From the code snippet you provided, I can see two while loops that - depending on the return value of place_meeting()  - could loop endlessly. I'd start by looking in there.

#5192930 is there a better way top refer to assets in a game?

Posted by Postie on 14 November 2014 - 07:16 PM

is high on readability, but runs slow.


Do you have evidence to back up that claim? How is passing a string to a sound playing function noticeably slower than passing an integer?


Are you trying to say that loading the sound asset from disk by filename is slow when compared to pulling the sound asset from a cache by its integer id? If so, then yes that would be noticeably slower.


You can get the best of both worlds however by using an associative array (or dictionary) to allow you to look up the assets by some unique string... such as the filename.

#5190029 Game Development with Delphi: "Yes or No?"

Posted by Postie on 29 October 2014 - 03:36 PM

I'm a software developer working in the healthcare industry. I've been using Delphi professionally for 12 years, and C# for about 5. Over the years I've created a few small game projects in Delphi (using OpenGL), and more recently I've embarked on a much bigger game project in C# (using SlimDX).


For me, the writing was on the wall regarding Delphi, so back in 2008/2009 I decided I needed more job skills to stay competitive, and started learning C#. When it came to the decision about which language to build my new game idea in, C# was an easy choice. There's nothing better than a nice meaty project to grow your programming/language skills.


Your original post is a little ambiguous on intent. Ie, are you just trying to ascertain Delphi's popularity as a game development language or are you genuinely trying to come to a decision regarding what to use for your next project?


If its the former, I'd say, "No". I wouldn't recommend Delphi as a platform. There's too few of us that know Delphi compared to something like C#. It's hard enough to get other people to collaborate on game projects, I wouldn't want to reduce the pool further. Similarly, there are less games tutorials or examples of games written in Delphi, which limits the learning resources you can draw on.


On the other hand, if its the second option then I'd figure out how good your Delphi skills are versus other languages, or if you're interested in learning something new.


There's a lot more to games development than just picking the language to use. There's game loops, resource management, rendering, efficient data structures etc.. and all those can be implemented in ANY language.


My advice: pick the language you're most comfortable with, and go nuts.

#5189293 "Click to start the game"

Posted by Postie on 26 October 2014 - 05:30 PM

In most cases I think its a console requirement. In order for a game to be certified for a consoles, the games developers have to abide by the console's conditions, such as the "click to play" screen. Another I've seen is the "this icon means the game is saving, don't turn off the device" notification.

#5187934 Percentage Health (100%) vs. Numbered Health (100/100)? Which ones better?

Posted by Postie on 18 October 2014 - 11:50 PM

You already have a percentage showing - the visual bar is your percentage (if the bar is half light-red and half-darkred, then you know you are roughly 50%). Showing a textual percentage (such as "53%") is somewhat redundant. 


This is the exact conclusion I came to when tackling the same question for my own game. I'd definitely go with something like "234/500" and let the visual bar represent the percentages. 

#5186642 shadow shader

Posted by Postie on 13 October 2014 - 01:54 AM

This technique would only work with solid objects with a convex profile, right? It seems like something as simple as a torus wouldn't shadow correctly.

#5183266 Optimization philosophy and what to do when performance doesn't cut it?

Posted by Postie on 27 September 2014 - 03:57 AM

I dislike the way the "premature optimisation.." quote is misused, and quoted without the benefit of its original context. 


I take the quote to have 2 meanings:

  1. Get the code working first then worry about optimising.
  2. Don't rush into optimisation without profiling the code first.

The benefit of #1 is that you can keep your working, reference implementation and ensure the output of your optimised version is still working correctly. And #2 gives you the best bang for buck, since as developers, our time is precious. 

#5177539 Did I begin learning late?

Posted by Postie on 01 September 2014 - 06:32 PM

In many respects you're lucky you can start so early! Python only came to my attention in the last few years, and I'm in my 30's.

#5172556 Getting started

Posted by Postie on 09 August 2014 - 11:30 PM

The best advice I can offer is to start simple and practise often. There's no quick way to gain the knowledge you need, the reality is that you'll have to put in the time and build up your skills by trying projects of increasing complexity.


The choice of game engine is far less important.

#5157279 2D physics in a game.

Posted by Postie on 01 June 2014 - 02:36 AM

Game physics is something that only works correctly if you update it at a constant, predictable rate, independent of the rate you're rendering to the screen. The way this is commonly achieved is to define how often you want to update your physics, eg, 20 times a second, and then calculate the elapsed time between each rendering frame. Accumulate that over several frames until you reach 1/20th of a second, then do a physics update, using 1/20th of a second as your time parameter in all your physics equations. This means that your physics updates are all done with the same time difference (or delta), and they happen predictably, which means the motion of your objects will be smooth.


I highly recommend you check out "Fix your timestep!", the seminal work on the topic.

#5157098 2D physics in a game.

Posted by Postie on 30 May 2014 - 10:50 PM

Typically, you'd apply a force to an object, which would cause that object to accelerate. Over time, acceleration alters the object's velocity. Over time, velocity alters the object's position.


Force, Acceleration, Velocity, Position and Time. Those are the 5 things you need to worry about. If however, you also want your object to rotate, then you have Torque, Angular acceleration, Angular velocity and Orientation to worry about.


Though it seems like 2D physics should be pretty easy compared to 3D physics, the concepts are actually the same, but some of the formulae are simpler since they involve one less dimension. 


I wrote a simple 2D physics engine in C# about 4 years ago, and Chris Hecker's articles on rigid body dynamics were an invaluable resource.


#5149852 Random map with prebuild pieces

Posted by Postie on 27 April 2014 - 07:40 AM

One approach I've seen is to first generate the rooms without any doors or corridors between them. Then you go through a second pass adding doors to each room to connect them all to each other. Larger rooms could be allowed more doors, and you could easily verify how many dead ends you have by looking at rooms with only one connecting door.


I can't find the link right now, but I recall seeing a presentation on Path of Exile's random dungeon generation, where they place a Start room, an end Room and then a room in the very middle of the map. Then they randomly add rooms and doors using a similar technique I mentioned above, but ensuring that there's a path from the start room to the middle room, and then the middle room to the end room. This ensures the overall network of rooms is linear, which is better for guiding the player.


Another interesting technique is described here: http://www.reddit.com/r/gamedev/comments/1dlwc4/procedural_dungeon_generation_algorithm_explained/

That might be more complex than you're after, but it could give you some ideas. 

#5148106 How to stop users from manipulating Game Save Data

Posted by Postie on 19 April 2014 - 05:54 AM

For a non-online game It is impossible to prevent a dedicated, intelligent individual from altering your game files.


You can discourage a high proportion of players by making it difficult to do so. However, the dedicated and intelligent will figure out what you did and circumvent it. Guaranteed.


Its a matter of diminishing returns. Do nothing, and anyone that is curious can look in the game folder and make whatever changes they feel like. Hiding the files or obfuscating them in some way will eliminate some of those but not all. Its an unwinnable battle. The question you have to ask yourself is how much time are you willing to spend on it, and could I instead invest that time in making the game better?


With that in mind, something simple like computing an MD5 hash of the file and storing it in code somewhere will take care of the majority of users. But, I'd advise against it.


The game project I'm currently working on is likely going to ship with all of its game data files as plain text with non obfuscated key/value pairs. Why? Two reasons:

  1. The game isn't directly competitive, so "cheating" doesn't affect anyone else. 
  2. I want to encourage people to make (and share) interesting mods I wouldn't have thought of myself.