Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (524)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (592)
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  
  How to create games like ..  (Read 984 times)
0 Members and 1 Guest are viewing this topic.
Offline syszee
« Posted 2014-06-21 04:08:52 »

You there!

Take a look at this: http://raiyumi.itch.io/the-valley-rule
This is a game made during a ludum dare jam, theme: beneath the surface. Made using mostly stencyl. The art and music make this game such a beautiful play.

Anyways, I could dream about progressing this far in development forever, so let me get to the point! How do games like this come to life? The block placement, level design, etc? I understand this was made in a game studio, which some indie developers actually use in great ways! (Best example, Vlambeer) However, how could this be done without a game maker? I've tried.. and tried.. and tried to create a beautiful game using '.png' files for maps, sprite sheets, etc, however it always fails, due to the following:

1.) My collision system and entity handling system just plain out suck.
2.) The game becomes way to overloaded due to all the handled entities on screen.
3.) I can't freaking make slopes with spirtesheet grids. (Mostly because my collision is directional).


What would be the best collision detected and block placement strategies for games like this? I want to be able to design levels with nice scenery, atmosphere, non-square-only scenery, etc. Although, 8-16 bit platform games are fun, what about the games like this? I always get let down when creating a game because I don't see my vision. My wanted style, the very style I strive so deeply for, is represented in this wonderful and beautiful game, the valley rule! Gosh, if only, huh?

My current system for doing things:
GameObject(Abstract) > ObjectId(Enum) > GameObjects (Player, Block, Coin, etc.) > Handler (With Tick/Render) (Organizes all objects into LinkedList) > Game State (Menu, Level Select, Level 1, etc.).

(Also, levels are loaded from a loadLevel(BufferedImage image) method that reads every single pixel of the image and places objects based on color of pixel. If more than half of the screen has objects, it gets really really laggy, I need a new system!)

The GameObject super class usually includes the following:
• Float x, y
• Float velX, velY;
• Tick method.
• Render method.
• 4 Rectangles for each side of the object, for its collision
• Anything else to check for during game development (Debug Mode, Health, Score, etc.)
• Also, getters & setters for everything.


I want a new system. Can I please receive proper assistance doing so? I want to be unique.. but I feel so locked to the basic style of loading from png files, placing blocks per pixel color, and things getting horrible and messy.

You feel me? (Thanks)
- A



Offline BurntPizza

« JGO Bitwise Duke »


Medals: 273
Exp: 5 years



« Reply #1 - Posted 2014-06-21 04:26:20 »

Usually you can easily define slopes mathematically (a line or curve), i.e. if an entity intersects the line, you know it's colliding. (and can find the point it's intersecting and the displacement vector, etc.)

Also there's pixel-perfect collision, where you render everything to separate offscreen image in solid colors, and detect if the player is in a region of the specific color to determine collision state. And with 32 bit color in the collision buffer you can have up to ~232 different collidable objects on screen at any time, so there's no real limit there.


I could make more comments, but I really need to go sleep as my college orientation is tomorrow morning (!) but I will say that a lot of it just comes from experience. There's really no substitute.
Offline syszee
« Reply #2 - Posted 2014-06-21 04:30:48 »

Usually you can easily define slopes mathematically (a line or curve), i.e. if an entity intersects the line, you know it's colliding. (and can find the point it's intersecting and the displacement vector, etc.)

Also there's pixel-perfect collision, where you render everything to separate offscreen image in solid colors, and detect if the player is in a region of the specific color to determine collision state. And with 32 bit color in the collision buffer you can have up to ~232 different collidable objects on screen at any time, so there's no real limit there.


I could make more comments, but I really need to go sleep as my college orientation is tomorrow morning (!) but I will say that a lot of it just comes from experience. There's really no substitute.

Hmmm, please when you get the chance explain how the pixel perfect collision system works! Also, I have my college orientation next month! Shocked

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline trollwarrior1
« Reply #3 - Posted 2014-06-21 07:45:44 »

