Jump to content

Recommended Posts

Posted

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.

Posted

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
Posted
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..?

Posted

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
Posted

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?

Posted

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
Posted

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
Posted

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
  • 1 month later...
Posted

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".

Posted

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 :)

  • 2 years later...
Posted

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
Posted

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.

Posted

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.

Posted

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.

  • 2 years later...
  • 7 months later...
Posted
On 12/7/2019 at 2:00 PM, Sailed Vegetable said:

It's fully playable mod? I have a problem with freeman compaign (3c mission i guess). Unit limits not allow me to constract enough army. I don't know is it my skill or what?

Apologies for the super belated reply. The missions have not been all thoroughly playtested, and most are indeed little more than playable place-holders. We intended to have much greater mission diversity but this has not materialised (yet). I'm afraid the project is on hold indefinitely at this moment, but scenario designers are welcome to try out something if they want.

Dune II is definitely capable of clever missions beyond the original's scope of build up the base and wipe out the AI. A recent mission pack by a fellow Russian map maker proves this:
https://www.youtube.com/watch?v=32EPgm0wePM

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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.