 |
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:31
|
|
I've coded a lot of things for the ai, and want feedback on that before I go any further, so...
What should I be doing now?
Here's what the polls gave, reordered by priority:
20) demo priorities
a - Savegames. 4 25,0%
d - Technology. 2 12,5%
f - Social model. 2 12,5%
g - Government/Riots models. 2 12,5%
l - Graphics and GUI update. 2 12,5%
b - Map generator. 1 6,3%
e - economics/infrastructure. 1 6,3%
i - Diplomacy. 1 6,3%
k - Military AI. 1 6,3%
The current code status vis a vis the demo:
a - nothing done
d - no extra code done, but Richard could probably do things with the existing code
f - little or nothing done
g - government code exists but sketchy
l - an alternate military units building UI exists
b - There are some map generators, which now include terrain types, but aren't playable
e - don't know what's needed here
i - some infrastructure exists but there is nothing usable
k - some improvements
Here are the options I think of (considering both how important that looks and how much I want to code that particular kind of things):
1)Savegames
2)Social model
3)Econ user interface
4)Map generator with random civs placement
5)Diplomacy
6)Infrastructure for Healing units
7)Auto explore and spying
|
|
|  |
 |
|
Mark_Everson
|
 |
Canton, MI
Jan 1970 time: 00:31
|
|
Hi Laurent, thanks for putting up the analysis and overview!
Originally I was going to vote for Bananas, but since there were no real details, I decided on Social Model instead. Since you are the one that is going to be doing the work, I'll just comment on your top 3:
1)Savegames
Despite many peoples' interest in this feature, I still think it is basically worthless at this point. Until the game gets more complex, and gets beyond 20 min. play times I don't see that this will generate player interest. I do agree that once social and govt. starts playing a bigger part in the game, and tech becomes more integrated in the scenarios, we will then have the depth to make saves worthwhile. The only reason I can see for doing them now is if they will help in debugging. OTOH, if you really want to do saves, at least it would get this discussion out of the way for good!
2)Social model
I had much of the social/govt stuff working at one point, although with some kludges. Then Gary refactored it, shutting off some of the stuff he didn't like. The documentation Rodrigo did is very good.
Pro: It would not take a huge amount of time for you to get this Major program area working again. Most of the needed code is there. The interface is partway along.
Con: I already have experience with it, and may have time to work on it over the holidays. However I am Awful with interfaces. . .
3)Econ user interface
Lee made some progress on this. Doesn't seem like it would take too much work to get it going. However I'm making that judgment base on relatively little knowledge. I haven't gone back to look at the state of play when it got dropped.
Thanks for all the hard work Laurent! I'm looking forward to trying out the latest version of the new AI. 
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:31
|
|
About the social model:
I agree that there are many documents, and data and equations explained, but:
- I must check the current state of the code.
- What effects on gameplay does the model have? This sounds like a nasty question at first, but it's really important: What amongst these would be most important?
-Riots model
-Effects of government
-What else?
If I go for the social model, I'd like to have something visible to the player.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:31
|
|
As a side note, CTP2 source code has been released. IT's C++, everyone seems to get more than a hundred compile errors with the code as is, not counting flex/yacc stuff, but I will be looking into this code to see if there's any idea worth mimicking. The default game ai was dumb, but with mods it could get quite effective, so maybe there's something in there worth looking at. This will slow me down a bit on Clash of course, but probably no more than a week or two. Lets more time for people to vote on the poll before I start implementing the secret clash bananas.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:31
|
|
I checked the riots/social model code quickly. Here are my remarks. I don't make comments on the save or other topics because save has been defined quite well by Gary (though nothing is coded and I disagree on one detail) and the rest doesn't seem to stir as much interest. Note that the ruler interface now looks like something and the sliders work correctly.
Riots code overview:
game.economics.MilitaryUnitCreation imports game.social.riots.* which is a package containing a MilitaryUnitCreation class. I don't know why the package is imported, but the riots class should be renamed differently else catastrophs will happen. Looks like the import is superfluous.
SquareClass can manage social events.
SquareEconomy knows EthnicDiscontentEvent (hard coded IMO) and is able to build units from this event (adheres to EconomicActivityModifier). How's that supposed to fit in? Note that in this code, there is likely to be a (bug) ambiguity over which MilitaryUnitCreation class is being used.
Code exists (commented) in SquareEconomy to scan for existing social events and apply their effects.
Such events, however are never generated right now.
Religion.java What's the logic behind iscriminationFactor? Shouldn't this.discriminationFactor(this) return 0? Also, is Religion supposed to have social attributes like traditionalism/nationalism/land connection/importance of religion/corruption?
What needs be done:
In SocialTurn() create appropriate social events. How do I do that? Create a social event for every square systematically? Per EG? May be a tad expensive. Maybe do so only if discontent is big enough (pre filtering)?
Modify the interface so that MilitaryUnitCreation is something understandable by a coder (which package - rename) and there is no hardwiring of he class EthnicDiscontentEvent in the economy code (tsk tsk).
If I get it well, an event should be created with ethnicDiscriminationFactor and religiousDiscriminationFactor. The unit created is also hard coded, which is not necessary, as the same code that finds the best available militia unit could be used here.
The population (quantity of people) of the EG is nowhere taken into account in the code. It should probably. Right now, 1 person can spawn 3 units if he's really unhappy. What a great leader!
Should the effect on econ be the proportion of the EG in the square times the severity instead of severity/5?
About the quantity of persons, I think the best is to define that (EG population * fighting proportion of population * proportion of discontent) at most will fight, and figure how many units that translates into (rounding numbers down, so if they aren't enough, there will be 0 unit).
The creation of units probably requires some changing of the 'unit takes enemy square' algorithm in order to be playable. Can probably wait for tests, but otherwise, it would lead to a minority revolting, and then the majority revolting back...
What's the civ of the newly created riotting unit?
How do we show discontent to the player? Panels are OK when units are spawned but I HATE the 36 city screen panels in cov telling you city XXX is rioting. Sure, I know, I just caused a revolution! Also, how do you show this on the map? Or does it show? Do we need to be able to display discontent in, for example, the minimap?
Mark, it looks like 'much of the social/govt stuff' still leaves lots of room for coding.
|
|
|  |
 |
|
Mark_Everson
|
 |
Canton, MI
Jan 1970 time: 00:31
|
|
Hi Laurent, a good set of comments. I have some statements to help explain some of the code oddities you mention. Following that I'll comment on your next steps section.
All the riot and unit creation stuff in the econ classes are an artifact of the case that I just put them there "temporarily" for a first very rough implementation. The code can go in SquareClass as you suggest. All the clearly nonsensical imports and/or references can be removed. My guess on MilitaryUnitCreation is that Gary began moving my test code out of econ and only got part way before he switched to something else.
quote: SquareEconomy knows EthnicDiscontentEvent (hard coded IMO) and is able to build units from this event (adheres to EconomicActivityModifier). How's that supposed to fit in?
Code exists (commented) in SquareEconomy to scan for existing social events and apply their effects.
Such events, however are never generated right now. |
An EthnicDiscontentEvent is, as it says in the header "Handles riots originating out of dissatisfaction with ethnic and religious discrimination, and their effect upon the game."
The two effects that I put in as a temporary implementation are screwing up the economy (what that commented-out code did) and allows for creation of military units. All these crude implementations can be modified at you will, especially to support a scenario that really gives the player something to do with the social/govt/riots models.
quote: Religion.java What's the logic behind iscriminationFactor? Shouldn't this.discriminationFactor(this) return 0? Also, is Religion supposed to have social attributes like traditionalism/nationalism/land connection/importance of religion/corruption? |
I'm not sure about these, and 5 min of looking into it didn't clarify things for me. I think I did the discriminationFactor stuff however Rodrigo specified it. I do believe religions are supposed to have those attributes. The attributes of the religion can influence those of an EG IIRC.
quote: What needs be done:
In SocialTurn() create appropriate social events. How do I do that? Create a social event for every square systematically? Per EG? May be a tad expensive. Maybe do so only if discontent is big enough (pre filtering)? |
The latter is what I had. I would say use your judgment
quote: Modify the interface so that MilitaryUnitCreation is something understandable by a coder (which package - rename) and there is no hardwiring of he class EthnicDiscontentEvent in the economy code (tsk tsk). |
Yeah, I agree and am duly chastised for my evil coding habits. . .
quote: If I get it well, an event should be created with ethnicDiscriminationFactor and religiousDiscriminationFactor. The unit created is also hard coded, which is not necessary, as the same code that finds the best available militia unit could be used here. |
Agree.
quote: The population (quantity of people) of the EG is nowhere taken into account in the code. It should probably. Right now, 1 person can spawn 3 units if he's really unhappy. What a great leader!
Should the effect on econ be the proportion of the EG in the square times the severity instead of severity/5?
About the quantity of persons, I think the best is to define that (EG population * fighting proportion of population * proportion of discontent) at most will fight, and figure how many units that translates into (rounding numbers down, so if they aren't enough, there will be 0 unit).
The creation of units probably requires some changing of the 'unit takes enemy square' algorithm in order to be playable. Can probably wait for tests, but otherwise, it would lead to a minority revolting, and then the majority revolting back... |
Agree.
quote: What's the civ of the newly created riotting unit? |
This can obviously get tricky. If a civ with that EG dominant exists in the game, I would have it become a unit of that civ. If more than 1 have that civ as majority I would go with the closest and break ties randomly. If no civ with the EG exists we have two options:
1. Have a single "Neutral" civ that gets control.
2. Make a new civ with that EG name.
I prefer #2, but it could get complicated.
quote: How do we show discontent to the player? Panels are OK when units are spawned but I HATE the 36 city screen panels in cov telling you city XXX is rioting. Sure, I know, I just caused a revolution! Also, how do you show this on the map? Or does it show? Do we need to be able to display discontent in, for example, the minimap? |
The message screen can give a message like "Ethnic Discontent in 32 squares" that can be selected by the player to get details. A mini-map seems the best way to get info on detailed ethnic discontent and rioting levels.
quote: Mark, it looks like 'much of the social/govt stuff' still leaves lots of room for coding. |
Yep, there is still an awful lot to do for a reasonably complete implementation. But I feel it should not be more than a month's worth of work to at least allow a crude alpha version that can interact with the player in scenarios. Perhaps I'm being overly optimistic. 
|
|
|  |
 |
|
Mark_Everson
|
 |
Canton, MI
Jan 1970 time: 00:31
|
|
I promised a bit back that I would look and find my previous proposals for scenarios that actively use the government/social models. The first writup I've found isn't detailed, but gets the big idea across. It is from the Demo 7.3 thru Demo 8 Proposed Plan thread. Note that the proposed scenario also contains a diplomatic component. I think that part can be finessed for now until there is a diplomacy interface. The relevant parts are:
quote: Internal and External Threats
The purpose of this scenario is to introduce the government model, and ethnicity in the social model to the player. The player will have to master these to hold on at the end. The internal threats are from riots of captured peoples of other ethnic groups, The external threat is, as before, a massive barb invasion at the end. We will also include the need for some nuanced diplomacy.
1. Much of the government and social model will be needed for this. The player’s power to tax will be limited by the governmental setup. The properties of the government will also affect technological and economic growth. Deciding how to balance these issues, and the ethnic-based and other riots mentioned below will be the key to winning.
2. In addition to the player there will be several other civs, that must be diplomatically isolated one at a time to be conquered profitably. If the small civs are made to band together through inept diplomacy by the player then the player should have a very difficult time of it. This would allow introduction of the diplomacy model in a reasonable way. The player must expand through conquest since the Evil Empire is known to be heading this way, and only under a unified civ is there any hope of resistance.
3. The delicate intra-civ manuvering in this scenario, once the player conquers some of the smaller civs, is to provide the player with conquered peoples that need to be administered. The reason is that Discrimination-Based riots are relatively straightforward to implement, and provide the player with a reason to engage in internal power struggles using the govt. model. The short version of this challenge is that there is a strong religious power block in the civ that is intolerant, and the player can only reduce overt discrimination by using the governmental apparatus. Trying to wrest away power from the strong religious political block is one way to prevent extreme oppression of the conquered peoples, which causes them to riot and/or revolt.
4. At the end there will be a substantial invasion by a big civ “offstage”. Whether the conquered peoples fight for the player, or the invaders is based on previous player actions.
I am not quite happy with this one yet, so counter-proposals are very welcome.
|
Here is another version of this proposal
quote: I had an idea for a social/govt model scenario for demo 7. It is a bit contrived, but it would show off some of the features of the govt model.
At start all civs are ethnically homogeneous, but each has a different EG. Assume there is a primitive riots model that looks at ethnic discontent from maltreatment, and adversely affects the economy, or leads to revolt if garrison is not sufficient. Also the size of civ's economies, in terms of multiples of X, assume AI is about like it is now. With better AI so that the comp players are harder to beat, they would need to be adjusted.
Player Civ:
ruler has 40-50% power
Religious component has a lot of power, 30-40%? and is ethnically and religiously intolerant
has X economic and military power, and is at war with non-player 1
Non-player 1:
has approximately X economic and military power, and a different religion and ethnicity from player Civ
Non-player 2:
has Twice X economic and military power. They are currently involved elsewhere, but are expected to be interested in conquering the other civs in 40 turns or so.
One solution for player civ to survive (no diplomacy allowed for now) is to conquer p1 and so have a civ big enough to hold off p2. The immediate problem with that is that given the hostile ED settings expected to exist, conquered peoples will be rioting all the time, screwing up the economy, and tying up needed troops.
Solution 1: player uses his influence on ethnic discrimination to reduce ED somewhat, lessening rioting/revolt.
Solution 2: player takes on the church and tries to move power away from the church to himself or other less xenophobic elements of society. This allows player/ruler to lower ED much more. Player might be able to influence the vote with a bribe to one faction or other.
Either of these might be enough to win. Without the solutions below, I expect both player and p1 will be conquered when p2 attacks. IMO this will let the player really Use the govt/social models in an entertaining way!
What do you think? |
from the Government Model v. 3.1 thread (page 2).
Detailed discussion of these should probably go in another thread. Laurent, if you like the idea, we can start a new Demo 8 proposal thread and discuss where we want to go in terms of a specific govt/social related scenario. If this has turned you off on the social/govt coding idea, then we can just let this idea lie fallow.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:31
|
|
I'm looking at the social model code now. I'll work on it because, if nothing else, it severely needs it. Some parts of it wouldn't have compiled in C++ using templates...
I have one question: What's supposed to be in PopulationData? Ethnicity objects or EthnicGroup objects? This kind of stopped my progression in the code. Ethnicities are put in, but some code casts the content into EthnicGroup. I think EthnicGroup should be in but I don't know for sure.
It's okay for me to have a new thread for the social model, or bump a relevant one.
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:31
|
|
Okay here is the current code status:
Scenarios work more or less as they used to.
-Dawn works well but I got slaughtered at the end before my first chariot became available. Desert nomads tend to avoid direct attack so they have a better chance of taking a square than with the old ai.
-Carthago is a bit slow because Hannibal builds so many archers. I don't know why he builds so many, and suspect they move a bit randomly while trying to reinforce one another. I should have fixed this somehow but haven't tested it on Carthago scenario. Note that with the default ruler settings, there will be riots in this scenario, but the ruler can remove them altogether by reducing ethnic discrimination in his profile (the lowest value available must be arounf 45%, which is enough in this scenario).
-The siegewar scenario is much harder because the ai chariot won't impale itself on Minas Tirith but try to conquer the land around the city so you have to take it out before you can attack MinasMorgul.
-My reinforcement test scenario showed the ai is much better when introducing a simple tweak to the pathfinding. (This is what I really want to boast about by the way) One problem with pathfinding is that going from A to B and going from B to A don't always produce the same paths. This may result in units trying to join together just running around in circles, or taking different roads... I changed the algorithm so it always compute the path between A and B by starting from the same point (arbitrarily, the one with lowest X, then lowest Y if both X are equal). This changes the paths and helps reinforcements find their desired target a lot.
Social model coding is well underway. I reactivated a lot of code, and here's the status:
Riots do happen, but usually cause only a small amount of damage to the infrastructure. There are no riotting armies raised yet. It is possible to specify in the scenario file the minimum riot probability to be taken into amount. This is used in the Carthago scenario: I set a minimum probability of 0.19 for riots to happen, and the player can reduce them to less than that although they start at 0.2 almost everywhere on the map.
The government model is partly implemented: Only negociated policies and the negociation system are implemented. See my remarks in the government threads about the system we want to use.
So now I need a scenario to show the player the social/government model at work. This should be only xml work, not actual programming, although I may have to add a few features to the code if the scenario requires it.
Once that's done, I think a new demo should get out. There are quite a lot of new things since demo7, and then I should go for savegames.
|
|
|  |
 |
|
Gary Thomas
|
 |
New Zealand
Mar 2001 time: 17:31
|
|
Hooray! actually discussing polygons!
I envisage a textured underlay, with small (very small) randomly placed icons on top. These elements could be extracted from the existing tiles without much trouble.
The biggest problem would be with the military model - deciding when troops are close enough to fight.
Cheers and PF
Last edited by Gary Thomas on 10-01-2004 at 23:41
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:31
|
|
quote: And anyway, why wasn't polygons one of the choices? |
Because I didn't feel like coding them. But if you want to, you're welcome. As for distance for military units, it could actually be used to enhance the military model a bit, by enticing players to use units with a scouting radius which allows them to engage/disengage farther...
I'd have started on save/restore even though I knew you wanted to do it (when you get started, I have a small remark on the interfaces you proposed: In the saverestore.html file, you proposed a Object difference(Object earlierVersion) method which I think may not always be the most appropriate. An Object getDifferenceSinceLastSave() or somesuch might be better suited in-memory (doesn't force to clone the object in case it didn't change for instance) when saving. Restoring from a preexisting turn from file would still require the differenc(Object). (I haven't checked recently your specs, that's just what I remember thinking of the time I read them, I hope I got it right).
I'm still in the social model code. I think the riots equation may need to be tweaked (I use the linear version that was already in the code rather than that of the model) in order to have a probability that's less linear. The coded social model doesn't evolve (only the ruler changes his policies), thus there isn't much to change for the player. I must confess I play more time playing nethack than programming when I'm on my computer right now, but a scenario exists, so if I could probably send a testbed now.
|
|
|  |
All times are GMT. The time now is 05:31. Apolyton Time is 00:31. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|