Jump to content

Dune 2000 1.06p - Game patching (bug fixes, new features)


FunkyFr3sh

Recommended Posts

From now on i am going to post all new features inside of this thread, else it is getting out of control if i create 100million threads :D

 

High res patch is now included in my patch, you can change the resolution via dune2000.ini "GameWidth=" and "GameHeight="

Interesting. Gonna test it right away.

 

Edit: The No-CD is not working.

Edited by D2k Sardaukar
Link to comment
Share on other sites

i just updated it today, all the buttons in-game should be on the right position and working now :) the final step will be the cosmetic changes, but that is not so important as long as all the buttons and functions are working :D once that is done i will have the full high res patch inside dune2000.exe, no extra files or patches needed!

 

if you like to test it then make sure you are using it on a fresh dune install without the old highres patch.

Link to comment
Share on other sites

It looks like the latest version doesn't make and/or read the .ini file. Perhaps I'm doing something wrong. I did get an error message when making the .exe, but it looks like build.bat just wants to start the game and cannot find all the files.

 

post-2251-0-75467100-1408130000_thumb.pn

 

I started .dune2000.exe without an ini and with an "selfmade" ini, but changing stuff has no effect.

 

 

Having the high res patch inside dune2000.exe would be really nice, but you are aware of the fact that the cosmetic changes you mention are (background) images that need to be changed? Perhaps its possible to change to them on loading the game? Also, the menus etc are located inside the .uil files, which is also outside the dune2000.exe. I can give you my Python code for changing the images and .uil files. It's not the most pretty code, but it works. :)

 

Edit: Got it working. Other make program was buggying it, had to fix path variable in windows. Only problem is that the file that is generated is called: ".dump-.patch-.import-.dune2000" ... hmmm

 

Ah, yes, high resolution is indeed working besides the cosmetics. The resolution 1680x1050 and other variants display the tile bug, this can be fixed by generating some black space next to the ingame build menu. The game needs for the battle view a width that fits 32 pixel tiles perfectly. So if you divide the width resolution by 32 and add the remainder to the build menu bar width (160pixels), other resolutions can also be supported. At decimal location 928224 (file offset) the menu bar width is given and so just do 160+(width%32)

Edited by D2k Sardaukar
Link to comment
Share on other sites

yes i know about the images, e.g. the small main menu surrounded by black. I will first try to center all the stuff automatically and then i take a look into the images :)

 

Sure go ahead, the code would help me to know which stuff i need to change :D

 

The patcher creates 3 .exe files, ".dump-.patch-.import-.dune2000.exe" ".dune2000.exe" and "dune2000.exe", you have to use the "dune2000.exe" since this is the one with all the patches applied

 

k, gotta check that tile bug out

Link to comment
Share on other sites

I noticed a special feature in window mode today, i could scroll the map around with hotkeys :D I added that now to fullscreen mode too, i hope it works!

 

I changed the hotkeys to

ScrollLeft = NUMPAD1;
ScrollDown = NUMPAD2;
ScrollRight = NUMPAD3;
ScrollUp = NUMPAD5;

 

You change them via dune2000.ini if you like:

"Hotkeys", "ScrollLeft"
"Hotkeys", "ScrollDown"
"Hotkeys", "ScrollRight"
"Hotkeys", "ScrollUp"

 

 

test file: http://www55.zippyshare.com/v/67752556/file.html

  • Upvote 2
Link to comment
Share on other sites

i have everything aligned now in the high res patch, now i only need to take care of the background images :/

 

i have 2 options...

1. center the original image (then it would be impossible to load any custom high res images cause the left and top side would always stay black)

2. load a different image for each res e.g. Title_800x600.tga, Title_1024x768.tga etc ..

 

Not sure where its going... anyways, does someone have background images for each resolution?

Link to comment
Share on other sites

i have everything aligned now in the high res patch, now i only need to take care of the background images :/

 

i have 2 options...

1. center the original image (then it would be impossible to load any custom high res images cause the left and top side would always stay black)

2. load a different image for each res e.g. Title_800x600.tga, Title_1024x768.tga etc ..

 

Not sure where its going... anyways, does someone have background images for each resolution?

I can help you with 2. I quickly made a background generator. It's based on my high resolution patch. See attachment. On end of python file you can see the resolutions I already created. You can find them in 'res' folder.

 

edit: it's only for r16 (16bit resolution).

background generator.7z

Edited by D2k Sardaukar
Link to comment
Share on other sites

Thanks! You dont happen to have all the other backgrounds too? :D

 

