About a co-op campaign project

  • 主题发起人 RecursiveHarmony
  • 开始时间

How many friend do you have to play a co-op campaign?

  • None. I'm a loner.

    选票: 3 21.4%
  • 1

    选票: 1 7.1%
  • 2

    选票: 0 0.0%
  • 3

    选票: 2 14.3%
  • 4

    选票: 2 14.3%
  • More.

    选票: 6 42.9%

  • 全部投票
    14

正在查看此主题的用户

RecursiveHarmony

I'm working on a co-op campaign project. I thought it would be good to get a couple opinions from the fan base. Also i have a couple questions. Let's start with a little info about the project. It'll be a single party one, one player is the leader (server), and the other players will be his companions (clients). There will be an external application (app) written in c# handles communication with the game by http messages and communicates with each other by tcp messages. Battles will be done with Battle Time (It doesn't seem possible to fully synchronize single player battles so i don't think there' s any better solution out there). So far what i managed to create are: server creates the game in the app, clients join, everybody starts their games and creates their characters and do that back alley mission with the merchant, i kept it for nostalgia :smile: , on the map screen when server moves other players moves too (only moving and its a little bit inaccurate for the time being). For now, that's kinda the whole stuff and i think you get the general idea, so let's get to the point, the questions.
  • First thing is, as asked in the poll, how many people you play with. There will be some hardcoded stuff with the player count such as player troops in troops.txt etc, so i think deciding on a number is good beforehand.
  • Is Battle Time boring? I mean quitting and loading games. I never played that mod.
And a couple technical questions.
  • Are str,int and pos registers thread-safe?
  • Is there any list about those registers which one is used for what by the game engine?
  • What is the timeout for http messages sent by send_message_to_url operation?
  • And their results are received by script_game_receive_url_response, is this script thread safe?
  • Finally, pos registers use three vectors (coordinate, rotation and scale), do all of them needed to give parties moving orders?
Edit: I dropped this project quite a while ago.
 
最后编辑:
Go here.
Since your thread will probably be moved there anyways, to answer some of your questions:
RecursiveHarmony 说:
And a couple technical questions.
  • Are str,int and pos registers thread-safe?
  • Is there any list about those registers which one is used for what by the game engine?
  • What is the timeout for http messages sent by send_message_to_url operation?
  • And their results are received by script_game_receive_url_response, is this script thread safe?[\li]
    • Finally, pos registers use three vectors (coordinate, rotation and scale), do all of them needed to give parties moving orders?
  • Threading in Warband? You sure?
  • Nope. Your best bet is to define your own above the 63 or so that are already given by default - those won't be in use already. Also things like reg0, s0, pos0 are used very often.
  • Again, you might be in for a surprise, but for all I know, Warband does not natively support anything Threading-related.
 
Namakan 说:
Go here.
Since your thread will probably be moved there anyways, to answer some of your questions:
RecursiveHarmony 说:
And a couple technical questions.
  • Are str,int and pos registers thread-safe?
  • Is there any list about those registers which one is used for what by the game engine?
  • What is the timeout for http messages sent by send_message_to_url operation?
  • And their results are received by script_game_receive_url_response, is this script thread safe?[\li]
    • Finally, pos registers use three vectors (coordinate, rotation and scale), do all of them needed to give parties moving orders?
  • Threading in Warband? You sure?
  • Nope. Your best bet is to define your own above the 63 or so that are already given by default - those won't be in use already. Also things like reg0, s0, pos0 are used very often.
  • Again, you might be in for a surprise, but for all I know, Warband does not natively support anything Threading-related.

I planned to create a mod page after a little bit more progress like taking a couple pics and videos and creating a moddb page. This was just a topic to talk about game engine, expectations or other co-op related stuff. Whatever if the moderator moved it, it's ok.

About your answers i think you got me completely wrong. I'm not talking about modding when i say "thread-safe", i'm talking about multi-threading safety precautions on the game engine. Let me give you an example. Assume you created 2 simple triggers one of them assigns "hello" to s0 and prints and the other one assigns "hi" to s0 and prints. If the string registers are thread-safe first one should always print "hello" and the other one  does "hi". If string registers are not thread-safe and these 2 simple triggers run at the same time you can see 2 "hello"s , 2 "hi"s or completely different strings. That's what i'm talking about.

String and integer registers are used by script_game_receive_url_response script (starting with s0 and reg0) and they doesn't seem to cause any issues.

