Jump to content

Dune2K - High Resolution


CCHyper
 Share

Recommended Posts

  • 1 month later...

I cant change the graphics, they stay the same, but the game would be able to run at a higher resolution, thus being able to see more on the Tactical View and making the sidebar longer.

Im working on similar projects for the C&C games: Red Alert, C&C and Sole Survivor.

EDIT: I just noticed the game patches dont check for registry entry's, i have a copy of the latest EXE, gonna take a butchers at the code :)

EDIT2: Its nice that the game holds strings that name most classes :P, so i should have no trouble getting it to run in high resolution, only thing i worry about it the sidebar, might be like C&C95...

how abort your project now?

Link to comment
Share on other sites

  • 2 months later...

@TSHyper: Well, I may be a bit late but some time ago you wrote: "There is a bool here, "gFullScreen" - 004EB008 (raw: E9808), change this to "00" and the game will run in a desktop window, the logic is messy though..."

I would like to play Dune 2000 in windowed mode but couldn't find this value in hex in any of the files. Which file do I have to edit or where can I change this value to play Dune 2000 in a desktop window? Thank you very much for any hints in advance.

Link to comment
Share on other sites

Bigger sprites is not easy. Look at OTTD extra zoom. It is still out of trunk and has issues.

I suggest you form a team like TTD Patch and OTTD and first create a patch and later an open source Dune 2000 game.

Bigger sprites? Sprites have nothing to do with it, its just the view port that needs changing...

dune2k_1024_768_test06.png

Link to comment
Share on other sites

I found it, thank you very much! It is in the dune2000.dat not the executable. But the window is not centered, it appears in the upper left corner and if you move it it will "snap" back into that position. I presume there is no way to center the window somehow...? ;)

Link to comment
Share on other sites

View port? Does this game use 3D view port?

What for graphic system does the game use actually? Like opengl, directx or is it home/house written (does that exist)?

If you was to look out of your window, the window frame and size is your viewport. What you see outside is your tactical map.

D2k as far as i know runs mainly on DirectDraw and DirectPlay, aka, DirectX. Of course it has some custom rendering librarys for VQAs, Shape Sprites, etc.

EDIT: I think it might have some OpenGL stuff, i just found a function called "GL::DrawStringCentered()".

EDIT2: My bad, its part of the company's graphlib.cpp, "Graphic Object Library".

Link to comment
Share on other sites

@Alexpop2: It is just at the location TSHyper had found: 0E9808 in the dune2000.dat There is 00 there if you search it via any hex-editor. Change this value to 01 and start the game (desktop colour depth should be 16-bit and no "run in win95 compatibility mode" or "run in 640x480" should be selected - in fact none of the XP compatibility options for older games should be selected or it will still go fullscreen no matter what). But it won't do you any good unless you accept that it is locked to the upper left corner of the screen ;)

  • Upvote 2
Link to comment
Share on other sites

If you was to look out of your window, the window frame and size is your viewport. What you see outside is your tactical map.

D2k as far as i know runs mainly on DirectDraw and DirectPlay, aka, DirectX. Of course it has some custom rendering librarys for VQAs, Shape Sprites, etc.

EDIT: I think it might have some OpenGL stuff, i just found a function called "GL::DrawStringCentered()".

EDIT2: My bad, its part of the company's graphlib.cpp, "Graphic Object Library".

Thanks for info.

I did some opengl programming last week, so I know a little about it, but I know nothing about (old) directx. Does that also make the hacking harder for you (that it is old directx stuff)?

Link to comment
Share on other sites

  • 2 years later...

I have had a few messages as of late, mostly asking if I am still active and working on the patch.

I have been helping MVI with some little hacks, so I am active, on and off, but I am working on the patch, there are quite a few problems I must research into more, and I do not have a lot of time to be honest.

But I will post any updates :)

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...
  • 5 months later...

It's not the game engine which is the issue, CCHyper has halfway to creating the patch, before he lost his files. It would take someone with experience of IDA (or similar) to reverse engineer enough to create the patch.

  • Upvote 2
Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

I checked the Dune 2000 binaries since i wanted to replay the classic myself. I was able to changed the resolution to 1024x768 (for testing under VM) and displace some GUI elements accordingly. The only problem is the part of the GUI which is mostly static during gameplay. In the original 640x480 mode the scanline takes up 640*2 bytes in 16bit mode. If we increase the resolution (i.e. 768) it will take 1024*2 bytes instead. Since memory layout is linear the loop responsible for copying the GUI pixels doesn't stop at pixel 640 and jumps to a different scanline but continues to write past 640 which leads to the obvious artifacts where multiple scanlines are placed next to each other instead of on top each other (3rd screenshot).

 

Since it takes a lot of time to time reverse engineer in general and this time is not easy to find i have documented the problem if somebody wants to take over and finish it. Although Westwood were my heroes back in the days, the Dune 2000 code feels rushed and hardcoded. Maybe it is worth waiting for OpenRA instead.

 

Details:

 

Following screenshot shows the .data section of Dune2000.dat. Those constants are responsible for most of the GUI elements in the game (if you update the resolution those have to be updated as well).

http://postimage.org/image/mi1fwbkcp/

 

The blit loop responsible for blitting the top bar. The stride artifacts are noticeable here. Note that it blits from Source surface to Destination surface. The Source surface is created before we enter the battlefield thus the correct logic must be fixed to have a Source surface with correct pixels. The Source surface only starts blitting if we actually overwrite the backbuffer areas which something (mousepointer i.e.) otherwise nothing is blitted per-frame.

http://postimage.org/image/klynvmu69/

 

The loop responsible for copying GUI pixels (from a file) to the surface which is later consider the Source surface. This happens before we enter the battlefield. If someone knows details about Dune2000 resources i guess it could be enough to change the images to a certain resolution. Width and height would be taken from the images and correct size would be created for the Source surface. With original assets this leads to the artifact and stride problem described.

http://postimage.org/image/mfu77oy4n/

 

If this only problem would be fixed (by me at a later time or by someone else) Dune2000 would be playable under higher resolution (already is with the lack of some GUI elements).

 

I have a working executable with 1024x768 and the mentioned stride problem. If someone wants to test it out i could send it over.

  • Upvote 2
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.

 Share

×
×
  • Create New...