Trying to start fake Coop Game
#1 Posted 04 September 2017 - 05:46 PM
I thought I would start with the built-in fake multiplayer, just to get a game going with a bot in it. Looking at the console commands, it would seem that these commands are the ones I want:
-q2 // two players total
-a // use fake multiplayer
Starting the game with those commands, I can get as far as configuring the game settings and launching the game, but then it gets stuck on the "waiting for votes" screen. Unfortunately, the bot never votes and I don't know how to skip past that screen and get into the game.
Please help!
EDIT: I can force the game to start in a specific episode or map by adding that to the command line. Not the ideal solution, since I want to be able to choose without editing the command line. But more importantly, the player is instantly squished when starting every time. Is this a known issue with the newest build?
This post has been edited by Trooper Dan: 04 September 2017 - 06:00 PM
#2 Posted 04 September 2017 - 07:01 PM
Now I have a simple question: Once the game is running in coop mode with one human player and a bot player, what do I check in the APLAYER actor to tell whether the current actor is the human player or the bot? (please note that I want a solution to work with an arbitrary number of bots and human players joining and leaving the game at any time).
UPDATE: Another serious problem is that the fake multiplayer game always starts with every single player spawn point occupied by an actual player sprite. Only the bot one is visible, but the others are still there and blocking. If you shoot them, the human player acts like he's taking damage.
I had hoped to avoid using OldMP, because this project (at least at the outset) doesn't require real multiplayer, and I don't want to go back in time with CON and other features.
This post has been edited by Trooper Dan: 04 September 2017 - 07:59 PM
#3 Posted 04 September 2017 - 11:56 PM
@echo off eduke32.exe -q8 -m -map _ZOO.MAP -c1 -noconsole -c "exit" CLS EXIT
@echo off eduke32.exe -q8 -map _ZOO.MAP -c2 CLS EXIT
Trooper Dan, on 04 September 2017 - 07:01 PM, said:
You have to start multiplayer with the maximum players per map. If I am not mistaken, the code was modified to let players join a game already running, so the number of players is set to the limit when the code starts, but the code is unfinished and cause issues.
This post has been edited by Fox: 05 September 2017 - 12:03 AM
#4 Posted 05 September 2017 - 12:29 AM
#5 Posted 05 September 2017 - 01:27 AM
This post has been edited by Fox: 05 September 2017 - 01:28 AM
#6 Posted 09 September 2017 - 07:30 PM
EDIT: Nevermind, I think I was confused about some stuff when I wrote that and need to figure it out for myself.
This post has been edited by Trooper Dan: 09 September 2017 - 08:56 PM
#7 Posted 09 September 2017 - 10:41 PM
localInput.fvel = mulscale9(staticInput.fvel, sintable[(pPlayer->ang + 2560) & 2047]) + (mulscale9(staticInput.svel, sintable[(pPlayer->ang + 2048) & 2047])); localInput.svel = mulscale9(staticInput.fvel, sintable[(pPlayer->ang + 2048) & 2047]) + (mulscale9(staticInput.svel, sintable[(pPlayer->ang + 1536) & 2047]));
The fvel and svel results which are set by the code above will actually make a player move. Through CON I can access the player's angle and there is a sin function and mulscale function....so far, so good. But this also uses staticInput.fvel and staticInput.svel, for which there do not seem to be any corresponding members accessible in CON. If the static input is the actual keypresses, then it would seem to correspond to the extbits member. But I'm not sure what to make of it. Can anyone help?
EDIT: More pieces of the puzzle:
#define NORMALKEYMOVE 40 #define MAXVEL ((NORMALKEYMOVE*2)+10) #define MAXSVEL ((NORMALKEYMOVE*2)+10)
if (BUTTON(gamefunc_Strafe_Left) && !(g_player[playerNum].ps->movement_lock & 4)) staticInput.svel += keyMove; if (BUTTON(gamefunc_Strafe_Right) && !(g_player[playerNum].ps->movement_lock & 8)) staticInput.svel += -keyMove; if (BUTTON(gamefunc_Move_Forward) && !(g_player[playerNum].ps->movement_lock & 1)) staticInput.fvel += keyMove; if (BUTTON(gamefunc_Move_Backward) && !(g_player[playerNum].ps->movement_lock & 2)) staticInput.fvel += -keyMove;
So it looks like the staticInput values increase or decrease each tic by increments of NORMALKEYMOVE up to the defined max/min values. Pressing forward yields positive staticInput.fvel and backwards is negative. Strafing left is positive staticInput.svel and strafing right is negative. This should be enough information now to try to make a CON equivalent for bots.
This post has been edited by Trooper Dan: 10 September 2017 - 01:29 AM
#8 Posted 10 September 2017 - 07:52 AM
If I understand it, staticInput is used by controllers with a sliding scale of movement (as opposed to a keyboard key). It should be of little relevance for what you are doing.
#9 Posted 10 September 2017 - 11:23 AM
Fox, on 10 September 2017 - 07:52 AM, said:
If I understand it, staticInput is used by controllers with a sliding scale of movement (as opposed to a keyboard key). It should be of little relevance for what you are doing.
Maybe I was reading it wrong, but I thought that staticinput could come from different sources, depending on what the player is using. In any case, I have to have something to feed into the functions that return fvel and svel.