Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Catacomb Snatch design questions  (Read 1469 times)
0 Members and 1 Guest are viewing this topic.
Offline Frór

Junior Newbie





« Posted 2012-02-28 14:56:52 »

Hello,

I'm starting the development of games under Java and I essentially come from the Business Java (Java EE, Spring, etc.).

I have have average knowledge in AWT/Swing.

I wanted to take a look at the source code of Catacomb Snatch (for which I proudly donated previous week-end) to help me start coding games and I have a few questions about it. I guess everything is related to performance or something like that. On top of that, they had only 60 hours, but I'm quite intrigued by half of their design choices.
  • Why doesn't Mojang use the standard tools of AWT such as BufferedImage but uses a kind of buffer (with their class Bitmap) without going through the AWT paint/update methods? Where can I find more information about this?
  • Why did they rewrite half of AWT for this game (Keys are handled differently, for instance)?
  • Why is there no kind of Manager?
  • Why are nearly all fields public? (and broader: why is nearly none of the  "good practices" ever used?)
  • Why is every art loaded at start rather than lazily?

There is probably something that explains all this, but I just couldn't find anything about it. If such resource exists, could you point me to it?

It's ok if not all questions find answers, I'll try to do it myself then.

Thanks a lot in advance Smiley
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 70
Projects: 15


★★★★★


« Reply #1 - Posted 2012-02-28 15:23:28 »

I wanted to take a look at the source code of Catacomb Snatch (for which I proudly donated previous week-end) to help me start coding games and I have a few questions about it.
I wouldn't recommend it as place to start learning since the game is pretty complex for a first game and its coded in a rush and they've probably had to cut several corners to get it done in time. Try something like the tutorials here.

  • Why doesn't Mojang use the standard tools of AWT such as BufferedImage but uses a kind of buffer (with their class Bitmap) without going through the AWT paint/update methods? Where can I find more information about this?
  • Why did they rewrite half of AWT for this game (Keys are handled differently, for instance)?
AWT isn't really designed for writing games (although its very possible to do so), there are several libraries out there that IMO are a better place to start (like Slick2D). AWT occasionally requires various hacks and tweaks to get working properly for games and proper fast enough rendering (especially for a fast paced game like the above).

  • Why is there no kind of Manager?
  • Why are nearly all fields public? (and broader: why is nearly none of the  "good practices" ever used?)
  • Why is every art loaded at start rather than lazily?
I'd guess the above choices are mostly taken due to the time limitation and there not being enough time to clean up the code, refactor it & limit the scopes on variable and to optimise it properly (such as the loading).
Offline UprightPath
« Reply #2 - Posted 2012-02-28 15:37:05 »

Why are nearly all fields public? (and broader: why is nearly none of the  "good practices" ever used?)

Seems to be a business practice that was original started by Notch. If you go back and read his Blog, you'll see several instances where he states that he does this on purpose because he considers accessors/mutators to be useless boiler plate. At least when your code is being used internally. If it's going to be in an outside project/accessed by others, he can see a purpose.

Even if you look at his other code, including Minecraft (Which you can view if you're attempting to mod it), there are several instances where "Bad coding practices" are used, because a lot of them actually work, even if they're not good.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 51
Projects: 11


Monkey for a head


« Reply #3 - Posted 2012-02-28 17:52:06 »

  • Why is there no kind of Manager?

Because classes named 'manager' are incredibly bad and a sign of a poorly thought out app. http://c2.com/cgi/wiki?DontNameClassesObjectManagerHandlerOrData

Quote
  • Why is every art loaded at start rather than lazily?

Because you don't want arbitrary pauses during the game while resources load. A jerky framerate is not fun.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Frór

Junior Newbie





« Reply #4 - Posted 2012-02-28 17:57:02 »

Note: this was written before Orangy Tang's answer

Thanks for the answers! But I don't find them very useful, unfortunately.

I understand you saying me "start by doing small stuff", but I already did that. My English is not the best and I should have chosen other words than "start coding games". Indeed my experience in game programming is small as I'm starting but it's not zero as well. I'm coding my game for six months now (purely casually, hence the long process), and I've been writing simulation renderers for another 5 years (in AWT).

I understand the factor "limited time" to develop it and I thank you for the indication of Notch's philosophy about accessors: I read his blog and found out what he meant.

Regarding the engine, I'll stick with AWT for the moment, not that Slick (which I also tested) is bad: I just want to start with what I know best.

In that context, I hope my questions make more sense and may actually find answers about how Mojang designed their Catacomb Snatch.  Smiley
Offline mast3rpyr0

Senior Newbie


Medals: 1



« Reply #5 - Posted 2012-02-28 17:57:45 »

I was watching this game being created and it made me want to get into game design too(Also donated for the games). From having no knowledge of game design yesterday(Although a few years of java knowledge), I now have a game loop that renders a map with a character I can control. Also noticed that Notch is a (still active?) member of this site! So thats cool too Smiley Best of luck with your games!
Offline UprightPath
« Reply #6 - Posted 2012-02-28 18:18:37 »

Because you don't want arbitrary pauses during the game while resources load. A jerky framerate is not fun.

Especially since the game has no sense of a "Loading" state. In several games, especially ones that use lazy-loading, or semi-lazy loading, there is some transition between the different game modes. Like, say in an RPG, you have loading between regions, often loading between going between "Movement" and "Battle" states. I haven't played Catacomb Snatch, but I would assume that's it's game loop is sort of like Minecraft and the stuff to have come from Notch, which is mostly transition free gaming.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (10 views)
2014-04-15 03:46:01

UprightPath (23 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (107 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!