Page 1 of 1

How to take generation of cities out of event codes

Posted: Sat Nov 07, 2015 2:03 am
by GaryChildress
Does anyone happen to know where the lines are in the event code for the Newdawn games which place cities on the map? I had this idea of creating a random game where only the capital city is placed on the map for each regime. Then I would make cities buildable and introduce a new resource called "manpower". Building a new city would require maybe 1000 manpower or something and as the game progresses and manpower is built up, each regime would be able to build cities based on the accumulation of manpower. Of course manpower would also be required to create sub formations and cities would generate manpower.

Trying to make an ATG random game sort of like Civilization.

Thanks.

RE: How to take generation of cities out of event codes

Posted: Sat Nov 07, 2015 2:38 am
by danlongman
I would love to see that Gary. Would it be like building a factory? I am trying to figure out how to put
NATO symbols and the Enhanced mods together with the Bombur 1930 for a random game. I lack talent.
Should never have quit drinking, I guess.

RE: How to take generation of cities out of event codes

Posted: Sat Nov 07, 2015 2:40 am
by danlongman
Plus I'd love to see a Napoleonics or ACW or 30 Years War type mod in a random game.
And military training and a bunch of stuff.

RE: How to take generation of cities out of event codes

Posted: Sun Nov 08, 2015 12:20 am
by Ormand
I don't think so. I think much of the map generation is hard coded and not done with events. I have looked a little because, frankly, I often don't like the nations that get set up that are split all over creation.

That said, it would not be hard at all to write an event that removes the cities, urban hexes and farm lands. This would be an event that runs first thing on round 1. This would have to be human only, since the AI wouldn't know how and where to put cities. You would have to code events for the AI to place cities.

RE: How to take generation of cities out of event codes

Posted: Sun Nov 08, 2015 1:35 pm
by GaryChildress
ORIGINAL: danlongman

I would love to see that Gary. Would it be like building a factory? I am trying to figure out how to put
NATO symbols and the Enhanced mods together with the Bombur 1930 for a random game. I lack talent.
Should never have quit drinking, I guess.

Hi dan,

Yes. I was thinking about having cities buildable in the same way as a factory is buildable. Of course one of my worries is with the AI and how it would react to the new requirement.

RE: How to take generation of cities out of event codes

Posted: Sun Nov 08, 2015 1:37 pm
by GaryChildress
ORIGINAL: Ormand

I don't think so. I think much of the map generation is hard coded and not done with events. I have looked a little because, frankly, I often don't like the nations that get set up that are split all over creation.

That said, it would not be hard at all to write an event that removes the cities, urban hexes and farm lands. This would be an event that runs first thing on round 1. This would have to be human only, since the AI wouldn't know how and where to put cities. You would have to code events for the AI to place cities.

Hi Ormand,

If cities are constructed in the same way as factories, do you think the AI would still have trouble creating cities?

RE: How to take generation of cities out of event codes

Posted: Mon Nov 09, 2015 6:27 pm
by Ormand
You could try, but I think it could go badly. I am not sure exactly how the factories are constructed for the AI. I suspect the type is randomly chosen. Also, there is the placement. If you are going to go "Civilization" there is the question of improvements as well. The AI couldn't handle it because it just isn't in the engine. But, you could make a new loctype for the cities, and make them buildable, and then put them in the AI auto build category. Look at the pre- and post-events that are used for factories, and see how to modify them. I think I would start with removing the factories, and see what the AI does with cities. Since features on the map are immune to FOW you should be able to see what the AI did fairly quickly.