Jump to content
MrFlibble

Dune 2 eXtended Project

Recommended Posts

dynasty    66

Looking forward to the new maps. :)

 

Just a quick note: it looks like the maximum timeout is 65535, or roughly 18 minutes.

I haven't checked it in detail, but it looks like you can squeeze in a division (an unsigned right shift, "shr") where the nop's are to accomodate longer timed games.

 

http://forum.dune2k.com/topic/18875-dune-2-exe-editing-programming-issues/page-25#entry380308

  • Upvote 1

Share this post


Link to post
Share on other sites
drnovice    62

Uhm I saw that g_timerGame & g_tickScenarioStart are uint32, instead g_scenario.timeOut is uint16, but mapSettingTimeout is defined as dw (double word).

The problem looks like the registers contain only a word as max length (00000000|00000000).

How would you use shr into opcode?

 

We could set dx register to shr 4, so we can have near: 18 * 2 * 2 * 2 * 2 => 18 * 2^4 = 288 mins, almost 5 hour of max timeout.

Share this post


Link to post
Share on other sites
dynasty    66

I was thinking of using "shr dx, 1" to divide by 2.  Looking more
closely though, it looks like you aren't using the high bits, which
will introduce problems later.  There's not enough any room to
completely do:
 

    (int32)g_timerGame - (int32)g_tickScenarioStart >= g_scenario.timeOut

 
However, instead of taking the first two bytes of g_timerGame and
g_tickScenarioStart (i.e. the least significant figures), we can work
on the second and third bytes to simulate a divide by 256.
(Neglecting to most significant byte shouldn't be a problem.)
So maybe something like this will work:
 

    mov     dx, word ptr timer_1 + 1     sub     dx, word_46CC1               cmp     dx, mapSettingTimeout     "(int16)(g_timerGame / 256) - (int16)(g_tickScenarioStart / 256) >= g_scenario.timeOut"

 
Set a timeout of 60 * 60 / 256 ~= 14 for 1 minute.

  • Upvote 1

Share this post


Link to post
Share on other sites
drnovice    62

I solved so:

http://forum.dune2k.com/topic/18875-dune-2-exe-editing-programming-issues/page-25#entry380308

 

One minute is 225 value into Scenario INI file Timeout variable.

In this way you can obtain a max timeout of near 5 hours to do the prefixed goal.

I think it's enough, but it's possibile set shr to 5, to reach more than 9 hours as max timeout possible.

 

Once again, thanks to notify! ;)

  • Upvote 1

Share this post


Link to post
Share on other sites
MrFlibble    114
Awesome work as usual! ^_^

I think it's enough, but it's possibile set shr to 5 to reach more than 9 hours as max timeout possible.

I've just tried to imagine someone playing a Dune IImission for 9 hours :D I fancy the only thing you can do to amuse yourself after the AI is defeated is to harvest nearly all the spice and then try to fill up the whole map with more spice via the trick with the destroyed harvester that is >50% full. Oh, and you can combine that with destroying an endless supply of enemy harvesters if you keep their refineries intact.

Oh yes, and with segra's looped reinforcements fix, one can have some small battle with enemy air-dropped forces once in a while.

BTW, I wonder how much points one can score that way. Also, I think some games from that time might crash or lock up if they run for too long..?

Share this post


Link to post
Share on other sites
drnovice    62

I think to increase game longevity it isn't necessary make too long Scenario Missions, instead we could create Campaigns that have more than 9 Scenario Missions levels, but we should do a complete background storyline to link these Missions.

  • Upvote 1

Share this post


Link to post
Share on other sites
MrFlibble    114

Heh, it's just that I thought that even five hours is more than necessary to beat a Dune II mission :) It isn't really about the time you spend playing, but rather about the game potential to be played for a certain period of time. Once you reach the upper limit of individual mission design (e.g. the number of units, structures, AI players and resources you can place on a map, as well as its maximum size), the maximum time a mission can be played will be limited accordingly.

On an unrelated note, I remember you posted a video in one of the editing threads here some time ago, but I can't seem to find it. Could you please link to it again? And if you have more Dune II or DuneX videos uploaded somewhere (even if it's pure testing), could you please point to them too?

Share this post


Link to post
Share on other sites
dynasty    66

drnovice, you still aren't taking any part of the high bytes of

g_timerGame and g_tickScenarioStart into the calculation, which will

lead to problems after 18 minutes (or maybe 9 minutes?).

 

The original logic was:                

 

                                        mov     ax, word ptr timer_1+2  ; ax = high bytes of g_timerGame    mov     dx, word ptr timer_1    ; dx = low bytes of g_timerGame    cmp     ax, word_46CCE          ; compare high bytes of g_timerGame and s_tickGameTimeout    jg      short loc_22395         ; Jump if high bytes of g_timerGame is greater than high bytes of s_tickGameTimeout    jl      short loc_22390         ; Jump if high bytes of g_timerGame is less than high bytes of s_tickGameTimeout                                    ; High bytes are the same, so compare low bytes    cmp     dx, word_46CCC          ; compare low bytes of g_timerGame and s_tickGameTimeout    jnb     short loc_22395         ; Jump if Not Below (CF=0)                                           "if ((int32)g_timerGame < (int32)s_tickGameTimeout)"
                                       

