Go on, ask me anything.

  1. I can do about 20k sprites per frame at 60Hz using JDK7 Server, a GTX280, and 2.6GHz i7. In the benchmark I measured this with sprites are all transparent, rotated and animating, and of varying sizes, but not really too fill rate limited. In practice, I find that 2-3k sprites is a reasonable figure to aim at to get 60Hz on a wide range of hardware up to about 5 years old, with some actual game going on as well.
  2. Learn more about OOP :slight_smile:
  3. Thousands of objects on screen is doable; what you need to do is “hibernate” offscreen objects when they are too far away to have any effect. Or put them somewhere else where they are updated much less frequently.

Cas :slight_smile:

Hello. I have a few questions for you princec.

  1. I believe you mentioned that you went to school for programming. How much did your school help you with designing and programming for games specifically and do you think it is/would be much harder to get into game programming without going to a school for a degree in CSE etc? (like for someone who is “self taught”)

  2. When you started programming games did you try and focus on specific areas until you could find other people to help with your projects or did you try and do everything at first (like the art for example)?

  3. Are there certain types of games beginners should master before going off on other projects? For example I’m trying to make an old school 2d rpg with no game programming experience.

  4. You seem to have had a lot of success with game programming and you seem very busy. What makes you take time out of your day to answer questions from all sorts of people? Is going to the forums and answering questions more like a break from writing and more of a fun thing or does it feel like work sometimes answering people questions or helping them out?

  5. Why are you so awesome?

Thanks for your time!

I think the situation today is very different from how it was when Cas went to school, which was like 1950 =D
So you should ask that a lot of people;
If I may comment on how it was for me, or still is: I’m doing a Bsc in “media-informatics” right now. And well… you only learn basic java programming on console level… all theoretically, nothing about how the industry actually does things.
Whenever I brought up practicality or performance, I got shut up.
Only one opinion, but I guess in every field: If you wanna get real good, you need like 1on1 training or a lot of self-learning and experience
bottom line, if you are good at self-learning, its very effective, because you can learn what you need and how you want…

Ehhhh I don’t think Cas is > 70 years old :stuck_out_tongue:

I’m self-taught on every programming language I’ve ever learned, but the formal education, deficient as it was, taught me things like graph theory, complexity and computability theory, stuff I’d probably never have picked up on my own. Even now, I struggle to read papers that use the simply typed lambda calculus, which is something I have books on (namely TAPL) but never had the discipline to read all the way through and do exercises and so on.

Programming languages are a dime a dozen. Once you understand the theory, most of them are just different dialects of the same thing.

making fun of old people =D

OMG! 38 is now old and busted in the eyes of the callow youth!

  1. I went to university to do a “degree” in Computer Science (back in 1991, Cero :)). Unfortunately there was surprisingly little of what I would consider relevant vocational software engineering in it and absolutely nothing related to games programming. Ironically I got bored and skived the relational databases module (ironic because I made an extremely healthy living out of SQL in the ten years after university). Actually as I spent the whole 3 years at university pissed and stoned I find it fairly hard to draw any realistic conclusions for how that particular degree course worked out for me or anyone else. My only advice is don’t do what I did, not because it might mean you will/won’t get some cool job somewhere, but because you’ll end up looking back on it in later life with some amount of regret for having wasted the time.

  2. I started programming games when I was 7, and anyone could do everything :slight_smile: (That was back in 1980 or so). I stayed with doing all my own stuff up until 1994 ish, of course just as a hobby, then I got a “real” job and didn’t think much more about games programming for another 7 years, by which time graphical expectations were so high there was no hope I’d ever be able to draw anything that looked good enough to sell. I realised that to do do art for my games I’d have to have spent the same amount of time learning to do it as I’d spent learning to code. Fortunately Chaz turned up again and the rest is history.

  3. In terms of complexity, 2D games are generally loads easier to do than 3D games; mostly because with a 3D game you spend the majority of your programming time and effort just figuring out how to draw something on the screen and then interact with the 3D world. With 2D you’ll spend the majority of time just making game logic because a sprite engine is a very easy thing to make. Multiplayer games add a whole new level of complexity.

  4. Sheer procrastination, and a genuine desire to see people happy. It is work, yes, but it’s part of the job that I quite enjoy.

