Author Topic: CitiesMod  (Read 6975 times)

0 Members and 1 Guest are viewing this topic.

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
CitiesMod
« on: December 24, 2012, 07:37:49 pm »
Okay, so I got into a discussion with my cousin about Minecraft things which ended in her convincing me to try to make something cool around generation.  So I did.  All yesterday afternoon while I was at their house, I worked on a Bukkit plugin which replaces the terrain generator with something that basically just renders an endless city.  If anyone's ever seen
that video was kind of the inspiration/basis of the idea.  There are still quite a few bugs that I'm working on, but I thought I'd post about it because it still looks pretty cool.  Below are the plugin, and a world with a few chunks of it generated if you don't want to load up a server to look at it.  If you use the plugin, you'll need some world plugin such as Nomcraft /shamelessselfpromotion or MultiWorld and teleport to the world "City".

Plugin: https://docs.google.com/open?id=0B7yzzD91paU_ODlOQ2JEcEE1a0U
World: https://docs.google.com/open?id=0B7yzzD91paU_cnZrUUFQang4V2s





EDIT: I should add some more info about the process for those interested.

Basically, each chunk consists of a building(s) and some road.  A single chunk per intersection seems a little small, and it looks a bit off, but for how much easier that makes it, it looks good enough.

The road is simply a four block border around two adjacent sides of the chunk (blocks 12-15 to be exact) with streetlights at regular alternating intervals.  This stuff is all pretty hard-coded, and pretty boring, but necessary to look good.

The buildings are randomly generated based on a sort of set of templates.  It first chooses a random height between $minsize and $maxsize where $minsize is 3 for shorter areas and 5 for taller areas. $maxsize is determined by a 3d sine-function-mixture based on the X and Z of the chunk being rendered, to give the "city" areas of taller and shorter buildings.  Then a width and length are randomly chosen between the same $minsize and a different $maxsize which starts at 12.  Then a material is chosen, always black wool for the taller buildings, but sometimes brick or wood for the shorter ones, which adds a nice feel to the alternating sized areas.  Then the walls are created, randomly either in the full style or cut-off-corner style.  The blocks are alternated randomly between the building material and glass, for windows.  There is a column of glowstone placed at the center to attempt to light the buildings, but because of how minecraft's lighting currently works, it sometimes breaks.  Some "floors" of stone are generated every three blocks.  Then a roof is chosen, either flat or peaked, and is placed on top.  If the building has a flat roof and is tall enough ($height > 40) it has a chance to additionally get come lights on top of the building.

After it generates one building, it checks if any more could fit inside the chunk, and still be greater than the $minsize.  If so, it goes back and creates another building with a new $maxsize.  This repeats until the chunk has been completely filled with buildings.  And this repeats forever.

I hope that made sense to anyone interested.
« Last Edit: December 25, 2012, 07:31:14 pm by cooliojazz »
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: CitiesMod
« Reply #1 on: December 25, 2012, 06:53:44 pm »
I've never tried minecraft, but I have to say, that looks pretty freakin cool. :D

Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: CitiesMod
« Reply #2 on: December 25, 2012, 07:32:13 pm »
Quick update:  Fixed a major part of buildings glitching into each other, so that should happen less often, and completely fixed buildings glitching into the streets.  Also made some buildings be a light grey instead, and made it spawn a lot more chunks in the test single player world.  Also installed optifine so i could make prettier looking screenshots with anti-aliasing and whatnot =P  Download of the files is still in the first post, updated to the new versions.




Edit: Thanks AOC, maybe this will make you want to now =P
« Last Edit: December 25, 2012, 07:32:57 pm by cooliojazz »
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)

Offline imo_inx

  • Manman, SaviourOfTheMultiverse!
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 473
  • Rating: +27/-8
  • imo_inx
    • View Profile
Re: CitiesMod
« Reply #3 on: December 25, 2012, 07:48:49 pm »
Someone should make a client mod for this! (now it should be universal...)


Offline cooliojazz

  • Support Staff
  • LV7 Elite (Next: 700)
  • *******
  • Posts: 619
  • Rating: +66/-9
  • I omnoms on your soul
    • View Profile
    • Unreal Phantasies
Re: CitiesMod
« Reply #4 on: December 26, 2012, 03:31:39 pm »
That would be the better option, but because of how much harder that would be to implement in a client (would have to add additional generation options and whatnot to specify whether a world should be generated like that or not, and im not entirely sure if that's within the scope of things like mcp, so i would probably have to do a direct client mod, which i have absolutely no idea how to do) for right now, the best option is just a server plugin.  If you want to use it locally, it's really not that hard to run a local craftbukkit =P  What do you mean it should be universal though?
Spoiler For Random signess:
You can not beat my skills.
Trust me.
So don't even try.
And remember never to trust someone who says, "Trust me."

TI File Editor Progress: Remade in java like a boss. 50% we'll call it? IDK =P
Java Libraries: JIRC - 90% JTIF - 5%
TI Projects: Unreal Notator - -5000%
Nomcraft, a Bukkit mod
Some of the music I write can be found here | The Rest Should Be Here (Bandcamp)