Modeling improvements/terrain (or: "So I've got this idea...")

Elle

Chieftain
Joined
May 5, 2006
Messages
3
I've been poking around the tutorials, docs and such toying with a rather pie in the sky mod idea: a game where instead of building cities, you build a large castle to defend. Probably, you would have a "keep" that functions in the game like a city would and improvements like "walls", "moat", "tower", etc, built around it.

Obviously this would require custom terain tiles and improvement models. Modeling skill and software aren't a problem for me but I've been poking around Google and these forums and I haven't seen any examples of this being done yet, much less tutorials. All I've been able to find is that they're the same file format as other units but nothing about how to get them into the game. If such instructions exist or there's people working on this who could offer advice it would be appreciated.

(On another note, there's the issue of coding to be considered: I'm lousy at it, although I'm going to need to learn at some point. XML doesn't seem too hard, python...well, I might get brave enough to learn; C++: Ack, hide! I've no idea which level of code mastery would be required to pull off the above, but if it involves digging into the SDK source there's a good chance i'll be scared off. Any idea how dirty I'd need to get with code to make this work?)
 
um.... Im not sure what you mean, but renaming cities into forts and renaming a few terrains, which are XML.

Most of this looks XML to me, but there could be something more sinister waiting around the corner, so this thread has been bumped anyway :bump:

nice first post by the way, yeah, a few more tutorials like this would be nice :)
 
It sounds to me like you want to put walls around the "Fat Cross" and then have towers, etc. as improvements inside those walls? Is that right? (What would be the mechanics / purpose of doing so?)
 
Ok, to make this more clear, I drew a picture of how this could work in-game..



A very basic castle, keep in the center, walls and towers around it, door between two towers.

Unit A is a standard military unit. It can't move onto or through the castle wall, nor can it attack unit C which is standing on the wall.

Unit B is a friendly unit inside the castle. It can climb the stairs inside the castle to get onto the walltop and move around on it. It can't, once on the wall, move off of it unless it goes back down the stairs. However, if it were a ranged unit like an archer, it would (idealy) be able to fire down upon enemies below (like a catapault when it bombards a city and causes colateral dammage?)

C and D are up on the wall and the tower respectively. Towers are stronger than walls and units on towers have a longer range of vision. Units on towers and walls gain a defensive bonus of course.

Catapault E (Ok, I was too lazy to hunt for a catapault to put on the map) can attack the walls directly and over several turns, knock them down, potentialy allowing troops to flood in.

Unit F is a special ladder-carrying unit, with which they can move onto the castle wall. This takes more than one turn however, and they're at a severe disadvantage if they meet up with a strong enemy unit(s) once they get up.

As for the castle itself, I envision it being built by Workers much in the way improvements are. Walls can be laid down in lines like roads, connected to towers, etc.
 
This is a really interesting idea. It would be tough doing it in just Python and XML, unless you make some sacrifices.

It would seem the idea of building walls is dead in the water if they were invincible, so at least the Catapult part would have to work. To do that, the walls could not be merely be improvements like typical workers build, since I doubt there's an easy way to assign a sort of hit points or power ratings to them for the catapults to chip away at. Also, even if you were to make an improvement which is "impassable" to the enemy, I don't think there's a way to not therefore make it "impassable" to yourself. Rather, each "wall" section would have to be actually a unit or city (with the catapults chipping away at the units power rating or the city's "culture" rating, respectively).

Making it a city would be nice, since the "bombard" option is already thrown in, but that would just make the map look strange, not to mention mess things up while cycling through cities. Making the wall an immovable unit would probably be better.

Perhaps make a terrain improvement called the "wall", and using the onImprovementBuilt function in the CvEventManager.py file (a function that is called whenever any improvement is completed), whenever you see that a wall has been created, put a "Wall" unit on that same territory. The "Wall" improvement will provide the graphics for wall, while the Wall unit provides the hitpoint (probably make the graphics for the wall unit transparent, not sure if that's possible). Whenever a wall unit is killed, which can be detected using the onUnitKilled function in the same CvEventManager file, remove the wall improvement.

You can change the wall improvements just with the XML so that people who are standing on a tile with the wall improvement get defensive and line-of-sight bonuses, but I'm not sure how you can make sure that certain types of units can / cannot attack from the top of the wall, nor be certain that certain types of units can / cannot attack the wall itself. Perhaps give a -100% bonus to those attacking the wall who aren't wall-attackers, and hope people get the point :P

Hope that can at least give you some ideas to run with.
 
Back
Top Bottom