Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 5483 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 ?
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: 57
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


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

[ - 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:

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  

EgonOlsen (47 views)
2018-06-10 19:43:48

EgonOlsen (29 views)
2018-06-10 19:43:44

EgonOlsen (49 views)
2018-06-10 19:43:20

DesertCoockie (214 views)
2018-05-13 18:23:11

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

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

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

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

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

Solater (146 views)
2018-03-17 05:04:08
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!