Starting a new project..

Hi there,

So I’m looking to start something official, a project for the summer. I want to actually finish a game, rather than start and push aside. However, before I can do this, I absolutely NEED to know a few things. Please answer any question you see upon reviewing this thread, it’ll help me out quite a bit!

1.) How exactly should I go about sizing objects, the main window, etc. I want to work off of a system where you can change the resolution, which is how most games do it, based on a specific set of rations. I also want to know the perfect size for sprites. I’ve been using 16x16, 32x32, and 64x64. However, 16 is to small, 32 is… mehh… and 64 is just kinda to big for small windows. (PS. Whenever resolution is changed, sprites are scaled larger, as well as text, any pretty much anything that is on screen. Basically magnifying the screen).

2.) What exactly is ‘clean code’?

3.) What steps should I take within the game? What order? (Planning, Sprite/Character Design, Programming, Mechanics, Story, etc).

4.) How exactly do particles and little text effects work? (For example, taking damage and a little “-1” pops up then fades away. Or picking up ammo and seeing “+20” pop up then fade away.)

& finally, 5.) How should I tackle handling entities? I’ve been using a handler that cycles through a LinkedList of entities and ticks/renders the selected (or initialized) entity, however this causes many problems for me…

Thank you for reading!
I am hoping to start something soon. Perhaps for my college entry or something.

Also, how easily could I achieve basic lighting?

I will answer these to the best of my ability so forgive me if I mess something up.

  1. There are a couple of ways that you could go about doing this. First way: Everything is based off of a default resolution. You scale things (position and size) based on the current resolution / default resolution. Second way: You multiply everything by an orthographic matrix. Everything automatically scales and moves. For sprite size, you aren’t constrained by powers of two! Make them whatever size is good. With that being said, always scale by powers of two so that you don’t get distorted sprites.

  2. This would be code that is modular, easy to read, and not duplicated. It usually takes a long time and a lot of refactoring to achieve something like this. You often go into a project trying to have clean code from the start. You hit a point though, where you just want to get something working, so you create bad code.

  3. Planning -> Story -> Programming / Mechanics / Gameplay -> Sprite / Character Design -> Refinement -> $$$
    Feel free to take some of these out of order.

  4. I’m not an expert at this, but you would basically just have a bunch of little sprites that have a life, color, texture, etc. Then, you just increase the age until it is old enough to ‘die’. Then you would remove it from the list. You could also set the transparency to the age to get some sort of fading out / in effect.

  5. What problems are you experiencing? Also, if you have an entity, shouldn’t it be initialized to be a part of the list? Why would you have uninitialized entities?

  6. Are you looking for per-pixel, or for more of a retro style of lighting?

Honestly, there is really no set value for these things. I mean, I’ve come to prefer windowed applications rather than full-screen, but it totally depends on the game you are making. My resolution of choice of late has been 800 x 600. I have no real reason for it, but I also leave the ability to re-size. I mean, a good resolution is something the player can see after all. Seriously, there is a difference programming for a mobile phone and a high end-PC. Resolution isn’t a set value.

The same goes for sprites, the bigger they are, the more detail. So I scale small ( 8 x 8 ) if I want the game to look retro, and large (128+ x 128+) if I want some good detail. Again it depends on the game and the style of how you want it to look. Basic rule, bigger sprites… more detail. If you are just starting and you don’t have an artist… try to go smaller.

[quote=“syszee,post:1,topic:49493”]
"Clean Code is about recognizing that your audience isn’t just a computer, it’s real-live humans! Clean code is a reader-focused development style that produces software that’s easy to write, read and maintain. "

[quote=“syszee,post:1,topic:49493”]
Planning - Mechanics & Sprite/Character Design & Story
Programming (Alpha - Beta) - Mechanics & Sprite/Character Design
Polish - Sprite/Character Design & Story & Programming

[quote=“syszee,post:1,topic:49493”]
Literally, fading effects are done with a combination of the timer and setting transparency. Usually, you just set the transparency to a value and alter it based on the timer.

[quote=“syszee,post:1,topic:49493”]
Well, you have to use some sort of array based format, like a factory, and Arraylist, or a basic array. The fact is you have a lot of items and they all have to be organized in some way. There is a lot of ways to accomplish this, but the best is just to look at the various tutorials that exist and emulate their systems for handling entities. It truly is game specific. I’ve gotten away with a simple int[] sometimes, and other times I needed a tree of classes. It totally depends.

[quote=“syszee,post:1,topic:49493”]
Basic lighting can sort of be achieved by drawing a lightened texture over the area using polygons, but I’d just suggest picking up LibGDX and learning about LWJGL if you want some really good lighting effects.

Wow thank you for providing such detail!! It all really helped a lot! Especially the age/die thing. What is the easiest second loop?

if(System.currentTimeMillis() - timer > 1000){
timer+=1000;
age++;
}

if(age >= 3) die();

??

& For the lighting, yes… more retro! :slight_smile:

Thank you for the detail! ^^ The way of particles I’m being opened up to makes so much more sense than me trying to figure it out in my head…

You could have the particle method… and its render… and of course tick…
setting it so that it dies whenever the set age is met… now I just need a really clean and easy second timer…

& Yea, I’m thinking of giving libgdx a try soon. :slight_smile:

Actually, regarding you say you use 8x8 for small sprites… wouldn’t that make the object in game harder to see?

Yes.

That is the smallest I ever went with a sprite. That sprite was for a checkerboard piece and it was visible enough to see. I mean obviously, it will be harder to see if it is smaller… but you have to do a lot less detail (faster art). Game making is up to judgement, so don’t take everything stated as 100% solutions to your problems. Making judgement calls is one of the most important parts of game making. As I said before, it depends on the game you want to make…

On the size, I like to use 40x40 or 45x45 pixels, but that’s just my preference.