The International Simutrans Forum
September 10, 2010, 08:54:35 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
Use the "Forum Search"
It may help you to find anything in forum Smiley .
 
   Home   Help Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Change to city growth code.  (Read 284 times)
0 Members and 1 Guest are viewing this topic.
inkelyad
*
Offline Offline

Posts: 69


« on: July 28, 2010, 09:32:13 PM »

Pushed to my github devel branch.

Cities will grow with more dense central part.

and cityrules.tab parameters for new code:

renovations_count -- how many buildings will be renovated in one step.
renovations_try -- How many attempts we will do to find them.

Don't forget to adjust renovation_percentage.

As usual, I need better names for variables/parameters.
Logged
jamespetts
Devotee
Moderator
*
Offline Offline

Posts: 3416


Cake baker


WWW
« Reply #1 on: July 28, 2010, 10:08:02 PM »

Thank you for this - will test it presently. How does renovation_percentage need adjusting for this patch?
Logged

James E. Petts

Download the experimental version of Simutrans and help to test lots of new features here.

Download Pak128.Britain here.
inkelyad
*
Offline Offline

Posts: 69


« Reply #2 on: July 28, 2010, 10:18:54 PM »

How does renovation_percentage need adjusting for this patch?
-10%, I think.
Logged
jamespetts
Devotee
Moderator
*
Offline Offline

Posts: 3416


Cake baker


WWW
« Reply #3 on: July 28, 2010, 10:28:28 PM »

Might I ask - why does this need adjusting in this way? Also, I have just applied the patch: when I try to generate a new map, I get a runtime error relating to an uninitialised variable "f" at line 4345 of simcity.cc - what is "f" for?

Edit: That seems to be fixed by setting f to 1.0 at line 4312, but does this alter the intended behaviour?
« Last Edit: July 28, 2010, 10:37:52 PM by jamespetts » Logged

James E. Petts

Download the experimental version of Simutrans and help to test lots of new features here.

Download Pak128.Britain here.
inkelyad
*
Offline Offline

Posts: 69


« Reply #4 on: July 29, 2010, 04:28:46 AM »

Might I ask - why does this need adjusting in this way?
I don't know. It just looks that way. Trial & error decision.
My patch uses renovation_percentage in somewhat different way then before => new 'best' value must be found.

Also, I have just applied the patch: when I try to generate a new map, I get a runtime error relating to an uninitialised variable "f" at line 4345 of simcity.cc - what is "f" for?
Yes. it wil break 'city avoid  high place' behaviour.
It was cut&paste error in my commit 3bae1da8f2eaa26a1d9400a73ed9878b437c1c27.
Fix pushed to github.
Logged
jamespetts
Devotee
Moderator
*
Offline Offline

Posts: 3416


Cake baker


WWW
« Reply #5 on: July 29, 2010, 09:45:10 AM »

Inkelyad,

thank you for your answers and for your fix, which I shall apply when I get a chance: that is most helpful. How does your patch alter how "renovation_percentage" works?
Logged

James E. Petts

Download the experimental version of Simutrans and help to test lots of new features here.

Download Pak128.Britain here.
inkelyad
*
Offline Offline

Posts: 69


« Reply #6 on: July 29, 2010, 10:29:15 AM »

Without too much details and in pseudo-code:
Before:
Code:
if simrand(100) <= renovation_percentage:
    try to renovate building via renoviere_gebaeude
renoviere_gebaeude not always do renovation. In my version it is checked.
Code:
if simrand(100) <= renovation_percentage:
    try to renovate building until we renovate renovations_count buildings ( or we do too many attempts)
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.061 seconds with 22 queries.