Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (499)
Games in Android Showcase (118)
games submitted by our members
Games in WIP (567)
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  
  streaming in 2d map  (Read 3904 times)
0 Members and 1 Guest are viewing this topic.
Offline JESTERRRRRR

Senior Member


Medals: 7
Exp: 1 year



« Posted 2014-04-04 04:23:40 »

Hi, after some general advice

I have this 2d game world I made a while back

It consists of 121 segments, each having 75x75 tiles, with each tile having the following variables:

12 bytes and 5 booleans (each tile has 4 'layers') - blocked, and 4 each of: atlasX, atlasY, flipped, rotation (for the texture)

Each segment is stored as a .txt file currently, 1 line per tile, with either an 'e' (empty) or a 'c' (same as most common tile which is stored in the first line) or a number with all the data, e.g. 2206001918001918001918000.  The total file size of all the 'segment' txts together is about 5mb. Each tile image is 16x16, and all 625 textures are packed into 1 image (texture atlas type thing - 512x512).

I was hoping someone could offer me some advice for making this into an android game, as while I've made plenty of 2d games in Java I have never tried for android (probably using Libgdx).

My intention is to 'stream' segments in so no loading screens, with 9 at a time, the the center and the 8 surrounding the player. I'm not sure if these are too big, and I should perhaps make segments say, 30x30 or something? Is this even a realistic aim for android?

Also, what is the fastest way to load data on the fly in your experience? I've read that serialization is extremely slow. Is my 512x512 image size going to be a problem? I'm gonna need another for player sprites, which will be 512x256.

Finally, any recommendations for how I should handle the file format of my maps?

Offline Endos
« Reply #1 - Posted 2014-04-04 06:51:19 »

To manage the maps the best thing you can do is use one of the tools supported by the framework/engine you are intended to use.
For libgdx you can use Tiled, and then simply use the libgdx tmx map loader. And your texture sizes are not a problem, they must work just fine.

Bored Birds - End with your boredom for Android
Retroships - Space Shooter for Android
Ultimate - 2D Side-Scrolling Platformer project
Offline JESTERRRRRR

Senior Member


Medals: 7
Exp: 1 year



« Reply #2 - Posted 2014-04-04 13:58:33 »

Ty Endos. I am reluctant to use tmx though, as far as I'm aware It doesn't allow me to rotate tiles, which I need.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #3 - Posted 2014-04-04 15:08:08 »

its save to say that you will need to write something on your own

Tiled/tmx is not what you need here, you want customized stuff, plus the streaming...
I always write my own level editors.
This is our old one, working on a new one though, since this was still for slick and was never 100% ported to libgdx:
<a href="http://www.youtube.com/v/Vyl-B7aULOo?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/Vyl-B7aULOo?version=3&amp;hl=en_US&amp;start=</a>

as for streaming, well, this is a tough one. But an obvious one.
I have never done a continuously streaming world ala GTA, but I was always intrigued to make one.

So lets have some other people comment that may have some experience

Offline Cero
« Reply #4 - Posted 2014-04-04 16:23:07 »

found this randomly



Offline JESTERRRRRR

Senior Member


Medals: 7
Exp: 1 year



« Reply #5 - Posted 2014-04-04 16:47:55 »

Yours looks really nice/professional. I made my world with an editor I put together when I first learnt lwjgl, its horrible but does the job.

Yeah I have done a streamed open world with TMX and libgdx before, but obviously using a PC made it possible; I had to have a seperate TiledMapRenderer object for all 9 segments. I've no idea of what balance I should be looking for in terms of how much world I store in RAM vs how often to load, #x#.

Anyway here is a picture for anyone interested

world map: http://i.imgur.com/frPkiyM.jpg (too big to post, pink is a hidden path)

this is the club in the bottom left

Offline Endos
« Reply #6 - Posted 2014-04-04 19:13:16 »

Ty Endos. I am reluctant to use tmx though, as far as I'm aware It doesn't allow me to rotate tiles, which I need.

You can rotate tiles with Tiled, just so you know.

Bored Birds - End with your boredom for Android
Retroships - Space Shooter for Android
Ultimate - 2D Side-Scrolling Platformer project
Offline JESTERRRRRR

Senior Member


Medals: 7
Exp: 1 year



« Reply #7 - Posted 2014-04-05 04:46:18 »

Oh cool, is that new? Do you happen to know if the TMX loader and renderer in libgdx allow it?
Offline LiquidNitrogen
« Reply #8 - Posted 2014-04-05 05:07:30 »

Wow, that is an epic map!  Grin

Offline Endos
« Reply #9 - Posted 2014-04-05 10:57:20 »

Oh cool, is that new? Do you happen to know if the TMX loader and renderer in libgdx allow it?

It's not new, and it works just fine in libgdx.

Bored Birds - End with your boredom for Android
Retroships - Space Shooter for Android
Ultimate - 2D Side-Scrolling Platformer project
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline JESTERRRRRR

Senior Member


Medals: 7
Exp: 1 year



« Reply #10 - Posted 2014-04-06 16:57:44 »

I didn't know that, so thanks Endos. And ty liquid, I hadn't done anything with it for ages, but figured it'd be a shame to not try and make it into something.
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.

Pippogeek (39 views)
2014-09-24 16:13:29

Pippogeek (30 views)
2014-09-24 16:12:22

Pippogeek (19 views)
2014-09-24 16:12:06

Grunnt (45 views)
2014-09-23 14:38:19

radar3301 (27 views)
2014-09-21 23:33:17

BurntPizza (63 views)
2014-09-21 02:42:18

BurntPizza (33 views)
2014-09-21 01:30:30

moogie (41 views)
2014-09-21 00:26:15

UprightPath (50 views)
2014-09-20 20:14:06

BurntPizza (54 views)
2014-09-19 03:14:18
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!