How do you create games like that? You just do it.

As you make games, your games will be better each time. You have to finish those games though.
Offline syszee
« Reply #4 - Posted 2014-06-21 15:53:07 »

Yea, but I have no idea how to properly create levels, handler entities, and handle collision. Every time I use my methods the game eventually fails, mostly due to lag. I just want to learn a new style of doing things.

Offline The Lion King
« Reply #5 - Posted 2014-06-21 15:55:25 »

Do you use Java2D

"You have to want it more than you want to breath, then you will be successful"
Offline PandaMoniumHUN

JGO Coder


Medals: 32
Exp: 3 years


White-bearded OGL wizard


« Reply #6 - Posted 2014-06-21 16:12:34 »

Yea, but I have no idea how to properly create levels, handler entities, and handle collision. Every time I use my methods the game eventually fails, mostly due to lag. I just want to learn a new style of doing things.
It really does depend on whether you want to make engines and learn the technical stuff or you want to make games.
All the points that you listed are problems within your engine and not in your game design. Pointing
To answer your problems one by one:
1.) Read up articles and books on collision handling and entity systems. Or you can just ignore the problem and go with existing frameworks like Box2D and Artemis.
2.) Start to use octrees and quadtrees to reduce the CPU load.
3.) See point 1.)

Writing a level designer tool is not hard in 2D (for 3D it gets way more complex), although I would not recommend it seeing that are already great tools for that (like Tiled).

Building your own engine is a hard and cumbersome process, it's mostly only good for learning and getting some experience in how things work "under the hood".
Once you've got that you should rather focus on your games and use great already existing APIs like LibGDX. Smiley

My Blog | Jumpbutton Studio - INOP Programmer
Can't stress enough: Don't start game development until you haven't got the basics of programming down! Pointing
Offline syszee
« Reply #7 - Posted 2014-06-21 16:57:24 »

Yea, but I have no idea how to properly create levels, handler entities, and handle collision. Every time I use my methods the game eventually fails, mostly due to lag. I just want to learn a new style of doing things.
It really does depend on whether you want to make engines and learn the technical stuff or you want to make games.
All the points that you listed are problems within your engine and not in your game design. Pointing
To answer your problems one by one:
1.) Read up articles and books on collision handling and entity systems. Or you can just ignore the problem and go with existing frameworks like Box2D and Artemis.
2.) Start to use octrees and quadtrees to reduce the CPU load.
3.) See point 1.)

Writing a level designer tool is not hard in 2D (for 3D it gets way more complex), although I would not recommend it seeing that are already great tools for that (like Tiled).

Building your own engine is a hard and cumbersome process, it's mostly only good for learning and getting some experience in how things work "under the hood".
Once you've got that you should rather focus on your games and use great already existing APIs like LibGDX. Smiley

Yea, I've been hearing that a lot lately. I actually tried setting up libgdx yesterday but had the worst time doing it. It didn't even work for me. If I just want to use the desktop library, can I just import the library into a project? & Do you recommend any tutorials for libgdx?

I guess I just feel like an impostor. I keep feeling like even though I'm programming practically from scratch, I'm not making anything. Idk, it's hard to explain. It sure has me all depressed right now though!

Thanks!
-A

Offline trollwarrior1
« Reply #8 - Posted 2014-06-21 16:58:45 »

It doesn't matter what tools you use for your project, as long as you stick to it. Even if you spend 1 month making your game engine, if you spend another 11 months working on the actual game it doesn't really matter.
Offline syszee
« Reply #9 - Posted 2014-06-21 17:04:14 »

Yea, I've gotten that.. Smiley I more or less want to know how a few things could work better than my system:
1.) Collision detected. Something separate from the "getBounds().intersects(Object.getBounds())" system.
2.) Level Design & Creation. I'm hearing a lot about Tiled, and I'm definitely going to try and learn how to use it.
3.) Handling objects without heavy loading.
4.) Rendering what is on screen only!

I'm tired of reading from a .png file, placing objects and lagging after 40+ objects. (But wait, how else could I design levels with as much as detail as games like the one I linked earlier, right?) & I'm tired of starting a project and then getting stressed and lost in my own code. It sucks.

Thanks!
- A

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

JGO Wizard


Medals: 99
Projects: 1
Exp: 7 years


Not a glitch. Just have a lil' pixelexia...


« Reply #10 - Posted 2014-06-21 17:18:50 »

Well, you have a final product to look forward to.

This game showed here is heavily inspired by Cave Story. The movement, the learning by doing, and the urge to explore the world is all here. (If you liked this little Ludum Dare game, Cave Story would be a good game to go check out also.) It is not my venture to make the next Cave Story like game, but given that game was built in Flash, it does have a decent shelf-life as it can actually be played online. (Something that Java has lost...)

The Story Behind the Caves...

In terms of just getting the raw game play aspect right, it takes the right mixture of art, coding, and visuals. This person pretty much emulated Cave Story's feel to create a sense of loneliness (which is actually something Cave Story did really well, in my opinion). By taking a hint from Pixel, this game was able to set the tone a lot more quickly. So, in your case, it all comes down to figuring out how to emulate what you want, without outright stealing it. A game can be inspired by another game.

In your case, you have to find the elements that you want your game to have, and tweak them to perfection. No one knows what is going on inside your head. As a collision and entity system that is bad to you may be great to someone else. Another problem is that you are using Java2D, which is probably not a good idea if you want to get this up and running quickly and with a decent speed.

Quote
1.) My collision system and entity handling system just plain out suck.
2.) The game becomes way to overloaded due to all the handled entities on screen.
3.) I can't freaking make slopes with spirtesheet grids. (Mostly because my collision is directional).

There is a way to do this without game maker, logic needs to be separated from the graphics.

A sprite sheet does not handle collision, your program does. If you need examples of how to handle slopes and collision, I suggest you look at some of the documentation behind Sonic the Hedgehog, as they dealt with 360 loops (all using only 2 points of floor collision markers, and 2 points of air collision markers.) Usually, the way you deal with multiple entities is just making sure that you don't render them unless they are needed.

If you insist on using Java2D, just know that each of these parts will have to be coded by hand. Results will take a very long time depending on how much time you are willing to put into each system you have. Honestly, what you should try to do is start with a blank sheet and try to emulate this game with the knowledge you have. When you get stuck, then research a similar platform game (like Mario) and see how they designed the code.

Learn by tweaking, I've been there. You won't know how to do everything, but you can at least try to get what you do know working to your standards. The more you understand, the closer you'll get to your goal. Just don't expect you'll just be able to code this up by tomorrow Tongue.




Offline imagnity

Junior Devvie


Medals: 2
Projects: 1
Exp: 11 years


Coding = Life;


« Reply #11 - Posted 2014-06-21 18:24:23 »

Yea, but I have no idea how to properly create levels, handler entities, and handle collision. Every time I use my methods the game eventually fails, mostly due to lag. I just want to learn a new style of doing things.
It really does depend on whether you want to make engines and learn the technical stuff or you want to make games.
All the points that you listed are problems within your engine and not in your game design. Pointing
To answer your problems one by one:
1.) Read up articles and books on collision handling and entity systems. Or you can just ignore the problem and go with existing frameworks like Box2D and Artemis.
2.) Start to use octrees and quadtrees to reduce the CPU load.
3.) See point 1.)

Writing a level designer tool is not hard in 2D (for 3D it gets way more complex), although I would not recommend it seeing that are already great tools for that (like Tiled).

Building your own engine is a hard and cumbersome process, it's mostly only good for learning and getting some experience in how things work "under the hood".
Once you've got that you should rather focus on your games and use great already existing APIs like LibGDX. Smiley

Yea, I've been hearing that a lot lately. I actually tried setting up libgdx yesterday but had the worst time doing it. It didn't even work for me. If I just want to use the desktop library, can I just import the library into a project? & Do you recommend any tutorials for libgdx?

I guess I just feel like an impostor. I keep feeling like even though I'm programming practically from scratch, I'm not making anything. Idk, it's hard to explain. It sure has me all depressed right now though!

Thanks!
-A

You do not need any tutorial for libGDX. Seriously. Just get SuperJumper demo from "badlogic" in Github and you are all set. That's how I learned libGDX. No other tutorial. Finally, badlogicgames' forum is amazing!

Offline Gibbo3771
« Reply #12 - Posted 2014-06-21 18:31:43 »

Yea, but I have no idea how to properly create levels, handler entities, and handle collision. Every time I use my methods the game eventually fails, mostly due to lag. I just want to learn a new style of doing things.

This stuff simply can't be learnt just by reading, you need to do.

You want to learn how to load levels via external files? Create a level editor, save the information and code a way to load it back in.

You want to learn about handling entities? Look at other peoples code, steal it and adapt it. Seriously.

All the things you mentioned are learnt via trial and error, reading about them alone won't get you anywhere.

I suggest using LibGDX if not already, it will probably help with the lag problem.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline BurntPizza

« JGO Bitwise Duke »


Medals: 273
Exp: 5 years



« Reply #13 - Posted 2014-06-21 20:23:12 »

Java2D is feasible, if you know what you're doing, in which case you probably would rather use something else. For instance, efficient data structures allowing you to quickly resolve collisions and cull off screen entities pretty much has to be a priority from the start.

You may also have to think about how much of a jack-of-all-trades you are actually capable of being, you may only be good at design, or programming, or art, etc. In that case you might try and collab with someone(s) who has the complementary skills. For instance I dabble in electronic music production and I'm pretty capable of the sound design/engineering part, but I'm crap at actual composition.

Storing maps in image files is pretty common and actually fairly desirable compared to some alternatives, however many will also write a level editor tool just speed up development of the actual game. Another consideration. There's also of course pre-made solutions to that as well, like Tiled.

I do recommend an assist like libGDX, look through my recent posts, I told someone else a bit about why it's good for beginners. It really does give a leg up over building everything yourself, esp. when you don't know how to/what to in the first place. At first it feels like "cheating" somehow, it's so good.

And yeah everything Gibbo said is right on the money.

You want to learn about handling entities? Look at other peoples code, steal it and adapt it. Seriously.

good programmers write good code; great programmers steal great code.
Offline syszee
« Reply #14 - Posted 2014-06-22 04:13:37 »

Okay, this is a reply to everyone who mentioned Tiled & Libgdx!!

Thank you! I have begun learning about using the two, and I must say, this is going to be awesome! I'm loving how well the two programs work together. While I do enjoy making my own game framework, this is just unbeatable. In order to get a good looking game out quickly, this'll definitely be the way to go.

While it is a bit confusing grasping the new concept, I'll get it eventually!

Thanks again!
- A

Pages: [1]
  ignore  |  Print  
 
 

 

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

The first screenshot will be displayed as a thumbnail.

toopeicgaming1999 (57 views)
2014-11-26 15:22:04

toopeicgaming1999 (51 views)
2014-11-26 15:20:36

toopeicgaming1999 (10 views)
2014-11-26 15:20:08

SHC (24 views)
2014-11-25 12:00:59

SHC (24 views)
2014-11-25 11:53:45

Norakomi (27 views)
2014-11-25 11:26:43

Gibbo3771 (24 views)
2014-11-24 19:59:16

trollwarrior1 (37 views)
2014-11-22 12:13:56

xFryIx (75 views)
2014-11-13 12:34:49

digdugdiggy (52 views)
2014-11-12 21:11:50
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!