View Full Version : Civ-like tile based game
11-04-2008, 07:50 AM
Hey guys, well I've been busy fooling around with programming and such, and have decided to try my hand at game programming... my idea came about after learning basic 2d drawing in XNA, which is directx, used in pretty much every xbox and windows game available... that and that i've been playing a lot of old games lately, one of which is called Masters of Magic... which is very much like civilization, but without tech, and with a combat sim resembling might and magic heros...
Talking with my friends about how much fun this game was, made me think about creating one myself, and so i've started...
The thing i need help on tho, and why its actually posted at this site, is how to build a tile based map, randomly, without it becoming some wierd and unrealistic mess?
I'll try to post any ideas i come up with, but if anyone has any good ideas on how to programatically create a random map, let me know!
11-04-2008, 08:29 AM
Well you have MapTool in your sig which could do it. Or you could run Robs dungeon creator script in Gimp or you can take the tiles I made for the August challenge which are still up in zip form. Alternatively you could write your own script to make them but if you ask me the best way would be to get a load of tiles together and render them out with directx as part of the game engine.
You can also put yourself on our members location map (http://www.viewing.ltd.uk/cgi-bin/WhereInTheWorld.pl) now too :)
11-04-2008, 09:14 AM
well, i mean random maps upon game start... like civ does, basically i'd need ideas about the steps to create a random world that looks fairly realistic... but the tiles i'll definitely look at, i'm planning on making my own as well eventually
You could always start with the open sourced sim city code... named Micropolis:
11-04-2008, 02:03 PM
You could also use GIMP to create a random "world" map.
11-04-2008, 05:59 PM
The main thing about the CIV tiles is that the grass, sand, water, etc. are just one base pattern for said elements. The problem is how to call up the various things that decorate the base like mountains, rivers, forests, lakes, and commodities like cows, iron, pastures, etc. I have the pics from CIV 4 unPACked (a PAC file is sort of like a zip file) onto my pc in a folder that I look at often for ideas. If you want I could send any of this to you so that you could reference them for helping you think your way through the process. I also have the pics for the Fall from Heaven mods in all of its various forms and upgrades and the Beyond the Sword bonus pack. I have all of the past CIV games and bonus packs as well...huge fan can't ya tell :)
11-04-2008, 06:28 PM
yeah exactly, i don't want to create one big random map that will be the same every game, i want to create a new map for each game... i don't think plugging in to gimp (if thats even possible) to build a map would be worth it...
but what your talking about ascension is what i was looking for, mostly the way in which they work out how to create continents, where to put the mountains, rivers, forests, fields, etc etc and all that...
11-04-2008, 06:39 PM
Have you looked at my Instant Islands (http://www.viewing.ltd.uk/cgi-bin/viewingdale.pl?category=instant_islands) app ? That sounds similar. It doesnt do the trees and water etc but to create a rough and random height map and paint out where the water and land belong is pretty easy stuff.
Its a freebie so just get it and play.
To get more detail would require a more complex algorithm which is where my other apps come in but they're not available.
If you like the app then here are some detailed tips (oh even source code I see !) on how to get a similar effect.
11-04-2008, 06:40 PM
Yeah, that's the rub...it's in the programming and I don't know anything about programming since Basic went away. Basically the images for terrain are laid out in 16 X 16 grids for rivers, beaches, hills, mountains, roads, and railroads. The programming somehow can chop up the images based upon the 16 grid slices and then plop 'em down in various ways to create the world file. The programming also can choose between sand, grass, and ice base terrains to put the other things on top of. I haven't looked through the forums there for this but I know that civfanatics.com has the largest forums I've ever seen. There are tons of mods there and maybe if you ask some of the folks over there they might help ya out or there might even be a tut. In fact I think I remember a sticky subforum on how to make your own mod and that might be a good place to start.
Another option would be to use a random terrain generator like Wilbur. It can run erosion and determine river location.
You could export the heightfield, a slopemap, an ocean mask, all of which could be taken and pixelated. From there it is a matter of using the heightfield and latitude to perform a lookup into your terrain tiles; use the elevation, latitude and slope to lookup the cover tile attributes (forrest, bare, brush, grasslands), and the river mask to add rivers...
I don't think Wilbur can be scripted though.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.