Trying to edit scrollspeed but no luck - any idéas?

Seb1974

Chieftain
Joined
Jan 17, 2022
Messages
16
Hi everyone,

After spending days studying Civ IV rules - watching videos, reading guides, taking notes on everything important, I finally decided to buy it on GOG.
The Complete Edition, $20 so wasn't cheap at all for such an old game, but I though it'll last for many many hours so might be worth it after all.

But when I start it up I notice that the map-scrolling speed is VERY SLOW!
Extremely annoying, so I look through all options, but no setting at all for scroll speed!
So I google it, and notice it's only me and like two more guys noticing this, and no solution anywhere.

So I start to look through all the files in the folders, and finally I find "...Civilization IV Complete\Civ4\Assets\Python\CvCameraControls.py
And inside I find iCameraMovementSpeed = CameraMovementSpeeds.CAMERAMOVEMENTSPEED_SLOW
Yeah, no kidding, SLOW!!!

Google then finds me this reference page: http://civ4bug.sourceforge.net/PythonAPI/Types/CameraMovementSpeeds.html
Which shows alternatives for this value.

CameraMovementSpeeds:

0 = CAMERAMOVEMENTSPEED_NORMAL
1 = CAMERAMOVEMENTSPEED_SLOW
2 = CAMERAMOVEMENTSPEED_FAST

I try editing in the file with CAMERAMOVEMENTSPEED_NORMAL and CAMERAMOVEMENTSPEED_FAST, and even putting in the numbers 0/2 instead.
I even try and change almost every number I can find in the file just to see if anything has any effect on anything, but nothing!
Actually, you can even DELETE the CvCameraControls.py entirely and game still runs like nothing happened, so maybe I shouldn't have any hopes of editing it to get any sort of effect :/
I also tried to start the base game instead of Beyond the Sword, but no difference there either.

I also tried adding the values in GlobalDefines.xml like this, putting the fast value 2 on them, but no difference there either. Editing other stuff in this file has effect though, but don't know what to edit/add to change scroll speed :/

<Define>
<DefineName>CAMERAMOVEMENTSPEED_SLOW</DefineName>
<fDefineFloatVal>2</fDefineFloatVal>
</Define>
<Define>
<DefineName>CAMERAMOVEMENTSPEED_NORMAL</DefineName>
<fDefineFloatVal>2</fDefineFloatVal>
</Define>

What to do? (Except beg GOG for a refund since I find the game unplayable, but I'm not sure they accept refunds).
Any help would be very appreciated!

Yes, I know you can click/drag in the mini-map, but that's not a very smooth solution, for me at least.
I just want what every other game has, some sort of setting/tweak for scroll speed.

Many thanks if anyone has some idéas :)

Moderator Action: Moved to C&C to see if experts here can assist. Cheers - lymond
 
Last edited by a moderator:
I just noticed that 2k has support for Civ IV - at least it's available in the support options when contacting them :)
So we'll see if they get back with any answer. If anyone knows how to tweak the scrolling speed it ought to be them!
(Unless all devs since that time are long gone and noones wants to bother with digging around in the files for a 15 year old game, just to please one player...)

And if the answer is "sorry not possible", then I can try refunding it as quickly as I can, knowing it's simply not possible to fix.
Either way I'm also waiting for Old World to release on GOG, so I might have future use of this forum however it goes :D
 
I play in windowed mode with mouse scrolling disabled (through My Games\Beyond the Sword\CivilizationIV.ini) and move the camera mostly by clicking on the main map (not minimap), which causes to camera to center on the position that was clicked. I think this is quite a bit faster than scrolling, especially when zooming out a bit. I guess I generally rely more on zoom than on camera movement. One can also hold down both mouse buttons on the main map and then drag, but I find that awkward.

As for CvCameraControls.py (the rest of this post is technical stuff), [edit: let's put it in a spoiler box] [another edit, four months later: there is a much simpler solution, see my post on page 2]
Spoiler :
I've added some print statements to that file (and enabled logging in CivilizationIV.ini) and noticed that most of the functions never get called, including the one that you've edited. Which also explains how the apparent bug (the parameter iCameraMovementSpeed being ignored) went unnoticed. Moreover, BtS has its own version of that file, and you've been changing the version in the base game.

The constructor (__init__) does get called, but that seems too early for changing the camera speed. If I insert
Code:
print "__init__"
print("old speed=" + str(CyCamera().GetCameraMovementSpeed()))
CyCamera().SetCameraMovementSpeed(CameraMovementSpeeds.CAMERAMOVEMENTSPEED_FAST)
print("new speed=" + str(CyCamera().GetCameraMovementSpeed()))
there, I get
Code:
__init__
old speed=0
new speed=0
in the log. Speed 0 should correspond to CAMERAMOVEMENTSPEED_NORMAL, i.e. it's not SLOW by default. Will have to do it in CvEventManager.onGameUpdate (CvEventManager.py, in the same folder as CvCameraControls.py) I guess:
Code:
onGameUpdate
old speed=0
new speed=2
Great – but it doesn't seem to scroll any faster (or the difference is tiny). If I set it to 1 (i.e. CAMERAMOVEMENTSPEED_SLOW), scrolling does become very slow. So this is unfortunate – seems that something inside the BtS executable somehow prevents faster scrolling.

We can speed up the arrow keys by moving the camera further in the respective direction whenever an arrow key is pressed. CvCameraMovement.handleInput gets called correctly (from CvEventManager), we just need to fix the previously unused moveCameraXPlots and moveCameraYPlots methods. They need to call
self.doMoveCamera
as "moveCamera" doesn't exist. Then we can do e.g.
Code:
if theKey == InputTypes.KB_LEFT:
    self.moveCameraXPlots(-0.5)
in handleInput. This works not too badly. In the early game, one can only scroll a certain distance into the unexplored black, and the moveCamera...Plots calls seem to cause the camera to briefly go past those limits until the EXE (I guess) puts the camera back right at the limit. Edit: The other keys ...
Code:
if theKey == InputTypes.KB_RIGHT:
    self.moveCameraXPlots(0.5)
if theKey == InputTypes.KB_DOWN:
    self.moveCameraYPlots(-0.5)
if theKey == InputTypes.KB_UP:
    self.moveCameraYPlots(0.5)
If you experiment any further with Python changes – though it sounds like you might've had enough of that –, you may want to be aware that code copied from the forum is not going to have the proper indentation (needs to be Tabs) and that Python files can be changed and saved while the game is running; upon gaining focus, Civ will reload all Python modules if any have been modified. And PythonDebug.log (print writes here) and PythonErr.log (uncaught Python exceptions go there) in My Games\Beyond the Sword\Logs are pretty indispensable (once logging has been enabled in CivilizationIV.ini).
 
Last edited:
Wow, thanks for really trying!
But seems it's hard to solve then?
I would like to try editing speed to 2, "fast", and see if I think the difference at least makes it playable for me, but how/where do I do that?

Should I just add the following, sort of anywhere, in CvEventManager.py?

onGameUpdate
old speed=0
new speed=2

I really don't have any clue how these files work so sorry if the question is really stupid :D
And I guess you already tried to enter higher numbers, like "5" or whatever, and that just doesn't work...
 
Weird. I don't really have any trouble with the map scroll speed. Be careful though with the python files.

Honestly, I use the mini-map mostly for moving around. Yes, it was awkward at first but I assure you that you can get used to it. I prefer it now.
 
I easily get strain/fatigue in my hands when gaming, so that's why I rely on edge scrolling with mouse.
I don't want more clicking, having to click and drag all the time, or play slow isometric games like they were FPS-games with left hand on WASD/Arrows all the time just cause devs haven't implemented edgescroll option.
Here we at least have edgescrolling, but it's just soooo slow (might differ depending on resolution and stuff, or just what speed you're used to have in isometric games).

I would probably like 100-200% faster speed here, but maybe 50% would make it playable at least.
If not fixable I'll just have to wait for Old World to get my Civ-needs satisfied (and hope GOG is kind and refunds this old expensive Civ IV so I can get some use of that money).
 
Gotcha! Yeah, using the mini-map requires quite a bit of wrist action and control, plus the clicking.

I think the speed varies on zoom level too.

Shame for you not to get into this game. It's one of the best.

IV usually goes on sale for around 6-7 bucks
 
Well there's always 2k support to hope for still...
And maybe the small fix from f1rpo makes some difference to me, when/if I get to know how/where I should implement it in my files :)

Gotcha! Yeah, using the mini-map requires quite a bit of wrist action and control, plus the clicking.

I think the speed varies on zoom level too.

Shame for you not to get into this game. It's one of the best.

IV usually goes on sale for around 6-7 bucks
 
I would hold little hope at all for help from 2K.

Your best option for help is around here. You can try the Mods forum as well. Folks over there may have some ideas.

(I almost considered moving this thread over there initially)

edit: Actually, I will move it over to C&C to get more eyes on this issue.
 
Last edited:
Lemme ping @Noble Zarkon regarding the GOG version. I believe he has experience with it, as well as some registry fix. Not sure if the fix is just for mods or applies to other areas as well, but maybe he has some thoughts.


By the way, are you playing BTS?

It's may be possible that the file is in a different location. Ugh..can't check this as I'm on a machine with the Steam version in which all the expansions are completely standalone, whereas the gog version and others have the old integrated format.
 
Helpful people in here, thanks all of you! :)

Yeah of course the plan is to play BTS. I payed way too much for getting the Complete Ed.
BTS has it's own folder under Civ IV, with it's own XML and Python files, but just not as many as in the main folder for Civ IV.
 