Whereas the current patch is:

 

                                           mov     ax, word ptr timer_1+2  ; ax = high bytes of g_timerGame    mov     dx, word ptr timer_1    ; dx = low bytes of g_timerGame    sub     dx, word_46CC0          ; dx = low bytes of g_timerGame - low bytes of g_tickScenarioStart    mov     cl, 4                          shr     dx, cl                  ; dx = (low bytes of g_timerGame - low bytes of g_tickScenarioStart) / 16    cmp     dx, mapSettingTimeout   ; compare dx to g_scenario.timeOut    jb      short loc_22395                                                       "if ((((int16)g_timerGame) - ((int16)g_tickScenarioStart)) / 16 > g_scenario.timeOut)"
I think these are signed comparisons, which halves the maximum time. 

The signed comparison is important when you load a saved game because it will set

g_tickScenarioStart = g_timerGame - savedElapsedGameTicks.

  • Upvote 1

Share this post


Link to post
Share on other sites
drnovice    62

I assume that max possible value is 65535, 11111111|11111111 binary.

So it's evident that max possible value of  "(g_timerGame - g_tickScenarioStart) / 16"  must be the same.

I discard the high parts since g_scenario.timeOut never will reach it.

Mabye the only thing was to set jbe instead jb.

 

However the Savegame point start isn't fixed by patch, so I must try another solutions.

  • Upvote 1

Share this post


Link to post
Share on other sites
drnovice    62

Thanks to Dynasty's suggestion, I took high 8 bits of lower register and low 8 bits of higher register to obtain a value between 256 and 16777215 (a max of more than 4660 mins or more than 77 hours of possible timeout) to compare with uint16 g_scenario.timeOut.

 

http://forum.dune2k.com/topic/18875-exe-editing-programming-issues/page-25#entry380308

    if ( ((uint32)g_timerGame / 256) - ((uint32)g_tickScenarioStart / 256)  >= (uint16)g_scenario.timeOut )

I tested with 3 mins (TimeOut=42) at starting game and with Restart Scenario. I tested even with Save/Load game.

I also tested with 20 mins (TimeOut=280) and it works (Restart Scenario + Save/Load game).

  • Upvote 1

Share this post


Link to post
Share on other sites
drnovice    62

I looked at the (Mercenary) Guild's planet: what about Tandis III ? ??? I can't find any info.

 

Tandis Four is background for Star Wars, afaik the Guild doesn't live in a planet, but it controls Tupile the "sanctuary planet".

Share this post


Link to post
Share on other sites
MrFlibble    114

I looked at the (Mercenary) Guild's planet: what about Tandis III ? ??? I can't find any info.

Tandis Four is background for Star Wars, afaik the Guild doesn't live in a planet, but it controls Tupile the "sanctuary planet".

"Tandis III" is completely made-up (by me) :) I think that I was subconsciously influenced by the Tandy 3 voice sound device option in the game's setup.

I also made up the Mercenary Guild. It is by no means the same thing as the Spacing Guild, but it seemed logical that the mercenaries would be united in some kind of a guild too (although FH never mentions anything like that, mercenaries probably came from a variety of sources and were not united into any single organization).

I didn't know about a Tandis Four in Star Wars (I only remember Tantive IV (spelling?) which was Princess Leia's Corellian Corvette?). Unless I came across the name Tandis Four while playing Dark Forces or reading Wookiepedia and subconsciously memorized it, we can count this as yet another (unintentional) parallel between the two universes :)

Share this post


Link to post
Share on other sites
Nyerguds    209

Looks like the images in the first post don't work... might want to reupload to a more reliable host like imgur or something.

Share this post


Link to post
Share on other sites
Nyerguds    209

http://cnc-comm.com/community/index.php?action=mgallery;sa=album;id=38

https://web.archive.org/web/20130301190534/http://forum.dune2k.com/topic/18360-dune-2-extended-project/

Sure you do :P

Heck, you can actually still download the images from the broken image links on the first page. It's just that ImageShack went crazy for some reason and no longer seems to allow embedding images, or something.

So yeah, my advice... just switch to Imgur :)

  • Upvote 1

Share this post


Link to post
Share on other sites
MrFlibble    114

You're right. I'm just being lazy (well, actually not very motivated because of being very busy), and I haven't really maintained the project for a long while.

I have an Imgur account so I should get those online soon.

Share this post


Link to post
Share on other sites
drnovice    62

We need to write an original plot for DuneX Campaigns, keeping in mind that levels don't need necessarily be 3 scenario per mission. It could be hacked to be 4 o 5 choice every "Select your next conquest" step, remembering to increase scenario.ini files for every choices in every step.

Share this post


Link to post
Share on other sites
MrFlibble    114

If you have the time to script a new campaign, you're welcome to do that. It would be interesting to explore more scenario combinations that are possible, e.g. missions with no base building. However I have absolutely no time for that ATM.

Share this post


Link to post
Share on other sites
MrFlibble    114

The v1.29 download was apparently lost during forum updates, so I had to re-upload the file.

Share this post


Link to post
Share on other sites
MrFlibble    114

Great, thanks a lot! ^_^

Wow, you have all the screenshots from the CnC Comm Centre Gallery, cool!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×