Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
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 2281 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.;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  

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

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

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

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

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

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

Solater (98 views)
2018-03-17 05:04:08

nelsongames (179 views)
2018-03-05 17:56:34

Gornova (405 views)
2018-03-02 22:15:33

buddyBro (1065 views)
2018-02-28 16:59:18
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!