Modify Urban Assault to natively support higher in-game display resolutions (Up to 4k)

For those of us who are curious and like to poke around in the game's data files and scripts as well as glitching. Caters to anything from unit/building stats to level data to telling how to glitch and stories of game errors.
Post Reply
User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Modify Urban Assault to natively support higher in-game display resolutions (Up to 4k)

Post by CharlotteLabyrinth » Thu Dec 08, 2016 4:00 pm

Hello again!

With Zidane's prodigious development of UA:Source, support for a higher display resolution in UA would be nothing completely new. But as the topic title suggests, I wanted to post something about the vanilla UA.


I have modified the original Urban Assault executables in order to add native support for displaying higher resolutions in the game. These .exe files will enable Urban Assault to automatically detect every available screen resolutions above '1024 x 768' on machines; allowing users to smoothly switch between extended arrays of supported resolutions at the game's Options screen. This work was done in original version of Urban Assault, and also conformably applied to Metropolis Dawn and Trial version.


Download:
Download Link


Before downloading, please keep in mind that the files are still in a HIGHLY EXPERIMENTAL stage and therefore may be unstable! Always backup your original .exe files prior to applying any of these new executables into the game, as I do not take responsibility for any kind of unexpected mishap that could possibly emerge due to an absence of backup files. Also currently, I presume there might be some bugs present with them. If you happen to find any, please report back to here. Feedbacks are greatly appreciated.


UPDATE: Software mode is currently not supported due to technical reasons. So please use Primary Display Driver mode.
Last edited by CharlotteLabyrinth on Fri Jun 30, 2017 5:00 pm, edited 2 times in total.
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

Ormu
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 840
Joined: Fri Dec 26, 2008 4:59 pm
Location: Finland

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by Ormu » Thu Dec 22, 2016 9:37 pm

Nice! I'll check this out. Was the functionality included and disabled, or did you have to add code?
Image
Matthew Lever wrote:Take out Ormus as soon as you see them.
UA community Discord channel: https://discord.gg/7H4dFQH
Not all Ormus are mine. When in doubt, please ask...

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by CharlotteLabyrinth » Sat Dec 24, 2016 6:03 pm

Ormu wrote:Nice! I'll check this out. Was the functionality included and disabled, or did you have to add code?
No external/custom code was added, just the bare minimum change to only enable higher resolutions (technically up to 4096 x 4096) in the game. And yes, the functionality was included. UA still makes me wonder sometimes!

Since I'm a purist I prefer to preserve everything intact as much as possible. Because there is no absolute guarantee that the changes I make personally from my own judgments are always sensible and objectively correct. :)


