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 (568)
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  
  Rules for loading images at one time ?  (Read 2074 times)
0 Members and 1 Guest are viewing this topic.
Offline Serethos

Junior Member




Java games rock!


« Posted 2003-11-16 07:31:34 »

is there any rule of thumb for loading/referencing a bunch of images at once for a level/a whole game ?

imaging a 2d-scroller. should i reference all tiles for a level at the beginning and where is the limit ?

or a card game with different deck-themes ... loading on demand or at the beginning ?


finally,  what size does an image-reference have ? is the whole pixel-array loaded into memory (so memorysize ~ image size) ?
Offline Jeff

JGO Coder




Got any cats?


« Reply #1 - Posted 2003-11-19 02:14:09 »

In  General...

Game assets get loaded before game play starts.  This is in order to prevent delays in user response.

So for instance, in a level based game, typically all assets get loaded before the level play starts.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline Jeff

JGO Coder




Got any cats?


« Reply #2 - Posted 2003-11-19 02:19:55 »

Quote
finally,  what size does an image-reference have ? is the whole pixel-array loaded into memory (so memorysize ~ image size) ?


Depends on  what kind of Image you are talking about.  Java supports many types (Images, BufferedImages, Volatile Images, etc)  In general all types immediately allocate the memory necessary to hold the entire image in the appropriate form.

The memory though does not necc contain all the Image data.  Using the traditional Toolkit getImage mechanisms the memory is allocated immediately but the image is loaded into it asynchronously.  If you wish to wait until the image data is fully loaded then you need to use a MediaTracker object.

A Volatile image represents shared video memory so a VolatileImage can lose its contents at any time and need to be refreshed.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Serethos

Junior Member




Java games rock!


« Reply #3 - Posted 2003-11-19 11:27:11 »

ok, i my view lays on the getImage() methods used with a mediatracker. in that case the data is completely stored in memory. my problem is, that i have no "feeling" about memory usage. if i program a 2d-space-shooter like Xenon or Raptor, then i have many background tiles, the ship sprites, weapon effect an so on. but it seems to be necessary for non stocking performance to load all at the beginning ...
Offline Serethos

Junior Member




Java games rock!


« Reply #4 - Posted 2003-11-19 11:30:45 »

ohh, btw:

perhaps you know 2d-games (especially for old game-stations) like zelda. there you are only free to move over a map which is perhaps 3times of monitor view. after that the avatar exits and reaches another "larger" map.
is this limit set for loading new images or only for limiting the tile-map array size ?
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #5 - Posted 2003-11-19 11:52:21 »

Quote
after that the avatar exits and reaches another "larger" map.
is this limit set for loading new images or only for limiting the tile-map array size ?

Bit of both, but mainly the second I'd say (going from experience coding the GBA). Since the consoles actually had built in support for tile rendering they have a section of ram reserved for the tile map, which is limited in size (and varies depending on the draw mode). Typically max size is from 256x256 to 1024x1024.

Also, loading in images while running is much simpler on these consoles - the data just has to be streamed in from one place on the catridge to the vRam, no modification needed so DMA method can be used.

For your app, just load everything at the start of a level (and try and cache images already loaded from the previous one). If you find thats not working then you can rework it later.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #6 - Posted 2003-11-21 00:58:36 »

Think about  web pages that load 400x400 images or so.  Thats not too unreasonable is it (a 50k gif?)?  Think of how many tiles and sprites you can fit in one 500x500 image.  I've never had an artist, so thats never been a problem for me!

Those old consoles are pretty neat; I've been thinking of a 'general purpose' console applet with a simplified vm; heh heh and mode7 rendering....  alot of work for little gain though Sad
Offline ENC

Junior Member





« Reply #7 - Posted 2006-10-18 01:51:52 »

IF you ask me... rules are meant to be broken... it more of a guideline rather than a rule.. as there are many ways good and bad, fast and slow ways to solve the problem.. ^^
Offline woogley
« Reply #8 - Posted 2006-10-18 01:55:55 »

ariiiise, zombie thread! feel life RUSH into your veins!!

*hummm*
Offline ENC

Junior Member





« Reply #9 - Posted 2006-10-18 01:59:58 »

lolz... I really think reading older threads makes you more wiser.... and remember the times when you had to put your first post.. really makes you seem like you were an idoit and that time and now a pro at this time.. ^^
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline woogley
« Reply #10 - Posted 2006-10-18 15:23:20 »

yeah but why reply? surely the conversation is over after 3 years Smiley
Offline ENC

Junior Member





« Reply #11 - Posted 2006-10-20 02:03:28 »

See if anyone has any bright ideas to the topic.. some people do not realy see the date before posting (No insults to those people out there!) SO yah.. hope that these posters will post something userful... haha
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.

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

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

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

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

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

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

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

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

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

BurntPizza (55 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!