Page 1 of 1

resolution of the game

Posted: Wed Feb 11, 2015 6:40 am
by nobody3
Hi, I have an older pc running star wars battlefront 2 and to get little fps boost I lowered the resolution to 640x480 using /resolution command in the game's shortcut. Problem is that I can't change a starting command post ingame (when you start game and you get to unit selection screen you can change the starting CP on "map")

I also play multiplayer sometimes and it gets really annoying that I have to travel through the whole map from the command post that I can't change until I get to see any enemies. Another thing is that the menu looks "shrinked" and I can't see some things. I guess it's because the default resolution is 800x600...

I looked through some scripts, hoping to change it so I can choose the CP. I found "ifs_charselect.lua" in data/common/scripts folder and there is some stuff about width and height but I dont really understand it. I guess many people didn't even looked through that so this question goes to the most advanced modders here. I'd appreciate an insight about this, thanks.

Re: resolution of the game

Posted: Wed Feb 11, 2015 12:54 pm
by Teancum
What are your PC specs? I've found that turning off extra features gives a much higher performance boost than dropping the resolution.

Re: resolution of the game

Posted: Wed Feb 11, 2015 3:08 pm
by nobody3
theyre turned off and its not just because of low performance, there are other reasons too

Is it possible or not? (my original question)

Re: resolution of the game

Posted: Thu Feb 12, 2015 6:02 am
by [RDH]Zerted
You can also use v1.3 to disable the award effects. That increases performance for a lot of people.

It may or may not be possible. I tried to add shortcut keys to selection screen and was only partially successful. I'm not even 100% sure where the code for the map container actually is. It might be entirely exe controlled. The unit selection screen is managed differently from every other IFScreen*. There's also ifs_mapselect.lua. Just play around with the numbers until you see something move, then play around some more until you can figure out how they work. But you actually want to start with ifs_pc_spawnselect.lua. My best and only guess is changing this.BotInfo's ScreenRelativeX to 0.0 or 0.5 and seeing what that does.

ScreenRelativeX isn't a pixel count. For example, 0.5 can be centered, 1.0 can mean on the right quadrant of the screen, and 0 could be the left quadrant. Something like that. Though sometimes the comments say 0.0 is centered... Positions are relative to their parent container, unless they're set to be absolute... It's normally easier to play with box widths and heights or titles first. The SWBF2 layout system is odd and confusing.

The screens were designed with a 4 player split screen in mind. That's why you see things like ifs_charselect1, ifs_charselect2, ifs_charselect3, and ifs_charselect4. Only the first screen is used on the PCs. Also use print statements so you can see what code is running. If you change a number and put a print statement there but never see that print in the log, then you know you didn't actually change anything the game was running, so maybe the change was in a bad location or your munged file isn't being loaded properly, or whatever.

*I couldn't even hide the unit selection buttons when making the 3+ Teams script despite knowing exactly where they're created (those this.Info[tag] buttons in the MAX_CLASS_SLOTS loop in ifs_pc_spawnselect.lua).

Edit: Can you post a picture of your shrunk menus?

Re: resolution of the game

Posted: Thu Feb 12, 2015 6:07 am
by nobody3
Thanks for taking my question seriously and sharing your knowledge. It's very helpful to me.

Oh and btw, I already removed award fx from ingame file :P it would be nice to make different fx that isn't such a fps bog but I guess its not possible

Re: resolution of the game

Posted: Thu Feb 12, 2015 10:20 pm
by [RDH]Zerted
Teancum took your question seriously. It's easy to become too focused on a specific solution and skip simpler ones. You didn't mention in your first post that you changed more than just the resolution in an attempt to gain FPS. Reducing graphical settings and increasing the resolution is the easiest way to fix not being able to select CPs.

Also if you're able to move the CP selection areas please let me know how you did it.

I don't know anything about creating new effects.

Re: resolution of the game

Posted: Fri Feb 13, 2015 6:35 am
by nobody3
Oh im sorry. My wording wasnt good I guess? I didnt mean to be ungrateful to Teancum. Im not native english so I dont understand some things I say completely.

Thanks for help you both.

Re: resolution of the game

Posted: Fri Feb 13, 2015 10:25 pm
by [RDH]Zerted
Is it possible or not? (my original question)
in response to Teancum combined with
Thanks for taking my question seriously
in response to me sounded like you were annoyed at Teancum's suggestion. Being very direct can sometimes be interpreted as being harsh.

I didn't remember that you're not a native English speaker. If I had, I wouldn't have seen it as harsh. By themselves each post was ok.

Re: resolution of the game

Posted: Sat Feb 14, 2015 5:22 am
by nobody3
oh ok, ill try to watch that but it comes it as a reflex when I translate it in my head from my native language

btw I tried to mess with the scripts (spawnselect lua and mapselect lua) I found more interesting info inside mapselect lua, there was this string "spawnpoint" and some code around it, I think thats it

but after I edited some values of both luas I went ingame with my new ingame.lvl and my unit selection screen was gone (the one with all the units to choose) but the map was still there and I clicked once on different spawnpoint and it changed, but when I tried again It wouldnt work. So maybe I used incorrect values...

Code: Select all

from mapselect lua:
local spawnpointWindowHeight = 30
local spawnpointWindowY = 0.12*h
from spawnselect lua:
ScreenRelativeX = 0.0
ScreenRelativeY = 0.0
Also when I was looking through ifs_pc_spawnselect I found that most of the code seems to refer to unit selection screen and not the spawnpoint changer map thing, maybe I should just give up... Its a trial and error.

Another question regarding this: Can I add new code inside those scripts? like the screenrelativeX ?

Re: resolution of the game

Posted: Tue Feb 17, 2015 4:21 pm
by [RDH]Zerted
Its a trial and error
That is how I built everything in v1.3. Make a change, see what happens. Eventually you will start to learn how things work.

Yes, you can add new code.