Wow, thanks for really trying!
But seems it's hard to solve then?
There is a handler for mouse movement too (CvEventManager.onMouseEvent), so one can probably do what I suggested for the arrow keys also for mouse scrolling, but figuring out whether the mouse has been moved onto or away from an edge of the screen sounds like it'll require some experimentation.
I would like to try editing speed to 2, "fast", and see if I think the difference at least makes it playable for me, but how/where do I do that?
Actually, having given it another try, it looks like this setting only affects how quickly the camera accelerates to its (fixed) maximal speed, and how long it takes to come to a halt once the player releases the arrow key or moves the cursor away. So it might help a tiny bit.
Spoiler :
Should I just add the following, sort of anywhere, in CvEventManager.py?
That's just the log output. The end of onGameUpdate (in \Beyond the Sword\Assets\Python\CvEventManager.py) should be the right place, i.e.
PHP:
   def onGameUpdate(self, argsList):
       'sample generic event, called on each game turn slice'
       genericArgs = argsList[0][0]
       turnSlice = genericArgs[0]
       # (Uncomment these if you like)
       #print("old speed=" + str(CyCamera().GetCameraMovementSpeed()))
       CyCamera().SetCameraMovementSpeed(CameraMovementSpeeds.CAMERAMOVEMENTSPEED_SLOW)
       #print("new speed=" + str(CyCamera().GetCameraMovementSpeed()))

   def onMouseEvent(self, argsList):
(with tabs instead of spaces)
That causes the speed to be set over and over several times per second, but I don't think there's any harm in that; at least it happens reliably this way.
And I guess you already tried to enter higher numbers, like "5" or whatever, and that just doesn't work...
I have tried that. Might default to NORMAL then; not getting noticeably faster.

Be careful though with the python files.
Right, I hope you're keeping backups of the original files. Could do this more safely in a mod or in Custom Assets, but that also complicates things further, and I guess you've been doing OK.
 
Last edited:
Yeah it gets a tiny bit better if I add your camera-fast-line there.
Clocking, several times, when I scroll from right edge to left edge, when pretty zoomed out, it takes 2,50s original and 2.40s after the "fix".
So a tiny bit better, but probably just acceleration that changes, so when you want to scroll a bit further the effect will be even smaller...
 
Speeding up mouse scrolling really seems difficult to do. (Also writing this for whoever else may want to implement such a thing.) onMouseEvent only triggers for clicks, not changes of the cursor position. So my best bet would be to check CyInterface().getMousePos() in onGameUpdate, but onGameUpdate gets called only 4(?) times per second; in a quick test, the jumps by 0.5 units that I used for the arrow keys don't yield any substantial speedup, and, for higher distances, the camera teleports more than it moves, i.e. it's way too choppy.
 
Anyway, another problem making it hard for me to enjoy the game is that the city names are very small and hard to read, speciall if a bit zoomed out (to give better overview and make scrolling a bit more effective).
I found the file to edit fonts in, and I can alter every font in the game it seems, EXCEPT the city names.
So oh well, maybe I'll just refund this and wait for the way more modern Old World, even if it's another take on this genre, it might as well be something I'd enjoy more :)
Much more modern and accessible when it comes to fonts and settings and everything we expect from modern games.

Strange anyway that I'm sort of the only one noticing scroll speed is very slow in this game, specially since the maps are so large!
 
Anyway, another problem making it hard for me to enjoy the game is that the city names are very small and hard to read
You have to remember that the game came out in 2005. Sure there are expansions and updates, but the core of the engine is from 2005. This means while the game does run in 4K resolution, they never tested or considered this as an option. Some parts of the game scales nicely while others not so much. Some are fixable with modding and some seems to be hardcoded in code out of reach from the modders.

Luckily there is a workaround. Switch the resolution to 1920x1080 and see if it works better. This often fixes all problems with text, popup windows and similar being too small. No idea about scrolling, but if somebody goofed and let scroll speed be x pixels for each frame, half the resolution would double the scroll speed. I never actually tested this though, but it's what comes to mind as a possible cause when reading this thread.
 
Yeah lower resolutions make the text a little bigger, but also way more unsharp, so actually even harder to read.

No effect on scroll speed, that was the first thing I tried when I noticed there was no setting for it, but makes no difference at all.

Yeah the game is very old so I understand all these limitations - maybe it was even modern for it's time, having edgescroll and so on, but doesn't really help when trying to enjoy it today.
That's why Old World might be a better choice for me when it comes, but have to be patient cause will take some months before it arrives...
 
Didn't work for me, with the citybar font size.
This is how 2560x1440 looks for me, very small city names.

I used this in that Civ4Arf-file...

<MiscArtInfo>
<Type>CITY_BILLBOARDS</Type>
<Path>None</Path>
<!-- positive scale: city billboards use fonts from GameFont.tga -->
<!-- negative scale: GFC billboards (uses the interface font) -->
<fScale>-2.0</fScale>
<NIF>None</NIF>
<KFM>None</KFM>
</MiscArtInfo>

EDIT: Or maybe it got a bit larger, but still not easier to read cause text looks worse instead.

 
Last edited:
We are off topic now, but anyway, here is the difference when fixing city names.
It gets larger, but it still isn't easy to read, and it also gets cut!
Here is a 100% crop from 2560x1440.

 
Top Bottom