Page 1 of 2
random city generation (with or without magnets)
Posted: 02 Oct 2013, 15:17
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?
Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 16:49
by Anarchid
how units can be attached to other units.
Everything is a transport.
Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 16:56
by FireStorm_
oh...thanks, ehm... never mind then

Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 17:29
by knorke
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:

Also Carreperairs maze thing is a bit similiar.
Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 17:42
by gajop
Could you explain your goal first, before jumping to an implementation?
Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 17:58
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

Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 20:02
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.
Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 20:45
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.

Now have the arms at random angles, different lengths and different amount of sub-arms.
Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 21:30
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.

Re: Knorkes Magnetism System
Posted: 02 Oct 2013, 22:03
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.
Re: Knorkes Magnetism System
Posted: 03 Oct 2013, 10:18
by FireStorm_
edit: not fully awake yet; posted a pm or something...
concept picture:

I'll probably be posting all the baby steps I make, so I won't forget I was doing this

Re: Knorkes Magnetism System
Posted: 04 Oct 2013, 16:10
by FireStorm_
Still very conceptual.
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.

Re: random city generation (with or without magnets)
Posted: 05 Oct 2013, 00:55
by FireStorm_
Re: random city generation (with or without magnets)
Posted: 05 Oct 2013, 09:23
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.

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 .
Re: random city generation (with or without magnets)
Posted: 05 Oct 2013, 16:28
by FireStorm_
PicassoCT wrote:
Just imagine a algo that stacks up concrete lego-building bricks.
You mean kinda like
this ?
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.
Re: random city generation (with or without magnets)
Posted: 06 Oct 2013, 01:01
by PicassoCT
Neither do i.
What is doable.. is buildings generated from lego via algo.
Re: random city generation (with or without magnets)
Posted: 07 Oct 2013, 12:41
by FireStorm_
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.
Re: random city generation (with or without magnets)
Posted: 07 Oct 2013, 13:05
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.
Re: random city generation (with or without magnets)
Posted: 07 Oct 2013, 15:12
by smoth
it's 2013. please post a reasonably sized picture
Re: random city generation (with or without magnets)
Posted: 07 Oct 2013, 15:26
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.)