Jump to content

Dune2K - High Resolution


CCHyper

Recommended Posts

Great work!

 

*Still need to figure out the bmp files for the world map before I release the script.*

 

Can you just read the bmp header as is, change only resolution fields and write it back with the enhanced pixel data as the new bmp? Or is the problem somewhere else?

 

 

*N.Kindt, what is different in your 0.8.1 version and the very first version?*

 

0.8.0 has the crash fix if cliking below 4th slot on upgrade but no ability to build anything (wrong byte sequence). In 0.8.1 you can build as usual (with the crash fix).

Link to comment
Share on other sites

Great work!

 

*Still need to figure out the bmp files for the world map before I release the script.*

 

Can you just read the bmp header as is, change only resolution fields and write it back with the enhanced pixel data as the new bmp? Or is the problem somewhere else?

 

 

*N.Kindt, what is different in your 0.8.1 version and the very first version?*

 

0.8.0 has the crash fix if cliking below 4th slot on upgrade but no ability to build anything (wrong byte sequence). In 0.8.1 you can build as usual (with the crash fix).

Is it possible that you have the crash fix of 0.8.1 also for other resolutions?

 

I can read and copy the bmp header and change the resolution (double width and height), but I don't know how to 'enhance' pixel data. Only changing resolution does not work and gives BMP error. Bitmaps are stored in scan lines with padding that I can't seem to put my head around.

 

I tried resizing the bmp images with imagemagick, but it seems to throw away the palette... Dune 2000 won't read those.

 

----- EDIT

 

OMG. I don't get it, I just opened, read and rewrote the bmp files and now it works. The image files are exactly the same. Only creation date might be different...

 

I don't get it...

 

It was just the background image I guess... I changed it from centred to in the left corner with the rest black.

 

315kd2e.png

Edited by D2k Sardaukar
  • Upvote 2
Link to comment
Share on other sites

Well done!

*Is it possible that you have the crash fix of 0.8.1 also for other resolutions?*

1024x768 only. Expect undefined behavior on other resolution. It's should be no problem to go to higher resolution if needed.

  • Upvote 1
Link to comment
Share on other sites

High resolution patch!

 

* Patch works on fresh/clean Dune 2000 (v1.06), English version preferred.

* Mods need to be made for original resolution and first be installed on fresh/vanilla Dune 2000 before patching.

* All you have to do is put the folder from the zip in the main Dune 2000 folder and run from within the folder "d2k_patch.exe".

* Always keep a (zipped) backup of a fresh/clean Dune 2000 game in case the patch goes funky or you want to try mods.

* Get mods and more stuff at http://d2kplus.com/ , like the mission select patch/mod.

 

Special thanks to N.Kindt and mvi.

 

DOWNLOAD:  hi_res_patch_v1.4.2.zip

 

Known bug: Certain reinforcements (mission events) on the smaller maps (first few missions) do not work correctly.
Larger maps (larger than screen resolution) do work correctly.

 

Not working? Try copying the whole folder like this: http://forum.dune2k.com/topic/19636-dune2k-high-resolution/?p=384335

Still not working?, try the cncnet-gruntmods-edition (contains code-parts of this patch and more!): https://cncnet.org/dune-2000

 

Here is an example of 1280x1024:

10fpe7q.png

Edited by D2k Sardaukar
fixed corrupt file. noted bug.
  • Upvote 7
Link to comment
Share on other sites

Great!

 

*Thanks. It would be great if you could update your patch so that with every resolution it works like 0.8.1*

 

How does it bahave on 1280x1024? Does it crash?

 

Don't remember what i patched there but some res-dependent values are hardwired directly into assembly instrcutions.

  • Upvote 1
Link to comment
Share on other sites

Great!

 

*Thanks. It would be great if you could update your patch so that with every resolution it works like 0.8.1*

 

How does it bahave on 1280x1024? Does it crash?

 

Don't remember what i patched there but some res-dependent values are hardwired directly into assembly instrcutions.

It crashes when clicking below the 4th build icon when in 'upgrade tab'.

Link to comment
Share on other sites