I found it while looking into an UA executable with a disassembler a few months ago, but nonetheless the actual modification was accomplished through a hex editor (because I'm paranoid :P ).

However since the change was so minimal, there should be a performance issue on higher resolutions; but it's only because the vanilla UA runs with so little memory (as you already know).

Maybe if I have some time later I may have a look into it again and see if I can do something about it. But for now, these modified .exe files will serve only as an experimental purpose.


By the way, these modified Urban Assault executables also contain a built-in fix for the helicopter glitch. The credit belongs to a discovery of Zidane the Great!
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

GoldStar611
BlackSect Creator
BlackSect Creator
Posts: 860
Joined: Sun Dec 02, 2007 1:16 am
Location: USA
Contact:

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by GoldStar611 » Sun Dec 25, 2016 7:48 am

I have tried it out in WINE under Linux mint and having higher resolutions is a very big plus (no more need to run in windowed mode)
Image
Image

User avatar
MarioSDU6/SDU7
Slime Lord
Slime Lord
Posts: 424
Joined: Sat Oct 09, 2010 3:12 am
Location: Panama City, Latin America

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by MarioSDU6/SDU7 » Sun Dec 25, 2016 8:01 am

CharlotteLabyrinth wrote:Hello again!

With Zidane's prodigious development of UA:Source, support for a higher display resolution in UA would be nothing completely new. But as the topic title suggests, I wanted to post something about the vanilla UA.


I have modified the original Urban Assault executables in order to add native support for displaying higher resolutions in the game. These .exe files will enable Urban Assault to automatically detect every available screen resolutions above '1024 x 768' on machines; allowing users to smoothly switch between extended arrays of supported resolutions at the game's Options screen. This work was done in original version of Urban Assault, and also conformably applied to Metropolis Dawn and Trial version.


Before downloading, please keep in mind that the files are still in a HIGHLY EXPERIMENTAL stage and therefore may be unstable! Always backup your original .exe files prior to applying any of these new executables into the game, as I do not take responsibility for any kind of unexpected mishap that could possibly emerge due to an absence of backup files. Also currently, I presume there might be some bugs present with them. If you happen to find any, please report back to here. Feedbacks are greatly appreciated.
Haha! I must admit it, you've indeed outdone yourself on this one (I know Zidane also did a really great job with the AI helicopters)! :D I was testing with the vanilla UA this, and the resolutions are now possible (I played with 1280x800, before moving to 1440x900, and so on, since I don't want to lose track of the map and any possible strategy I do :ninja: ). But one question, is it me, or each time I do want to change from Primary Display Driver to Software and then I click on "OK", the game suddendly gets stuck in a black screen (it doesn't say any errors). I used the Task Bar, and it said UA was "not responding". Did you change the Direct3D Device from Primary and Software in all of the versions (vanilla UA, MD, and Trial), you clicked on "OK", and you had no black screen or crash?

Lucky I made a backup copy, and when I renamed both UA.exe (the vanilla .exe and the .exe you modified), into UA_2.exe and the other one to open into UA.exe, I opened the vanilla .exe, and it worked without issues to change back the Software into Primary Display Driver. And after renaming it again (the vanilla .exe renamed to "UA_1.exe" and the .exe you edited to "UA.exe"), I opened and it works normally, with all of the resolution options intact.

Lol, these screenshots with the HUD upgrades (I've already seen the minor resolution bug pics you mentioned):
HUD upgrade 1
HUD upgrade 2

Btw (by the way), Merry Christmas! :)
Intense Mod progress (it includes tests):
Resistance 100% done
Demo version uncertain fate
New Ghorkov and Taerkasten 100% done

Image
Image
Image

Factions of choice: Resistance, Ghorkovs, Taerkastens

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by CharlotteLabyrinth » Sun Dec 25, 2016 4:08 pm

MarioSDU6/SDU7 wrote:Haha! I must admit it, you've indeed outdone yourself on this one (I know Zidane also did a really great job with the AI helicopters)! :D I was testing with the vanilla UA this, and the resolutions are now possible (I played with 1280x800, before moving to 1440x900, and so on, since I don't want to lose track of the map and any possible strategy I do :ninja: ). But one question, is it me, or each time I do want to change from Primary Display Driver to Software and then I click on "OK", the game suddendly gets stuck in a black screen (it doesn't say any errors). I used the Task Bar, and it said UA was "not responding". Did you change the Direct3D Device from Primary and Software in all of the versions (vanilla UA, MD, and Trial), you clicked on "OK", and you had no black screen or crash?
Thanks for the bug report! Well, the answer for that is quite simple - Software rendering mode is not really meant to be available on higher resolutions for good reason! UA as a software was released like 18 years ago, so I don't expect its ancient built-in rendering engine would be so powerful enough to handle higher resolutions even on modern CPUs. ;)

Actually, there is an integer limit of 0x555(=1365) that UA's software renderer can acknowledge without a glitch when drawing a resolution size. If I make the number exceeds this limit in the UA assembly code, then the black screen bug starts to occur on Software mode. So the only practical solution is setting the number lower than the limit. However, doing so restricts the maximum resolution size available on Primary Display Driver mode; and that's not something I aimed when I disassembled the files.


I think even the Zidane's development of UA:Source versions prior to OpenGL implementation (where the original UA's Software and Hardware rendering methods were still used) did not supported the software rendering at all. I don't know much detail in the case of UA:Source, so he might give us a better answer regarding this issue. :ninja:


At least that's my experience and perspective. It’s truly a shame that the software rendering is cannot be made fully functional alongside the hardware rendering in the modified executables. :( I also want to make these files perfect in functionality; but I can’t imagine any simple, practical ways to conduct it efficiently so I just gave up on that to save the time. Also, I tried to avoid modifying any registers or operands unnecessarily as much as possible, so perhaps analysing their properties and cross-references might prove to be resourceful. But currently, I have no intention of updating the files right now.

As I mentioned already, these .exe files are strictly experimental and I never recommend using them in place of the original Urban Assault executables permanently. :D

MarioSDU6/SDU7 wrote:Lucky I made a backup copy, and when I renamed both UA.exe (the vanilla .exe and the .exe you modified), into UA_2.exe and the other one to open into UA.exe, I opened the vanilla .exe, and it worked without issues to change back the Software into Primary Display Driver. And after renaming it again (the vanilla .exe renamed to "UA_1.exe" and the .exe you edited to "UA.exe"), I opened and it works normally, with all of the resolution options intact.
Graphics settings are not affected by which UA.exe you use as their data are stored inside the .def files in the env directory. :)

MarioSDU6/SDU7 wrote:Lol, these screenshots with the HUD upgrades (I've already seen the minor resolution bug pics you mentioned):
HUD upgrade 1
HUD upgrade 2

Btw (by the way), Merry Christmas! :)
These are perfectly normal. UA is an old game that was originally designed to be played on a screen with the 4:3 aspect ratio, so without any custom scaling methods the wireframes will inevitably come out stretched when you play the game at any widescreen resolutions.

