Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Mechanics / Content of the tiles in a tile map on: 2014-08-21 22:45:17
I'm working on my first game, and therefore I lack experience with the design of the complex systems, the best way to do things and so. That's why a seek advice.

First, I'll try to briefly describe how I handle the tile map now: my map is infinite size (I procedurally generate it), and I divide it in chunks (I'm inspired a lot by minecraft for this game). Each chunk consists in a 2-dimensional array, that currently stores instances or instances of subclasses of the Block class (I know mixing both is a really bad approach, the way I'm doing it). Also, the chunks are stored in a Map <Point,Chunk> (being Point the coordinate of the Chunk) which is a field in the class ChunkManager(for the lack of a better name). Finally, one field of the World class is a ChunkManager.

Then, my problem lies within the Block class. I don't know which approach will be the best (if there is such thing):
1-Store a byte/short/int/whatever, and then lookup in a Map which Block subclass does it belong to.
2-Store a Block subclass, which would store the light value of the tile, the x and y coordinates, a reference to the ChunkManager and other things.

Now I would probably go with the first, but I wanted to be able to do thing like chunkManager.getBlock(5,6).explode() instead of BlockMap.getBlock(chunkManager.getBlockId(5,6)).explode(chunkManager,5,6). On the other hand, I would like to avoid the duplication of the coordinates (they would be both in the Block subclass instance and in the position of the block in the chunk plus the position of the chunk in the map multiplied by the side of the chunk) and in general storing more information than necessary.

Note: I'm not looking for third party solutions (feel free to recommend them though), I want to implement it myself.

Anyway, what is your view on the problem? Please tell me which option is better, or another if you think those two aren't right. Thank you for your help and for reading the whole thing.

TL:DR: Should I just store an int for each tile that corresponds to a type of tile, or an instance of the type of tile along with other useful (but duplicated) information, as the coordinates?
2  Game Development / Newbie & Debugging Questions / Re: Noob thinking about trying to use a library on: 2014-01-14 16:42:09
Thank you for all the responses  Cheesy , now I know that libgdx is the way to go.

Also, about loading and unloading parts of the map, I meant to ask if libgdx would load the images just in the screen and unload them when they go out, or if Id have to handle the loading and unloading part myself.

On the lightning part, I think Ill try to finish the engine I started making.

Finally, where can I find easy resources to get started in libgdx?
3  Game Development / Newbie & Debugging Questions / Noob thinking about trying to use a library on: 2014-01-13 19:00:01
Lets be honest, Im a noob in java (that's why I am here) trying to make a game similar to Minecraft (Im aware that this is an ambitious project for a starter, but it's helping me to learn stuff) but in 2D (not platformer 2D, but Zelda like 2D). However, I feel like things are going too slow...  Undecided So far, I hava managed to make:


The graphics:
-An ortographic view (if it is called so the view that moves with your character) using paint() method to draw things (I know it's a terrible idea, right?), which supports floating point movement and rescaling, and renders blocks as colored points.
-A crappy lightning system (yet I managed to make it cast shadows).

Gameplay:
-I can move my character around, and it collides with walls (this is sad).

Engine:
-The world is infinitely generated using Perlin noise (so far just walls and empty spaces).
-The world is generated and divided in chuncks, whose side can be modified.
-Each chunck is composed of blocks, each one with its own id and lightning.

An ugly starting menu


The last thing I did was the lightning system, which was hard (for me), and Im a little frustrated. So I thought I should stop messing around in my paint() method, and instead move to a suitable engine ("engines" I have used so far: console, JLabels with an image, and curent one). But I'd like to ask some questions before making that move:

-What is the best (I hope I dont start a flame war with this) java engine/library for 2D games?
-Is that engine/library capable of loading/unloading regions of an infinite grid? (this might be a stupid question)
-Has that engine/library anything to make lights?
-Is the engine/library easy to learn for a noob? (I know how to handle basic java stuff, and a little of Object oriented programming, but nothing more).
-Does that engine/library provides an easily accessible particle/sprite system?

Keep in mind that I dont want something that makes everything for me, but Id like to concentrate in the random generation and enemy AI of my game, rather than in the graphics...

Btw, this is my first post in this forum Grin .

PS: Who designed the little "test" to validate an account?. Im just curious, I didnt expect that kind of thing...
PS2: If I made an spelling or grammar error, dont be so hard on me, Im not a native speaker (but point it out, so I learn from it)  Smiley
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

rwatson462 (30 views)
2014-12-15 09:26:44

Mr.CodeIt (23 views)
2014-12-14 19:50:38

BurntPizza (50 views)
2014-12-09 22:41:13

BurntPizza (84 views)
2014-12-08 04:46:31

JscottyBieshaar (45 views)
2014-12-05 12:39:02

SHC (59 views)
2014-12-03 16:27:13

CopyableCougar4 (57 views)
2014-11-29 21:32:03

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

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

toopeicgaming1999 (32 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

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
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!