Shooter game.

Blitz3D Forums/Blitz3D Programming/Shooter game.

Paul "Taiphoz"(Posted 2007) [#1]


I am starting a new project, which will be an up screen shooter that will make use of some material that I have already to save some time in development.

The above screen shot shows what I call a Tile, a screen might show 5 Tiles at a time, and a level of course will be many tiles long.

I am creating my tiles all as generic blank slates, much like the one above, I will then edit and create a set of unique tiles for each zone in the the game, which will allow me to create dynamic levels that always look different but that still fit with each other as the basic shap of the tiles wont change.

Anyone think this is worth doing ? or would it be better on the CPU and memory if I just make one big level model per zone and fill it with all the detail it comes with ? or keep this tile idea iv got.

Its been a while since iv done anything a few years to be exact so just wanted to check this and run it past you guys to see if there will be any major issues.

PS. posting this on both B3D and Max forums as I am not sure which language I will be using, will probably pick based on responses from this post.


Vertigo(Posted 2007) [#2]
Are you going to use 3d models as the tiles? This can add up in a hurry if you dont merge it into smaller surfaces. At the angle you have the top one at, with a short drawing distance, you should be able to get away with it just fine.


Paul "Taiphoz"(Posted 2007) [#3]
I am still playing with tile size and stuff. but yeah the tiles will be 3D. and the camera will be at the same angle as in the picture, but not off to the side like that, it will be set in the middle of the map, and the camera will tilt and pan to follow the ship as it moves to the left and right on the level.

I hit a lighting problem with the tiles tho, I only have 1 onni light set at the camera, and I noticed it was lighting each of the tiles the same, so you got this light dark effect which you could see when the tiles were loaded. very annoying.

Early days tho.


big10p(Posted 2007) [#4]
Not sure I understand your lighting problem. There shouldn't be a problem lighting them correctly, as long as the vertex normals are correct.


GfK(Posted 2007) [#5]
The angle of the top screenshot reminds me of Durrel's "Critical Mass". Or possibly "Zaxxon".


Vertigo(Posted 2007) [#6]
Yavin is probably talking about the fact that blitz lights every object each "tile" has a gradient light from top to bottom on EACH tile. It looks annoying I know what he is referring to. Merge all the tiles into the same mesh this should resolve the issue.


big10p(Posted 2007) [#7]
I still dont get it. Blitz lights meshes using the vertex normals. If the normals are correctly set, it should be fine.

*shrugs*


GfK(Posted 2007) [#8]
I know what he's talking about.

Try using flatshading - that might help.


big10p(Posted 2007) [#9]
Ah, I think I see what you mean now - the lighting is wrong where the tiles join?

If so, I dont think flatshading will help, TBH. It isnt properly implemented in B3D. Instead, just make sure the norms at the tile edges are pointing straight up, instead of having them smoothed.


Stevie G(Posted 2007) [#10]
Unwelding, calculating the normals per triangle manually then flatshading will definately sort this. I've had this lighting issue when using 3d tiling with lights in the past.

You could try the functions I posted here ... B32's last ones retain the vertex uv's.

http://www.blitzbasic.com/Community/posts.php?topic=64797

Stevie


Paul "Taiphoz"(Posted 2007) [#11]
http://www.midnightdragons.org/Yavin/pyro.rar

This should show what I am talking about. I dont think I can merge the meshs cos its tiles, and I want to free each tile as it scrolls out the bottom of the screen.

As for the normals, some one said make sure they are all set correctly .. Not sure how to do that in 3DS Max 6.


big10p(Posted 2007) [#12]
Well, if I were doing this, I wouldnt bother with unwelding or flatshading. I'd just create each tile (without sides or bottom), and make sure all vertex normals were point straight up. Am I missing something here?

[edit] well, not ALL normals. I mean set the normals at the edge of the tile mesh perpendicular to the poly they belong to. Gah, I've had way too much beer for this. :P


Stevie G(Posted 2007) [#13]
Well for starters your ignoring the normals which you set in 3ds max completely by calling updatenormals() after loading. Even after removal you still get the issue though so your normals are wrong at the edges .. looks like they are averaged as per Blitz's updatenormals() command.

This works better but it looks like you're texture uv's are off .. hence the black lines on the distant tiles.




Paul "Taiphoz"(Posted 2007) [#14]
So what those functions are doing is taking the normals per face and fixing its alignment. ?

Seems to work, thanks m8. Anyone know how to set this manually in 3DSMax 6 ? cos I cant figure it out. I would rather have them set in the mesh than have to do it in code.

Also @ Steve, I noticed that black line in the distance, not sure what thats all about cos the UVmap is fine on the tiles close to the camera, Iv tried padding out the UV's a little giving the texture a little more space at the edge's but its still there.

Any ideaS? change to blending mode perhaps?

www.midnightdragons.org/Yavin/pyro.rar here is an updated source with the new tile I am working with, its a little larger than before.

What I noticed as well is that even if I overlap the joins between tiles a little you still see that black line ??

I recall being able to change the Z order of objects, but its been ages I will need to look the command up, I think it might just be an Ordering issue.


big10p(Posted 2007) [#15]
Those black lines are probably a z-buffer issue, most likely caused by the camera range you've set. The large camera range is probably diluting the z-buffer resolution too much - if you see what I mean. Just a guess.

If you're using such a large camera range because the meshes are so large, try scaling everything down and using the default camera range.


Stevie G(Posted 2007) [#16]
I've looked at this again and it seems to be a mipmapping issue.

To confirm this .. try this code after the level is loaded ..

Tex = LoadTexture( "test/SLAB001.png", 256 )
EntityTexture Levela, Tex


Note that flag 256, as well as loading into vram also disables mipmapping.

p.s. Your model has some dodgy white plane underneath it. Is that meant to be there?

Stevie


Paul "Taiphoz"(Posted 2007) [#17]
I stuck the white plane there to show up any gaps between the tiles.

I fixed the line, it seemed that even though I thought and it indeed looked like the tiles were flush with each other, turns out there was a very small gap and you could see it once the level started to scroll.

Its actually all look rather nice now. Will upload what I have a few minutes.

I have a question about your functions tho if thats ok.

I added a water plane to the river tile, set its name to water in Max, and then thought I could use findchild to get it and set its alpha but that didnt work. findchild didnt find anything in the mesh.

So I then expanded the array 20,2 and 1,1 being the riverbed, and 1,2 being the water plane. that let me set the alpha of the river plane so that its alphaed and looks nice.

lost track of what my question was lol.. be back in a bit when i remember what it was I wanted to ask you haha I hate it when that happens.


big10p(Posted 2007) [#18]
I fixed the line, it seemed that even though I thought and it indeed looked like the tiles were flush with each other, turns out there was a very small gap and you could see it once the level started to scroll.
Ah. Also bear in mind that the positioning of objects gets less and less accurate, the further they're positioned away from 0,0,0. I trust you've got a fixed camera position and achieve scrolling by moving the tiles?

I added a water plane to the river tile, set its name to water in Max, and then thought I could use findchild to get it and set its alpha but that didnt work. findchild didnt find anything in the mesh.
Did you use LoadAnimMesh, instead of plain LoadMesh?


Paul "Taiphoz"(Posted 2007) [#19]
I wasnt aware of the drop in accuracy and no, I am moving the comera and player.

you think it would be better to move the tiles instead?

and no I didnt use loadanimesh.. I forgot all about that.


Paul "Taiphoz"(Posted 2007) [#20]
How strange is that, if you just change that loadmesh to loadanimmesh then it stops drawing the extra tiles in the array.


big10p(Posted 2007) [#21]
you think it would be better to move the tiles instead?
Deffo. ;)

How strange is that, if you just change that loadmesh to loadanimmesh then it stops drawing the extra tiles in the array.
Not sure why that would happen, TBH. You need LoadAnimMesh to access child objects, though.