• Welcome to SC4 Devotion Forum Archives.

Construction Layer Prototype (Quick and Dirty)

Started by tomkeus, October 26, 2009, 01:06:10 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tomkeus

I was fed up trying to think about the design of the software and decided to get my hands dirty and I have to say it was pretty useful because, when thinking about software design, you think about problem you expect to have, but when writing the software you think about the problems you actually have and are relevant for the whole process.

So, I've finished basics of my construction layer demo. I've uploaded a video on youtube explaining basic workflow when placing down roads and zones.

http://www.youtube.com/watch?v=T_9VprsYtyg

As you can see, it has a distinctive CAD feel, and that is because, if we're to go off-grid, my opinion is that CAD like tools and roads and zones based on vector data and top-down view are the best way to lay down roads and zones. So I hope that this, or variation of this will end up in the game.

Currently program can only be used for drawing, but it is valuable because it is a very good testbed for our ideas on zoning, transportation etc and the code it uses can be reused, in making final version of the game.

So, my first order of business, will be to implement some of the ideas put up on a Zoning topic and I hope that in a week or two I'll be able to put here version of this program that subdivides zones into lots and places buildings on them.

After, that, next major task will be to go from simple 2D, I have here, to 3D. That shouldn't be to much of a problem because geometry-related, and good portion of interface code are actually 3D. I'll use Irrlicht for the task. When I have that, I will be able to demonstrate how bridges, overpasses, and similar, will be implemented.

I'm curently starting to read about boost graph library, and once I understand how it works, I hope I will be able to start working on foundations of the transportation network.

As things, crystallize, ie, we understand problems we have, and undestand what solutions work and how, we will slowly finalize documentation and start assembling actual playable game.


I have attached the app to try it for yourself


Quote
NOTE: Perpendicular and parallel helpers situation gets weird whenever arcs are counterclockwise or point on arc was clicked beyond 180 degrees. Some of you probably noticed that. I know that the reason for that is some piece of maths code that doesn't enforce right-hand rule properly. I'll hunt this down when I consolidate code.

Fixed it. Things would be much more simpler if rotation group was simply connected  ;D
#define TRUE FALSE /*Happy debugging suckers*/

Orange_o_

I just play and test your little program. It's very simple to use and very intuitive. It is imperative to keep this simple use  &apls

   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °   °  


croxis

I like, and works in wine! It feels much more controllable than citiesxl network building. My only complaint so far is that zoning feels difficult to flush to the road, but I am sure refinement can help with that.

I've already started my own work on a client program with the Panda engine. We should probably get together and nail down what engine to use so we don't needlessly spend time doing the same thing for different engines. In fact, let me revive/start a thread on that.

WC_EEND

just had a little go with it, and as orange stated, it's very easy to use and that is the way to go. No need to hide everything in difficult to find submenus like Vista does
RIP Adrian (adroman), you were a great friend

My LOT thread                                    

SCAG BAe146/Avro RJ Project

tomkeus

Quote from: croxis on October 26, 2009, 02:45:11 PM
My only complaint so far is that zoning feels difficult to flush to the road, but I am sure refinement can help with that.

That is in part because I didn't want to force zones sticking to the roads. I want to have possibility to widen the road later without the need for demolition.
#define TRUE FALSE /*Happy debugging suckers*/

croxis

Ahh yes this makes sense (and bloody annoying in that other game ;) )
I dunno how it is in your part of the world, but in my state every roadway is on a strip of land called a right of way which no one can build on. This way the road can be expanded as needed up to the edge. This is most similar to the offset. Maybe something similar can be used where the player can specify how wide the right of way is for the road to sit in. This space is then reserved and can't be used for anything else.

Delecto

#6
Hey tomkeys, I downloaded and tried your little app, and ... it smells good.  :thumbsup:
I have no idea how you do that, but congratulations!
For the curves, your choice is very good, but what do you think of a controller by Bezier curves? Possible or too complicated?
Anyway, you did a wonderful job and I can only push you further.

I just want to add the offset tool is a genius idea!  &idea

DEL!

tomkeus

Thanks you guys for the nice words :)

Quote from: Delecto on October 26, 2009, 03:59:57 PM
For the curves, your choice is very good, but what do you think of a controller by Bezier curves? Possible or too complicated?


They certainly are possible, but I'm not sure they would fit very well into the workflow I showed in the video. Circles can be specified with 3 points, while Beziers need 4. Also, Beziers aren't used by civil engineers in road  or rail construction.
#define TRUE FALSE /*Happy debugging suckers*/

Nique

 :thumbsup:

gj tom,

Do you know sketchup? I think you do :P, Is there a way we can use the same method as they used for exact degree / distance input? (when you press numbers, it will take that value (bottom right of the window while creating a object in sketchup). This way we can provide the player with some very precise tools. Great job! may i see the source? (so i can learn from it). What IDE are you working in?
thanks
Proudly developer of

tomkeus

Quote from: Nique on October 26, 2009, 06:06:04 PM
Do you know sketchup? I think you do :P, Is there a way we can use the same method as they used for exact degree / distance input? (when you press numbers, it will take that value (bottom right of the window while creating a object in sketchup). This way we can provide the player with some very precise tools. Great job! may i see the source? (so i can learn from it). What IDE are you working in?
thanks

Heard of sketchup, but never used it. Anyway, I'm downloading it. If there's anything worth stealing, I'll do it. I've already targeted Maya's hotbox for implementation.

As for code, code is currently a beautiful example of stovepipe design, because I wanted to finish as fast as possible. When I clean it up a bit, I'll put source online.

IDE is VS2008.
#define TRUE FALSE /*Happy debugging suckers*/

superhands


daeley

that is just really great! Some time ago, I started on my own little simulator (in Java though, never finished) but I got stuck on the networks. This is exactly how I imagined things should have looked like. The nice thing is, you can probably auto-generate the paths for cars to follow... don't even need SC4PATH files :)

I'd love to take a look at your code - don't care if it's quick'n dirty :) I take it that you are currently filling up the areas with solid colors? Any idea on auto-generating textures yet? Boy, my mind is racing... Now that I've seen this, I really want to help ;D
1. Install SC4+RH
2. Install LEX (CD&DVD helps) and latest NAM + updates
3. Play the game
4. ? ? ? ?
5. Profit!

tomkeus

#12
Quote from: daeley on October 28, 2009, 01:04:38 AM
I'd love to take a look at your code - don't care if it's quick'n dirty :) I take it that you are currently filling up the areas with solid colors? Any idea on auto-generating textures yet? Boy, my mind is racing... Now that I've seen this, I really want to help ;D

I'm organizing code currently and making a few improvements. I hope I'll finish sometimes next week and then I'll upload the code. As for the drawing, it is extremely simple use of FLTK's drawing functions. Now, you people might have missed it, this is entirely 2D graphics (although objects are stored with 3D vector data and geometry and math related parts of the code are also 3D) so no textures for now (and as far as I'm concerned construction layer isn't supposed to have any). First thing after existing code reorganization is to make algorithm for subdivision of zones into lots. After that I shall start working on traffic network generation. Once that is finished I'll port the code to 3D (shouldn't be too much job since 2D-related code is well isolated and there is not much of it).
#define TRUE FALSE /*Happy debugging suckers*/

Atomius

In Virtucity I have a similar thing called 'map mode' (you switch between this (used for developing your city and administering it) and 'regular mode' for eye candy purposes.

In Simcity you could represent the data maps on your city and i like the idea of a 'construction layer' as you term it...

I am aware there was mention the project would not be in full 3D but would utilize SC4 like billboardng techniques... Perhaps like with the construction layer you could make allowance for a full 3D 'mode' for those players with better computers... or as an add on like Rush Hour is to SC4? I just think that giving up the idea of full 3D completely is... I dunno just wrong and defeatist


croxis

I am personally interested in working on a full 3d client in addition to the billboarding technique.

Atomius

That's good to know. I doubt my project will ever go full 3D so it's nice to know that there is still hope for a full 3D SimCity 5 of sorts.

LucaPdor

Wow! Great work tomkeus!
I can't wait to see the progress!  &apls
semel in anno licet insanire

tomkeus

OK, things got a little complicated. While reorganizing code, I wanted to make interfaces which will allow me to use simpler 2D graphics for basic tests and later switch to some 3D engine without changing too much of the code. That created some problems because I had to make my own interfaces which already exist in all 3D engines so when I transfer to 3D engine I will just have to put 3D engine behind my interface. This not only reduces performance, it creates a lot of redundant code which is something I don't want. I can barely manage things as they are. I will have to prolong things a little. Me and croxis have a little debate over Panda3D/Irrlicht so this could take some time to finish.
#define TRUE FALSE /*Happy debugging suckers*/

Atomius

Always best to take as much time as is needed I always say...

Mind you with my computer I daresay performance will be slow anyway

croxis

I'll be home monday from vacation so we can start tackling the code then.