Turn Based Selection

.trixX..trixX. Budapest Join Date: 2007-10-11 Member: 62605Members
I've set out to create a mod that repurposes NS2 to be a TBS game. I'm a seasoned developer, but have no experience with LUA or the Spark engine. I'd like to outline my approach and ideas, in the hope of receiving suggestions/advice/best practices/ideas from you ;]

1. Only two players would be able to participate in a match and only as commanders

2. Element of chance would come from player actions. My budding idea for this is to allow aliens to choose a feign move, while the marines can choose an anticipate move.
Gorges could choose feign left/right (50%)
Skulks: left/right/up(33%)
Lerks: left/right/up/down (25%)
Fades: left/right/up (33%)
Onos: no feign (100%)
Marines would select an according anticipate move when targeting a lifeform. If the marine choses the same as the alien, 100% damage will be dealt, otherwise only 50%. Aliens would always deal 100% damage (spikes and spit will need replacement/changes probably). This would be the core mechanic of every engagement.
One could argue this is still dice rolling, so I'm thinking the chosen evade move will have to have some kind of tactical effect. Evade direction could limit the movement direction for the next round maybe?

3. Dividing the game into rounds would be based on current time values. So for eg, max running and walking distance for the round would be calculated from the corresponding speed values. Each round would take a fix amount of time, around 5 seconds (compared to current vanila game).

4. My guess is that creating the mod from scratch would be the best approach. Theres a ton of code which deal with hitreg, player movement and whatnot. My plan is to override Client/Server/Predict/Shared/FileHooks, and just copypaste what I need from the original. Sure, the codebase is huge, but I'd have to digest it either way. This would also prevent future updates breaking the mod. Is starting from "scratch" a reasonable approach?

5. Is there a doc somewhere that details these core functions? http://wiki.unknownworlds.com/ns2/Category:Lua_Libraries

6. Which is the latest doc/tools on how to create/edit models? Also, what 3d app can I use? I'm not planning on mesh editing, only some small stuff like changing a material or shader.

7. May I use DLC content freely? It would be for changing marine skins based on equipped primary weapon

8. The two players would be in the planning stage at the same time and would see their moves unfold at the same time. Think of it as splitscreen rather than hotseat.

These are just the rudimentaries and first written sketch of my brainfart...
If anyone is willing to help - the idea is awesome ofc :] - msg me and we'll set up a github repo for this

Comments

  • NordicNordic Long term camping in Kodiak Join Date: 2012-05-13 Member: 151995Members, NS2 Playtester, NS2 Map Tester, Reinforced - Supporter, Reinforced - Silver, Reinforced - Shadow
    "May I use DLC content freely? It would be for changing marine skins based on equipped primary weapon."
    I don't know if you can, but it is actually not necessary to use DLC content. There are many skins, some better than others, that are free on the workshop.
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    edited August 2016
    @.trixXx. Sounds interesting. I strongly recommend you jump on discord and visit the Modders channel. There is a lot of collective knowledge on there and modders are helpful towards each other. Plus, we (the devs) do try and read up on that channel and chime in when/where we can to help out.

    1) Makes sense, but you might want to tinker with ways to get more than two people playing at once. This will make it much more likely to get your mod hosted on a server once it's ready.

    3) That is rather tricky, as you'll need to manage "Game Time" separate from "Session Time". Meaning, you'll need to be able to stop (effectively pause) the game-play clock, while keeping the Lua code's "update-clock" continuing. Things like idle animations are a prime example, and nearly all of the NS2 code expects a Delta-Time value on each tick of the game-loop.

    4) For what you're going for, starting from scratch isn't ideal. Also, just because a mod _can_ override 100% of the NS2 code, doesn't exactly make it more stable. If for some reason we have to change the Lua->Engine binding layers, callbacks, or their behaviors it could still break a "stand-alone" mod. This type of issue is why Filehooks were introduced some time ago.

    5) For the available Lua functions, check the docs/api folder in your NS2 install directory. That contains a json files for all the built-in functions (note: not ones declared in Lua, but ones provided by the engine). There is a community made Lua documentation of the codebase itself, while not extensive nor perfect, it's a good place to get started: http://ns2docs.bplaced.net/ns2docs/tables/index.html

    6/7) Granted I'm a bit biased on this, but if you need different skins for a mod _and_ want to keep its filesize down, I recommend using my ColoredSkins mod: http://steamcommunity.com/sharedfiles/filedetails/?id=177027441 (assuming that's what you're going for). Regarding the DLC-unlocked content, it's generally frowned upon to unlock it freely for players, but for your use-case I think it would be OK (since it's isolated to your _gameplay_ mod and not modifying vanilla).

    8) Keep in mind, Spark & NS2 are dominated by the concept of networking. Even on a localhost both the Client, Prediction, and Server are all running. So, to make it easier on yourself, you should stick to that design-model.


    Good luck! I hope to give this a whirl when it's ready
  • .trixX..trixX. Budapest Join Date: 2007-10-11 Member: 62605Members
    @McGlaspie coloured skins are perfect for me... awesome mod, thx! :]
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    Oh, something I forgot to add. Working with a version control system (svn, git, etc) along with NS2 modding can be annoying.
    However, there is a simple solution that lets you keep your base install "clean" while gaining all the benefits of modding & version control.
    I wrote a little how-to for using symlinks to make this work: https://docs.google.com/document/d/1Jj8XcrVw1Y-u9ONvDepagMR77B0LrXeJRh2zZmvpmXg/edit?usp=sharing
Sign In or Register to comment.