Menu

LEX File Exchange
EA Support Files
SC4 Wikipedia
Network Addon Mod
Dependencies
Chat

Author Topic: CityMania  (Read 98303 times)

0 Members and 1 Guest are viewing this topic.

Offline builderbuiltoff

Re: Open Simcity
« Reply #40 on: February 06, 2009, 05:30:34 AM »
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:

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #41 on: February 06, 2009, 05: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()
Proudly developer of

Offline JoeST

  • Forums Guru
  • *
  • Posts: 2648
  • Total likes: 15
  • Reputation: 10
  • fbstj
  • CL: Not your average...
Re: Open Simcity
« Reply #42 on: February 06, 2009, 05:44:12 AM »
can I just ask, how are you storing map-data?
Copperminds and Cuddleswarms

Offline ehbk2006

  • RAM Team
  • Forums Mayor
  • *
  • Posts: 181
  • Total likes: 0
  • Reputation: 1
  • Traffic BAT's
    • My sketchup models on the 3d warehouse.
Re: Open Simcity
« Reply #43 on: February 06, 2009, 06:07:48 AM »
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

Offline Diggis

Re: Open Simcity
« Reply #44 on: February 06, 2009, 06:09:36 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.

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #45 on: February 06, 2009, 06:57:18 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 ..

Quote
can 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:
<a href="http://img11.imageshack.us/img11/3894/video20090206135036yh4.swf" target="_blank" rel="noopener noreferrer" class="bbc_link bbc_flash_disabled new_win">http://img11.imageshack.us/img11/3894/video20090206135036yh4.swf</a>
« Last Edit: February 06, 2009, 07:19:13 AM by Nique »
Proudly developer of

Offline wouanagaine

  • NHP Team
  • Forums Guru
  • *
  • Posts: 2854
  • Total likes: 7
  • Reputation: 43
  • CL: :computer: SC4 CodeMaster
Re: Open Simcity
« Reply #46 on: February 06, 2009, 07: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


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

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #47 on: February 06, 2009, 07:26:18 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
« Last Edit: February 06, 2009, 07:31:27 AM by Nique »
Proudly developer of

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #48 on: February 06, 2009, 07:53:09 AM »
Proudly developer of

Offline wouanagaine

  • NHP Team
  • Forums Guru
  • *
  • Posts: 2854
  • Total likes: 7
  • Reputation: 43
  • CL: :computer: SC4 CodeMaster
Re: Open Simcity
« Reply #49 on: February 06, 2009, 08:10:47 AM »
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

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #50 on: February 06, 2009, 09:01:05 AM »
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

Offline wouanagaine

  • NHP Team
  • Forums Guru
  • *
  • Posts: 2854
  • Total likes: 7
  • Reputation: 43
  • CL: :computer: SC4 CodeMaster
Re: Open Simcity
« Reply #51 on: February 06, 2009, 09:06:36 AM »
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

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #52 on: February 06, 2009, 09:28:40 AM »
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.

Code: [Select]
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
« Last Edit: February 06, 2009, 09:31:00 AM by Nique »
Proudly developer of

Offline wouanagaine

  • NHP Team
  • Forums Guru
  • *
  • Posts: 2854
  • Total likes: 7
  • Reputation: 43
  • CL: :computer: SC4 CodeMaster
Re: Open Simcity
« Reply #53 on: February 06, 2009, 09:46:52 AM »
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
Code: [Select]
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


« Last Edit: February 06, 2009, 09:56:55 AM by wouanagaine »
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

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #54 on: February 06, 2009, 01:28:45 PM »
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

Offline io_bg

Re: Open Simcity
« Reply #55 on: February 06, 2009, 01:38:30 PM »
Looks great! Amazing work! &apls
Visit my MD, The region of Pirgos!
Last updated: 28 November


Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #56 on: February 06, 2009, 01:41:30 PM »
Looks great! Amazing work! &apls

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

Offline wouanagaine

  • NHP Team
  • Forums Guru
  • *
  • Posts: 2854
  • Total likes: 7
  • Reputation: 43
  • CL: :computer: SC4 CodeMaster
Re: Open Simcity
« Reply #57 on: February 06, 2009, 01:46:47 PM »
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

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #58 on: February 06, 2009, 01:54:32 PM »
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

Offline Nique

  • Moderator
  • Forums Governor
  • *
  • Posts: 288
  • Total likes: 0
  • Reputation: 6
  • The dutch will do it ;)
Re: Open Simcity
« Reply #59 on: February 07, 2009, 01:31:15 AM »
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


« Last Edit: February 07, 2009, 01:33:38 AM by Nique »
Proudly developer of