Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh
Don't make Tetris. If you actually try to make it "right", you'll spend an insane amount of time on the rotation systems: http://www.tetrisconcept.com/wiki/index.php/Category:Rotation_Systems

Yes, there is a wiki just for Tetris, and yes, they have an entire category for all the different rotation systems that games use.

Make something like Pac-Man or Loderunner. They're still really easy to do, and afford you a fair bit more flexibility (level editors anyone?). And you might be able to get people to play them without wasting your time trying to perfectly emulate obscure rotation rules.

Adbot
ADBOT LOVES YOU

Splinter
Jul 4, 2003
Cowabunga!
Tetris Attack actually only has 1x1 square blocks, so there's no rotation to be done. Blocks are cleared by lining up 3 or more blocks of the same color. You move blocks around by using a cursor to swap adjacent blocks. It really doesn't have much in common with Tetris...I have no idea why they named it that. Is this still a bad game to do?

Edit: Wiki for Tetris Attack. There's a screen shot there that should give you an idea of how it plays. New blocks scroll up from the bottom and you lose if any block touches the top. I imagine the trickiest part being the system for making blocks fall when blocks bellow them have been cleared, and the combos that can result from the falling (you can move stationary blocks while other blocks are falling).

Splinter fucked around with this message at 07:12 on Mar 27, 2009

Mustach
Mar 2, 2003

In this long line, there's been some real strange genes. You've got 'em all, with some extras thrown in.

quote:

I want to get into game development (as a hobby for now) but I'm not quite sure where to start.
Do you want to learn how to implement games or do you want to make games? The answer will affect what people recommend — programming languages and libraries, versus engines and programs like Game Maker.

Mustach fucked around with this message at 15:17 on Mar 27, 2009

Splinter
Jul 4, 2003
Cowabunga!

Mustach posted:

Do you want to learn how to implement games or do you want to make games? The answer will affect what people recommend — programming languages and libraries, versus engines and programs like Game Maker.
Implement. I want to avoid programs like Game Maker. Part of the reason I'm doing this is to to get more practice and experience programming.

Twernmilt
Nov 11, 2005
No damn cat and no damn cradle.
This is a cross-post from the Java thread because it just occurred to me that you all might have some insight and advice.

I'm running into an OutOfMemoryError while I'm using a double buffer. It draws the first frame fine, but give me the error when it draws the second frame. I'm new to Java so I'm guessing that I'm missing something simple. Also, if I'm going about this all wrong, let me know.

I'm trying to render only the visible portion of a large image to the screen and then apply a grid over it. x and y are the upper left coordinates on the large image. xres and yres indicate the screen resolution. So it should render only a screen sized portion of the image every time drawStuff() is called. What is the best method for limiting how many frames are rendered per second? Sleep doesn't seem like my best option.

This is the double buffer method (obviously);
code:
code:
private void drawStuff() {
        BufferStrategy buffer = this.getBufferStrategy();
        Graphics backimage = null;

        try {
            backimage = buffer.getDrawGraphics();
            image.draw(backimage, xscreen, yscreen, xres, yres);
    	}
        finally {
        backimage.dispose();
        }

        buffer.show();
        Toolkit.getDefaultToolkit().sync();
}
This is the class that keeps the information about the image and draws it to the back-buffer in the above method.
code:
public class BackgroundImage {
    private BufferedImage grid;
    private BufferedImage background;

    public BackgroundImage() {
        try {
            grid = ImageIO.read (new File("Grid03.png"));
        }
        catch (IOException e) {
        }

        try {
            background = ImageIO.read (new File("Background.png"));
        }
        catch (IOException e) {
        }
    }

    public void draw (Graphics image, int x, int y, int xres, int yres) {
        image.drawImage(background, 0, 0, xres, yres,
                                   x, y, x+xres, y+yres, null);
        for (int i = 0; i <= xres-25; i+=25)
            for (int j = 0; j <= yres-25; j+=25)
                image.drawImage(grid, i, j, null);
    }
}

Twernmilt fucked around with this message at 07:36 on Mar 28, 2009

Morpheus
Apr 18, 2008

My favourite little monsters

Splinter posted:

Implement. I want to avoid programs like Game Maker. Part of the reason I'm doing this is to to get more practice and experience programming.

