Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (594)
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  
  Tile based background in Real-Time Strategy  (Read 1488 times)
0 Members and 1 Guest are viewing this topic.
Offline alaskamatt17

Junior Newbie




Java games rock!


« Posted 2002-12-06 21:23:54 »

My real-time strategy runs way slower than it whould for as simple as it is.  All I have so far is a scrolling background with 400 tiles.  Each tile has a random Image so every map is different.  Even if you load a preset game map it has a random tileset to choose images from and a random background soil pattern.

I was wondering if it was better to create 400 Tile objects with an image each or to put 400 Images through a filter that makes one image out of all 400 images and create 1 BitmapSprite with that Image.  Right now I am using 400 Tile objects and they run verrrrry slowly on a 333 MHz system.  This isn't a huge problem since the game is intended to be played by hardcore gamers, who will almost always have a 1 GHz or higher processor, I just wanted to see if there was a way to significantly cut processor requirements on the game.
Offline zparticle

Senior Devvie




Thick As A Brick


« Reply #1 - Posted 2002-12-07 00:27:31 »

I use a palette of separate images and each map cell points one of them. My MapDisplayExample is using a map with 2500 cells (displaying about 300 of them at a time) and it is very fast.

I am working on a new game where each map (level in this case) contains 28,620 cells and haven't seen a speed problem. Now understand I'm working on a 1.2Ghz system.

I would like to know what your 333Mhz does with the MapDisplayExample. Please give it a try and let me know how it performs.


http://www.java-gaming.org/cgi-bin/JGOForums/YaBB.cgi?board=share;action=display;num=1036252001;start=15

Check this thread, the first message describes how to run the example and the last a link to the latest code.

Edit: Looking at your post again I'm wondering why if you have a map of 400 tile cells you use 400 different images? Is every cell different in appearance? If not then loading a single image for the map would seem to be more efficient. Perhaps this is because of the random requirement you have. In that case I would still create a single map image (as a VolatileImage from the cell images) and blit that to the screen. That should be a lot faster than making 400 drawImage calls.

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.

PocketCrafter7 (12 views)
2014-11-28 16:25:35

PocketCrafter7 (8 views)
2014-11-28 16:25:09

PocketCrafter7 (8 views)
2014-11-28 16:24:29

toopeicgaming1999 (75 views)
2014-11-26 15:22:04

toopeicgaming1999 (65 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (28 views)
2014-11-24 19:59:16
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!