Show Posts
|
|
Pages: [1]
|
|
3
|
Java Game APIs & Engines / Xith3D Forums / Re: 2D map in 3D optimizations
|
on: 2004-04-08 19:10:16
|
Ok, let me explain this with an example (oh and by the way the "zone" partitionning is a good idea!) What I want to do is a terrain like my subdivided with tiles. Let's define what a tile is: A tile is a square subdivided into small triangle making little square. So, a tile has about 10x10 small pane into it. So, that's about 200 polys (triangle). I can modify the poly coords to make terrain effects in it. A tile is also as large as a character in the screen, so it is not big like a terrain. Now, let's define map: A map is made of tiles aligned to each other (with the height of each tiles) Making the map like a Warcraft 3 map. A map can have 64x64, 128x128, 100x50, etc. tiles. Though, I'm just showing what the camera is seeing, let's say the camera is pointing the character like warcraft. So, I just want to show maybe 16x16 tiles. Well, now that's where the problem lies. The basic way to do this is surely a 2D array, containing the tiles informations. tile - [y]
and then getting the character position in the map, x and y, and limiting the vue to x + 8, x - 8, y + 8, y - 8.
now you can loop with 2 for loops like this:
for ( int y = charY - 8; y < charY + 8; y++ ) for ( int x = charX - 8; x < charX + 8; x++ ) if (we're not outside the array && the tile isn't null ) enable( tile - [y] );
ok, it can be a bit long, I thought of another way that is making an array with one dimension like this:
tile[x * y]
// getting the top left 16x16 square depending on the character position topleftSquare = ( mapSizeX * charY ) + charX;
// getting the bottom left 16x16 square depending on the character position bottomleftSquare = ( mapSizeX * charY ) + charX;
for ( int i = topleftSquare; i < bottomleftSquare; i++ ) enable( tile )
I don't know if it's really faster, but anyway.
Another way could be making different BranchGroup, called zone. And when I'm approching of one zone, I enable it. While this solution can be the fastest (perhaps) It can be a problem if I'm in a 40x40 tiles zone and I load up a 40x40 zone.
Or, I could load the map, and divid it into small 16x16 tile not caring of what the map is made of (a "room" could be cut in a half) but the user will not see this, since 16x16 is as large as the screen view.
Any thought is welcome, I'm a bit lost in all this
|
|
|
|
|
4
|
Java Game APIs & Engines / Xith3D Forums / 2D map in 3D optimizations
|
on: 2004-04-08 16:18:33
|
|
Hi all, I can see a lot of new game based on 2D map (ie: all the rts new games). Anyway, though they might use terrain, I was wondering about ways to optimize without terrain.
So if some has some link to some optimized algorythm of a (x,y) map. Sure I thought of showing only some tiles depending on where the camera was, but still, there must be other ways.
thanks a lot.
|
|
|
|
|
5
|
Java Game APIs & Engines / Xith3D Forums / Re: Model scale
|
on: 2004-04-08 15:05:48
|
|
I don't know if setScale(float) works, but what I do is this:
Transform3D tr = new Transform3D(); Vector3f scale = new Vector3f( 0.5f , 0.2f , 0.9f ); // distortionned scale
tr.setScale( scale ); myTransformGroup.setTransform( tr );
|
|
|
|
|
6
|
Java Game APIs & Engines / Xith3D Forums / Re: registerPath and Netbeans
|
on: 2004-04-05 22:13:28
|
Well, I found what the problem is! Netbeans sets the working directory to you home directory. When you run your apps from the java command line it works #1. So I changed the working directory to my project directory and it's fine now! thanks for the help though 
|
|
|
|
|
9
|
Java Game APIs & Engines / Xith3D Forums / registerPath and Netbeans
|
on: 2004-04-04 16:51:00
|
Hi all! I'm having a problem with the textureloader where it can't find my texture. I do something like: 1 2 3 4 5 6 7 8 9 10 11
| texname = "tex.jpg"; tl.registerPath( "../medias/textures/" ); app.setTexture( m_textLoader.loadTexture( texture , "RGB" , mipmap , Texture.BASE_LEVEL , Texture.BASE_LEVEL_LINEAR , Texture.WRAP ) ); |
it says that It couldn't find tex.jpg I tried putting it in the says directory (of the .class) nothing. I work with package, so the structure looks like org/myname/project/prog org/myname/project/medias I thought that it begans to look at the root of the package, but no chance  I'm using netbeans IDE 3.5.1 with java 1.5 thanks alot
|
|
|
|
|
11
|
Java Game APIs & Engines / Xith3D Forums / Re: New to Xith3d need advice on aproach to proble
|
on: 2004-04-01 16:28:23
|
That sounds like a terrain really. If you want to implement a terrain based map you might want to check out the Xith Terrain demo/library.
Tile based maps normally have the constraint that they must support having a different texture per tile. Modifing the height is logically quite simple after that.
Kev But, I really want a tile based terrain like map  Should I use terrain and make virtual tile. And can I assign diffrent texture for different tile let's see an exemple With the terrain I can change every polys height and form. But can I assign grass.jpg to the tile (1,1) and sand.jpg to tile (2,3) ? The system I proposed was different plane (tile) next to each other to build a terrain like map. And if I want, assign grass.jpg to plane (tile) (1,1) and sand.jpg to plane (2,3). If you tell me that I can do this with a terrain, I mean ONE terrain not 2 or 3 "zone", then I'll take terrain. I just want to make things clear here 
|
|
|
|
|
13
|
Java Game APIs & Engines / Xith3D Forums / Re: New to Xith3d need advice on aproach to proble
|
on: 2004-03-31 21:02:34
|
|
Just adding thought about the 2D layed out map.
I thought of something if you want to do more detailed tile like Warcraft 3 or Command & Conquere.
Let's say you subdivid your terrain into plane. A plane is a tile. A plane can have as many poly as you want. But it's always the same size (let's say 4x4 units). What you can do with that plane is:
- play with a height modifier on every point of a polygone. - You can do a simple average of the border height so you can allign it with the tile next to it. - one texture by tile.
You align every tile and you have a terrain like map.... I don't know if it can be good that way?
|
|
|
|
|
14
|
Java Game APIs & Engines / Xith3D Forums / Re: New to Xith3d need advice on aproach to proble
|
on: 2004-03-30 21:26:24
|
You should read about terrain. I also want to do that kind of map (warcraft iii like maps) First, I did like aNt and then displayed them. But, I found that it was slow. And if you have 4-5 layers, it can be pretty slow, even when you show 10x10 squares. So I think having a large plane, subdivised into small planes could be a nice idea. But now you have a problem. If I want to put different texture on it, what should I do. Constructing a new texture (ie: taking a base texture, modify it in memory, and apply it to the plane) Or should I make "plane" category. I think constructing the texture is the best idea. Maybe I'm just off the track, if so, someone could bring me back 
|
|
|
|
|
16
|
Java Game APIs & Engines / Xith3D Forums / Compile or to not compile
|
on: 2004-03-30 21:13:21
|
|
Hi all
I was thinking about structuring stuff, and then I came across this problem. You construct a universe, and then add it some object. Now, you compile the scene to make it "render friendly" (I didn't even understand the friendly part, if someone could explain what it mean !)
Well, anyway, what if I'm making a dynamic world, where I want to add models while it's being rendered. What should I do ? Reload the whole scene and compile it ? It doesn't sound good. Should I recompile the scene whenever an object is being added to it ?
Tnx
|
|
|
|
|
18
|
Java Game APIs & Engines / Xith3D Forums / Xith and MD3
|
on: 2004-03-30 01:32:35
|
|
Now on with the second post. I was running the cooldude's demos, and I have some problem getting them work correctly. I mean, with some of them the texture won't show. And the MD3 demo it all weird. The texture isn't applied correctly.
If someone could help me out. I've install both, java3d 1.3.1 directx and opengl. I've also installed the latest alpha of Xith, and the latest version of JOGL. My graphic card is a NIVIDIA Ti4200 with the latest driver, (56.64).
tnx
|
|
|
|
|
19
|
Java Game APIs & Engines / Xith3D Forums / Xith and Swing
|
on: 2004-03-30 01:29:03
|
Hi, I'm new to the forum, and I'm also new to Xith. I'm working on a game project, we're still discussing the base structure, and I was checking about this Xith3D api. It looks pretty nice. Still, I've done some test with Java3D and I'm unable to do the same thing with Xith. I was wondering if there's a way to integrate Xith INTO a swing template. Not swing into Xith I know it capable of. J3D does it pretty well, but I like the "game loop" of Xith  Well, that's it 
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|