On the bright side, since it does not alter the original scaling the display ratio is consistent throughout the every resolution size. So it will not have display ratio bugs such as the tank HUD problem. :P UA:Source on the other hand implements a custom scaling at higher resolutions in order to make game objects appear more adjusted and conforming within its newly supported resolutions. The current tank HUD problem on it is probably a coincidental drawback from those works.

And Merry Christmas to you, too! :mrgreen:
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

Ormu
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 840
Joined: Fri Dec 26, 2008 4:59 pm
Location: Finland

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by Ormu » Mon Dec 26, 2016 1:35 pm

CharlotteLabyrinth wrote: Actually, there is an integer limit of 0x555(=1365) that UA's software renderer can acknowledge without a glitch when drawing a resolution size. If I make the number exceeds this limit in the UA assembly code, then the black screen bug starts to occur on Software mode. So the only practical solution is setting the number lower than the limit. However, doing so restricts the maximum resolution size available on Primary Display Driver mode; and that's not something I aimed when I disassembled the files.
Hm, does this mean that the largest supported resolution in software mode would be 1366x1366? Is this just a limit or is it a result of some programming practices, e.g. using fixed-size arrays?
CharlotteLabyrinth wrote:I think even the Zidane's development of UA:Source versions prior to OpenGL implementation (where the original UA's Software and Hardware rendering methods were still used) did not supported the software rendering at all. I don't know much detail in the case of UA:Source, so he might give us a better answer regarding this issue. :ninja:
I think Zidane said he doesn't want to reverse the software renderer. I understand his decision very well since it would require extra work, perhaps even quite a lot of work, and the software renderer might use DirectX/Windows-specific calls which Zidane wants to get rid of.
Image
Matthew Lever wrote:Take out Ormus as soon as you see them.
UA community Discord channel: https://discord.gg/7H4dFQH
Not all Ormus are mine. When in doubt, please ask...

User avatar
Zidane
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 167
Joined: Mon Nov 22, 2010 8:38 pm
Location: Novosibirsk, Russia

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by Zidane » Mon Dec 26, 2016 2:30 pm

Ormu wrote: I think Zidane said he doesn't want to reverse the software renderer. I understand his decision very well since it would require extra work, perhaps even quite a lot of work, and the software renderer might use DirectX/Windows-specific calls which Zidane wants to get rid of.
Yeah, it's tonn of work too and software rendering was implemented because of many PC doesn't have 3D acceleration in 1998, often 2D cards with few mbytes of vram. And originally game engine might be compiled for dos or amiga where software rendering needed too
合体! ライオカイザー

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by CharlotteLabyrinth » Mon Dec 26, 2016 4:44 pm

Ormu wrote:Hm, does this mean that the largest supported resolution in software mode would be 1366x1366? Is this just a limit or is it a result of some programming practices, e.g. using fixed-size arrays?
Actually 1365 x 1365 would be the largest supported resolution in software mode – at least possibly on a widescreen with 16:9 aspect ratios (which I used to check the bug). It is because (1366/768) > (16/9) > (1365/768). The reason I'm suddenly stating like this is because yesterday I took a quick glance into the files again and had found something. So I can't jump straight to conclusions about the limit for now, maybe the value could be in fact dynamic. I might add details later.

By the way, can anyone test software mode with these modified executables on non-widescreen monitors? e.g. monitors with 1280 x 1024 (5:4) or 1600 x 1200 (4:3) resolutions? At the moment my access to computers is unfortunately limited only to my study laptop (1920 x 1080 widescreen), so the feedbacks from monitors with different aspect ratios (preferably 4:3 or 5:4, as I mentioned) could be helpful for figuring out more about the black screen problems in software rendering.
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: Modify Urban Assault to natively support higher in-game display resolutions

Post by CharlotteLabyrinth » Fri Dec 30, 2016 6:24 pm

Quick Update: I got permission from a professor to use an unused computer lab in a former facility and found an old Windows XP computer with a 1280 x 1024 resolution monitor there.

So I (secretly) installed Urban Assault on it and tested the game with my modified executables, and as I expected, the software rendering worked flawlessly in every respect on the 5:4 monitor without any black screen! One interesting thing to note is that Software mode seems capable of supporting much wider and detailed array of available resolutions on a same monitor.


Since this is just single evidence, again, I can't jump to conclusions yet. But when summed up while strictly disregarding all the uncertainties discovered so far, it probably goes something like this:

  • When displaying resolutions on Software mode with the modified .exe files, Urban Assault checks if the monitor's width exceeds 1365 (looks like it's just a limit), as well as the aspect ratios. (I have something more to talk about this one, but it is too uncertain and not verified yet, so more to come on that later maybe.)
  • If the monitor's width exceeds the limit, the black screen occurs on software mode with the modified .exe files.
  • If the monitor's width is lower than the limit, then the black screen won't appear with the modified .exe files.

Feel free to correct me as I'm still not entirely convinced of it. Because my knowledge of x86 Assembly is rather limited and especially, I won't have much time to spend on my hobbies from now on...
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

Post Reply