Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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).

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

-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]
DesertCoockie (33 views)
2018-05-13 18:23:11

nelsongames (75 views)
2018-04-24 18:15:36

nelsongames (70 views)
2018-04-24 18:14:32

ivj94 (752 views)
2018-03-24 14:47:39

ivj94 (82 views)
2018-03-24 14:46:31

ivj94 (622 views)
2018-03-24 14:43:53

Solater (98 views)
2018-03-17 05:04:08

nelsongames (179 views)
2018-03-05 17:56:34

Gornova (405 views)
2018-03-02 22:15:33

buddyBro (1065 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!