• Welcome to SC4 Devotion Forum Archives.

CityMania

Started by Nique, February 03, 2009, 11:33:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

builderbuiltoff

because i dont understand everything here, its maybe a stupid question, but would this be posible in game or not?
if that so that would be  :thumbsup:

Nique

What, free looking?

Of course  :)

You will play in the so called 'SC4' camera(s) mode, but if you want to look around and stuff like that, yes... it will be posible.. just a matter of clicking on the 'free camera' button  ()stsfd()
Proudly developer of

JoeST

can I just ask, how are you storing map-data?
Copperminds and Cuddleswarms

ehbk2006

Looks promising.

For some inspiration, a game what already has been released and uses the same type of engine:

http://www.tt-forums.net/viewtopic.php?f=28&t=40825

My BAT Showcase: ehbk2006's traffic BAT's
My sketchup models on the 3d warehouse.
[RDY]: Veolia - Coal hopper + E189

Diggis

Quote from: Nique on February 06, 2009, 03:37:45 AM
What, free looking?

Of course  :)

You will play in the so called 'SC4' camera(s) mode, but if you want to look around and stuff like that, yes... it will be posible.. just a matter of clicking on the 'free camera' button  ()stsfd()

Just out of curiosity, how are going to manage the buildings?  SC4 fixes the camera as buildings are just images on a box generated by Max.  If you were to take these 3D then you would get some weird shapes. (try it in the Reader)

If you run with fully 3d models they won't be able to be as detailed as they are currently due to rendering limitations on poly counts.

Nique

#45
Quote from: Diggis on February 06, 2009, 04:09:36 AM
Just out of curiosity, how are going to manage the buildings?  SC4 fixes the camera as buildings are just images on a box generated by Max.  If you were to take these 3D then you would get some weird shapes. (try it in the Reader)

If you run with fully 3d models they won't be able to be as detailed as they are currently due to rendering limitations on poly counts.

Simcity 4 was finished in 2002...

Computers have been improved from 800mhz (rush hour) to 4ghz.. (computers are 5 times faster).. and not only 'cpu'.. also the GPU.. (graphics card). Beside all this.. many people have 'multiple' processors.. for instance, i have a quad core .. I don't think we have to worry about graphics / peformance yet.

The first thing to do is writing simular functions as in SC4.. (for instance, the economic system.. but also new: climate)

(imagine the detail @ GTA4)..
Maybe we need to move to some other engine.. I was thinking about using Visual3D?

Example:



I do not know everything yet.. i'll just go.. and see where it ends. With my actions, i hope others to inspire to join.. i cant build this on my own ..

Quotecan I just ask, how are you storing map-data?
Not yet, i'm just importing a height bitmap. But of course, this should be like the same as in SC4 in the future. (render regions).


Seasons:
http://img11.imageshack.us/img11/3894/video20090206135036yh4.swf
Proudly developer of

wouanagaine

Again split your quad using the correct diagonal it will look way better


imagine you have a flat land with a square mesa
x- x-x-x-x- x
|  |  | |  |  |
x-X-X-X-X-x
|  |  | |  |  |
x-X-X-X-X-x
|  |  | |  |  |
x- x-x-x-x- x

( x is lower than X )
then you'll need
x- x-x-x-x- x
|/ |\|\ |\ |\|
x-X-X-X-X- x
|\ |\| \| \|\|
x-X-X-X-X-x
| \| \|\|\| /|
x- x-x-x-x- x

hope my artistical talent is showing up



New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

Nique

#47
Quote from: wouanagaine on February 06, 2009, 05:18:57 AM
Again split your quad using the correct diagonal it will look way better


imagine you have a flat land with a square mesa
x- x-x-x-x- x
|  |  | |  |  |
x-X-X-X-X-x
|  |  | |  |  |
x-X-X-X-X-x
|  |  | |  |  |
x- x-x-x-x- x

( x is lower than X )
then you'll need
x- x-x-x-x- x
|/ |\|\ |\ |\|
x-X-X-X-X- x
|\ |\| \| \|\|
x-X-X-X-X-x
| \| \|\|\| /|
x- x-x-x-x- x

hope my artistical talent is showing up




This is not very easy to make.. i will search how to make..

I understand what you mean.

but i need to figure out how to calculate the shortest piece of that tile
Proudly developer of

Nique

Proudly developer of

wouanagaine

Quote
but i need to figure out how to calculate the shortest piece of that tile
v0 --- v1
|         |
|         |
v2----v3

if ( v0-v3 ).SquaredLength() > (v2-v1 ).SquaredLength()
split along v2v1
else
split along v0-v3

From what I get in your pic if the light green is the one choosen, it looks ok


New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

Nique

Yes, but the problem is, that the map is being load & created before the heights come in. So i can not calculate it (yet).. i need to find a way to set up the indices including the height data.
Proudly developer of

wouanagaine

you need to create multiple index buffer and multiple vertex buffer, because you'll be able to do early frustum culling and send much less data to the GPU. And lot of old GPU cards won't perform very well with a big vertex buffer. A usual way is to split the map into 33x33 chunks ( edges are shared between chunks ). Then once you created your vertex buffer for one chunk, create your index buffer using the correct diagonal


New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

Nique

#52
Ehh.. ok. This is hard.

Uhm, this is my Draw Method

Is there a way you can take a look at it? Because i do not understand what you mean.


private void DrawTerrain(Matrix currentViewMatrix)
        {
            effect.CurrentTechnique = effect.Techniques["Colored"];
            Matrix worldMatrix = Matrix.Identity;
            effect.Parameters["xWorld"].SetValue(worldMatrix);
            effect.Parameters["xView"].SetValue(currentViewMatrix);
            effect.Parameters["xProjection"].SetValue(projectionMatrix);

            effect.Parameters["xEnableLighting"].SetValue(true);
            effect.Parameters["xAmbient"].SetValue(0.4f);
            effect.Parameters["xLightDirection"].SetValue(new Vector3(-0.5f, -1, -0.5f));

            effect.Begin();
            foreach (EffectPass pass in effect.CurrentTechnique.Passes)
            {
                pass.Begin();

                device.Vertices[0].SetSource(terrainVertexBuffer, 0, VertexPositionNormalColored.SizeInBytes);
                device.Indices = terrainIndexBuffer;
                device.VertexDeclaration = terrainVertexDeclaration;

                int noVertices = terrainVertexBuffer.SizeInBytes / VertexPositionNormalColored.SizeInBytes;
                int noTriangles = terrainIndexBuffer.SizeInBytes / sizeof(int) / 3;
                device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, noVertices, 0, noTriangles);

                pass.End();
            }
            effect.End();
        }


I think you'll need the whole document but okay
Proudly developer of

wouanagaine

#53
it looks good for rendering but it is not about rendering, but about setting up your vertex buffers and indexbuffers


but you have only one terrainVertexBuffer and one terrainIndexBuffer for the whole map

so if your map is 257x257, create 8x8 VertexBuffer ( each contains 33x33 vertices ) and 8x8 IndexBuffer ( each contains 32*32*2*3 indices - 32 by 32 quad, *2 for triangle, * 3 because you're using a TriangleList )

fill each vertexbuffer with the corresponding height values ( first vertex of chunk 0,0 is the pixel 0,0 f, first vertex of chunk 1,0 is pixel 32,0 ) etc..
then fill the corresponding indexbuffer to accomodate the diagonal ( you have all the data at that time to choose the correct one )

for after that your code will be

effect.Begin()
for each pass:
pass.Begin()
  for each  vertexbuffer,indexbuffer pair:
                device.Vertices[0].SetSource(vertexBuffer, 0, VertexPositionNormalColored.SizeInBytes);
                device.Indices = indexBuffer;
                device.VertexDeclaration = terrainVertexDeclaration;

// you definitly need to store that instead of computed it
//                int noVertices = terrainVertexBuffer.SizeInBytes / VertexPositionNormalColored.SizeInBytes;
// but as we use a fixed size chunk, we know it already
                noVertices  = 33*33;


//                int noTriangles = terrainIndexBuffer.SizeInBytes / sizeof(int) / 3;
// idem, we know it already
                noTriangles= 32*32*2;
// try to use a triangleStrip to speed up rendering  but that need more work on the indexbuffer
                device.DrawIndexedPrimitives(PrimitiveType.TriangleList, 0, 0, noVertices, 0, noTriangles);

                pass.End();
            }
            effect.End();
        }


Then when the need arise ( ie to speed FPS ), you'll just have to do frustum culling for each vertexbuffer ( by storing its boundingbox and test if the bounding box is in the frustum )and really do the rendering if the boundingbox is visible
You can also put the vertexbuffer/indexbuffer and its bounding box in a quadtree to gain more FPS
You can also add LOD ( level of details ) into the indexbuffer to draw less triangles ( ie no need to draw all triangles if the terran is flat or if the triangle is far away )
etc..
There are many thing you can do to speed terran rendering, but the first thing to have is to get the terran in a good structure for all the above algorithm to work well



New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

Nique

wouanagaine thank you for explaining!  :thumbsup:

The only thing is.. that i just noticed that there are so many 'start' packages.. 3d engines etc. Why should i do all that work for myself :P
It's very technical and its not really my thing. Anyway, i'm allways intrested to learn, so if you have any tips / links for me to learn, please post :D

In the meanwhile I've seen the LightFeather Engine, and this one looks pretty good.. okay it's not ala CitiesXL or Crysis, but that's not what we are aiming here right? ..The main goal is to make a SC4 clone, so the community can modify / add new function's and depth to the game. Something that's not possible with SC4 now as at least 40% was still hard-coded.

This Terrain looks pretty good.. (engine: 2 years ago)..


they kept developing in the past 3 years and look what they brought (engine: Now):


Proudly developer of

io_bg

Looks great! Amazing work! &apls
Visit my MD, The region of Pirgos!
Last updated: 28 November

Nique

Quote from: io_bg on February 06, 2009, 11:38:30 AM
Looks great! Amazing work! &apls

(the above 2 examples arent my work, but thanks anyway) :P
Proudly developer of

wouanagaine

As I can see it runs at 21 fps , is it on your computer ? just because there is nothing else but rendering here. So if runs at 21 FPS on your computer, what can you expect to do simulation wise ?
It also use 4 textures for terran, usually you'll have to paint the terran, and the renderer will blend the 4 textures based on what you paint which at first glance is quite great, but when you get used to it, you'll definitly missed SC4 256 terran textures ( Cycledogg one, not maxis one )

But I agree with you, you should definitly try to find an existing engine which matches as much as possible your vision and what you'd like to do. Creating technologies and creating games are two different things, both rewarding and both requiring dedication and massive amount of time, you just have to choose where you want to be. But trying to do techno & game is bound to failure ( especially for hoby )

New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

Nique

Quote from: wouanagaine on February 06, 2009, 11:46:47 AM
As I can see it runs at 21 fps , is it on your computer ? just because there is nothing else but rendering here. So if runs at 21 FPS on your computer, what can you expect to do simulation wise ?
It also use 4 textures for terran, usually you'll have to paint the terran, and the renderer will blend the 4 textures based on what you paint which at first glance is quite great, but when you get used to it, you'll definitly missed SC4 256 terran textures ( Cycledogg one, not maxis one )

But I agree with you, you should definitly try to find an existing engine which matches as much as possible your vision and what you'd like to do. Creating technologies and creating games are two different things, both rewarding and both requiring dedication and massive amount of time, you just have to choose where you want to be. But trying to do techno & game is bound to failure ( especially for hoby )

No wasn't on my pc.. I'm building the files right now, i want to see how it works. I have seen more engines and tested some of them.. i'll keep going. Never give up. But you are right, i have no plans to build my own engine (for now?) .. :P

:)
Proudly developer of

Nique

#59
Last night i have been busy with designing the GUI (inGame City play).

Like i said before.. it must look and feel like Simcity 4.. it's a clone.
I used the Miramonte Font


Proudly developer of