I've never had any issues with registers. They seem to be thread-safe and used by the operation and the script i mentioned. I just asked these questions to be sure about it, otherwise the whole mod goes out of business  :grin:
 
I missunderstood you indeed.
Registers are not thread-safe, going with your definition. Their value can be overwritten from another place (be it a trigger, presentation or a script) at any time. Usually this is not an issue, you might run into it from time to time though - you might have to take some precautions.
 
RecursiveHarmony 说:
Namakan 说:
Go here.
Since your thread will probably be moved there anyways, to answer some of your questions:
RecursiveHarmony 说:
And a couple technical questions.
  • Are str,int and pos registers thread-safe?
  • Is there any list about those registers which one is used for what by the game engine?
  • What is the timeout for http messages sent by send_message_to_url operation?
  • And their results are received by script_game_receive_url_response, is this script thread safe?[\li]
    • Finally, pos registers use three vectors (coordinate, rotation and scale), do all of them needed to give parties moving orders?
  • Threading in Warband? You sure?
  • Nope. Your best bet is to define your own above the 63 or so that are already given by default - those won't be in use already. Also things like reg0, s0, pos0 are used very often.
  • Again, you might be in for a surprise, but for all I know, Warband does not natively support anything Threading-related.

I planned to create a mod page after a little bit more progress like taking a couple pics and videos and creating a moddb page. This was just a topic to talk about game engine, expectations or other co-op related stuff. Whatever if the moderator moved it, it's ok.

About your answers i think you got me completely wrong. I'm not talking about modding when i say "thread-safe", i'm talking about multi-threading safety precautions on the game engine. Let me give you an example. Assume you created 2 simple triggers one of them assigns "hello" to s0 and prints and the other one assigns "hi" to s0 and prints. If the string registers are thread-safe first one should always print "hello" and the other one  does "hi". If string registers are not thread-safe and these 2 simple triggers run at the same time you can see 2 "hello"s , 2 "hi"s or completely different strings. That's what i'm talking about.

String and integer registers are used by script_game_receive_url_response script (starting with s0 and reg0) and they doesn't seem to cause any issues.

I've never had any issues with registers. They seem to be thread-safe and used by the operation and the script i mentioned. I just asked these questions to be sure about it, otherwise the whole mod goes out of business  :grin:
I am definitely out of my depth here but I would assume the engine is 'thread-safe' but like Namakan said, there is no native multithreading and so your example (from a modder's standpoint) is impossible - even if you have two simple triggers firing every frame for example, they still fire in sequence and not simultaneously... Thus registers will behave as expected and contain the most recent assigned value. Engine hooks seem to only ever use s0/s1 and reg0/reg1 so if you're incredibly paranoid avoid those, but I doubt you'll have issues.

I would recommend taking a look at the WSE2 thread in this same board and maybe even directing small engine related questions there. K700 is really the only active forum member who could answer these questions for certain (and maybe even give you support for features Native couldn't cover.)

Good luck with your project. :smile:
 
Thank you both for your replies.

@Ruthven:
I've been wandering around modding sites and this forum for years before creating this account, so i'm quite familiar with the famous mods, tools and names in the forum. I thought of creating something unique. I suck at modeling and texturing kinda graphics related stuff, so i wanted to make some script-heavy mod. Among a lot of ideas, i thought of making some mod like your Explorer mod then i saw your mod topic and i just abondoned the idea. :grin: I know you from that time and I played the first version, great mod btw. After that i thought of adding some unorthodox features by some external application. I checked Script Enhancer's source code and unfortunately c++ and reverse-engineering is not my thing exactly. I code in c# and i didn't want change core game codes so my mod doesn't require extra work for every new game version. There were lots of discussions about a co-op campaign mod. Lots of people want one, but almost all of them thinks its nearly impossible to implement in warband engine. It sounded quite unorthodox and i decided to make one. I did a little research and only thing i found similar to what i'm trying to was dragon's (don't know his user name exactly, currently it's "_" ) MP COOP campaign "engine" project. He quitted after issues with parties and messaging stuff. I devised some solutions to those issues and created a similar thing on c#. I'm just trying to say that i know the Script Enhancer  :grin:

About registers, if they are thread-safe either as you say code blocks are queued and executed one by one or when you use a register it locks the entire code block. Either way i should better ask it to K700.

A couple things about current poll results. It seems like people have quite a lot of friends. After thinking a while, if i manage not to create many un-loopable things for every player like global variables, it shouldn't be hard to write code to support 10, 20 even 100 players. Only real issue seems so far is how much the server machişne can handle.
 
后退
顶部 底部