Page 3 of 6
Re: [NoGo] CityDomination
Posted: 08 Jan 2012 10:37
by LSky
Question and/or feature suggestion.
Is it possible for the game to be restarted through a script? As in, once a goal is reached (or a number of goals, which opens up so much more possibilities by the way) all the players get messages on who the winner is and the game/map restarts itself for people (who get reconnected automatically, in the ideal situation) to start over again?
Re: [NoGo] CityDomination
Posted: 08 Jan 2012 11:05
by Zuu
Scripts can't control servers to restart. But they can send messages to the Admin port. So a game script in combination with a server admin program, can do that.
Re: [NoGo] CityDomination
Posted: 31 Jan 2012 21:27
by frosch
FS#5035 reported a problem. The GoalTown constructor does always passes 0 as TownID, so the GUI always scrolls to the same town.
Code: Select all
- if(id == null) this.id = GSGoal.New(company, GSText(GSText.STR_GOAL_TOWN, town), GSGoal.GT_TOWN, 0);
+ if(id == null) this.id = GSGoal.New(company, GSText(GSText.STR_GOAL_TOWN, town), GSGoal.GT_TOWN, town);
Re: [NoGo] CityDomination
Posted: 01 Feb 2012 14:55
by 11Runner
FS#5035 reported a problem. The GoalTown constructor does always passes 0 as TownID, so the GUI always scrolls to the same town.
Thanks for the report. I will get this fixed this weekend. I am not familiar what "FS#5035" is...
EDIT:
Found the flyspray bug

Re: [NoGo] CityDomination
Posted: 05 Feb 2012 23:12
by 11Runner
Here is the tiny bugfix release for the goals issue. Any bug reports still welcome. No changes in english.txt if you would like to be a translator