If you just want experience programming, I personally would suggest the XNA framework. It's really easy to get up and running, it uses C# which is incredibly similar to Java, and a lot of the graphical work is done for you. I'm sure people can list some pitfalls to it; one big one is that to get anyone to actually play your game, they need to install something on their computer as well, but if you're just doing this for yourself then that shouldn't be a problem.

Edit: I can not believe that there is not only a wiki for Tetris, but a page for every one of its rotation systems. I can't believe there are even rotation systems. Some people really really love the game.

flippy
Oct 23, 2005

Splinter posted:

I want to get into game development (as a hobby for now)

From the wiki page you linked, Tetris Attack doesn't look that bad. Tetris might be a bit easier (you don't have to do the cursor movement), but as Avenging Dentist said, the rotations can be a bit annoying. They really aren't that bad if you isolate that behavior and put some tests around it to keep you sane. Pacman is also nice, but it is slightly more complicated in as far as you have to make behavior for the ghosts.

Personally, I would probably start with what you know - figuring out how to write a graphical game and learning a language at the same time can be a bit much. And I would probably go with Java as you can go with the built-in graphics as opposed to finding the different options in C++. You can also write your Java game as an applet and run it in the browser (though that seems to be out of vogue).

This book on Java game development seems to have drafts of the chapters online - might be useful:
http://fivedots.coe.psu.ac.th/~ad/jg/

Of course, having said all of this, I am not following my own advice - I'm using game programming as an exercise to learn Haskell. But I don't think I'd recommend that to anyone unless you are a bit of a glutton for punishment.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
What are the basic controls typically for a 3D tank game? I'm can't remember the last one I played on a PC. I'm thinking mouse to control the turret, W to move forward, S to move backwards. A & D would then just slow down the left track or the right track to turn (if you were holding W or S at the same time). If you hit A or D while you are stationary it will cause the tracks to rotate in different directions, causing you to pivot. Does this sound about right?

fletcher fucked around with this message at 07:12 on Mar 31, 2009

Horn
Jun 18, 2004

Penetration is the key to success
College Slice

Mustach posted:

Do you want to learn how to implement games or do you want to make games? The answer will affect what people recommend — programming languages and libraries, versus engines and programs like Game Maker.

Check out Unity 3D. The newest version adds support for windows. It's not free but there is a 30 day trial and an indy license is only 200 dollars.

terminatusx
Jan 27, 2009

:megaman:Indie Game Dev and Bringer of the Apocalypse

fletcher posted:

What are the basic controls typically for a 3D tank game? I'm can't remember the last one I played on a PC. I'm thinking mouse to control the turret, W to move forward, S to move backwards. A & D would then just slow down the left track or the right track to turn (if you were holding W or S at the same time). If you hit A or D while you are stationary it will cause the tracks to rotate in different directions, causing you to pivot. Does this sound about right?

sounds good to me sir, seems like a pretty typical approach

Rottbott
Jul 27, 2006
DMC

fletcher posted:

What are the basic controls typically for a 3D tank game? I'm can't remember the last one I played on a PC. I'm thinking mouse to control the turret, W to move forward, S to move backwards. A & D would then just slow down the left track or the right track to turn (if you were holding W or S at the same time). If you hit A or D while you are stationary it will cause the tracks to rotate in different directions, causing you to pivot. Does this sound about right?
It would probably be rubbish but I always wanted to do one with a console controller, using the two thumbsticks to control the tracks independently. So you have to push both forward together to go straight ahead.

huge sesh
Jun 9, 2008

Rottbott posted:

It would probably be rubbish but I always wanted to do one with a console controller, using the two thumbsticks to control the tracks independently. So you have to push both forward together to go straight ahead.

That's exactly how Katamari controls. It works pretty well!

Yare
Jan 9, 2008
Legend

Avenging Dentist posted:

Also, design patterns are hacks because they exist to work around missing language features

What? Functions and classes are design patterns too, you know. Just because the compiler for some language is hiding the work from you doesn't mean the principles behind the patterns aren't being applied.

You make your most important decision about which design patterns to exploit when you choose the language for your project.

shrughes
Oct 11, 2008

(call/cc call/cc)

Yare posted:

What? Functions and classes are design patterns too, you know. Just because the compiler for some language is hiding the work from you doesn't mean the principles behind the patterns aren't being applied.

You make your most important decision about which design patterns to exploit when you choose the language for your project.

