Technopolies

Started by rolz, October 21, 2004, 04:03:43 PM

Previous topic - Next topic

Kamil

It's normal caleron based on P4. videocard is not integraded.  Hmm car demo from engine zip runs  on averange fps at 75 at 800x600 fullscreen.  

Ok reducing terrain details gives me about 35fps.

EgonOlsen

The P4 based Celeron is a weak CPU greatly handicapped by its lack of second level cache (only 128KB). It is especially bad in 3D games/applications and your clock rate is quite low. If lowering the details helps, you are most likely CPU limited. Have you tried Paradroidz? How fast is that one running?
For reference: Technopolies runs at around 40fps (starting position/1024*768/all setting default) on a PIII-866Mhz with 512MB SDRAM and a GeForce4Ti-4400. Due to the weak CPU, it drops down to 15 fps in situations where many many bots are visible, but it remains playable.

Edit: Here's a little benchmark based on the car-example: http://www.jpct.net/download/carbench.zip It can be run in "native" mode (st_opengl.bat) and "awt" mode (mt_opengl.bat). It would be interesting to see what your setup can score in this one (53/48 on the PIII mentioned above).

Kamil

st_opengl.bat :
fps : 54.10

mt_opengl.bat :
fps : 46.96

EgonOlsen

That's almost on par with the PIII-866...i'll try to get some reference values for a similar machine to see if this is normal for such a setup. I fear it is... :cry:
BTW: The current record in this benchmark are 381fps scored on an overclocked dual core P4 Presler... :shock:

Kamil

I've just played Paradroid (highscore list 736 ;) ) .  Depends from scene, fps were 50-80, but mostly around 70.

EgonOlsen

Speaking of that old PIII, i've tried to run Techno on some old graphics cards lying around here. It runs fine on a Kyro2 chip with 64MB. Slightly slower than on the GF4, but not much. However, blitted text was blured...maybe you are using a texture for that that is too large for the Kyro2 to handle? I couldn't find the chip's exact specs anymore, so i don't really know what max texture size it supports. I remember something like 1024*1024, but i'm not sure. (pic1, pic2)

Edit: Found the specs: It is 1024*1024.

Then, i tried to run it on a Voodoo5-5500...it didn't work... :cry: But neither did Paradroidz. Both started fine in windowed mode but only managed to survive a few seconds before crashing. I've tried different drivers but to no avail. Well, it's a long gone card anyway...

rolz

Yes, I actually use 2048x16 texture for bitmap fonts. Will try to see if if can be changed to 1024x32
Regards,
Andrei

Anonymous

Quote from: "rolz"Yes, I actually use 2048x16 texture for bitmap fonts. Will try to see if if can be changed to 1024x32

:evil: Andrew, it's a good practice to use only (strongly preferable) square textures ;-) so, you'd better use 192x192 texure, and place your font here.

PS. It's Mike :-D

rolz

#293
- improved texture generation

Textures are now generated using more clever algorithm:

Fine transitions between textures:
*Removed*

Coarse transitions:
*Removed*

Not sure what of these two methods is better, they both make terrain look better than ever before. ;)
Regards,
Andrei

EgonOlsen

I'm not sure either. I think i prefer the fine transitions when looking at the texture alone but seeing it in game could be a completely different story.

rolz

#295
Yes, fine transitions look better when applied to the 3d terrain:
*Removed*

some more additions:

- Olbridge location has been converted to a single big map (it should take about 10-20 minutes to reach from one corner to another)
- It appeared that texture generation takes some time (172 textures, 128x128 each - 10-30sec.), so i decided to generate them at first start and store on disk.
- added some improvements to terrain generator. Basicly, what i want is to generate terrain and decorations on the fly - to allow smooth changes between locations.
Regards,
Andrei

rolz

#296
- terrain is now generated on the fly, this will allow maps to be really huge and continuous.
- some improvements for game quests/scenario

Auto generated terrain. Works fine with shadows.
*Removed*

Olbridge Map so far:
(lots of small dots near radford are trees. the small orange square is the bunker)
*Removed*
Regards,
Andrei

manumoi

As usual, your screenshots are amazing.
I have 2 questions :

Where did you get your trees? Do you know somewhere where i could find free low polygons trees with texture?

Could you explain the algorithm you used for your transitions and for rendering the terrain? And also what is the method you use for shadow?

Thanks

Manu

Uija

I bought lots of tree and other naturestuff in 2 packs from here and I am quite happy with them. There are some free trees too, to test.

rolz

sorry for late response folks, i dont have much time lately. ;(

regarding models - trees are quite simple, you can use them. Just unpack client.jar and check resources1/static/trees for model and textures

regarding texture generation, it's actually an RGB filter which i use to mix 4 textures - one per each vertex, here is the code. It's rough and somewhat code dependent but.. anyway - it's enough to explain the idea


   private static class MixFilter extends RGBImageFilter {
       BufferedImage [] images;

       int size = 0;

       public MixFilter(Terrain3D []terrains) {
           images = new BufferedImage[terrains.length];
           for (int i = 0; i < terrains.length; i++) {
               Terrain3D terrain = terrains[i];
               images[i] = (BufferedImage) terrain.getImage();
           }

           size = images[0].getWidth();
       }

       public int filterRGB(int x, int y, int rgb) {

           double maxLen = Math.sqrt(2) * size;

           double[]weights = new double[images.length];

           weights[0] = (maxLen - 1 - Point.distance(x, y, 0, 0)) / maxLen;
           weights[1] = (maxLen - 1 - Point.distance(x, y, size, 0)) / maxLen;
           weights[2] = (maxLen - 1 - Point.distance(x, y, size, size)) / maxLen;
           weights[3] = (maxLen - 1 - Point.distance(x, y, 0, size)) / maxLen;

           if (Math.random() > 0.2)
               return getFineRGB(weights, x, y);
           return getCoarseRGB(weights, x, y);
       }

       private int getFineRGB(double[] weights, int x, int y) {
           double r = 0;
           double g = 0;
           double b = 0;
           for (int i = 0; i < weights.length; i++) {
               weights[i] = weights[i] * weights[i];
//                weights[i] = Math.pow(weights[i],2.5);
           }

           double weightsSum = 0;
           for (int i = 0; i < weights.length; i++) {
               double weight = weights[i];
               weightsSum += weight;
           }

           for (int i = 0; i < weights.length; i++) {
               weights[i] = weights[i] / weightsSum;
           }

           for (int i = 0; i < weights.length; i++) {
               double weight = weights[i];
               Color col = new Color(images[i].getRGB(x, y));
               r += (col.getRed() * weight);
               g += (col.getGreen() * weight);
               b += (col.getBlue() * weight);
           }
           return new Color((int) r, (int) g, (int) b).getRGB();
       }

       private int getCoarseRGB(double[] weights, int x, int y) {
           double weightLimit = 0;
           for (int i = 0; i < weights.length; i++) {
               if (i < weights.length - 1) {
                   double lim = 0.2 * (0.5 - Math.random());
                   weights[i] += lim;
                   weightLimit += lim;
               } else {
                   weights[i] -= weightLimit;
               }
           }

           int idx = 0;
           double maxWeight = 0;
           for (int i = 0; i < weights.length; i++) {
               double weight = weights[i];
               if (weight > maxWeight) {
                   maxWeight = weight;
                   idx = i;
               }
           }
           return images[idx].getRGB(x, y);
       }
   }
Regards,
Andrei