Re: [NoGo] CityDomination
Posted: 29 Mar 2012 12:40
by 3iff
Possibly a bug.
Began a small game that started with 2 towns. Although I got goals to dominate both towns, I didn't get the population target and I was completely unable to get ownership of either town. I guess the script needs a minimum of 3 towns to function?
Restarted and got a game with 3 towns. Got ownership immediately and a target of 5000 pop to dominate.
Re: [NoGo] CityDomination
Posted: 29 Mar 2012 17:50
by 11Runner
Possibly a bug.
Began a small game that started with 2 towns. Although I got goals to dominate both towns, I didn't get the population target and I was completely unable to get ownership of either town. I guess the script needs a minimum of 3 towns to function?
Restarted and got a game with 3 towns. Got ownership immediately and a target of 5000 pop to dominate.
Did you have a competitor in the game? Did the total population of the 2 towns exceed the amount of the goal?
Re: [NoGo] CityDomination
Posted: 30 Mar 2012 07:15
by 3iff
I was playing solo. I don't think the total population was high enough.
Another oddity from trying it again last night. A 256*256 game with 9 towns, solo play. I dominated all the towns except the last one. In my current 'goals' list I have to dominate this one town (where I can't get ownership at all) and two others where I'm already in control.
Something else that's bugging me...town growth for all towns is every 257 days regardless of whether I have a presence there or not. It does make trying to grow the towns much more difficult. My current game has a pop of 9,500 dominated with a target of 15,000 and I can't get the towns to grow. The only city I have is 3,500, lots of stations with trains and buses plus a goods supply but still only grows every 257 days.
Does this script NEED an opponent or two to make it function correctly?
Other than these small problems it is quite enjoyable...although I should have built a coal line or two first as a few passenger routes can't make enough money...
Using version 7 but the script complains that this version is older than the saved version which it isn't. (I think the version check hasn't been amended but that's a minor point).
Re: [NoGo] CityDomination
Posted: 31 Mar 2012 05:35
by 11Runner
I was playing solo. I don't think the total population was high enough.
OK, thanks for confirming
Another oddity from trying it again last night. A 256*256 game with 9 towns, solo play. I dominated all the towns except the last one. In my current 'goals' list I have to dominate this one town (where I can't get ownership at all) and two others where I'm already in control.
Did you make sure that you dominated the town for a full period of 3 months? The reason for the 3 month requirement is to make sure you have a solid domination of the town, if you know what I mean
Something else that's bugging me...town growth for all towns is every 257 days regardless of whether I have a presence there or not. It does make trying to grow the towns much more difficult. My current game has a pop of 9,500 dominated with a target of 15,000 and I can't get the towns to grow. The only city I have is 3,500, lots of stations with trains and buses plus a goods supply but still only grows every 257 days.
You are correct. I will fix that bug over the weekend. Thanks for your report
Does this script NEED an opponent or two to make it function correctly?
It is recommended that you have competitors, mainly because this script is designed for multiplayer gameplay primarily, however, it should still operate correctly in single player as well.
Using version 7 but the script complains that this version is older than the saved version which it isn't. (I think the version check hasn't been amended but that's a minor point).
Thanks, thats another bug which I will fix soon (hopefully this weekend)

Re: [NoGo] CityDomination
Posted: 02 Apr 2012 04:00
by 11Runner
New Release! CityDomination v8:
* Added complete cargo support
* Fixed all of 3iff's previously reported bugs
* Fixed a bug where building a station and not using it gives you perfect station ratings, which is not fair
As usual, CityDomination is also available on bananas.
Re: [NoGo] CityDomination
Posted: 02 Apr 2012 08:25
by 3iff
Did you make sure that you dominated the town for a full period of 3 months? The reason for the 3 month requirement is to make sure you have a solid domination of the town, if you know what I mean
I was delivering stuff for 6 months or more yet couldn't get any ownership.
I'll give the new version a thorough test and report back if there are issues.
Re: [NoGo] CityDomination
Posted: 02 Apr 2012 09:13
by 3iff
Oops, managed to break it again...
Solo game, 5 towns. I got the initial goal of dominating 3 towns...and meanwhile, I dominated the other 2 towns in advance. That seems to have confused the script a bit.
So, once the TOTAL population reached 5000, I got the next target (15000) even though the HQ sign shows my domination population for the original 3 towns (excluding Mentstoke and St Nandean). Seems I'm not being credited with dominating those 2 towns for the HQ sign but I am getting credit for the overall population target. I also didn't get a message confirmation for getting those other 2 towns as they weren't on the goal list when I got them.
I have the savegame if you need it...and it's newgrf-free to make things easier.
(edit) Looks like the script has reset the dominated towns for the new goal of 15000. It now counts all 5 towns with the combined population total reporting correctly in the HQ sign.
Re: [NoGo] CityDomination
Posted: 02 Apr 2012 13:16
by 3iff
Started a game with 4 computer players. Ran ok for a while but then it seemed to stop updating. I saved and quit then reloaded the game...the script crashed.
Savegame available if needed.
Re: [NoGo] CityDomination
Posted: 02 Apr 2012 13:59
by 11Runner
Solo game, 5 towns. I got the initial goal of dominating 3 towns...and meanwhile, I dominated the other 2 towns in advance. That seems to have confused the script a bit.
So, once the TOTAL population reached 5000, I got the next target (15000) even though the HQ sign shows my domination population for the original 3 towns (excluding Mentstoke and St Nandean). Seems I'm not being credited with dominating those 2 towns for the HQ sign but I am getting credit for the overall population target. I also didn't get a message confirmation for getting those other 2 towns as they weren't on the goal list when I got them.
I have the savegame if you need it...and it's newgrf-free to make things easier.
A save file would be nice please

(just so I can know which towns you dominated and figure out what happened)
Started a game with 4 computer players. Ran ok for a while but then it seemed to stop updating. I saved and quit then reloaded the game...the script crashed.
Savegame available if needed.
The crash I will fix promptly as well, although I would like the save file for this one too
Re: [NoGo] CityDomination
Posted: 02 Apr 2012 15:17
by 3iff
Saves enclosed. The crash one might have involved a crashing AI...I'm not sure. Anyway, the game continued eventually (after another save/restart).
I also learned about what constitutes dominating a town...it's transporting all cargo in its zone...not just passengers.
Hope these files help...
One thing, the original target is 5000 then it jumps to 15000...is this correct?
Re: [NoGo] CityDomination
Posted: 02 Apr 2012 23:58
by 11Runner
I also learned about what constitutes dominating a town...it's transporting all cargo in its zone...not just passengers.
Actually, its the cargo ratings for each station are added up, and whoever has the highest station ratings dominates (actually, I wanted to determine it by how much cargo is transported by each individual company, but that was not available on the API, so I decided the station ratings were the closest).
One thing, the original target is 5000 then it jumps to 15000...is this correct?
No, it is not. I think that I will add a new parameter which changes how far the population jumps with each new goal
And thanks for the saves

Re: [NoGo] CityDomination
Posted: 03 Apr 2012 07:22
by 3iff
Actually, its the cargo ratings for each station are added up, and whoever has the highest station ratings dominates (actually, I wanted to determine it by how much cargo is transported by each individual company, but that was not available on the API, so I decided the station ratings were the closest).
Would it not be better to average the rating over the number of stations? Otherwise, a company could spam lots of stations getting 50% rating (say 10 @ 50% for 500) which would beat 4 stations at 100% but the 4 would surely be better than the 10. Alternatively, take the best 10 stations from each player in a town and total those. That at least gives a cutoff point to stop spamming dozens of stations and would make players focus on making some stations highly effective.
It might also help (if possible) to display the domination rating in the owner sign...something like...
Owner: 75% Jones Transport.
Then players would know how dominant an owner was.
Re: [NoGo] CityDomination
Posted: 03 Apr 2012 21:06
by CrazySquirrel
Appears that player built towns can't be owned.
Re: [NoGo] CityDomination
Posted: 03 Apr 2012 23:27
by 11Runner
Would it not be better to average the rating over the number of stations? Otherwise, a company could spam lots of stations getting 50% rating (say 10 @ 50% for 500) which would beat 4 stations at 100% but the 4 would surely be better than the 10. Alternatively, take the best 10 stations from each player in a town and total those. That at least gives a cutoff point to stop spamming dozens of stations and would make players focus on making some stations highly effective.
I considered that, and to counter that, I ensured that the script will check to see if the station is actually transporting any cargo before counting it. This makes it much more difficult for a user to "spam the town, because he/she must actually continually use the stations in order for them to be counted. I also decided that more stations should transport more cargo typically than averaging all the stations, or else the user could just have 1 good station and win from that, even though another player could be transporting more cargo.
The cutoff I may consider, but for right now let me focus on other things
Appears that player built towns can't be owned.
I think you are right! I will work on that too.
EDIT: One more question...
What is the owner rating you were talking about above the HQ 3iff?
Re: [NoGo] CityDomination
Posted: 04 Apr 2012 00:17
by 11Runner
OK here we go... CityDomination v9:
* Added new AI option to control step size of population goals
* Fixed gamesave bug reported by 3iff
* Fixed CrazySquirrel's bug where player built towns are not added to the processed towns list
As usual, available on bananas
Solo game, 5 towns. I got the initial goal of dominating 3 towns...and meanwhile, I dominated the other 2 towns in advance. That seems to have confused the script a bit.
I was unable to figure this one out... are you sure it wasnt a feature somehow? It takes 3 months after dominating the town for the goal to complete, in case you didnt know
