Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (590)
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  
  Map Chunk system  (Read 2729 times)
0 Members and 1 Guest are viewing this topic.
Offline brian22950

Junior Newbie





« Posted 2012-08-29 11:11:29 »

Hello, guys,
How can i do a chunked map(or a tilemap game) ? Can it optimize  my game ?
Thx,
Brian22950
Offline Mads

JGO Ninja


Medals: 26
Projects: 3
Exp: 6 years


One for all!


« Reply #1 - Posted 2012-08-29 11:20:30 »

I don't think it'd be worth it. You'll go a long way with a simple multidimensional array. Of course, you could legitimately benefit from a chunked map. I just have a feeling this is not the case.

Offline Damocles
« Reply #2 - Posted 2012-08-29 11:31:08 »

Chunking a map / world makes ONLY sense when you either:

-have memory problems
-performance problems

For this to happen you needs to handle a lot of Data (Terrain, structures) or render too many Objects.

See the chunking just as a way to only load and process the part of your world wich is
currently of any interest for the gamelogic.
Other parts of your gameworld wich are too far away dont need to be loaded or can get discarded.

A very simple (and standard) example of "chunking" is to load a new level in a platformer.
You would not load and display all levels at gamestart...

A dynamic example is to split the world into smaller Cubicles, and load only the
next 20 cubicles wich are close to the player.

When the player moves around, some of the cubes get unloaded, and others wich some closer
get loaded.
  
But beware that this also means, that the non loaded cubicles should not be
of any relevance to the AI or collision detection. Anything happening there should be "frozen"


..


Only implement that if you really need it.

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

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #3 - Posted 2012-08-29 11:32:45 »

Chunking a map / world makes ONLY sense when you either:

-have memory problems
-performance problems

Or:

-you're generating the world on the fly.

Although if you're feeling pedantic you could possibly group that into 'memory problems' as it'd be impractical to generate it all at once.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Damocles
« Reply #4 - Posted 2012-08-29 11:36:42 »

memory and performance, you dont want to search and cull 99% of unused elements.

its basically just a method to limit the "scope of relevance"

Also works good for Pathfinding on huge maps, when you dont need to have long walks to be calculated.

Offline loom_weaver

JGO Coder


Medals: 17



« Reply #5 - Posted 2012-08-29 14:10:00 »

I did something like this once:

http://www.java-gaming.org/topics/negative-integer-division/25116/msg/215445/view.html

After probably spending a full week or more getting it to work and all of the side-effects (e.g. loading/saving) I ended up taking it out.  It added too much complexity for its benefit.

Unless your game is a sandbox game like Minecraft then too large of a world map (or a continuous one) is a drawback.  It's next to impossible to add enough meaningful content for the player.
Offline Ultroman

JGO Knight


Medals: 25
Projects: 1


Snappin' at snizzes since '83


« Reply #6 - Posted 2012-08-29 19:18:59 »

Diablo 3? Has a bunch of chunks, and they get strapped together randomly. It's not a bad idea if you want a sort of consistency but also want the player to have a different experience each play-through.

If we're talking about a JRPG game, you could have towns as static locations, but randomize the connections between the different chunks of map. You could even have each area be basically the same with mountains and such, but the roads and decor are randomized, so there are new connections every time you play. It's a huge amount of work, but done right, I think it'd be brilliant.

- Jonas
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.

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

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

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

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

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

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

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

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

moogie (80 views)
2014-11-03 06:22:04

CopyableCougar4 (80 views)
2014-11-01 23:36:41
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!