It's true. Except, by "functions", don't you mean "factories"?

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Yare posted:

What? Functions and classes are design patterns too, you know. Just because the compiler for some language is hiding the work from you doesn't mean the principles behind the patterns aren't being applied.

You make your most important decision about which design patterns to exploit when you choose the language for your project.

Can I just say "lol" in response to this? Because if so



lol

Splinter
Jul 4, 2003
Cowabunga!

flippy posted:

You can also write your Java game as an applet and run it in the browser (though that seems to be out of vogue).
What's in vogue for creating browser games (besides Flash)?

POKEMAN SAM
Jul 8, 2004

Splinter posted:

What's in vogue for creating browser games (besides Flash)?

AJAX

Yare
Jan 9, 2008
Legend

shrughes posted:

It's true. Except, by "functions", don't you mean "factories"?

Nah. Functions as we use them in most languages are a relatively high level construct. Push parameters, jump to location, run code, pop parameters, push return values, jump back. This pattern shows up a whole bunch, so every language higher than assembly has it as a language feature.

And there are many languages where classes don't exist natively, but you can implement the pattern yourself.

OneEightHundred
Feb 28, 2008

Soon, we will be unstoppable!

Yare posted:

This pattern shows up a whole bunch, so every language higher than assembly has it as a language feature.
:eng101: Even a good deal of CPU instruction sets contain instructions for store-and-offset-stack-pointer, store-instruction-pointer-store-stack-pointer-and-jump, pop-instruction-pointer-and-jump, etc.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Yare posted:

Nah. Functions as we use them in most languages are a relatively high level construct. Push parameters, jump to location, run code, pop parameters, push return values, jump back. This pattern shows up a whole bunch, so every language higher than assembly has it as a language feature.

And there are many languages where classes don't exist natively, but you can implement the pattern yourself.

These are not design patterns because they do not solve design problems. They solve implementation problems. Design patterns are models for the relationships between components (e.g. objects), because that is what software design is about. This is also separate from software architecture, which concerns itself with larger-scale issues (e.g. MVC is an architectural pattern, not a design pattern).

Avenging Dentist fucked around with this message at 05:43 on Apr 2, 2009

Yare
Jan 9, 2008
Legend

OneEightHundred posted:

:eng101: Even a good deal of CPU instruction sets contain instructions for store-and-offset-stack-pointer, store-instruction-pointer-store-stack-pointer-and-jump, pop-instruction-pointer-and-jump, etc.

The more you know!

Yare
Jan 9, 2008
Legend

Avenging Dentist posted:

These are not design patterns because they do not solve design problems. They solve implementation problems. Design patterns are models for the relationships between components (e.g. objects), because that is what software design is about. This is also separate from software architecture, which concerns itself with larger-scale issues (e.g. MVC is an architectural pattern, not a design pattern).

Right, but your point was that patterns are hacks meant to emulate missing language features. My point was that they're still patterns once they become a language feature. Also whether the pattern is compiler- or programmer-supplied, it's not a hack.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Yare posted:

Right, but your point was that patterns are hacks meant to emulate missing language features. My point was that they're still patterns once they become a language feature. Also whether the pattern is compiler- or programmer-supplied, it's not a hack.

So you provide some lovely examples and then try to backpedal without providing any support for your claims, all while missing the point entirely. Generally speaking, the addition of a language feature does not merely simplify the use of a particular design pattern; it eliminates that pattern from the language's lexicon entirely.

Reiterating my (old) example: the visitor pattern is often used to emulate (a subset of) dual runtime dispatch. In a language that supports this natively, the visitor pattern simply does not apply. There's no need to create a "visitable" object as in the visitor pattern, either from the application writer's perspective or the language writer's perspective.

What you're forgetting is that design patterns are fairly specific in nature. They don't just describe something you might want to do; they specify how you'd do it. That's why design patterns only apply to a particular language (or sets of related languages). It's fruitless to try and arbitrarily apply design patterns from language A to language B because, many times, the patterns are irrelevant since there's a better way to do it.

In particular, the GoF book exists because of the deficiencies of object-oriented languages in modeling relationships between classes. The patterns show the scaffolding necessary to provide limited support for connecting components in a particular way. The pattern isn't just the connection, but the specific internal workings of the connection. It'd be a pretty pointless book if the section for the visitor pattern were just a single sentence: "You should probably separate algorithms from the data they operate on."