Cas :slight_smile:

Ive perticipated in like 10 commercial games, made several indy games (wich only one sold to some extend).
i still dont think to have archived anything in gaming… :frowning:

having too many gameideas in the drawer. but maby Im too lazy to realize any of them in full effort.

Thanks for answering my questions everyone. I’ll probably think of more later when I get better at programming!

Pidly~

Teasing =D
Also you started saying that you are old. Not in this thread, but in general :wink:

just a little thing: you mentioned “bundle your game with a jre 7”
did you experience a significant performance boost from 6 to 7 ?
we still compile everything with 6, so that it works quickly on linux and mac to test with.
obviously I can run stuff compiled which was compiled with 6, with a 7 jre, but I’m just curious about real advantages.

I saw you tweeting about Raspberry Pi, with Kevin’s game on it and all…

Do you really think there is a market ?
I mean I guess Java wouldn’t even work, and would people who buy a cheap device like this spend money on games for it ?

Whoops, didn’t see your last post.

Java 7 = 20% boost in performance or so in Revenge of the Titans, last time I tried some inaccurate measurements.
I still compile for Java 6 too of course. Actually might even be Java 5. I forget.

I don’t care if there’s a market for the RaspPi, I want one :slight_smile:

Cas :slight_smile:

PrinceC: First of all, thank you for this thread. I’ve been coding as a job for over 15 years and as a hobby since the Apple ][ days (which probably makes me one of the oldest guys on this board) and I’m still learning a lot from this thread.

You talked a bit about the public/private key encryption which you used. Could you discuss the actual data flow of how you use that encryption. For example:

  1. Somebody buys your game via PayPal. What exactly happens to make their game work only for them? How is this key generated and given to them? How are you protected from somebody copying their key and handing it to somebody else?

  2. Is there a login check when they start the game? If so do you have a server which checks their key and authenticates it?

Thank you

Greg

How is baby formed?

When a mommy and a daddy love each other very much, they get together and call a special method: createBaby().

The general gist of it is described here on the Puppyblog. The technical part is a simple use of some straightforward Java APIS:



	private boolean validate(PublicKey publicKey, String encoding) throws Exception {
		Signature dsa = Signature.getInstance(SIGNATURE_ALGORITHM);
		dsa.initVerify(publicKey);
		if (encoding != null) {
			dsa.update(name.getBytes(encoding));
			dsa.update(address.getBytes(encoding));
			dsa.update(email.getBytes(encoding));
		} else {
			dsa.update(name.getBytes());
			dsa.update(address.getBytes());
			dsa.update(email.getBytes());
		}
		return dsa.verify(regCode);
	}

	/**
	 * Create the regcode for these user details using a private key.
	 * @param privateKey The private key to use
	 * @throws Exception if something goes wrong
	 */
	public void register(PrivateKey privateKey) throws Exception {
		Signature dsa = Signature.getInstance(SIGNATURE_ALGORITHM);
		dsa.initSign(privateKey);
		dsa.update(name.getBytes(ENCODING));
		dsa.update(address.getBytes(ENCODING));
		dsa.update(email.getBytes(ENCODING));
		regCode = dsa.sign();
	}

BMTMicro calls a servlet with the name, address and email data (we actually ignore the address and don’t use it any more); this generates the regcode using that register() method there.

Cas :slight_smile:

Does that apply for games sold on Steam and Desura? Do they have their own platform-specific registration checks, or do you just skip it?

Steam has its own checks using the (private) Steamworks APIs. We don’t deal with Desura any more because they weren’t making us any money.

Cas :slight_smile:

can I still use BMTMicro without having experience with servlets ? I guess they’re not that complicated though…

BMTMicro simply call a webpage with a GET; how it works on your own server is however you want. I used a servlet because I wanted to use this Java key tech.

You could just as easily use polynomials etc. (eg. like Steam keys), and back them up with serverside verification; in which case a bit of PHP will do the job. The main advantage in the public/private key system is that it is effectively impossible to “crack”, that is, generate keys. That said, if you have any serverside validation, it is similarly impossible to crack because even if you can generate keys on a whim they won’t be in the server database.

Cas :slight_smile: