random city generation (with or without magnets)

random city generation (with or without magnets)

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

random city generation (with or without magnets)

Post by FireStorm_ »

Knorkes Magnetism System :-)
It has become relative to my interests.
In general I like to know more about how units can be attached to other units.

I got some inspiration from Piccaso's Town

The idea is, if a have a part of town (a unit consisting of a road and 1 or 2 buildings) and pieces defined in a script where placed along the road, then maybe I could let the pieces of the roads connect with each other in a way that could form a somewhat natural looking town-plan.

(my solution to terrain interfering with the town, is just to identify interference and not allow the town to spawn there, btw :-) )

Any thoughts?
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Knorkes Magnetism System

Post by Anarchid »

how units can be attached to other units.
Everything is a transport.
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: Knorkes Magnetism System

Post by FireStorm_ »

oh...thanks, ehm... never mind then :-)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Knorkes Magnetism System

Post by knorke »

Image

beside transports, can also use movectrl to "attach" units to each other:
http://springrts.com/phpbb/viewtopic.php?f=14&t=27503
It is funnier because you can also attach units that can not be transported and it works with features.
For city imo not useful.
The idea is, if a have a part of town (a unit consisting of a road and 1 or 2 buildings) and pieces defined in a script where placed along the road, then maybe I could let the pieces of the roads connect with each other in a way that could form a somewhat natural looking town-plan.
Hm I would do random city like this:
Have tiles of same size. A tile can either be a straight road, turn, crossing, building etc. Something like like this: http://conclusion.uw.hu/dirGames/imgRoa ... enshot.png
Some tiles could have buildings, trees etc on their non-road areas. That way you never get buildings standing a road etc.
Like in a LEGO city:
Image
Also Carreperairs maze thing is a bit similiar.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Knorkes Magnetism System

Post by gajop »

Could you explain your goal first, before jumping to an implementation?
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: Knorkes Magnetism System

Post by FireStorm_ »

What if I had a town-part-unit that looked like a roundabout with one exit road, lets say a q-shape. The road is designed/drawn as a dirt road that still looks fine if it overlaps with another piece of road. Inside this roundabout stands a building which is also the centre of the unit. Now I randomly spawn these town-part-units, but with fixed and constant distances between them. Every units scans for nearest other unit, altering their heading towards that position, thus aligning the roads towards a sister part of town, forming a network of interlocking q-shaped road parts; a rudimentary town.

I don't think what I just described is viable the way I described it :-) . But It is just to illustrate that I was searching for a way to procedurally generate, so to speak, a town in a way that doesn't look like a simciy2000 or a LEGO city. But maybe a jungle town or a moon base, that would have no logic being structured on some kind of Manhattan-grid.

I guess I have to think on it some more :-)

ps.
@ ninja gajop :-)
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Knorkes Magnetism System

Post by zwzsg »

Don't use "magnetic" units. Just place them with Lua. Also, maybe feature or pure Spring Lua OpenGL would be better than full units.

I'd like to know how you can make a randomly generated network not aligned on a grid. I mean, you could use a non square grid (like an hexagonal one), or even a tessellation with two shapes, but if both your heading and length are random, I don't see how you'll make your roads connect nicely.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Knorkes Magnetism System

Post by knorke »

Every units scans for nearest other unit, altering their heading towards that position, thus aligning the roads towards a sister part of town, forming a network of interlocking q-shaped road parts; a rudimentary town.
That does not guarantee that you will get one fully connected road network. Might also create small "islands"

"Moonbase" made me think of:
http://www.technovelgy.com/graphics/con ... n-base.jpg
http://www.slawcio.com/mars2.jpg
http://th03.deviantart.net/fs70/PRE/f/2 ... 4botz6.jpg
One bubble-building or node, which has some tunnels/arms which have more sub-nodes and sub-arms.
Not a grid but basically the layout is a star or snowflake.
Image
Now have the arms at random angles, different lengths and different amount of sub-arms.
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: Knorkes Magnetism System

Post by FireStorm_ »

@zwzsg
Well the nice line-up/connections of roads is a problem, but if they are swirly dirt roads, with maybe buildings inside the resulting cells, I think that might work.

@Knorke
Yes, all that was pretty much what I had in mind at one point or another. (only, the moonbase examples don't allow movement around the buildings, so road instead of tunnels)
I'll see if I can find some time the coming days to create some simple assets to play around with this idea.

@gajop
To be precise: To be honest I hadn't thought it through. Lets call it a thought experiment or R&D, that might result in something depending on factors like my time and my laziness. :-)
User avatar
Anarchid
Posts: 1384
Joined: 30 Nov 2008, 04:31

Re: Knorkes Magnetism System

Post by Anarchid »

but if both your heading and length are random, I don't see how you'll make your roads connect nicely.
If roads can be rotated at arbitrary angles - and SetGroundTexture should allow for that with some magicking well enough - it's just picking the best of many ways to construct a chaotic graph.
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: Knorkes Magnetism System

Post by FireStorm_ »

edit: not fully awake yet; posted a pm or something...

concept picture:
Image
I'll probably be posting all the baby steps I make, so I won't forget I was doing this :-)
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: Knorkes Magnetism System

Post by FireStorm_ »

Still very conceptual.
Image

Image
bigger

And I made a text file for the gadget, that's pretty much how far along that is.

Also:
no offence to knorke :-) , but would a moderator be so kind to change the title of this thread. I think I will call this idea (and the aimed for result) "the Settlementor". Something more descriptive like, spawning town via script, is fine too. :-)
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: random city generation (with or without magnets)

Post by PicassoCT »

beautifull...

I thought about this, and came up with a idea of my own - particuarlly for the buildings.. It would be usefull to be able to copy pieces at runtime. Just for graphicspurpose, the whole thing could be merged into one matrice after its done.

Its just so much easier to generate procedural +random stuff, if you dont have to predefine what you need a dozen times.

@Firestorm. Its a "one" decal per building system, so its going to be expensive, if you dont use the TerrainTexture Replacement. Plus you got to rotate the textures to fit it together. That or make the terrain part of the modell. Which has graphic hazards on its own, if you imagine a grassy garden on moon.

Im currently uploading my attempt. The Streets and the buildings dont allign, but its allready quite nice. Would be of course nicer even, if i made cityparts(heres were the social downers live- hey, were is my umbrella- how will the foolish masses know now, that im there FUEHRER) ;)

And certainly would benefit from real random generated buildings.
Image
Just imagine a algo that stacks up concrete lego-building bricks.
Its one of the more awesome things of opensource gamemaking that we can harvest the forces of maths nature to do some work for us .
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: random city generation (with or without magnets)

Post by FireStorm_ »

PicassoCT wrote: Just imagine a algo that stacks up concrete lego-building bricks.
You mean kinda like this ? :-)

Image

I started modelling with only cubes. A few larger beams I made where 1/4 cube placed behind eachother. I sacrificed some modularity when texturing, for speed and easiness, but I could bring it back in the textured model, if it was going to serve a purpose.

I almost always texture the meshes I use on all sides. I think it makes for better colose-ups in in-game video's and better (in any case easier to make) wreckage models.

Perhaps not surprising, what you said also made me think of those floating metal blocks that form one huge block as a construction process in Journeywar. :-)

Do you think other things might be possible/doable using similar blocks? I was daydreaming a bit about a big building collapsing into it's modular parts, which would spread around in the vicinity after the death-explosion, and could then be reclaimed individually.
But that kinda describes a unit (or something similar) consisting of other units, so I'd have no clue if or how that would be doable.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10454
Joined: 24 Jan 2006, 21:12

Re: random city generation (with or without magnets)

Post by PicassoCT »

Neither do i.Image

What is doable.. is buildings generated from lego via algo.
Attachments
ScreenSchotter.jpg
(2.41 MiB) Downloaded 1 time
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: random city generation (with or without magnets)

Post by FireStorm_ »

Image

Still don't know what I'm doing.
I think I now know how I can create dense favelas :-)

But I was aiming at something more like an abandoned small scale mining operation with interconnecting roads, so that's what I hope it will resemble somewhat in my next screenshot.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: random city generation (with or without magnets)

Post by Beherith »

If you want to just fool around with the generation part, then I highly recommend these house models: http://springrts.com/phpbb/viewtopic.php?f=13&t=22678

These are designed to be tiled into a city, because they are exactly 6*8 = 48 elmos on a side.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: random city generation (with or without magnets)

Post by smoth »

it's 2013. please post a reasonably sized picture
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: random city generation (with or without magnets)

Post by FireStorm_ »

The reason I show such strange progress is I don't know how to code what I want to do (or perhaps more accurate: I don't know how to code) and I'm trying to learn. :-)
In order to do that I think I shouldn't deviate to much from my original idea.

A main point/part of that idea is letting the tiles or strait-grid thinking go. I must admit these assets aren't that inspiring to me in that regard, but it think I could easily make models that would still look fine placed partly on-top/in-side of each other, like a few pieces of some kind of sci-fi favela, possibly with a bulky foundation.

I'm not going to; I've almost got some carefully created mining-opration-LEGO and dirt-road-images done. Think It'd be a shame to waste that stuff now. :-)

bigger version for smoth. (It's just a bunch of big buildings very close to each other.)
Post Reply

Return to “Game Development”