tl;dr: you're trying to say that, in a Sufficiently Advanced Language, all these various patterns still exist, except now they're under the hood. This simply isn't true because a person using SAL's language features would bypass the patterns entirely.

Avenging Dentist fucked around with this message at 06:41 on Apr 2, 2009

Yare
Jan 9, 2008
Legend

Avenging Dentist posted:

What you're forgetting is that design patterns are fairly specific in nature. They don't just describe something you might want to do; they specify how you'd do it.

A fair point, but how would you reconcile it with something like the Strategy pattern? It describes what you want to do, but it can be implemented with a simple language feature (first class functions, or function pointers in a tight spot) or something that requires more architecture like inheritance and polymorphism. Either way you get the same thing done, but in the former case the language handles the bulk of the pattern for you.

I'm sure a lot of people who work in languages with first class functions get the exact effect that strategy performs without having any idea that they're using a pattern.

I guess I just see the line as being a lot fuzzier than you do. Good thing I'm not an enterprise software architect!

Yare
Jan 9, 2008
Legend

Avenging Dentist posted:

It'd be a pretty pointless book if the section for the visitor pattern were just a single sentence: "You should probably separate algorithms from the data they operate on."

See, this sentence is where we disagree. What you wrote is exactly how I see design patterns.

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

Yare posted:

See, this sentence is where we disagree. What you wrote is exactly how I see design patterns.

Those are patterns in design, not design patterns. When people talk about "design patterns" in software, they're referring to the basic outline of patterns as defined by GoF, since that's where design patterns entered software development. This means that a pattern must have a specific structure (e.g. UML) and at least some information about implementation, among other things.

Your definition of "design pattern" is just the intent of the pattern, and that's great and all, but it's not what people mean when they discuss design patterns. You should probably use a different name to disambiguate.

(This is the problem with technical terms. A non-technical reading of the term has a much broader scope, and people then try to apply the term to things that don't make sense to someone familiar with the term.)

Avenging Dentist fucked around with this message at 07:41 on Apr 2, 2009

a slime
Apr 11, 2005

Hate to ruin the party- I'm dicking around with a little overhead low res scroller, and I wanted to get some quick feedback. If you would down and try this control test, I'd really appreciate it.

It feels lovely to me but I think it might just be the lack of animation. Something seems... Off. Get it here (Windows binaries)

edit: arrow keys to move and that is all

a slime fucked around with this message at 07:45 on Apr 2, 2009

Gold Dust Gasoline
Jul 11, 2006

just be yourself and you'll be fine
Pillbug

not a dinosaur posted:

Hate to ruin the party- I'm dicking around with a little overhead low res scroller, and I wanted to get some quick feedback. If you would down and try this control test, I'd really appreciate it.

It feels lovely to me but I think it might just be the lack of animation. Something seems... Off. Get it here (Windows binaries)

edit: arrow keys to move and that is all

The moving is fine, the camera is messed up. It moves pretty choppily.

If you can, smooth it out and it will be fine.

a slime
Apr 11, 2005

Gold Dust Gasoline posted:

The moving is fine, the camera is messed up. It moves pretty choppily.

If you can, smooth it out and it will be fine.

Right, because at the moment the camera can only be positioned at integer coordinates (effective resolution is 320x240 or some poo poo). If I smooth it out by allowing float coords, textures don't align correctly and start doing some crazy poo poo like the following

not a dinosaur posted:

It doesn't happen at all float coordinates, only some. Lower image shows the ugliness.





And so far I haven't really found a solution. Thanks for the feedback, though.

Gold Dust Gasoline
Jul 11, 2006

just be yourself and you'll be fine
Pillbug

not a dinosaur posted:

Right, because at the moment the camera can only be positioned at integer coordinates (effective resolution is 320x240 or some poo poo). If I smooth it out by allowing float coords, textures don't align correctly and start doing some crazy poo poo like the following


And so far I haven't really found a solution. Thanks for the feedback, though.

This have something to do with SDL?

Yare
Jan 9, 2008
Legend

Avenging Dentist posted:

Those are patterns in design, not design patterns.

Oh, goodness. It's little details like this that make me glad I'm not an architect. :)

ValhallaSmith
Aug 16, 2005

Horn posted:

Check out Unity 3D. The newest version adds support for windows. It's not free but there is a 30 day trial and an indy license is only 200 dollars.

I've been trying this out as well now that it supports authoring on windows. Its very handy for simple stand alone games and is about the only reasonable game in town for browser 3d games. Short of requiring someone to DL a plugin for each game.

ValhallaSmith fucked around with this message at 08:00 on Apr 3, 2009

flippy
Oct 23, 2005

Splinter posted:

What's in vogue for creating browser games (besides Flash)?

As far as I can tell, there isn't a 'besides Flash'. I mean, there are many other approaches, but I haven't seen them nearly as much. You can always do Javascript. There are other plug-ins (Silverlight, I saw something called "wild pockets" that they are using at a game jam next week), but people have to download those and they may not be cross-platform. But, depending on what your goals are, these might be fine.

The_Frag_Man
Mar 26, 2005

Splinter posted:

What's in vogue for creating browser games (besides Flash)?

Write a Java applet.

Jaded Samurai
Mar 29, 2004

Yarr ^^_

The_Frag_Man posted:

Write a Java applet.
This man jests, as much as I love Java, applets simply won't cut it.

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

not a dinosaur posted:

Right, because at the moment the camera can only be positioned at integer coordinates (effective resolution is 320x240 or some poo poo). If I smooth it out by allowing float coords, textures don't align correctly and start doing some crazy poo poo like the following


And so far I haven't really found a solution. Thanks for the feedback, though.

Oh hey, I remember this. Did you ever say what the relative scale of your float coordinates was? This almost looks as if you're running into FP precision errors (which seems kind of unbelievable to me).

TSDK
Nov 24, 2003

I got a wooden uploading this one

not a dinosaur posted:

And so far I haven't really found a solution.
It looks very much like you need to check out the rasterisation rules and texel lookup rules, because that's exactly the sort of effect I'd expect if you haven't got the pixel->UV->texel alignment, or pixel coverage right.

a slime
Apr 11, 2005

Gold Dust Gasoline posted:

This have something to do with SDL?

No, it has to do with the way OpenGL is choosing to map textures to my quads.

Hubis posted:

Oh hey, I remember this. Did you ever say what the relative scale of your float coordinates was? This almost looks as if you're running into FP precision errors (which seems kind of unbelievable to me).

Yeah, I kind of come back to this project every other month, get frustrated with the same problem and put it off again. What do you mean by relative scale of my float coordinates?

Alright I just changed some code to allow float coordinates for the camera, and it works :aaaaa: What the gently caress. I've since gotten a new machine and completely switched toolchains, so it was either my lovely old laptop graphics card or something really hosed up with GCC.

Updated version is here, I think it's a lot better. If anybody minds looking at it, I would appreciate knowing if my old problem occurs on other people's machines

Hubis
May 18, 2003

Boy, I wish we had one of those doomsday machines...

not a dinosaur posted:

No, it has to do with the way OpenGL is choosing to map textures to my quads.


Yeah, I kind of come back to this project every other month, get frustrated with the same problem and put it off again. What do you mean by relative scale of my float coordinates?

Alright I just changed some code to allow float coordinates for the camera, and it works :aaaaa: What the gently caress. I've since gotten a new machine and completely switched toolchains, so it was either my lovely old laptop graphics card or something really hosed up with GCC.

Updated version is here, I think it's a lot better. If anybody minds looking at it, I would appreciate knowing if my old problem occurs on other people's machines

No problems here (nice camera motion tracker btw)

I guess my question is, how big are the numbers you're feeding into OpenGL? I'm wondering if you're doing any massive translations, your texture coordinate/world sizes/transform values are particularly large, etc. But, seeing as how it worked itself out, let sleeping dogs (bugs) lie I guess vOv

Adbot
ADBOT LOVES YOU

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Splinter posted:

It really doesn't have much in common with Tetris...I have no idea why they named it that. Is this still a bad game to do?

They're closer than you think. Checking for completed lines or patterns, dropping blocks, keeping score, initalizing playfields... A lot of things go behind the scenes in games and writing something relatively simple like a Tetris clone is a good way to find that out as a beginner.

I say go ahead and do it.

Other games such as Pac Man present their own challenges such as AI, which you won't find in a puzzle game. Pick one of the two and keep working at it until you get it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply