Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (523)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (591)
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  
  Which of these two level method should I use? :P  (Read 962 times)
0 Members and 1 Guest are viewing this topic.
Offline Delta517

Senior Devvie


Medals: 2
Projects: 1



« Posted 2013-05-10 22:04:15 »

Sorry for the bad title, I'll try and explain more Tongue

You see, I'm currently creating a overview 2D type of game, and in that game I'm going to have a big city overview map for the players to roam around in (think GTA and Zelda type). Smiley The problem is that I'm very uncertain on how I should do this. I know a lot of people make tiles and use arrays to make maps in 2D overview games, but since I'm going to create a large map, with alot of free space like streets, I was wondering if it would be better to just make a big background and then use the arraylist method to draw important objects, like building and trashcans, on top of the background again Tongue

What do you think? Smiley
Offline ctomni231

JGO Wizard


Medals: 99
Projects: 1
Exp: 7 years


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


« Reply #1 - Posted 2013-05-10 22:11:30 »

Always go for the most simple method.

Big background images usually take up a lot of RAM. So you have to be careful that you don't use up all your memory when you load the entire map at once. Depending on the size, it will be the easiest solution, but it'll also take a lot of memory to render it all.

Tile maps are a bit better because you can control how much of the map you show at once. Since people will not search up everywhere on a map at once, you can load the map in smaller chunks. IT will save memory and make your game faster depending on the technology used (Java2D, LWJGL, JOGL, etc.)

I personally like using the second method. because not everyone searches every square pixel of a map you create. However, you see the pros and cons of each method here, so it should give you some better insight.

Offline Delta517

Senior Devvie


Medals: 2
Projects: 1



« Reply #2 - Posted 2013-05-10 23:15:53 »

Okay, I see Smiley I'm planning to port the game to android later Tongue Do you think that would be a problem with rendering a big background then? Tongue I know that andorid devices have less RAM than PCs :/
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline nerb
« Reply #3 - Posted 2013-05-11 08:06:23 »

Yep, it can be a big issue on Android. Don't quote me, but on current Android devices you are limited to between 24 and 32MB heap memory, but older devices have as little as 16MB to play with. If you exceed this your app will bail out with an 'out of memory' exception. Large images will chew this up quickly.

If Android is you ultimate aim, then you should probably be looking towards the tile-map approach and re-using textures wherever possible; or at least only loading the segments that you immediately need.
Offline quew8

JGO Coder


Medals: 31



« Reply #4 - Posted 2013-05-11 11:03:55 »

Doesn't Android handle it's "Bitmap memory" (as in images) aside from the rest of your apps memory? Also on android 4.0+ you can request more memory and if you did your file loading in ndk then you can use a lot more memory (you are limited by available memory rather than allocated memory).
Anyway, you can always load sections of the image one at a time and load them into the gl texture as needed.
Offline Delta517

Senior Devvie


Medals: 2
Projects: 1



« Reply #5 - Posted 2013-05-11 15:15:54 »

Yeah, thats a good idea Smiley I'll have the game load up parts of the images which is required Tongue

I'm really not looking forward to learning how to make the map since I'm bad at graphics and stuff like that xD Do any of you guys know a good tutorial on how to code maps in to java games? Smiley
Offline nerb
« Reply #6 - Posted 2013-05-12 00:20:01 »

Doesn't Android handle it's "Bitmap memory" (as in images) aside from the rest of your apps memory?

In general no, they still come out of your allocated memory and hence count towards your memory limit. Although apparently they don't when using OpenGL like you've suggested.

I'm really not looking forward to learning how to make the map since I'm bad at graphics and stuff like that xD Do any of you guys know a good tutorial on how to code maps in to java games? Smiley

A bit of Googling or Youtubing should give you some idea. There is a few 'map design/format' topics on this forum too. I can't for the life of me think of any good tutorials on it, my apologies.
Edit: And if you do go have a search, don't necessarily limit yourself to 'coding maps in java games'. The general principles are the same for any language.
Offline Delta517

Senior Devvie


Medals: 2
Projects: 1



« Reply #7 - Posted 2013-05-12 13:38:14 »

Okay, thanks for all the answers Cheesy
Offline Delta517

Senior Devvie


Medals: 2
Projects: 1



« Reply #8 - Posted 2013-06-06 12:02:41 »

Okay, so I found this thing called Tiled Map Editor which seems really nice! Smiley All I'm wondering about is if anybody out there have used this before and if I can use it with just pure java for my game? Smiley
Offline Andre Lopes
« Reply #9 - Posted 2013-06-06 16:31:57 »

Okay, so I found this thing called Tiled Map Editor which seems really nice! Smiley All I'm wondering about is if anybody out there have used this before and if I can use it with just pure java for my game? Smiley

1  
2  
3  
4  
Java

A library for loading TMX files is included with Tiled at util/java/libtiled-java.
libgdx, a Java-based Android/desktop/HTML5 game library, provides a packer, loader and renderer for TMX maps


https://github.com/bjorn/tiled/wiki/Support-for-TMX-maps

Does that help ?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 138
Projects: 4
Exp: 3 years



« Reply #10 - Posted 2013-06-06 18:43:01 »

No need to pack your .tmx maps with libgdx anymore...http://www.badlogicgames.com/wordpress/?p=2870
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

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

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

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

digdugdiggy (52 views)
2014-11-12 21:11:50

digdugdiggy (46 views)
2014-11-12 21:10:15

digdugdiggy (40 views)
2014-11-12 21:09:33

kovacsa (66 views)
2014-11-07 19:57:14

TehJavaDev (70 views)
2014-11-03 22:04:50

BurntPizza (68 views)
2014-11-03 18:54:52

moogie (83 views)
2014-11-03 06:22:04
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!