btw, there is some code which loads files named "uinew.tga" and "uinew.bmp", it seems like these two files are a replacement for the UIBB.R16 ... but the code is disabled :D did you ever seen those files? i might be able to load these and skip UIBB.R16 since its just 1 image inside of that file anyways

Link to comment
Share on other sites

i just checked out whats up with that uinew.bmp and found out that the game is able skip using its special formats and uses more standard stuff instead, maybe that could be interesting for some modders, dunno ... is there any file you guys have no clue what it does? or you dont know how to modify/mod it?

 

here is a small list of what i found (there is much more...) first you see the file name the game is using normally and afterwards the alternative it can load:
;Colours.bin -> colours.txt
;vars.bin -> vars.dat
;font.bin -> font.map
;font.fnt -> font.bmp
;mouse.r16/mouse.r8 -> mouse48.bmp
;circles.bin -> SCircles.bmp
;templates.bin -> many different .bmp files...

....

 

 

if you like to test around, the bool to change the formats is here:

0x004EB014, DisableDebugFileFormats

  • Upvote 3
Link to comment
Share on other sites

You mean with other backgrounds those in other menus like title screen etc? What I do with those is just add black space around original image, perhaps you can edit the code more pro and just put the images at the centre.  BUT! to align the menus then with the backgrounds you need to edit all the .uil files (also different for each resolution). I got code for that but perhaps it's easier to just keep everything at old location and only change the battlefield/gameplay menu. This one could perhaps be adjusted on the fly when the game is started? The .uil files for putting gameplay menu (when you press esc) in the middle are: InGame.uil, InGameMP.uil and InGameSK.uil. When you open the files (for example with d2k+ toolkit from mvi) you will see 4 numbers (sometimes separated with comma, sometimes not). The first two are x,y position, the other are width and height. So just change for those 3 files the x,y position for all elements in the uil files will do it.

 

I also have code to change build icon buttons (UI_ENG file) so when you go to starport you don't see non-usable build icons, but those also are resolution depended. 

 

I haven't seen uinew.tga or uinew.bmp. If you can get the code to work, its perhaps easier to just make it load bmp or tga files. This way the gameplay background is also tga just like menu backgrounds are already tga.

Link to comment
Share on other sites

yes i been talking about the Title.tga etc, i found the function which loads the UIL files and modified it to adjust the X Y for all uil files with just a few lines of code :D

 

here it is:

@HACK 0x004827D8, AlignUI
    mov ecx, dword[esp+0x1C]
    cmp byte[_HighResPatchEnabled], 1
    jnz .out
    add edx, dword[_HighResUIAlignY]
    add ecx, dword[_HighResUIAlignX]
.out:
    mov dword[ebp+0x0C], edx
    mov edx, dword[esp+0x2C]
    mov dword[ebp+0x8], ecx
    jmp 0x004827E6
@ENDHACK

 

yea i noticed that problem in the sidebar when you go to the startport menu, the game doesnt redraw this area :/ are you sure this is related to ui_eng file? i thought it was caused by uibb.r16

 

i tested the uinew.tga code and the game reads the files fine (see my post above)

  • Upvote 3
Link to comment
Share on other sites

Wow, really awesome with the auto adjust UIL files!! You are making great progress. I looked for it a couple of times with IDA Pro Free, but I could not figure it out. What's your trick?

 

Hmm, the uibb.r16 is purely the background image, it don't think it will fix the sidebar problem. Editing the ui_eng file to fix the problem is actually a hack/trick. I make the starport buttons at the bottom (which are grey blocks) very long so they overlay the non-usable building icons. Perhaps there is a better way with editing the code?

Link to comment
Share on other sites

that uil parser is huge, big mess :D like 50 functions are used there, not so easy to find xD

 

yea i just tested it, i thought the big background image would fix the redraw issue but it seems like there is a bug in the area of the additional icons which causes a redraw fail down there. the trick with the ui_eng file probably works cause it draws the stuff in a specific order .. maybe i can force a redraw or draw some crap on it to fix it :D

Link to comment
Share on other sites

