Planet M.U.L.E. online!

Talk about everything related to general reverse engineering of computer games!

Moderator: Kroah

Planet M.U.L.E. online!

Postby bigheadzach » 12 Dec 2009, 20:51

Some enterprising young Scandinavians have brought things to a great start...

http://www.planetmule.com

As we Americans might say...the shit just got real.

So, there's been lots of discussion on the forums about tweaking the gameplay to exactly match the original (save for the bugs in the Atari version, and some vastly improved interfaces)...and Kroah, your name tends to come up a lot as an authority (ok, it's me doing most of that), and I believe the dev team used your document (v.40) as a primary reference, but translations tend to give different people different perspectives. So, there's some definite interest in seeing that document get fully translated. Also a number of questions on details that I wanted to ask, if we could engage in some private messaging.

Thanks for all you've done in the spirit of unbridled capitalistic amusement.

Zach Gaskins
bigheadzach
 
Posts: 3
Joined: 12 Dec 2009, 20:43

Re: Planet M.U.L.E. online!

Postby Kroah » 14 Dec 2009, 11:50

Hello Zach,

The remake seems really promising. I can't download it right now, but i'll give it a shot.

If you have any questions, feel free to ask here. I would rather a post than a PM, so everyone interested can contribute (according the question does not concerns internal & private rules of the remake of course). I've registered at their forum if they don't want posting here.

I will not be able to complete the translation right now, i have to release CoCoNet this week before Christmas. This is on my todo list though.

Regards,
Kroah
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: Planet M.U.L.E. online!

Postby bigheadzach » 15 Dec 2009, 07:24

Ok, regarding two vague points in the translated decompilation:

-----------------------------------------------------
Personal events (the ones that happen before development/exploitation):

The requirements for an event to occur are:

an event happens only one time in the game
a good event never occurs to the first ranked player
a bad event never occurs to the 2 last ranked players
certain events require a particular condition

Which of these two phrases Is correct?
  • Once an event has happened, it cannot happen again to any player.
  • Once an event has happened, it cannot happen again to that player.
If the answer is #2 (cannot happen again to that player), does this mean that multiple players may automatically trigger the Care Package event if they meet the criteria (not in 1st place, and has no Food)?

If the answer is #1, then that implies there is a possibility that all of the personal events will occur, meaning that no more personal events can/will happen in the game.

-----------------------------------------------------
When the Store makes MULEs following the auction, which of the following happens:
  • The Store uses all of the Smithore it currently has, including units that were sold to it by players during that turn.
  • The Store uses all of the Smithore it possessed at the start of the turn.

The game manual states that it takes a full turn for the Store to make MULEs; this would make #2 true, and #1 false.

Thanks for any help you can give!
bigheadzach
 
Posts: 3
Joined: 12 Dec 2009, 20:43

Re: Planet M.U.L.E. online!

Postby Kroah » 15 Dec 2009, 12:38

Hello,

Regarding the effort you've made translating the French part of the document (at the Planet Mule forum) and the on-going remake of mule you've quoted, i definitively put the mule translation at the 2nd place of my todo list.

I will try to clarify some obscure points of the rules and if needed, I'll post some pseudo-code to illustrate the sentences.
I always look at the disassembled code to check the rules, so i can't do that at work. I will keep you informed soon!
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: Planet M.U.L.E. online!

Postby Kroah » 25 Dec 2009, 19:26

bigheadzach wrote:[*]Once an event has happened, it cannot happen again to any player.
Yes.

bigheadzach wrote:If the answer is #1, then that implies there is a possibility that all of the personal events will occur, meaning that no more personal events can/will happen in the game.
Yes.

Here's the pseudo-code used in the 8bits version of MULE:
Code: Select all
// for all 22 events, true if it already happend
// initialized to false at the game start
bool [22] eventsHappend;

void DoTurnEventForPlayer (int player) {
  int rnd = Random [0;79];
  if (rnd >= 22) {
    // 72.5%: no event
    return;
  }

  int event = rnd;
  int nbTries = 20;

  // look for an available event
  while (eventsHappend [event] == true) {
    // nice label for the goto, ugh
    Label LookForAnotherEvent:

    event --;
    if (event < 0) {
      event = 21;
    }
   
    nbTries  --;
    if (nbTries  == 0) {
      // no event available!
      return;
    }
  }

  if (!IsEventValid (event, player)) {
    goto LookForAnotherEvent;
  }

  // if the event is not a package
  // AND the player is not first
  // AND the player has no food
  if (event != 0) {
    if (!IsFisrt (player)) {
      if (HasFood (player)) {
        event = 0;
      }
    }
  }

  if (!IsPrerequisitesMet (event, player)) {
    goto LookForAnotherEvent;
  }

  DoEvent (event, player);
}

// Check if an event is valid according to the player rank and the event quality
bool IsEventValid (event, player) {
  bool valid = true;

  // no bad event for 3th & 4th players
  if (IsBadEvent (event)) {
    if (IsLast (player)) { // 4th
      valid = false;
    }
    if (IsBeforeLast (player)) { // 3th
      valid = false;
    }
  }

  // no good event for 1st player
  if (IsGoodEvent (event)) { // 1st
    if (IsFirst (player)) {
      valid = false;
    }
  }

  return (valid);
}
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: Planet M.U.L.E. online!

Postby Kroah » 25 Dec 2009, 20:33

