Jump to content

CnCNet 5 now supports Dune 2000! Play Dune 2000 Online, now!


Recommended Posts

i will add that, it is in my todo list :) You can already do it now, you will have to create your own _prac.mis (_spawn.mis on cncnet) for that. You can look at the coop maps, all of those come with preset alliances. You could just copy that file over or modify it to suit your own needs

Link to comment
Share on other sites

lil update, the colors of the ai players are now changeable too. You can give all ai players the same color or even give them the same color as your own if you like to toy around or do 2vs2 games with them :D


Someone asked about the ai starting credtis (difficulty settings) here they are:

easy = 4000

normal = same as human players

hard = 40000

Link to comment
Share on other sites

  • 2 weeks later...
This is getting better every update! simply awesome!!! we play everyday! is it possible to add 2 things?

1_ the possibility of choose allies.

2_ please add an option to enable/disable queues feature. it would be fair if the ones we want to play with that feature can choose it.  :happy:


Thanks guys!  :)

Link to comment
Share on other sites

Pre-set alliances, Selectable starting locations and spectator mode are on my to-do list, but i gotta look up some things first before i can add any of those :)

queues feature will never be available online, sorry ;(

well the first one is a really good news!!  :D but when you said "queues never will be available" is sad. :( i suppose there are valid reasons for that. its a pity. thanks anyway for all effort

Link to comment
Share on other sites

havent looked yet, i need to look up how the houses are woking. Its not like in ra1 where the colors decide the house, yesterday i been messing around with it a lil because i wanted to add spec mode, but it isnt the order of the players inside of spawn.ini either. Will be able to add spec/alliances/selectable spawns once i know the logic :) The host is always multi1 and the ai players are added after the humans, thats all i know atm

Link to comment
Share on other sites

I dont know how it is in cnc1, no one messed around with the houses there cause we never added all these features that require knowledge about the houses. But it could be that cnc1 works the same since there is a host and all other players are guests like in dune.

Anyways i checked how the radar was displaying the names and their matching kills and wrote a lil function to get the house of a player using his name like in the radar, spectators are now working and i can do it the same way for preset alliances. It seems like the player who is connecting first to the host becomes multi2, but not sure

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

yes i noticed mcv spawning and the other units are kinda separated (disabled each of them once to see what it is about). I didnt look into the selectable spawns yet cause when i made the map preview generator i noticed that every starting location got the same id (not like in the other games where you have waypoint 0-7). But i guess it just starts from the top left going to the bottom right and saves them in that order.

Yes i know about that logic, the reason why i wanted to add the spec mode quick was that i wanted to skip spawning units for spectators but keep the same logic (player1 biggest distance to player 2 etc) cause we always had problems with messed up spots when one guy was watching :) The first player is using a random number for the spots like you said, so i had to add my code infront of that to make sure the spots are still random even if the host (multi1) is spectator hehe


thanks for the help, will prolly look into that stuff the next days

Link to comment
Share on other sites

Can you show me a spot where the game sets up alliances (e.g. for single player missions)? Want to see how it works.

The alliances are saved in the .mis files (works in multi and single player too), if you follow the code where it loads the file named _prac.mis you will find where it saves the alliances for sure


check here:

0x004752FE <- should be skirmish

0x0047533D <- should be multiplayer

Link to comment
Share on other sites

nope, been doing other stuff :( I guess i will do the selectable starting locations first cause the alliances are not so nice without it (you know, the good ol 2vs2 top vs bottom problem)

Yes, that's really useful, but I think alliances it's important when you play with AI it would be more challenger. I've tried spectator mode, seems did not work for me too. :D

Link to comment
Share on other sites

Oh k. Btw I tried spectator mode but it doesnt seem to work, I get units and mcv as usual, radar isnt unlocked and shroud covers the map. It was with AI, maybe that's why? I was able to see their cash tho.


Yes, that's really useful, but I think alliances it's important when you play with AI it would be more challenger. I've tried spectator mode, seems did not work for me too. :D

Spectator mode only works in online games with at least 3players :D where 2 have to play and 1can be spectator


In skirmish the game would end right away because you have no units

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.

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.