Im getting closer to finish the high res patch... i tried to make everything working without the need to ship any extra files, but the in-game sidebar graphic needs to be custom, there is no way to stretch/center it like all the other graphics :(

 

the patch loads now custom sidebar graphics for each resolution automatically, test files are here:

dune2000.exe - http://www66.zippyshare.com/v/76605024/file.html

 

it works fine without extra graphics, but if you like to have an good looking sidebar, grab these:

http://funkyfr3sh.cncnet.org/files/d2k/HighRes-sidebar.7z

 

-

 

It does also support custom background images for each menu, if the game finds a high res graphic in your folder it will load it and center all menus automatically ... if there was no high res graphic found it will just use the original graphics and keeps all menus at the top left, you can get some graphics here:

http://funkyfr3sh.cncnet.org/files/d2k/HighRes-backgrounds.7z

 

 

some files are still missing in these packages:

uibb.r8 versions in all resolutions

dunemap.tga and dunemap2.tga (the sp menu is not fully done yet but i have found the most stuff to center it)

 

 

special thanks to D2k Sardaukar for helping me out with all the graphics

 

; ### TODO ###
sidebar graphic glitches when you switch the menu
fix sp menu (center anim)
map too small graphic glitches
airstrike OOS

  • Upvote 4
Link to comment
Share on other sites

Awesome work!

 

Perhaps add to TO-DO (but not that important as Airstrike OOS):

- center tooltips/pop-ups (for example in skirmish menu)

- center videos

- tile-bug resolutions (width/32 has remainder)

 

For fixing the crash with small maps and large resolutions I added unreachable grey/black tiles in the map data. This is not a neat solution. Perhaps you can find in the code a way to prevent the crash and just let it display black?

 

Is it also an idea to eventually add the option/code that when an user enters a fancy resolution like 1366x768 the game first (if not available) generates the custom UIBB background image(s)? Or incorporate this functionality into the ini file editor you perhaps wanted to make? I might give a try at converting my python code to c++ for generating the UIIBB. You can probably do it way faster, but perhaps other things are more important now.

 

I got code for editing the UI_ENG files to fix "sidebar graphic glitches when you switch the menu", but like I mentioned it is a cheap hack and it means for each resolution again lots of UI_ENG (r8 and r16) files. Do you think you can fix it within the code? Not to mention there are lots of other UI files out there, like UI_GER, UI_ITA etc.

Link to comment
Share on other sites

oh i didnt know about a crash with small maps, i have to check it out :)

 

i think its the best to generate the backgrounds with the same tool that writes/reads the dune2000.ini, would be cool if you could convert it C#/VB cause those are the most comfortable languages for GUI stuff :D but c++ is fine too, could make it a dll!

 

yea i still need to look into the sidebar glitches, editing UI_ENG is not really an option since they contain language specific stuff :( would be cool if it somehow works via the uibb files, but there should be a way to fix it just with code i guess

Link to comment
Share on other sites

So I figured out how to fix tooltips (for skirmish), but I don't know how to do it in the patching framework. I tried all @something but they add jumps.

All I want is this (a couple of times); change this line:

cmp eax,00000280

to

cmp eax,004EB020

 

Where 004EB020 is defined as ScreenWidth in the code of course.

 

EDIT: Got it working with @PATCH thanks to Sonarpulse

 

I got a fix for the tooltips, but when I use github windows program, it get the message that I do not have permission to push my changes to this repository. I completely understand that I don't have the permissions, but do you see my push or do I need to use a fork with a pull request? Or something else ..... so you can accept my changes? I'm okay that all my changes need approval, keep it that way, I understand that, I'm just not sure if my push is visible for you.

Edited by D2k Sardaukar
Link to comment
Share on other sites

nice :) the last 2 times it was working, i could merge your changes but this time i cannot see anything

Is the idea to have the resolution configurable in the INI? That would help with the installer a lot, as currently I have to call the patch program and rely on the user to select the correct resolution.

Link to comment
Share on other sites

Is the idea to have the resolution configurable in the INI? That would help with the installer a lot, as currently I have to call the patch program and rely on the user to select the correct resolution.

It already is. You just generate/copy an ini where you change GameWidth=... andGameHeight=... to whatever you want (as long as videocard supports it). For correct sidemenu and background you need to install separate UIBB files. And for all menus to centre also separate background tga files. See: http://forum.dune2k.com/topic/26661-new-patching-framework/?p=388122

Link to comment
Share on other sites

It already is. You just generate/copy an ini where you change GameWidth=... andGameHeight=... to whatever you want (as long as videocard supports it). For correct sidemenu and background you need to install separate UIBB files. And for all menus to centre also separate background tga files. See: http://forum.dune2k.com/topic/26661-new-patching-framework/?p=388122

So it still needs an external program to run and switch those around currently. Would it be possible to have the exe do the image stretching, or is that like the UIBB where it will always need to be edited externally?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...