I'm pretty sure it does, I get some palette issues on 8 bit mode, but it looks ok apart from that. It's really simple to make those changes work for 8 bit as well though, if you need any help give me a shout :-)

Link to comment
Share on other sites

I'm pretty sure it does, I get some palette issues on 8 bit mode, but it looks ok apart from that. It's really simple to make those changes work for 8 bit as well though, if you need any help give me a shout :-)

For me 8 bit goes all crazy:post-2251-0-61977700-1367442173_thumb.jp

But what is really crazy is that switching between Windows desktop and the game for like half a second displays the game correct, but then funky again. I will try to put 8bit in the next version, but I can't test it good.

 

------

EDIT: Ordering with starport now possible, but I can't seem to move the height of the button.

EDIT2: There is still a strange crash when going over normal building icons (also empty space) when in starport 'order menu'. I'm afraid N.Kindt can only to fix that.

Edited by D2k Sardaukar
Link to comment
Share on other sites

For me 8 bit goes all crazy:attachicon.giffunky.jpg

But what is really crazy is that switching between Windows desktop and the game for like half a second displays the game correct, but then funky again. I will try to put 8bit in the next version, but I can't test it good.

 

------

EDIT: Ordering with starport now possible, but I can't seem to move the height of the button.

EDIT2: There is still a strange crash when going over normal building icons (also empty space) when in starport 'order menu'. I'm afraid N.Kindt can only to fix that.

 

Do you have a savgame of this state since i am pretty sure i clicked between the slots, below and around it enough to consider it fixed. Is it 1024x768?

Link to comment
Share on other sites

Do you have a savgame of this state since i am pretty sure i clicked between the slots, below and around it enough to consider it fixed. Is it 1024x768?

 

Use the mission selector and start OD6 (v1 or v2). Click on the starport menu and move the mouse below the 4th building icon on the first column. It will display first some strange building text like 'Engineer' and then crash. This is for 1024x768 and both version of your patch.

You edited your post, are you ok with UI_ENG now?

I'm semi-ok. I got the starport purchase button visible and working, but the game won't change the vertical location, it's always stuck under the 2 by 4 building icons. Location in UI_ENG.R16 is 66166 right? 66162 is x position and does respond to different values.

Link to comment
Share on other sites

I updated my script to version 1.1.1, it now also updates the .r8 files and you can purchase from the starport again. Could someone reply back if 8 bit mode works ok? On my pc 8 bit is acting a bit funky. If someone wants the python scripts, I will post them on the forum.

 

N.Kindt, I would like to help with fixing the last little crash bugs. Is there something I can do/test? Would you perhaps also like to share more about how you did the hacking, like what software, where to look at, etc?

 

 

Some extra info:

Supported and not supported resolutions:
720x480 x
720x576 x
800x600 v
1024x768 v
1152x864 v
1280x720 v
1280x768 v
1280x800 v
1280x960 v
1280x1024 v

1360x768 x
1360x1024 x
1366x768 x
1400x1050 x
1440x900 v
1600x900 v

1680x1050 x
1920x1080 v

Edited by D2k Sardaukar
  • Upvote 2
Link to comment
Share on other sites

*N.Kindt, I would like to help with fixing the last little crash bugs. Is there something I can do/test? Would you perhaps also like to share more about how you did the hacking, like what software, where to look at, etc?*

 

It's unfortunately quite involved. You need extensive knowldege on the x86 instruction set and the architecture in general (stack, memory model, registers, etc). Additionally you need to be very confident with the native Windows API (and x86 ABI, calling conventions) since the game runs on Windows. From there you can take absolutely any disassembler/debugger you feel comfortable with and start reading/stepping through assembly instructions and try to figure out what the code does. Being comfortable with reverse engineering can take years and at least couple books to read and understand. I am afraid you have to wait till i get back at this full force.

 

*Use the mission selector and start OD6 (v1 or v2). Click on the starport menu and move the mouse below the 4th building icon on the first column. It will display first some strange building text like 'Engineer' and then crash. This is for 1024x768 and both version of your patch.*

 

The first patch regarding upgrade menu did not fix the startport so thats expected. I asked people to try if it works for startport and now we know it doesn't. I hope to find some time and check this + adjust upgrade fix for other resolutions. Did you experience any crash on Upgrade menu only (can we consider it fixed)?

 

Other then that, nice work! :)

Link to comment
Share on other sites

Did you experience any crash on Upgrade menu only (can we consider it fixed)?

I did some testing (a lot of clicking) until I clicked with the right mouse button below the 4th building icon; crash. It says: "Invalid array index  [ gGameTicks = x ] " - where x can be any natural number.

 

If you can fix RMB crash, I'm quite convinced it's fixed for upgrade menu. Only thing I can nitpick about is cosmetics; that the not-upgradeable buildings should not be displayed in the upgrade menu. Is that possible? :-)

Link to comment
Share on other sites

Hmm, it's just crashing for me. The patch isn't making a new DAT file.

Did the cmd screen say "PATCHING COMPLETE!" ?

 

Do you get an error message? Perhaps try running the patch in administrator mode. Right click on d2k_patch.exe and select 'run as administrator'.

Link to comment
Share on other sites

HI,

 

I'm new on this forum. I'm french and i try to play Dune2K in Hi-res mod.
When i try to launch  Dune2000-hrpatch.exe command it says : 

can't open Dume2000_1024x768.dat ... why ?

thank you very much ;)

Link to comment
Share on other sites

Did the cmd screen say "PATCHING COMPLETE!" ?

 

Do you get an error message? Perhaps try running the patch in administrator mode. Right click on d2k_patch.exe and select 'run as administrator'.

No, it doesn't. I am running it as administrator. Here's a video of what happens 

http://youtu.be/wTwp0wRrRCE

I'm getting an IndexError

Link to comment
Share on other sites

I got past the crash by making a shortcut for DAT_patch.exe with "C:\Westwood\Dune2000\High Resolution Patch\DAT_patch.exe" -w 800 -h 600 --workaround but it looks like the old patch

 

 

EDIT it's working now, some left over files from Luminar's Layout Replacment were the issue.

Edited by Shai-Gel98
Link to comment
Share on other sites

I got past the crash by making a shortcut for DAT_patch.exe with "C:\Westwood\Dune2000\High Resolution Patch\DAT_patch.exe" -w 800 -h 600 --workaround but it looks like the old patch

 

 

EDIT it's working now, some left over files from Luminar's Layout Replacment were the issue.

Good that it's working. "DAT_patch.exe" is just N.Kindt's patch renamed.

 

I think I'm going to add a date check on the files that are being edited with the next version so that it will display a message when the files are not original.

 

On the other hand, this date check should not be needed if people make a mod that contains correct, meaning working, UI elements. :)

 

If people make a mod with new background images and stuff, they only need to make it working for 640x480 resolution and the patcher will do the rest. I could adjust the script in the next version so that when people have vanilla dune 2000 patched to say for example 1600x900 and a few days later install a mod, that the patcher when run again will see based on the date that a mod is installed and (if necessary) adjust the files to the 1600x900 resolution. This only works however if the mod maker created the mod for vanilla d2k. A better practise would be if the mod user just installs the mod on a vanilla d2k and then runs the patcher and when the mod user gets a new mod, he again gets a vanilla d2k, places the mod and runs the patcher. For this practise the patcher doesn't need to be adjusted. If you just keep a (zipped) backup of your Dune2k install and use a copy of that as vanilla d2k whenever you want to try a mod, you're always save.

 

What I find less fun is how slow the script patches the files in your video. Perhaps I can adjust the algorithm for some images for faster patching.

 

For the next version I also tried editing the power bar and I think I'm able to put it on the bottom of the gameplay UI, however the size of the power level (green, yellow, red) is still the same because that's generated by (I'm guessing) dune2000.dat.

 

Hmm, I just got an idea to perhaps fix the starport bug by making the starport purchase button extremely large (over the 4th building icons all the way to the bottom). Of course not stretched, but just black space. I'll see somewhere this week if that is possible and fixes the problem.

Edited by D2k Sardaukar
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...