Jump to content

Iran

Fremen
  • Posts

    21
  • Joined

  • Last visited

Reputation

5 Neutral
  1. Any chance multiplayer support can be added? CnCNet Online support would be cool too.
  2. Any chance you can release the source code or put the project on github?
  3. Yeah he is talking about that. The AI goes for Ore Trucks a lot IIRC.
  4. Can you show me a spot where the game sets up alliances (e.g. for single player missions)? Want to see how it works.
  5. I just saw you modify some spots in the code. I've documented the code for multiplayer spawning. Try playing around with these code locations: .text:00469FD0 Do_MCV_Spawn: ; label starts doing the MCV spawning .text:00469FD0 mov eax, [esp+17D8h+Current_Selected_Spawn_Location] ; a value 0-7 for each possible map spawn location, stack (ESP) value needs to be changed, NOT eax as the same stack value mght be used for unit (UnitCount) spawning. Set here just before MCV spawning .text:00469FF5 mov byte ptr ds:gSpawnLocationUsedBoolArray[eax], 1 ; byte values for whether spawn location is used or not, 1 is used and 0 is used. Set here just before MCV spawning .text:0046A01E mov esi, [esp+17D8h+Current_Player?] ; current player index, from 0 to ? (7 I assume) .text:0046A04A call ModAddUnit__unit_spawn_func_ ; Spawn MCV Spawning the other units is done after MCV spawning but as long as you set the stack value for [esp+17D8h+Current_Selected_Spawn_Location] just before MCV spawn the units will be spawned around the new location after MCV spawning. That should be all that's needed for selectable spawn locations. What I suggest doing is hooking: .text:00469FD0 mov eax, [esp+17D8h+Current_Selected_Spawn_Location] and at that spot have the code do: 1. Check if [esp+17D8h+Current_Player] is 0, which should mean the game is trying to spawn the MCV for the first player, whose spawn location has been randomly determined. 2. If current player == 0, run the init code which consists of setting the byte ptr ds:gSpawnLocationUsedBoolArray array to 1 for every spawn location that has been selected by a player before game start. 3. Check if current player spawn matches the spawn selected by the current player (you need to initialize a new array in the spawn config reading code for this), if not set the current player spawn to the one the current player selected before game start else select a new random spawn and check again whether the new random spawn has already been used (via checking byte ptr ds:gSpawnLocationUsedBoolArray) 4. Set esp+Current_Selected_Spawn_Location correctly after determining the correct spawn. The spawning logic looks similar to Red Alert and Tiberian Sun so it's probably the same, there's a check after spawning the first player to make sure the second player spawn is as far away as possible from the first player. If player 1 selects his spawn and player two is random spawn it should work just fine with the farest distance spawn logic, but if player spawn 1 is random and player 2 selects his spawn then player 1 won't always be the furthest away from the other player. You'll have to write up some extra logic for that.
  6. BTW did you find the function for multiplayer unit spawning?
  7. Have you figured out how alliances work internally? You could check how the game sets up alliances when reading in a map file.
  8. How did you figure out how to set up all internal variables, how to start a match and where the data for players (colors, IPs etc) are stored?
  9. In Red Alert 1 the tech level value for every player is a data member of the HouseClass they are. The multiplayer menus have a global variable used to set the tech level for multiplayer games. In SINGLEPLAYER the tech level for every house is read in from the level file, defaulting the to the internal mission number. Code for single player. For every house section of the map INI, e.g. [spain] or [badGuy]: AUTO:004DDD36 028 mov [ebp+var_24], eaxAUTO:004DDD39 028 mov ebx, offset aTechlevel ; "TechLevel"AUTO:004DDD3E 028 mov eax, [ebp+lpScenario] ; INIClass for current scenarioAUTO:004DDD41 028 mov ecx, dword ptr ds:ScenarioNumber ; Default value if INI key missingAUTO:004DDD47 028 mov edx, edi ; House name, e.g. Spain or badGuyAUTO:004DDD49 028 mov esi, [ebp+var_24]AUTO:004DDD4C 028 call const INIClass::Get_Int(char *,char *,int)AUTO:004DDD51 028 mov ebx, offset aMaxbuilding ; "MaxBuilding"AUTO:004DDD56 028 mov edx, ediAUTO:004DDD58 028 mov ecx, [esi+2Ch]AUTO:004DDD5B 028 mov [esi+20h], eaxAUTO:004DDD5E 028 mov eax, [ebp+lpScenario]
  10. Iran

    Dune Dynasty

    Oh that makes sense yeah. Not sure if that causes issues and I think it might allow the server to cheat.
  11. Iran

    Dune Dynasty

    You're using a server model?
  12. Iran

    Dune Dynasty

    What kind of things have you done so far? CnCNet v5 support requires adding a -SPAWN command line argument which reads an INI file with match settings and the IP and port of other players. It's an external launcher and it manages things like tunnel servers, filling in this INI which needs to be read by the game, and making sure everyone launches the game at the same time. Things Red Alert 95 does: - Connect to players - Wait for players at start of match - Send/receive packets - Frame synchronization and checking with CRC - Adjust networking timing - Kill connection of non-responsive players (and makes their house AI controlled) - Execute network event do-list The following network events (where 'mega missions' are things like setting a unit into guard mode or telling a vehicle to repair on the service depot): dd offset Event_Execute_ALLYdd offset Event_Execute_MEGAMISSIONdd offset Event_Execute_MEGAMISSION_Fdd offset Event_Execute_IDLEdd offset Event_Execute_SCATTERdd offset Event_Execute_DESTRUCTdd offset Event_Execute_NULLdd offset Event_Execute_PLACEdd offset Event_Execute_OPTIONSdd offset Event_Execute_GAMESPEEDdd offset Event_Execute_PRODUCEdd offset Event_Execute_SUSPENDdd offset Event_Execute_ABANDONdd offset Event_Execute_PRIMARYdd offset Event_Execute_SPECIAL_PLACEdd offset Event_Execute_EXITdd offset Event_Execute_ANIMATIONdd offset Event_Execute_REPAIRdd offset Event_Execute_SELLdd offset Event_Execute_SELLCELLdd offset Event_Execute_SPECIALdd offset Event_Execute_NULLdd offset Event_Execute_NULLdd offset Event_Execute_RESPONSE_TIMEdd offset Event_Execute_NULLdd offset Event_Execute_SAVEGAMEdd offset Event_Execute_ARCHIVEdd offset Event_Execute_ADDPLAYERdd offset Event_Execute_TIMINGdd offset Event_Execute_PROCESS_TIMEdd offset Event_Execute_PROPOSE_DRAWdd offset Event_Execute_RETRACT_DRAW The engine (and the critical RNG) is deterministic so RNG isn't synchronized, all that's done is seeding it with a value at start that's same for every client. You'll have to take a look into adding support for sending messages to players ingame too and showing a player list with the right colors.
  13. Thanks mvi. I'll ask him but I'm gonna assume he has no idea about it. ;(
×
×
  • Create New...