Have you written a game?

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

Have you....?

created a game solo
54
58%
created a game as part of a team
7
8%
not created a game but would like to
29
31%
not created a game and have no interest
3
3%
 
Total votes: 93

User avatar
Cleverbeans
Posts: 1378
Joined: Wed Mar 26, 2008 1:16 pm UTC

Have you written a game?

Postby Cleverbeans » Tue Jan 26, 2010 7:06 pm UTC

The title says it all, have you created a game before? Just curious about the collision between programmers and gamers as it seems to be a common motivation to learn programming in the first place.
"Labor is prior to, and independent of, capital. Capital is only the fruit of labor, and could never have existed if labor had not first existed. Labor is the superior of capital, and deserves much the higher consideration." - Abraham Lincoln

ntietz
Posts: 73
Joined: Sun Aug 31, 2008 6:05 pm UTC

Re: Have you written a game?

Postby ntietz » Tue Jan 26, 2010 7:10 pm UTC

For me, I became interested in CS and programming because of mathematics; I took a programming class in high school with the mentality that programming is helpful for math, and it turned out that it was a more natural fit for me than mathematics (so now I'm doing both). Gaming wasn't ever really high on my list until college and even now... I don't really play video games that much. Maybe a total of 12 hours last semester, 12 hours over break, and 0 this semester.

I chose "have not made a game and have no interest" because it was the best fit, but there's a catch. I'm technically involved in creating a game with some of my friends, but I'm not going to be working on much of the "game" part of it. Right now, my main projects are making random name generators and other utilities, most of which are actually fairly useful outside of the scope of the game itself. So, I figure I'm not developing a game, I'm just developing tools that will happen to only be used for making a game.

User avatar
Earlz
Gets Obvious Implications
Posts: 785
Joined: Sat Jun 09, 2007 8:38 am UTC
Location: USA
Contact:

Re: Have you written a game?

Postby Earlz » Tue Jan 26, 2010 7:41 pm UTC

I hate all of these silly people that try to get kids interested in programming by creating a game. Creating a game is probably the most difficult form of programming because

1. Optimization DO matter
2. Sometimes dropping to assembly is necessary.
3. Intense math.
4. 3D graphics programming is not fun.
5. Must create graphics (not programming related)
6. Very difficult to get noticed due to market flooding.
7. Must almost always be written in a lower level language in order to be fast enough to be considered "smooth" (if the game has any complexity or is 3D)


That said, I don't plan on writing a game *unless* it is an open source clone of Diner Dash. I love that game for some reason and I'm tired of my touch screen phone performing poorly at running it.
My new blag(WIP, so yes it's still ugly..)
DEFIANCE!
Image
This is microtext. Zooming in digitally makes it worse. Get a magnifying glass.. works only on LCD

User avatar
Indon
Posts: 4433
Joined: Thu Oct 18, 2007 5:21 pm UTC
Location: Alabama :(
Contact:

Re: Have you written a game?

Postby Indon » Tue Jan 26, 2010 8:21 pm UTC

I have a history of making simple games in order to teach myself various features of languages. Nothing studio-quality, though.
So, I like talking. So if you want to talk about something with me, feel free to send me a PM.

My blog, now rarely updated.

Image

User avatar
Area Man
Posts: 256
Joined: Thu Dec 25, 2008 8:08 pm UTC
Location: Local

Re: Have you written a game?

Postby Area Man » Tue Jan 26, 2010 9:15 pm UTC

I've created games solo AND with teams, but that's not what motivated me into programming... so I don't know what to vote.

3D programming is a lot of fun (when you get into it), but it is intense - not something you casually drop into, and getting anything close to current release quality takes a lot more than just awesome programming. Not something I'd care to do full-time (or at all right now). It consumes your life.
Bisquick boxes are a dead medium.

User avatar
MHD
Posts: 630
Joined: Fri Mar 20, 2009 8:21 pm UTC
Location: Denmark

Re: Have you written a game?

Postby MHD » Tue Jan 26, 2010 9:54 pm UTC

I once made a console snake game in C++, have a half finished improved version somewhere.

I live for console apps, so graphics is not an issue.
EvanED wrote:be aware that when most people say "regular expression" they really mean "something that is almost, but not quite, entirely unlike a regular expression"

spupy
Posts: 153
Joined: Sun Apr 13, 2008 10:48 pm UTC

Re: Have you written a game?

Postby spupy » Tue Jan 26, 2010 10:43 pm UTC

Started to write an RPG for mobile phones with Java. With some really sweet tileset I downloaded from the net it looked very nice. But I lost interest and the only thing I finished was walking around. I sometimes regret abandoning it, since the graphics were awesome (in 2D zelda way).

Also, a simple bull-and-cows game (a.k.a. mastermind). Of course the computer had some primitive AI.

But I don't think I will ever again try to write a game. Flash seems repulsive, but iphone and android look nice for some small entertaining games.
There are two types of people in this world - those who can count to 10 by using their fingers, and those who can count to 1023 by using their fingers.

User avatar
Squid Tamer
Posts: 220
Joined: Fri Apr 03, 2009 3:59 am UTC
Location: Over there
Contact:

Re: Have you written a game?

Postby Squid Tamer » Tue Jan 26, 2010 11:40 pm UTC

Mine are mostly just the simple things that result from playing with Python, but I do have one work in progress that's pretty involved. Just a simple text-based thingy, but I had to learn lots of stuff to do it.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Have you written a game?

Postby You, sir, name? » Wed Jan 27, 2010 12:40 am UTC

I dabble occasionally. Though it's the challenge of creating game engines that appeal to me more than creating actual games.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
Mighty Jalapeno
Inne Juste 7 Dayes I Wille Make You A Hero!
Posts: 11265
Joined: Mon May 07, 2007 9:16 pm UTC
Location: Prince George In A Can
Contact:

Re: Have you written a game?

Postby Mighty Jalapeno » Wed Jan 27, 2010 12:44 am UTC

Got my start writing games in LOGO, in Grade 4. Good times.

Of course, now, PHP / CSS confuses me.

User avatar
Cosmologicon
Posts: 1806
Joined: Sat Nov 25, 2006 9:47 am UTC
Location: Cambridge MA USA
Contact:

Re: Have you written a game?

Postby Cosmologicon » Wed Jan 27, 2010 5:32 am UTC

Earlz wrote:I hate all of these silly people that try to get kids interested in programming by creating a game. Creating a game is probably the most difficult form of programming because

1. Optimization DO matter
2. Sometimes dropping to assembly is necessary.
3. Intense math.
4. 3D graphics programming is not fun.
5. Must create graphics (not programming related)
6. Very difficult to get noticed due to market flooding.
7. Must almost always be written in a lower level language in order to be fast enough to be considered "smooth" (if the game has any complexity or is 3D)

While I agree with you that game programming is probably a really bad way to dive into programming, some of what you're saying only applies to fairly professional games. Especially #6. What program of any type written by someone just learning programming is going to "get noticed"?

I've written several games in pygame now. Only a couple were 3-D. None of them are good enough I could ever sell them, but most were good enough to motivate someone interested in games to learn programming. You can write a pretty fun game in pure python with no 3-D graphics at all.

Anyway, I agree that games are not the way to learn programming in general - that's just a recipe for frustration. But I think they might be a good way to learn object-oriented programming. That paradigm has never made so much sense to me as when I'm writing a game.

PS: I've also written games in Javascript, Basic, and LAMP, and I'm learning SDL. :)

kmatzen
Posts: 214
Joined: Thu Nov 15, 2007 2:55 pm UTC
Location: Ithaca, NY

Re: Have you written a game?

Postby kmatzen » Wed Jan 27, 2010 5:45 am UTC

I took a video game design course last semester that I thought was a lot of fun, but also a ton of work. It breaks down to three weeks for a 2D game, three weeks for a 3D game, and seven weeks for a final team project. The hardest part was coming up with fun ideas for games with those three week projects. It's such a short amount of time that you really have to just get running and start working on writing an engine even if you don't know what the gameplay will be like. It was tough for me to just be like, okay, I'll make a third person shooter engine, and then actually map that to a game idea _after_ the engine was complete.

User avatar
Sc4Freak
Posts: 673
Joined: Thu Jul 12, 2007 4:50 am UTC
Location: Redmond, Washington

Re: Have you written a game?

Postby Sc4Freak » Wed Jan 27, 2010 7:05 am UTC

I'm the solo developer of NextWar: The Quest for Earth on the Xbox 360 (Trailer).

I'm one of the cases who decided to learn to program because I wanted to make games. That said, game development is hard. NextWar certainly wasn't my first attempt - I had years of experience before I started NextWar, and it took me about a year of my free time (including my summer holidays) to make it. It's the probably biggest personal project I've ever completed - but after doing it once I don't think I'd want to do it again.

If I were to get a job in software development, I sure as heck wouldn't want to go into professional game development. From what I've read, game developers are poorly paid, work long hours, and have a very high turnover rate. To a novice, game development seems like a dream job at first, but the novelty quickly wears off. It'd be even worse in a professional environment, when you're not working on your own game ideas, but someone else's.

User avatar
Xeio
Friends, Faidites, Countrymen
Posts: 5101
Joined: Wed Jul 25, 2007 11:12 am UTC
Location: C:\Users\Xeio\
Contact:

Re: Have you written a game?

Postby Xeio » Wed Jan 27, 2010 2:45 pm UTC

You, sir, name? wrote:I dabble occasionally. Though it's the challenge of creating game engines that appeal to me more than creating actual games.
Same here, especially with the fact that I have a hard time coming up with ideas for something I'd actually like to see.

One of my first programming projects was actually a 2D tile engine (mostly imitating Mirage/Player worlds, if any of you've heard of it, except it was single player). Granted, I never really finished it (to the extent that I bunch of features I left partially completed, or unimplemented), but it was quite fun. I learned some good coding practices from it too, also because I went "Wow, I should have planned this better, and commented more, and... yea...". Still, a fun experience.

User avatar
Dason
Posts: 1311
Joined: Wed Dec 02, 2009 7:06 am UTC
Location: ~/

Re: Have you written a game?

Postby Dason » Wed Jan 27, 2010 7:10 pm UTC

Xeio wrote: "Wow, I should have planned this better, and commented more, and... yea..."


I'm pretty sure we've all felt like this at some point.
double epsilon = -.0000001;

User avatar
headprogrammingczar
Posts: 3072
Joined: Mon Oct 22, 2007 5:28 pm UTC
Location: Beaming you up

Re: Have you written a game?

Postby headprogrammingczar » Wed Jan 27, 2010 8:19 pm UTC

Sc4Freak wrote:I'm the solo developer of NextWar: The Quest for Earth on the Xbox 360 (Trailer).

I'm one of the cases who decided to learn to program because I wanted to make games. That said, game development is hard. NextWar certainly wasn't my first attempt - I had years of experience before I started NextWar, and it took me about a year of my free time (including my summer holidays) to make it. It's the probably biggest personal project I've ever completed - but after doing it once I don't think I'd want to do it again.

If I were to get a job in software development, I sure as heck wouldn't want to go into professional game development. From what I've read, game developers are poorly paid, work long hours, and have a very high turnover rate. To a novice, game development seems like a dream job at first, but the novelty quickly wears off. It'd be even worse in a professional environment, when you're not working on your own game ideas, but someone else's.

If I had an Xbox, I would definitely play that game. I am the current "lead" coder for Eternal Silence, which is about as posh a position as you can have when developing a game. If you ever want to make games for fun, definitely go with joining a mod team. Mod teams are small, so virtually every developer is also a designer, which is what most people really want to do. It can be really easy to design a game, but it can be damn near impossible to design a good game if you don't know exactly what you are doing. Programming a game can be exponentially less fun that programming anything else, even when you only implement your own ideas. So much has to be perfect, and if you have even one bug in your code, players will find a way to use it to their advantage. Memory leaks are crippling, as are wasted CPU cycles, long disk reads, network choke, and framerate drops. Moral of the story: don't conflate development and design.
<quintopia> You're not crazy. you're the goddamn headprogrammingspock!
<Weeks> You're the goddamn headprogrammingspock!
<Cheese> I love you

10nitro
Posts: 192
Joined: Mon Nov 03, 2008 8:46 pm UTC
Contact:

Re: Have you written a game?

Postby 10nitro » Wed Jan 27, 2010 9:12 pm UTC

I started out with basic stuff like the one game where you fly the plane and avoid the others, and started to work on some reasonably complex/advanced RPGs that I never finished.
I think I even wrote a basic 3D-rendering engine at one point (the math from that helped me out later :)

However, I've moved away from game programming. Although, for a special occasion I'm working on a StarCraft clone (in very preliminary stages right now).
~ Luke Shumaker
FRC1024 Programmer
IT technician, GNU/Linux admin, comp. security guy
Eagle Scout
http://lukeshu.ath.cx

fllaim
Posts: 1
Joined: Thu Jan 28, 2010 10:38 am UTC

Re: Have you written a game?

Postby fllaim » Thu Jan 28, 2010 11:05 am UTC

It's my hobby. I make games rather than play. After I've noticed that my cell phone supports python, I started to making games in it. I'm writing scripts in phone. In these days I'm working on a 2d physics engine. I'm planning to build a motocross game. I coded geometrical collisions and computations, but I couldn't done physics yet. It's so buggy.
I've written games for PC also. I know SDL-OpenGL programming and to use Open Dynamics Engine.

User avatar
Toeofdoom
The (Male) Skeleton Guitarist
Posts: 3446
Joined: Wed Jan 10, 2007 10:06 am UTC
Location: Melbourne, Australia
Contact:

Re: Have you written a game?

Postby Toeofdoom » Thu Jan 28, 2010 12:25 pm UTC

I'm in the 4th year of a game design degree at Swinburne. It isn't exactly "intensive" the way I'm sure some courses are and essentially we don't build any games until 3rd year, but I think I've learned a fair bit. There are a few prototypes on my website (see sig), I was one of 2 main programmers for a mobile phone game for the Australian government (an energy saving campaign, hasn't been released and not sure if it will be) and I'm working on some significantly larger projects now.
EDIT: As for learning to program with games, I think a better approach would be to have a competition to create AIs for a specific game, for example. http://www.robotbattle.com/ would be a good example, the main problem is it requires knowledge of AI instead of coding to do well.
Hawknc wrote:Gotta love our political choices here - you can pick the unionised socially conservative party, or the free-market even more socially conservative party. Oh who to vote for…I don't know, I think I'll just flip a coin and hope it explodes and kills me.

Website

User avatar
Sc4Freak
Posts: 673
Joined: Thu Jul 12, 2007 4:50 am UTC
Location: Redmond, Washington

Re: Have you written a game?

Postby Sc4Freak » Thu Jan 28, 2010 11:00 pm UTC

Toeofdoom wrote:I'm in the 4th year of a game design degree at Swinburne.

Heh, incidentally Swinburne was the one who gave me a $3000 prize and first place in the 2008 SwinGame competition for the Windows version of NextWar. It's because of them that I had the motivation to port the game to the Xbox 360 in the first place. :D

User avatar
minno
Posts: 152
Joined: Fri Jul 31, 2009 11:33 pm UTC
Location: Where you least expect it.

Re: Have you written a game?

Postby minno » Thu Jan 28, 2010 11:49 pm UTC

I've made tictactoe and a basic shooting game for my calculator, and several dice/board games like Othello (reversi) and Yahtzee in Python for programming class assignments.
If you fight fire with fire, you'll get twice as burned.

User avatar
Toeofdoom
The (Male) Skeleton Guitarist
Posts: 3446
Joined: Wed Jan 10, 2007 10:06 am UTC
Location: Melbourne, Australia
Contact:

Re: Have you written a game?

Postby Toeofdoom » Fri Jan 29, 2010 5:06 am UTC

Sc4Freak wrote:
Toeofdoom wrote:I'm in the 4th year of a game design degree at Swinburne.

Heh, incidentally Swinburne was the one who gave me a $3000 prize and first place in the 2008 SwinGame competition for the Windows version of NextWar. It's because of them that I had the motivation to port the game to the Xbox 360 in the first place. :D

Haha, very nice. Looks like a good game too. Yeah, the course I'm in builds up slowly, although they do teach quite a lot outside the narrow "this is how you program for a game" area so it's cool. Hopefully one of my projects gets to a real "complete" state sometime instead of "I had a week to make it and it's been a week so it's done".
Hawknc wrote:Gotta love our political choices here - you can pick the unionised socially conservative party, or the free-market even more socially conservative party. Oh who to vote for…I don't know, I think I'll just flip a coin and hope it explodes and kills me.

Website

User avatar
_Big_Mac_
Posts: 83
Joined: Sun Sep 07, 2008 8:30 pm UTC
Location: Poland

Re: Have you written a game?

Postby _Big_Mac_ » Sat Jan 30, 2010 4:33 pm UTC

Earlz wrote:I hate all of these silly people that try to get kids interested in programming by creating a game. Creating a game is probably the most difficult form of programming because

1. Optimization DO matter


First, optimization matters, or should matter, everywhere. Even boring database mangling apps often use tricky optimizations - only done in SQL instead of inline assembly.
Secondly, unless you're doing a AAA title (which you aren't if you're working solo) your code usually won't be that taxing.

2. Sometimes dropping to assembly is necessary.


Dropping to inline assembly is almost never necessary. You're unlikely to get huge speedups anyway. When you think about optimization, your hierarchy should roughly be as follows:
1. Define the problem correctly (so you're not solving more than you should)
2. Pick the best method.
3. Pick the best algorithm for this method.
4. Create a streamlined design (still speaking of high level abstractions)
5. Come up with the best data structures that will work with this algorithm and within the design.
6. Parallelize.
7. Pick a good language.
8. Optimize implementation within this language (using language specific tricks)
9. If still too slow, profile for hot spots - in 99% of cases you'll be able to fix them by going to step 8.
10. Only then think of inline assembly.

The key here - you will be getting the biggest speedups by optimizing on higher levels. No amount of assembly will fix an O(n^2) algorithm when you could've picked an O(n) one. No amount of assembly hacks will be faster than even naive parallelisation. A rule of a thumb: if you think you're forced to code assembly, take a step back and see where you've gone wrong.

3. Intense math.

What's wrong with that?
4. 3D graphics programming is not fun.

You're right, it's not just fun - it's superfun ;)
5. Must create graphics (not programming related)

Unless you find a friend who can. Or create graphics procedurally and spice them up with post processing - there's been plenty of games that looked great by doing it.

6. Very difficult to get noticed due to market flooding.

Name one market where it's easy to get noticed.

7. Must almost always be written in a lower level language in order to be fast enough to be considered "smooth" (if the game has any complexity or is 3D)


Completely not true. This is a very common myth - you need to write in C to get gamey performance. Unreal Engine 3 was written in C++ and most of the game functionality has been delegated to interpreted scripts. Even high performance 3D engines, which a solo dev is unlikely to need, much less make from scratch, can be written in pretty, object oriented C++ code. If you think C++ is too low level, you can use .NET - there's a managed wrapper for DirectX which reportedly achieves around 97% of the native code performance. But you don't need to code in bare Dx or OpenGL anyway - take a rendering engine like Ogre3D (which also has nifty .NET or Python bindings), drive it with, say, PhysX and use another OOP audio library - you can have a really solid 3D game without ever touching C or assembly. I can attest to this personally. Hell, want high performance 3D without touching native code? Use UDK.

I can guarantee that most indie games, even complex ones, can be written in high level languages.

I've made two games in the course of my studies, a 2D platformer in Java
http://img.photobucket.com/albums/v26/_ ... flying.jpg (yes, it's a bear that shoot raports)
which had "real physics"
http://img.photobucket.com/albums/v26/_ ... yrone4.jpg
I've even drawn sprites myself, lot's of fun
http://img.photobucket.com/albums/v26/_ ... yrone5.jpg

And a 3D racing game where you'd race Martian Rovers. Multiplayer game, Ogre3D plus PhysX.
http://www.youtube.com/watch?v=AvRCq8dixgg

Both were LOTS of work and LOADS of fun to make. Both also got me top grades for the courses I've made them for (Concurrent programing and Distributed systems). If I were to make them again, I would. Of course I'd avoid some mistakes I've made ;)

They took me about 3 months from start to finish each.

Technical Ben
Posts: 2986
Joined: Tue May 27, 2008 10:42 pm UTC

Re: Have you written a game?

Postby Technical Ben » Sat Jan 30, 2010 10:04 pm UTC

I think I love you _Big_Mac_!
Those games looks hilarious. I could seem someone modding in a "rover racing" game somewhere. Especially after the XKCD comic.

I also thought I'd give java programming a go, with the idea to make at least one simple game with sprites. Any chance of some pointers once I'm past the basics Big Mac?
It's all physics and stamp collecting.
It's not a particle or a wave. It's just an exchange.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Have you written a game?

Postby You, sir, name? » Sat Jan 30, 2010 10:10 pm UTC

Technical Ben wrote:I also thought I'd give java programming a go, with the idea to make at least one simple game with sprites. Any chance of some pointers once I'm past the basics Big Mac?


Game programming in java is possible, but it's very easy to make mistakes. You have to be pretty conservative about how many objects you allocate, as the garbage collector is very good at absolutely murdering performance at random intervals, especially on single-core machines.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

Technical Ben
Posts: 2986
Joined: Tue May 27, 2008 10:42 pm UTC

Re: Have you written a game?

Postby Technical Ben » Sat Jan 30, 2010 10:14 pm UTC

Oh, I'm looking at something like this, but turn based etc. Being as it's day 3 of my first programming since BASIC I'm just keeping it simple for now. No idea how performance will be. :/
It's all physics and stamp collecting.
It's not a particle or a wave. It's just an exchange.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Have you written a game?

Postby You, sir, name? » Sat Jan 30, 2010 10:19 pm UTC

Technical Ben wrote:Oh, I'm looking at something like this, but turn based etc. Being as it's day 3 of my first programming since BASIC I'm just keeping it simple for now. No idea how performance will be. :/


You are seriously underestimating the complexity of strategy games, yes even turn based ones. Try doing tetris or something, and then work your way up from there.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

Technical Ben
Posts: 2986
Joined: Tue May 27, 2008 10:42 pm UTC

Re: Have you written a game?

Postby Technical Ben » Sat Jan 30, 2010 10:33 pm UTC

I am doing. :roll:
So how is Tetris going to kill my performance on a pc just because it's java?
It's all physics and stamp collecting.
It's not a particle or a wave. It's just an exchange.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Have you written a game?

Postby You, sir, name? » Sat Jan 30, 2010 10:40 pm UTC

Technical Ben wrote:I am doing. :roll:
So how is Tetris going to kill my performance on a pc just because it's java?


Hopefully not. I'm not saying it's impossible to botch a tetris implementation enough to be unplayable in Java, but it does take some doing.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

0xBADFEED
Posts: 687
Joined: Mon May 05, 2008 2:14 am UTC

Re: Have you written a game?

Postby 0xBADFEED » Sat Jan 30, 2010 10:45 pm UTC

_Big_Mac_ wrote:No amount of assembly hacks will be faster than even naive parallelisation.

Certainly not true. Naive parallelization can easily be slower than naive serial code.

Technical Ben
Posts: 2986
Joined: Tue May 27, 2008 10:42 pm UTC

Re: Have you written a game?

Postby Technical Ben » Sat Jan 30, 2010 10:47 pm UTC

You, sir, name? wrote:
Spoiler:
Technical Ben wrote:I am doing. :roll:
So how is Tetris going to kill my performance on a pc just because it's java?


Hopefully not. I'm not saying it's impossible to botch a tetris implementation enough to be unplayable in Java, but it does take some doing.


Yep. I'm going to be posting here a couple of times just to get a text based parser to function. :oops:
It's all physics and stamp collecting.
It's not a particle or a wave. It's just an exchange.

User avatar
Toeofdoom
The (Male) Skeleton Guitarist
Posts: 3446
Joined: Wed Jan 10, 2007 10:06 am UTC
Location: Melbourne, Australia
Contact:

Re: Have you written a game?

Postby Toeofdoom » Sun Jan 31, 2010 2:59 am UTC

You, sir, name? wrote:
Technical Ben wrote:I also thought I'd give java programming a go, with the idea to make at least one simple game with sprites. Any chance of some pointers once I'm past the basics Big Mac?


Game programming in java is possible, but it's very easy to make mistakes. You have to be pretty conservative about how many objects you allocate, as the garbage collector is very good at absolutely murdering performance at random intervals, especially on single-core machines.

Remember when I said I programmed a game for mobile phones? Yeah, java. Ewww.

What's especially bad is if you're used to using all the nice things java can do with strings... you can fill up a phones ram in about 10 seconds just by refreshing a timer. Or the fact that the emulator loads the .png files you're using for graphics compressed, showing only tiny ram usage but phones don't do that. Lots of annoying problems. Oh and the J2ME sound API is easily the worst API I've come across.

For PC it shouldn't be too bad, but I still prefer C++.
Hawknc wrote:Gotta love our political choices here - you can pick the unionised socially conservative party, or the free-market even more socially conservative party. Oh who to vote for…I don't know, I think I'll just flip a coin and hope it explodes and kills me.

Website

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Have you written a game?

Postby You, sir, name? » Sun Jan 31, 2010 3:16 am UTC

Toeofdoom wrote:
You, sir, name? wrote:
Technical Ben wrote:I also thought I'd give java programming a go, with the idea to make at least one simple game with sprites. Any chance of some pointers once I'm past the basics Big Mac?


Game programming in java is possible, but it's very easy to make mistakes. You have to be pretty conservative about how many objects you allocate, as the garbage collector is very good at absolutely murdering performance at random intervals, especially on single-core machines.

Remember when I said I programmed a game for mobile phones? Yeah, java. Ewww.

What's especially bad is if you're used to using all the nice things java can do with strings... you can fill up a phones ram in about 10 seconds just by refreshing a timer. Or the fact that the emulator loads the .png files you're using for graphics compressed, showing only tiny ram usage but phones don't do that. Lots of annoying problems. Oh and the J2ME sound API is easily the worst API I've come across.

For PC it shouldn't be too bad, but I still prefer C++.


Sounds painful. But why not use StringBuffer? Java strings are by definition constant, so whenever you manipulate them, you create a crapton of litter that the GC has to clean up.

On PC the issue is that the memory pool gets gradually spent, and then maybe every 10 minute the GC fires up and your performance is nuked for several seconds. Unless you've got a multi-core machine that is, or write exceptionally memory-conscious code.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

User avatar
_Big_Mac_
Posts: 83
Joined: Sun Sep 07, 2008 8:30 pm UTC
Location: Poland

Re: Have you written a game?

Postby _Big_Mac_ » Sun Jan 31, 2010 11:47 am UTC

Technical Ben wrote:I also thought I'd give java programming a go, with the idea to make at least one simple game with sprites. Any chance of some pointers once I'm past the basics Big Mac?


The main issue I had in Java was indeed performance. This was mainly my fault that I didn't notice a stupid thing - at each frame I would clear all sprite information and allocate new sprite objects instead of modifying existing ones. This is something I would likely never do in C++ but you just don't "see" those things in Java - EVERYTHING is allocated with new and it's just so natural not to care about heap vs. stack. You also don't see where things are destroyed, it's just way to easy to forget you're working with real memory where allocations and deallocations are costly, which can fragment etc.

So, from my experience, be very wary of what's happening to your memory in Java. You don't immediately see the problems because, hey, it works. You allocate new objects all over the place, GC cleans up, everything seems nice until, suddenly, your 2D game struggles to keep framerates on a quad core.

Another hint - use libraries. Don't write collision checking on your own if you don't have to. I used Phys2D for physics in Tyrone the Bear. It wasn't very fast, but it was good enough. You are unlikely to come up with something faster anyway unless you actually know how to and spend much work on it. Don't write path finding unless you really need to, find a working implementation somewhere and use it instead. If you have to, build your game around such libraries - ex. if this path finding implementation has its own Tile class, have your tiles inherit from it. Perhaps get some sort of a complete game library. The more work you delegate to code someone else has written, the more time you'll have to design your game.

(note: links given here are just examples, Google for more)

0xBADFEED wrote:
_Big_Mac_ wrote:No amount of assembly hacks will be faster than even naive parallelisation.

Certainly not true. Naive parallelization can easily be slower than naive serial code.


Absolutely true, I've made a shortcut there. I meant to say "a properly used naive parallelization is better than any assembly". For example, if an algorithm's main work is done in a huge for loop with no dependencies, a "naive" way to parallelize it would be to just slap

Code: Select all

#pragma omp parallel for
in front of it and you're likely to get much better speedups than with hacking assembly within the loop's body. Assuming you use a decent compiler that supports OpenMP. Naturally, finding where parallelization is applicable and beneficial is not always trivial (profile, profile, profile!) but it falls at point 6 of my hierarchy instead of 10 :)

Technical Ben
Posts: 2986
Joined: Tue May 27, 2008 10:42 pm UTC

Re: Have you written a game?

Postby Technical Ben » Sun Jan 31, 2010 1:37 pm UTC

Thanks Big Mac for the links. Being able to just "plug in" sound, sprites and a little eye candy to the game would be a my aim (and why I chose Java as a starting platform). When you mention strings, do you mean, as soon as I initialise or create them, they are persistent in memory, so I have to destroy/delete them later in my code if it's not being used? I'm yet to get that far in my tutorials, not sure if it's covered. I'll try and remember it.

If I manage to get a simple 2d grid game, even with alphanumeric characters instead of gifs, running in flash, I might be brave enough to try C++ for more complicated stuff.
It's all physics and stamp collecting.
It's not a particle or a wave. It's just an exchange.

0xBADFEED
Posts: 687
Joined: Mon May 05, 2008 2:14 am UTC

Re: Have you written a game?

Postby 0xBADFEED » Sun Jan 31, 2010 1:42 pm UTC

_Big_Mac_ wrote:Absolutely true, I've made a shortcut there. I meant to say "a properly used naive parallelization is better than any assembly". For example, if an algorithm's main work is done in a huge for loop with no dependencies, a "naive" way to parallelize it would be to just slap

Code: Select all

#pragma omp parallel for
in front of it and you're likely to get much better speedups than with hacking assembly within the loop's body.

This is basically never the case, especially in games where you're dealing with lots of interacting objects that necessarily have lots of interdependencies on one another. Naive parallelization would not take into account issues like lock-contention patterns, memory-access patterns and other things that kill your performance when trying to write concurrent code. Worse yet, naive concurrency introduces entire failure-modes into your application that are not present with serial execution (e.g. deadlocks).

You just can't do worthwhile concurrent code without spending an immense effort critically analyzing its ramifications (in most languages). Not to mention if you're doing anything halfway serious you'll have several different libraries from different sources all with different concurrency requirements/restrictions that you'll have to verify are being respected before you can even regard your code as correct. Parallel programming isn't magic and it's at least an order of magnitude harder than writing serial code.

My point is that naive concurrency is bad concurrency and it is a sure way to introduce subtle show-stopping bugs, period. Bad concurrency isn't really worth doing.

Technical Ben
Posts: 2986
Joined: Tue May 27, 2008 10:42 pm UTC

Re: Have you written a game?

Postby Technical Ben » Sun Jan 31, 2010 2:11 pm UTC

Is this why the likes of Crygen studios can pull the entire Crysis2 engine out of the PS3? Because they have the staff, knowledge and time to code the rendering engine naively into the core processors. This has been especially hard for most developers as the core chips have "new" code. So most stuff is ported to the PS3, and thus quite sloppy and slow in comparison to the lower specced Xbox.

I remember there being a competitor to photoshop at one point that said they had faster software. They wrote it in assembly code to be perfectly optimised., No idea what the name was though. :/
Just try photo editing in the good, but slow, pixlr and you'll see how slow code is when it's not native. :(
It's all physics and stamp collecting.
It's not a particle or a wave. It's just an exchange.

User avatar
_Big_Mac_
Posts: 83
Joined: Sun Sep 07, 2008 8:30 pm UTC
Location: Poland

Re: Have you written a game?

Postby _Big_Mac_ » Sun Jan 31, 2010 11:12 pm UTC

0xBADFEED wrote:My point is that naive concurrency is bad concurrency and it is a sure way to introduce subtle show-stopping bugs, period. Bad concurrency isn't really worth doing.


You're confusing naive parallelism with bad parallelism. I've seen bad parallelism, have been bitten by deadlocks and, much worse, subtle bugs that don't always manifest. But I've also had cases with a long loop with no dependencies. It's not that uncommon. Naturally when you try to employ something like this in a high, abstract level, like execute each Actor's "onTick()" method concurrently or whatever, you're likely to be kicked in the balls since an overridden onTick() can do absolutely everything in some arbitrary child of Actor.

Naive parallelism isn't slapping omp pragmas everywhere where you *think* you might have potential concurrency - that's being careless and it will bite you. Naive parallelism is when you positively identify an embarrassingly parallel loop and *then* slap the pragma.

RogueCynic
Posts: 409
Joined: Sun Nov 22, 2009 10:23 pm UTC

Re: Have you written a game?

Postby RogueCynic » Mon Feb 01, 2010 7:19 pm UTC

I learned a couple of business languages in school and another in the field, only wrote one program in the real world. I learned some C/C++ on my own. I'm trying to write a game but I can't seem to find the time or motivation. I don't see why people think they need to use 3d graphics or that they need to market the game. I just want to write one so I can say I accomplished something.
I am Lord Titanius Englesmith, Fancyman of Cornwood.
See 1 Kings 7:23 for pi.
If you put a prune in a juicer, what would you get?

MoghLiechty2
Posts: 629
Joined: Sat Jan 24, 2009 8:55 pm UTC

Re: Have you written a game?

Postby MoghLiechty2 » Mon Feb 01, 2010 8:49 pm UTC

I will ever and always suggest XNA for anyone would like to get into game programming. It's extremely easy to get something going rather quickly while being very powerful. It also has a very nice support network and fantastic amounts of tutorials and documentation.

As for myself, I find myself looking at a career in game development, so I've programmed a few games in my time.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 9 guests