bigheadzach wrote:[*] The Store uses all of the Smithore it currently has, including units that were sold to it by players during that turn.

Correct.

bigheadzach wrote:The game manual states that it takes a full turn for the Store to make MULEs; this would make #2 true, and #1 false.

I think that "full turn" hints at the turn between the shortage message received at the colony summary and the end of the auctions. I agree this is misleading.

After the mule are built, the mule price is computed. The mule price only depends on the smithore price, and not the quantity of mule in the store:
mulePrice = (smithorePrice - smithorePrice % 5) * 2

But because the smithore price goes up when there is a smithore shortage, mule price is indrirectly linked to the smithore quantity in the store:
smithore shortage -> smithore price goes up -> mule price goes up
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France

Re: Planet M.U.L.E. online!

Postby bigheadzach » 26 Dec 2009, 08:35

Where did you get this pseudocode? Is this from Ozark Softscape originally? Just curious. Could answer a lot of questions if this is what both versions were based on...
bigheadzach
 
Posts: 3
Joined: 12 Dec 2009, 20:43

Re: Planet M.U.L.E. online!

Postby Kroah » 26 Dec 2009, 19:45

bigheadzach wrote:Where did you get this pseudocode? Is this from Ozark Softscape originally? Just curious. Could answer a lot of questions if this is what both versions were based on...

If only it could be real... but no, this is a pseudo code i wrote from the code i disassembled.

I can share my work with you, but you need to have a good knowledge of 6502 assembly (and IDA pro).

For example, here's a sample of the assembly code (with some comments) from which i wrote the pseudo code:

Code: Select all
DoTurnEvent:                  ; ...
  JSR   MoveWampus
  LDA   #80
  JSR   Random_0_A            ; A = random [0;79]
  CMP   #22
  BCC   loc_813E              ; if (A >= 22)
  RTS                         ;   return
; ---------------------------------------------------------------------------

loc_813E:                     ; ...
  STA   byte_BC               ; // ici A = random [0; 21]
                              ; byte_BC = A
  TAX                         ; X = A
  JSR   C1_255
  LDA   #20
  STA   byte_8B               ; byte_8B = 20

loc_8148:                     ; ...
  LDA   turnEventsHappend,X   ; do {
  BEQ   playerEventValid      ;   if (turnEventsHappene [X] == 0) {
                              ;     goto playerEventValid
                              ;   }

lookForAnOtherPlayerEventX:   ; ...
  DEX                         ;   X --
  BPL   loc_8152              ;   if (X < 0) {
  LDX   #21                   ;     X = 21 // boucler
                              ;   }

loc_8152:                     ; ...
  DEC   byte_8B               ;   byte_8B --
  BEQ   noEvent               ;   if (byte_8B == 0) {
                              ;     goto noEvent
                              ;   }
  BNE   loc_8148              ; } while (byte_8B != 0)

playerEventValid:             ; ...
  LDA   turnEventsQuality,X
  BPL   loc_816B              ; if (turnEventsQuality [X] < 0) {
  LDA   currentPlayer         ;   // MALUS
  CMP   ordersPlayer+3
  BEQ   lookForAnOtherPlayerEventX ;   if (currentPlayer == last) {
                              ;     goto lookForAnOtherPlayerEventX
                              ;   }
  CMP   ordersPlayer+2
  BEQ   lookForAnOtherPlayerEventX ;   if (currentPlayer == beforeLast) {
                              ;     goto lookForAnOtherPlayerEventX
                              ;   }
  BNE   loc_8172              ; }
                              ; else {

loc_816B:                     ; ...
  LDA   currentPlayer         ;   // BONUS
  CMP   ordersPlayer
  BEQ   lookForAnOtherPlayerEventX ;   if (currentPlayer == first) {
                              ;     goto lookForAnOtherPlayerEventX
                              ;   }
                              ; }

loc_8172:                     ; ...
  STX   byte_BC               ; byte_BC = X // byte_BC = turn event
  LDY   currentPlayer
  LDA   playersColor,Y
  STA   byte_2DF1
  LDA   #$96
  STA   byte_D4
  LDA   #$1E
  STA   byte_D5
  LDA   byte_BC
  BNE   loc_81A4              ; if (turn event == 0) {

playerEvent3F2E:              ; ...
  LDY   currentPlayer         ;   // 00 + YOU_JUST_RECEIVED_A_PACKAGE_FROM_YOUR_HOME-WORLD_RELATIVES_CONTAINING_3_FOOD_AND_2_ENERGY_UNITS.
  LDA   goodsPlayersNb,Y
  CLC
  ADC   #3
  STA   goodsPlayersNb,Y      ;   goodsPlayersNb [FOOD] [currentPlayer] += 3
  LDA   goodsPlayersNb+4,Y
  CLC
  ADC   #2
  STA   goodsPlayersNb+4,Y    ;   goodsPlayersNb [ENERGY] [currentPlayer] += 2
  LDA   #0
  STA   byte_BC               ;   byte_BC = 0
  JMP   AddPlayerEventMessageAndEnd ;   goto addPlayerEventTotalMessage
; ---------------------------------------------------------------------------

noEvent:                      ; ...
  RTS                         ; }
; ---------------------------------------------------------------------------

loc_81A4:                     ; ...
  LDY   currentPlayer         ; else { // si byte_BC != 0
...
...
Kroah
Site Admin
 
Posts: 430
Joined: 07 Feb 2006, 01:01
Location: France


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron