New Mods for NS2 Engine?

yimmasabiyimmasabi Join Date: 2006-11-03 Member: 58318Members
<div class="IPBDescription">Do we ABLE to develop our own tactical game ?</div>Hmmm,


If NS Engine is much more public, may be we can develop another tactical NS game parallel to this or a story game of NS.


E.g. Snakes vs Bugs game including commanders, different alien models etc. ?
Or Aliens vs Predators game bla bla....

I tought that u are also thinking this property. Huh?

Comments

  • AlignAlign Remain Calm Join Date: 2002-11-02 Member: 5216Forum Moderators, Constellation
  • CrispixCrispix Join Date: 2007-01-10 Member: 59543Members, Constellation, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow
    You're not being quite clear on what you're saying, but from what I think you mean, you're asking if you can modify/make mods on the NS2 engine. Yes, if you know lua script, you can modify the game play, most likely change some skins/create new models for player units, and do much more with the other tools that are coming equipped with the game.

    Snakes vs bugs though?

    I guess whatever floats your boat <img src="style_emoticons/<#EMO_DIR#>/smile-fix.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile-fix.gif" />
  • Paradox MonkeyParadox Monkey Join Date: 2007-08-25 Member: 61969Members
    With the LUA implementation in NS2, it should be extremely easy to modify just about any aspect of the game. Assuming you know LUA, of course, though it doesn't look too difficult to pick up.
  • CrispyCrispy Jaded GD Join Date: 2004-08-22 Member: 30793Members, Constellation
    Can anyone who does know LUA give me an example of what a class or ability script might look like?
  • livindedlivinded Join Date: 2007-10-23 Member: 62706Members
    Will there be free access to the actual engine code for non-commercial uses like valve does with Source?
  • locallyunscenelocallyunscene Feeder of Trolls Join Date: 2002-12-25 Member: 11528Members, Constellation
    <!--quoteo(post=1706648:date=May 11 2009, 05:28 AM:name=Crispy)--><div class='quotetop'>QUOTE (Crispy @ May 11 2009, 05:28 AM) <a href="index.php?act=findpost&pid=1706648"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Can anyone who does know LUA give me an example of what a class or ability script might look like?<!--QuoteEnd--></div><!--QuoteEEnd-->
    There's some sample LUA code for the armory <a href="http://www.unknownworlds.com/ns2/news/2007/02/prosumers_and_natural_selection_2" target="_blank">in this old blog post</a>. Not sure if that helps.
  • ElliottBElliottB Join Date: 2009-05-11 Member: 67392Members
    edited May 2009
    <!--quoteo(post=1706661:date=May 11 2009, 09:50 AM:name=locallyunscene)--><div class='quotetop'>QUOTE (locallyunscene @ May 11 2009, 09:50 AM) <a href="index.php?act=findpost&pid=1706661"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->There's some sample LUA code for the armory <a href="http://www.unknownworlds.com/ns2/news/2007/02/prosumers_and_natural_selection_2" target="_blank">in this old blog post</a>. Not sure if that helps.<!--QuoteEnd--></div><!--QuoteEEnd-->


    It is difficult to give an example of what a class or ability script might look like. This is because Lua (Not LUA, it is a word not an abbreviation) is a language, and not an end-all solution. Developers who use Lua have to define their own callbacks, functions, and classes for interacting with the game engine. We can't write an example, without knowing the functions, callbacks, and classes used for hooking into the engine functions.

    In that blog post, for example, they are showing parts of code ranging from precaching the armory's model.


    Engine, which is essentially a Class, is their method of calling Engine specific components of the game engine.

    OnMapPostLoad(), is a call back, which is used to trigger functions. So whatever is placed within that function, is called when the loading of the map has finished.

    --

    If you're still unsure, I can explain further. I develop in Lua for a few games. Lua is a simple language to work in, but has some ambiguity due to the different ways it can be embedded/implemented. Some implementations, instead of just defining the callback within the script, use a function to connect to the callback.

    Multi Theft Auto, for example, uses their system of 'Event Handlers'.


    By the way, long time lurker... first time poster.
  • CrispyCrispy Jaded GD Join Date: 2004-08-22 Member: 30793Members, Constellation
    <!--quoteo(post=1706661:date=May 11 2009, 04:50 PM:name=locallyunscene)--><div class='quotetop'>QUOTE (locallyunscene @ May 11 2009, 04:50 PM) <a href="index.php?act=findpost&pid=1706661"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->There's some sample LUA code for the armory <a href="http://www.unknownworlds.com/ns2/news/2007/02/prosumers_and_natural_selection_2" target="_blank">in this old blog post</a>. Not sure if that helps.<!--QuoteEnd--></div><!--QuoteEEnd-->I think that looks more code-heavy.

    I would guess that the script would list certain properties (such as 'kMGcost' and 'kShotguncost') and define their attributes.

    Basically I'm wondering how easy it would be to alter the properties (assuming you have the models, textures, animations and sounds already).

    For example, this is a nice and light weapon script with no heavy code, the sort of thing I am capable of editing without any sort of programming expertise.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->WeaponData
    {
        // Weapon data is loaded by both the Game and Client DLLs.
        "printname"            "MP500 SMG"
        "viewmodel"            "models/weapons/mp500/v_mp500.mdl"
        "playermodel"            "models/weapons/mp500/w_mp500.mdl"
        "anim_prefix"            "smg2"

        "bucket"            "2"
        "bucket_position"        "1"

        "clip_size"            "30"
        "default_clip"            "60"

        "weight"            "4"
        "item_flags"            "0"

        "damage"            "23"
        "firerate"            "0.1"
        "refire_delay"            "0.15"

        "dmg_const"        "1"
        "dmg_linear"        "0.0"
        "dmg_quad"        "0.000001"


        "cof_modifier_crouched"        "-0.5"
        "cof_modifier_walking"        "1"    
        "cof_modifier_running"        "2"
        "cof_modifier_sprinting"    "4"
        "cof_modifier_jumping"        "6"

        "player_speed_modifier_firing"    "0.8"

        "time_to_penalty_cap"            "3"
        "idle_time_before_penalty_decay"    "0"
        "min_time_before_penalty_decay"        "0.4"
        
        // V system
        "v_horizontal_cap"        "6"
        "v_vertical_cap"        "2"
        "vramp5"            "0.05"
        "vramp10"            "0.05"
        "vramp20"            "0.10"    
        "vramp30"            "0.20"
        "vramp50"            "0.40"

        // Cone of fire
        "min_cof_angle"            "1.75"    // in degrees
        "max_cof_angle"            "8"    // in degrees
        "cof5"                "0.05"
        "cof10"                "0.05"
        "cof15"                "0.05"
        "cof16"                "0.15"
        "cof30"                "0.45"    // When our current penalty reach 25% of cof_penalty_cap, we want to be at 10% toward max COF
        "cof50"                "0.90"    // When our current penalty reach 50% of cof_penalty_cap, we want to be at 50% toward max COF

        // Recoil
        "recoil_increment"        "0.10"
        "recoil_cap"            "1.5"

        // view kick
        "shake_power"            "0.7"


        // Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
        SoundData
        {
            "empty"                "Weapon_MP500.Empty"
            "single_shot"            "Weapon_MP500.Single"
            "reload"            "Weapon_MP500.Reload"


            
            
            "special1"            "Weapon_SMG1.Special1"
            "special2"            "Weapon_SMG1.Special2"
            "double_shot"            "Weapon_SMG1.Double"
            "burst"                "Weapon_SMG1.Burst"
        }

        // Weapon Sprite data is loaded by the Client DLL.
        TextureData
        {
            "weapon"
            {
                    "font"        "WeaponIcons"
                    "character"    "a"
            }
            "weapon_s"
            {    
                    "font"        "WeaponIconsSelected"
                    "character"    "a"
            }
            "ammo"
            {
                    "font"        "WeaponIcons"
                    "character"    "r"
            }
            "ammo2"
            {
                    "font"        "WeaponIcons"
                    "character"    "t"
            }
            "crosshair"
            {
                    "font"        "Crosshairs"
                    "character"    "Q"
            }
            "autoaim"
            {
                    "file"        "sprites/crosshairs"
                    "x"            "0"
                    "y"            "48"
                    "width"        "24"
                    "height"    "24"
            }
        }
    }<!--c2--></div><!--ec2-->

    I'm wondering if it will be this easy to customise existing elements in Lua, or if there is more programming knowledge required.
  • FirewaterFirewater Balance Expert Join Date: 2002-12-12 Member: 10690Members, Constellation
    <!--quoteo(post=1706708:date=May 12 2009, 06:16 AM:name=Crispy)--><div class='quotetop'>QUOTE (Crispy @ May 12 2009, 06:16 AM) <a href="index.php?act=findpost&pid=1706708"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I think that looks more code-heavy.

    I would guess that the script would list certain properties (such as 'kMGcost' and 'kShotguncost') and define their attributes.

    Basically I'm wondering how easy it would be to alter the properties (assuming you have the models, textures, animations and sounds already).

    For example, this is a nice and light weapon script with no heavy code, the sort of thing I am capable of editing without any sort of programming expertise.

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->WeaponData
    {
        // Weapon data is loaded by both the Game and Client DLLs.
        "printname"            "MP500 SMG"
        "viewmodel"            "models/weapons/mp500/v_mp500.mdl"
        "playermodel"            "models/weapons/mp500/w_mp500.mdl"
        "anim_prefix"            "smg2"

        "bucket"            "2"
        "bucket_position"        "1"

        "clip_size"            "30"
        "default_clip"            "60"

        "weight"            "4"
        "item_flags"            "0"

        "damage"            "23"
        "firerate"            "0.1"
        "refire_delay"            "0.15"

        "dmg_const"        "1"
        "dmg_linear"        "0.0"
        "dmg_quad"        "0.000001"


        "cof_modifier_crouched"        "-0.5"
        "cof_modifier_walking"        "1"    
        "cof_modifier_running"        "2"
        "cof_modifier_sprinting"    "4"
        "cof_modifier_jumping"        "6"

        "player_speed_modifier_firing"    "0.8"

        "time_to_penalty_cap"            "3"
        "idle_time_before_penalty_decay"    "0"
        "min_time_before_penalty_decay"        "0.4"
        
        // V system
        "v_horizontal_cap"        "6"
        "v_vertical_cap"        "2"
        "vramp5"            "0.05"
        "vramp10"            "0.05"
        "vramp20"            "0.10"    
        "vramp30"            "0.20"
        "vramp50"            "0.40"

        // Cone of fire
        "min_cof_angle"            "1.75"    // in degrees
        "max_cof_angle"            "8"    // in degrees
        "cof5"                "0.05"
        "cof10"                "0.05"
        "cof15"                "0.05"
        "cof16"                "0.15"
        "cof30"                "0.45"    // When our current penalty reach 25% of cof_penalty_cap, we want to be at 10% toward max COF
        "cof50"                "0.90"    // When our current penalty reach 50% of cof_penalty_cap, we want to be at 50% toward max COF

        // Recoil
        "recoil_increment"        "0.10"
        "recoil_cap"            "1.5"

        // view kick
        "shake_power"            "0.7"


        // Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
        SoundData
        {
            "empty"                "Weapon_MP500.Empty"
            "single_shot"            "Weapon_MP500.Single"
            "reload"            "Weapon_MP500.Reload"


            
            
            "special1"            "Weapon_SMG1.Special1"
            "special2"            "Weapon_SMG1.Special2"
            "double_shot"            "Weapon_SMG1.Double"
            "burst"                "Weapon_SMG1.Burst"
        }

        // Weapon Sprite data is loaded by the Client DLL.
        TextureData
        {
            "weapon"
            {
                    "font"        "WeaponIcons"
                    "character"    "a"
            }
            "weapon_s"
            {    
                    "font"        "WeaponIconsSelected"
                    "character"    "a"
            }
            "ammo"
            {
                    "font"        "WeaponIcons"
                    "character"    "r"
            }
            "ammo2"
            {
                    "font"        "WeaponIcons"
                    "character"    "t"
            }
            "crosshair"
            {
                    "font"        "Crosshairs"
                    "character"    "Q"
            }
            "autoaim"
            {
                    "file"        "sprites/crosshairs"
                    "x"            "0"
                    "y"            "48"
                    "width"        "24"
                    "height"    "24"
            }
        }
    }<!--c2--></div><!--ec2-->

    I'm wondering if it will be this easy to customise existing elements in Lua, or if there is more programming knowledge required.<!--QuoteEnd--></div><!--QuoteEEnd-->

    From my understanding, it is harder to code the game in LUA for the developers. The trade off is balance changes and things of that nature can be changed on the fly for playtests/official patches. I don't believe the developers have to release multiple builds when just testing balance and manipulating the already in game code.

    This time investment will save an enormous amount of hours with regards to PTs looking at balance and other features, things can be coded on the fly and implemented immediately.
  • ElliottBElliottB Join Date: 2009-05-11 Member: 67392Members
    Developing a game in Lua is, honestly, no more difficult than developing it in pure C/C++. Developing a game engine which utilizes Lua, however, is more time consuming. Once the engine is built to use Lua, and has adequate callbacks and functions, you can develop your game rather rapidly, in part due to the ability to rapid prototype changes. In a sense, you can modify the Lua files during run time (Generally requires a reload/refresh of the specific file/files). This allows for changes to be made during play. Developing in pure C/C++ without an embeddable language, you have to recompile your binaries with every minor change. So clients and servers have to update. Whereas with an embeddable language, you change something server side and the client gets the changes upon connection. This allows the server to temporarily override the client's files, both simplifying rapid prototyping by only having to modify the server and not spread files across testers and making Modifications possible.


    Also, Crispy, I don't see the point, except possibly under separation of systems, to have a separate format for defining weapons or entities. This can all be done in Lua, if the engine is developed to have those hooks. Additionally, if it is all contained in Lua, this allows for servers to easily modify weapons and their properties. Even add custom ones.
  • CrispyCrispy Jaded GD Join Date: 2004-08-22 Member: 30793Members, Constellation
    <!--quoteo(post=1706740:date=May 12 2009, 08:20 PM:name=ElliottB)--><div class='quotetop'>QUOTE (ElliottB @ May 12 2009, 08:20 PM) <a href="index.php?act=findpost&pid=1706740"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Also, Crispy, I don't see the point, except possibly under separation of systems, to have a separate format for defining weapons or entities. This can all be done in Lua, if the engine is developed to have those hooks. Additionally, if it is all contained in Lua, this allows for servers to easily modify weapons and their properties. Even add custom ones.<!--QuoteEnd--></div><!--QuoteEEnd-->I'm not asking for it to be this way, I was asking if it will be this way,

    You answer seems to hint that this is down to how UWE want to program their game, so Lua doesn't really feature in this decision, it's more of a personal preference.
  • ElliottBElliottB Join Date: 2009-05-11 Member: 67392Members
    <!--quoteo(post=1706759:date=May 12 2009, 06:09 PM:name=Crispy)--><div class='quotetop'>QUOTE (Crispy @ May 12 2009, 06:09 PM) <a href="index.php?act=findpost&pid=1706759"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I'm not asking for it to be this way, I was asking if it will be this way,

    You answer seems to hint that this is down to how UWE want to program their game, so Lua doesn't really feature in this decision, it's more of a personal preference.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Exactly. Lua is a language that is meant to be implemented many different ways. I just brought up that, in my view, having entities defined within Lua would allow for more direct access for modification on the server. This will allow less hacking to make a modification. Though, if they decide to store weapons and such in a format such as that, they could use a meta file or linkage system so that servers could supply files for use in a similar fashion to client-side lua overrides.
Sign In or Register to comment.