RAGE Multiplayer 0.3.7 Public Testing

@rangemultiplayer am 11/24/2018 11:58 pm

RAGE Multiplayer 0.3.7 is another iteration of the 0.4 major features testing backport, this update is to assure the smoothest transition to 0.4.

 

0.3.7 introduces backports of major client-side scripting subsystem improvements, such as C# implementation (.NET Core, just like server-side) bringing new possibilities for C# game mode developers, but enhancements for the JavaScript runtime as well.

 

C#

C# scripts are stored in the /client_packages/cs_packages/ folder. Once a player connects, it collects all the scripts, checks its integrity and compiles into an in-memory assembly. Thanks to a number of compilation-time checks, there's no way to allow C# client-side scripts to maliciously hurt users.

Despite the community concerns, all events and functions are available in C#!

 

Here's a quick peek of basic C# stuff:

 

EVENTS

 

public class EventsExample : RAGE.Events.Script
{
  public EventsExample()
  {
    // this kind of events receives mp.trigger, mp.events.callLocal, but also remote events
    RAGE.Events.AddEvent("remote_triggerable_event", SomeEvent);
    
    RAGE.Events.AddDataHandler("some_data", SomeDataHandler);
    
    RAGE.Events.Tick += Tick;
    RAGE.Events.OnPlayerChat += ChatHandler;
    
    // trigger a js event
    RAGE.Events.CallLocal("eventName", 1, "someString", 1.0f);
  }
  
  public void SomeEvent(object[] args)
  {
  }
  
  public void SomeDataHandler(RAGE.Elements.Entity entity, object value)
  {
  }
  
  public void ChatHandler(string text, RAGE.Events.CancelEventArgs cancel)
  {
    if(text == "cancelme")
    {
    	cancel.Cancel = true;
    }
  }
  
  // known as "render" in JS
  public void Tick(System.Collections.Generic.List<RAGE.Events.TickNametagData> nametags)
  {
  }
}

 

GAME INTERACTION

// trivial game stuff
int interior = RAGE.Game.Interior.GetInteriorFromCollision(0.0f, 0.0f, 0.0f);

// player interaction
RAGE.Elements.Entities.Players.GetAtRemote(1).ClearDecorations();

// player interaction using a game entity handle
RAGE.Game.Ped.ClearPedDecorations(RAGE.Elements.Player.LocalPlayer.Handle);

// ped creation
uint freeroamHash = RAGE.Game.Misc.GetHashKey("mp_m_freemode_01");
RAGE.Elements.Ped ped = new RAGE.Elements.Ped(freeroamHash, new RAGE.Vector3(0.0f, 0.0f, 0.0f), dimension: 5);

 

 

CEF

 

...
  
public void OurEventHandler(object[] args)
{
  RAGE.Chat.Output("Got actually called! {0}", (string)args[0]);
}
  
public void TriggerMe()
{
  	RAGE.Events.Add("eventExample", OurEventHandler);
  
	RAGE.Ui.HtmlWindow wnd = new RAGE.Ui.HtmlWindow("package://index.html");
 	wnd.ExecuteJs("mp.trigger('eventExample', 'yep')");
  
  	// "mp.gui.execute"
  	RAGE.Ui.DefaultWindow.ExecuteJs("test()");
}

 

 

BUILT-IN NATIVEUI

 

using System;
using System.Collections.Generic;

using RAGE.NUI;

public class MenuExample
        : RAGE.Events.Script
{
    private bool ketchup = false;
    private string dish = "Banana";
    private MenuPool _menuPool;

    public void AddMenuKetchup(UIMenu menu)
    {
        var newitem = new UIMenuCheckboxItem("Add ketchup?", ketchup, "Do you wish to add ketchup?");
        menu.AddItem(newitem);
        menu.OnCheckboxChange += (sender, item, checked_) =>
        {
            if (item == newitem)
            {
                ketchup = checked_;
                Notify("~r~Ketchup status: ~b~" + ketchup);
            }
        };
    }

    public void AddMenuFoods(UIMenu menu)
    {
        var foods = new List<dynamic>
        {
            "Banana",
            "Apple",
            "Pizza",
            "Quartilicious",
            0xF00D, // Dynamic!
        };
        var newitem = new UIMenuListItem("Food", foods, 0);
        menu.AddItem(newitem);
        menu.OnListChange += (sender, item, index) =>
        {
            if (item == newitem)
            {
                dish = item.IndexToItem(index).ToString();
                Notify("Preparing ~b~" + dish + "~w~...");
            }

        };
    }

    public void AddMenuCook(UIMenu menu)
    {
        var newitem = new UIMenuItem("Cook!", "Cook the dish with the appropiate ingredients and ketchup.");
        newitem.SetLeftBadge(UIMenuItem.BadgeStyle.Star);
        newitem.SetRightBadge(UIMenuItem.BadgeStyle.Tick);
        menu.AddItem(newitem);
        menu.OnItemSelect += (sender, item, index) =>
        {
            if (item == newitem)
            {
                string output = ketchup ? "You have ordered ~b~{0}~w~ ~r~with~w~ ketchup." : "You have ordered ~b~{0}~w~ ~r~without~w~ ketchup.";
                Notify(String.Format(output, dish));
            }
        };
        menu.OnIndexChange += (sender, index) =>
        {
            if (sender.MenuItems[index] == newitem)
                newitem.SetLeftBadge(UIMenuItem.BadgeStyle.None);
        };
    }

    public void AddMenuAnotherMenu(UIMenu menu)
    {
        var submenu = _menuPool.AddSubMenu(menu, "Another Menu");
        for (int i = 0; i < 20; i++)
            submenu.AddItem(new UIMenuItem("PageFiller", "Sample description that takes more than one line. Moreso, it takes way more than two lines since it's so long. Wow, check out this length!"));
    }

    public void DrawMenu(System.Collections.Generic.List<RAGE.Events.TickNametagData> nametags)
    {
        _menuPool.ProcessMenus();
    }

    public MenuExample()
    {
        _menuPool = new MenuPool();
        var mainMenu = new UIMenu("Native UI", "~b~NATIVEUI SHOWCASE");
      
      	// original NativeUI replicates GTA V "interaction menu", 
      	//changing FreezeAllInput to true makes the player completely frozen
      	// while the menu is active
        mainMenu.FreezeAllInput = true;
      
        _menuPool.Add(mainMenu);
        AddMenuKetchup(mainMenu);
        AddMenuFoods(mainMenu);
        AddMenuCook(mainMenu);
        AddMenuAnotherMenu(mainMenu);
        _menuPool.RefreshIndex();

        RAGE.Events.Tick += DrawMenu;

        mainMenu.Visible = true;
    }

    public static void Notify(string text)
    {
        RAGE.Game.Ui.SetNotificationTextEntry("STRING");
        RAGE.Game.Ui.AddTextComponentSubstringPlayerName(text);
        RAGE.Game.Ui.DrawNotification(false, false);
    }
}

 

Here's how that NativeUI example looks in the game:

image.png

 

General Changes

  • JS: "entityDataChange" event has been replaced with "mp.events.addDataHandler(key, handler)"
  • JS: added mp.events.callLocal
  • Improvements on initial server loading
  • Fix voice chat not getting cleared properly after setting "voice3d" to false
  • Improve voice chat playback thread synchronization mechanism, so it doesn't affect anything else
  • Fix reported voice chat crashes
  • 0.4's game interaction performance improvements backport
  • Fix in-game UI not saving "latest IP connected to" correctly
  • DataStorage UTF-8 support fixes
  • Added a smoother voice chat packet loss handling
  • Fixed reported voice chat stability issues
  • Fixed some specific remote player tasks stuck after finished
  • Added "experimental web platform features" flag to the in-game CEF
  • Fixed key binding issues with isDown param = false

 

 

Downloads

You can download the update using the regular RAGE Multiplayer updater. Open config.xml and set your updater branch to 037_testing. Once you restart the client, it will download the update. We don't recommend to use the testing release build to play on 3rd-party servers.

NOTE: In order to enable the client-side C# API IntelliSense fanciness, you should add the "dotnet/rage-sharp.dll" as a reference. additionally, You can reference "dotnet/Newtonsoft.Json.dll" for the Json functionalities.

 

RAGE Multiplayer 0.3.6 Stable Release

@rangemultiplayer am 10/28/2018 08:21 pm

Even though a major update is under development still, it has been decided to push an update containing new features alongside with 1.45 game patch compatibility update. Today, nearly a week after public beta started, RAGE Multiplayer 0.3.6 goes into the stable branch!

 

General changes

  • Added: server-based voice chat (server config option to enable: `voice-chat`: true)
  • Updated: Scripting stability improvements ("undefined" errors should be fixed now, needs to be confirmed)
  • Updated: V8 (a separate vanilla one is used client-side now, not the one bundled with NodeJS)
  • Updated: Security enhancements
  • Added: Grand Theft Auto V's 1.45 patch support
  • Reimplemented "construction zone crash" fix
  • Vehicle model limit adjustment (it's not an actual 0.4 backport since it uses another method that doesn't rely on 0.4 features)
  • Updated NodeJS
  • Backported native fool proofing
  • Added "allow-voice-chat-input" option (only available via registry at the moment); default value: 1
  • Updated: CEF (Chromium 70.0.3538.77)
  • Fixed: potential aiming synchronization data corruption
  • Added: more game limits have been adjusted so more global conversion mods are compatible now
  • Fixed: custom dlc packs conflicting with certain game dlc pack
  • Fixed: dlc packs not working correctly with FQDN
  • Miscellaneous fixes

 

Scripting

  • Added: mp.voiceChat.muted (client-side)
  • Added: mp.voiceChat.getPreprocessingParam(param) (client-side)
  • Added: mp.voiceChat.setPreprocessingParam(param, value) (client-side)
  • Added: player.voiceVolume (client-side)
  • Added: player.voice3d (client-side)
  • Added: player.voiceAutoVolume (client-side)
  • Added: player.isVoiceActive (client-side)
  • Added: event: playerStartTalking (client-side)
  • Added: event: playerStopTalking (client-side)
  • Added: player.enableVoiceTo(target) (server-side)
  • Added: player.disableVoiceTo(target) (server-side)
  • Added: player.voiceListeners (server-side)
  • Added: mp.voiceChat.isAllowed (read-only) (client-side)
  • Added: player.clearDecorations() (server-side)
  • Added: player.getVoiceAttribute(attribute) (client-side)
  • Added: player.setVoiceAttribute(attribute, value) (client-side)
  • Fixed: vehicle.getOccupant
  • Updated: C# enums
  • Fixed: C# UTF-8 support improvements

 

Downloads

 

*if you already have RAGE Multiplayer installed, it will update itself on the next launch

 

UPD: As stable updater branch got C# API files conflict, we pushed server_bridge_035.exe server build which is compatible with 0.3.5's C# API. For 0.3.6's C# API you should get the complete package (https://ragemp.bastage.net/files/ragemp-0.3.6.zip) and grab that there at the moment. The conflict is being resolved now.

 

0.4

uh, soon(tm), probably?

 

 

 

0.3.6.1 changelog

  • The "Zero Dot Four" updater is used now
  • Additional voice chat sanity checks
  • Added "voice-chat-sample-rate" server config option (allowed values are 8000, 16000, 24000, 48000)
  • More client fool-proofing

 

16.09: Development Report

@rangemultiplayer am 09/16/2018 11:46 am

image.png

 

Hi there! It has been mentioned that it is important for us to keep the community in touch with the latest changes we make. Here's a small peek of what has been implemented since the previous announcement!

Peds
Shared peds have been added. This implementation lets you make your client-sided peds globally visible (as long as players can see the owner of the ped) and will be synchronised without any additional work. Being a basic version, this feature got a few limitations such as a lack of control server-side (as this implementation is based on the existing client-side mp.peds, however, scripters can wrap it into a server-side dummy entity).


While you surely can use this to "make the traffic dream come true" (thanks to unoccupied vehicles synchronization introduced in 0.4 earlier, peds even can drive vehicles!), this implementation is purposed at making proper PvE game modes with AI involved (scripted missions? competitive game modes with enemy AI?). Shared peds API is pretty simple and does include only a few changes to mp.Ped class properties:

  • Added: boolean: ped.isShared (read-only for non-owners)
  • Added: boolean: ped.isOwned (read-only)
  • Added: mp.Player: ped.owner (read-only)
  • Added: number: ped.sharedId (read-only) (note that shared peds id system works per player so different peds owned by different players aren't supposed to have unique shared ids)
  • Added: Array: player.peds

Here's a quick code example:

mp.peds.new('mp_m_freemode_01', mp.players.local.position, 0, (ped) =>
{
	// make it shared on stream in, you can't make a ped global if it's not physically created on our side yet
	ped.isShared = true;

	// apply some trivial scripting tasks, run animations or something similar
	const targetPos = mp.players.local.position;
	ped.taskGoStraightToCoord(targetPos.x + 10, targetPos.y + 10, targetPos.z, 1, 10000, 0.0, 0.5);

	setTimeout(() =>
	{	
		ped.taskHandsUp(5000, 0, 0xFFFF, true);
	}, 10000);    
});

 

...and a video showing how it looks in the game for a local and remote player:

 

Scripting (examples given in JavaScript, but changes applicable for other runtimes too)

  • Added: mp.events.addCommand, it works just like the server-sided one, but without player argument (local player should be considered instead, obviously) [client-side]
  • Updated: mp.game.invoke/player.invoke now supports 64-bit unsigned BigInt native identifiers (String ones are still supported too): [shared]
player.invoke(0xB96B00E976BE977Fn); // New syntax (BigInt)
player.invoke("0xB96B00E976BE977F"); // Legacy syntax (String)

 

  • Updated: client-side entity.model setter supports String value too (like server-side does)
  • Updated: 64-bit integer (BigInt) support has been added to local/remote events mechanism/shared variables
  • Added: rage::ILocalEventHandler introduced earlier got implemented for scripting VMs, adding next APIs: mp.events.addLocal, mp.events. callLocal (don't confuse with mp.events.call which triggers local events too, but only ones inside the local JS runtime):
mp.events.addLocal("trigger_my_js_stuff_plox", (arg1, arg2) =>
{
    return new mp.Vector3(1, 1, 1);
});

 

  • JS runtime is now disabled when the server doesn't use any JS package (as people tend to forget to configure it)
  • JS runtime increasing the usage of newest V8 Engine features to avoid deprecated APIs


Misc

  • A deeper game clean-up with major game resources reloading on reconnect
  • New server config option: "instant-connections". It lets you, for example, join faster to your test server without the deep clean-up ("true" means 0.3 reconnect clean-up behavior)
  • New game load and resources download UI with server customization support to be added by next development progress report

  • Peds aren't invincible or frozen by default anymore
  • CEF dependency update: 3.3497 (Chromium 69)
  • NodeJS dependency update: 10.10.0

 

3rd September: Progress of the Week

@rangemultiplayer am 09/03/2018 03:53 pm

Hello there,

Usually, we don't post weekly announcements but thought that it would be a good idea to keep the community up to date with the latest updates made before the next major release goes public.

Scripting

  • Client-side JS debugging support has been implemented, source maps compatibility is still in the process of being implemented.
  • Added: property bool object.isWeak [client-side].
  • Added: event "connectionScreenFadeOut" (cancellable to let you spawn the player gracefully) [client-side].
  • Updated: ped.setHeadOverlay is now same as player.setHeadOverlay to avoid confusion [client-side].
  • Added: mp.game.ui.removeConnectionScreen() [client-side].

General

  • Server packages now download in parallel (up to 5 concurrent downloads by default, configurable up to 10)
  • Improved client packages encryption cryptography
  • Fixed player's ability to send chat messages before getting completely ready
  • Increased initial server data download timeout
  • Modding: "raw" dlc packs mechanism has been implemented (files get packed into a virtual "rpf" on client loading so it's technically the same): this makes updating your dlcpacks easier and faster for your players, but also lets you use mods without using additional software to pack/encrypt it. Recursive RPF support is implemented too, structure example:

image.png

 

  • Internal testing and code reviews have helped us to resolve issues introduced when working on 0.4, this has also helped with reducing the need for splitting new major releases per testing releases

Launcher / Updater Changes

  • Updater now also downloads in parallel (up to 10 concurrent downloads), this provides a faster updating process
  • Fixed rage:// launch protocol
  • Updater UI has been updated (credits to @Kasimir for the hard work on making it as lightweight as possible, to keep updater quick and small)

Would you prefer more frequent update announcements for future changelogs? Do you love the new updater UI?

Comment below or give us feedback on our Discord

27th August: Recent Development Progress

@rangemultiplayer am 08/27/2018 08:42 pm

It has been a month since the previous 0.4 development announcement, this time we used to post some random development progress (such as 1.44 support or 3D CEF experiments, for example), but isn't this day (by the way, first 0.3 Developer Preview has been released exactly a year ago!) nice enough to share a recent updates list?

 

Anti-Cheat Essentials, Part I

RAGE Multiplayer 0.3 did not have an actual anti-cheat code, but basic checks and some game code parts being protected, it prevented most of unauthorized mods/cheats to work correctly, however, 0.4 introduces a more advanced anti-cheat protection with multiple detection methods unavailable script-wise. Despite some of lower level protection methods having to be implemented yet, here are some of its current features:

  • Detection of most of the internal/external cheats
  • Abusive software detection
  • Game code changes aimed at breaking existing game mods compatibility and protecting game's internals
  • A quick pre-launching scan to notify players about potential cheating software is running

 

Launcher improvements

  • Pre-launch Social Club initialization has been cut to speed up game launching times and fix launcher failures.
  • Multiple game instances support has been made public (currently unavailable for Steam though due to its protection)
  • Updater does not require .NET and performs faster now

 

Scripting

  • Added: object.rotateLocal(rotation) [client-side]
  • Added: object.rotate(rotation) [client-side]
  • Added: event "exceptionCaught" [client-side]
  • Added: mp.events.addDummyHandler(type, handler) [client-side]
  • Added: mp.objects.newWeak(gameHandle) which creates a mp.Object reference to a game object to let you use it without natives
  • Removed: mp.game.ped.createPed, mp.game.object.createObject, mp.game.object.createObjectNoOffset, mp.game.graphics.createCheckpoint, mp.game.cam.createCamWithParams, mp.game.cam.createCameraWithParams, mp.game.cam.createCamera, mp.game.cam.createCam, use mp.peds.new, mp.objects.new, mp.checkpoints.new, mp.cameras.new [client-side]
  • Added: mp.game.player.enableDefaultEngineBehaviour (toggle) [client-side]
  • Added: event "cheatDetected"
  • Added: client/server cross-plugin/vm events mechanism (e.g, C# <-> C++ <-> JS)

 

Misc

  • Standalone cross-platform optional client packages hosting application
  • Dummy entity serialization server performance improvements
  • Internal server SDK refactor that makes scripting wrappers easier and with less overhead scripting wrappers (such as JS and C# API)
  • Game's vanilla script processing has been disabled for increased performance and security.
  • Rockstar SocialClub in-game front-end processing has been disabled (that annoying window popping up when you press Home was affected 💀 too, by the way)
  • Client package downloader has been rewritten to prevent known issues and improve overall performance
  • 0.4's new synchronization bandwidth optimizations
  • Launcher front-end is now shared with the in-game menu
  • Fixed cursor not showing correctly for "Windows" mouse input mode users
  • Multiplayer menu initialization time has been decreased drastically
  • Fixed random client crash on launch when CEF initialization is slow
  • Unoccupied vehicle synchronization
  • Fixed "fastdl-host" server config option
  • Fixed mp.keys.bind not working correctly for 'down'
  • Fixed mp.game.graphics "outline" and "centre" params
  • Rockstar Editor clip recording fixes
  • Fixed MP sounds not loading by default
  • Native invoker improvements and fool-proofing
  • 0.4d's "unrevealed feature" got voice activity detection ;)
  • Dependencies such as CEF (Chromium version is 68 now) and NodeJS (10.9.0 now) have been updated
  • Fixed the DLC packages issue introduced with Grand Theft Auto V's latest update
  • JS sanity checks preventing the "undefined:0" error (in the cases reported to us)
  • Improvements to server-side API calls ordering reliability

 

 

Release Date? ETA?

We do not have an official ETA announced and won't until the day it's fully complete. The reason is so that the release isn't rushed and you aren't let down if the release date passes without an actual release. There is an "internal ETA" that is followed and is soon™ approaching. Don't worry, progress is being made!

 

14th July, 2018: Preparing for the 0.4

@rangemultiplayer am 07/13/2018 11:36 pm

 

image.png

 

Hello everyone! It's been 2 months and a number of _not that big_ updates released since our major RAGE Multiplayer 0.4 update was announced (with which we've enjoyed a major increase in the amount of concurrent players online, thanks for that! 😉), so today, the development team is happy to share another 0.4 development update!

 

Before starting: the 0.4 testing versioning:

  • 0.4a - basic 0.4 update, including multiplayer core improvements such as new streamer and most of C#/JS scripting enhancements, new UI
  • 0.4b - synchronization update covering most of the flaws existed ever (almost every of player animations synchronized? yeh, right! client-side scripted animations synchronized? yes!). Examples below don't show all improvements, but some trivial cases:

ezgif.com-gif-maker.gif

climbing ladder / fall / ragdoll synchronization

 

2018-07-14_00-26-10.gif

cover / cover shooting / reloading weapon while running / combat roll synchronization

 

  • 0.4c - client-side C# API release
  • 0.4d - partial p2p introduction and some bonus feature 🤠
  • 0.4 Stable - 0.4 ending update featuring stability improvements and not released yet features

 

0.4a: General Updates

  • Major client-side scripting refactoring
  • Part of game limits adjusted (more content could be stored in dlc packs!)
  • Networking improvements made to implement *cheap* NPC traffic in future releases
  • Original bike melee from GTA Online has been added into the game
  • Client-side packages encryption
  • Chromium has been updated to 67
  • NodeJS has been updated to 10.6.0 (V8: 6.7.288.46)
  • Compression of resources (less client-side resources download time, less drive space taken!)
  • Added screenshots:// scheme to access screenshots in CEF
  • Reimplemented state-of-art client-/server-side streamer tailored for the game's needs and limits

  • Grand Theft Auto V's character system has been disabled that allows you to get rid of stats, but also it fixes some game glitches

0.4a: UI Updates

  • Completely new launcher UI with fresh design useful features such as all country flags added!

  • Game menu's alternative trigger key is disabled now
  • New chat with highly requested features such as scrolling and message history

 

2018-07-13_21-14-19.gif

 

  • Main menu: disconnect button
  • Main menu: fixed server list visual issues
  • Game pause menu: removed useless tabs

 

0.4a: Stability / Performance Updates

  • Initial loading optimizations for multiple cases: a) lots of players joining b) lots of entities spawned
  • JS runtime optimizations
  • Optimized shared data
  • Optimized CEF rendering
  • Optimized nametag rendering
  • Fixed Windows 7-related issues
  • Fixed server-side native triggers
  • Fixed several server-side C# functions
  • Fixed client-side peds-related crash
  • Improved client's threading model
  • Fixed takeScreenshot paths
  • Optimized 3d text label rendering
  • Drastically improved performance of triggers containing really huge data
  • Improved JS API memory management
  • Fixed vehicle number plate value in vehicle constructor being ignored for existing players
  • Fixed some face features not applying well when not set using SetFaceFeature
  • Fixed recently added clothes drawables not working
  • Fixed game crashes in specific game locations
  • Fixed vehicle.repair() keeping exploded vehicles not usable
  • Fixed heavy vehicles sounds
  • Fixed waypoint events
  • Fixed vehicle customization not setting correctly for connected players
  • Improved updater downloading performance
  • Fixed game when crash large amount of players/peds streams in
  • Fixed disabled game menu input issue
  • Server-side entity streaming performance has been improved
  • Other miscellaneous stability improvements and API fixes

 

0.4a: API Updates

  • Internal wrappers initially created for C# were moved into the server core to improve stability, supportability and make it possible to be used by different APIs (e.g., it could be imported directly into any language that supports C interoperability).
// a short example of using Player::Spawn at LuaJIT (considering you have basic LuaJIT hosting plugin)
local ffi = require("ffi")

ffi.cdef[[
void SpawnPlayer(unsigned short playerId, float x, float y, float z, float heading);
]]

ffi.C.SpawnPlayer(playerId, 0.0, 0.0, 0.0, 0.0)
  • Server-side facial decorations
player.setDecoration(collection, overlay, isFacial);
  • Client-/server-side weapon components API
// tints
player.setWeaponTint(weapon, tint);
let tint = player.getWeaponTint(weapon);

// weapon attachments
player.addWeaponAttachment(weapon, attachment); // attachment is attachment hash or an array of hashes
player.removeWeaponAttachment(weapon, attachment);
player.hasWeaponAttachment(weapon, attachment);
  • Server-side entity attachments:
entity.attachTo(targetEntity, bone, positionOffset, rotationOffset);
entity.attachment
entity.attachedTo
entity.attachedEntities
  • Blip API enhancements: attachments, radius functionality:
blip.radius = 10; // set radius

mp.blips.new(1, [0.0, 0.0, 0.0], 
{
	radius: 20 // set radius in constructor
});

mp.blips.newAttached(1, entity,  // attached blips
{
	alpha: 100
});
  • 0.4d+: Client-to-client triggers (if p2p connection is established, then delivered directly, otherwise the server is used):
// client 2
mp.events.add("private_message", (player, msg) =>
{
    mp.gui.chat.push(`${player.name} [${player.remoteId}]: ${msg}`);
});

// client 1
let receiver = mp.players.atRemoteId(playerId);

if(mp.players.local.p2pAllowed) // check if the player (local player in that case) allows p2p connections
{
  if(receiver.connected) // check if direct client-to-client connection is established
  {
      receiver.call("private_message", ["hello beast"]);
  }
}
  • Asynchronous evented triggers answers:
// clientside
mp.events.add("this_event_returns_something", (argument1) =>
{
  return [argument1*10, argument1*100];
});

// serverside
player.call("this_event_returns_something", [5], (player, argument1, argument2) =>
{
  console.log(argument1, argument2); // 50 500
});
  • Game legacy version native identifiers were (re-)added into the game on par with current game update ones. Since it's actually added, but not translated, performance is absolutely same and no overhead has been added (No worries, there's no native collisions):
let maxWantedLevel = mp.game.invoke("0xB89B7DB2727D69D6"); // uses 1.43 hash
let maxWantedLevel = mp.game.invoke("0x462E0DB9B137DC5F"); // uses legacy native, that is possible in 0.4
  • Client-side `entityDataChange` has been replaced with `mp.events.addDataHandler(name, handler)`
mp.events.add("entityDataChage", (name, value) => { if(name === 'score') { code; } }); // old, wont work in 0.4
mp.events.addDataHandler("score", (value) => { code; }); // new
  • New: bool OnIncomingConnection(ip, serial, rgscName):
mp.events.add("incomingConnection", (ip, serial, rgscName) =>
{
  return whitelistedSerials.indexOf(serial) !== -1; // allow connection only in case if "whitelistedSerials" contains our serial
});
  • Added vehicle body/engine health server-side setters:
vehicle.engineHealth = 0.0;
vehicle.bodyHealth = 1000.0;
  • Updated native invoker that supports references and different return values
// mp.game.invoke(native[, returnValueType], arguments)

// 0xD75960F6BD9EA49C BOOL GET_PED_LAST_DAMAGE_BONE(Ped ped, int* outBone)
// 0x17C07FC640E86B4E Vector3 GET_PED_BONE_COORDS(Ped ped, int boneId, float offsetX, float offsetY, float offsetZ)

// this native shows just an example of updated invoker, however in real environment this code could've been implemented using client-side API and especially Player class method
const types = mp.game.invokeTypes;

let argumentsWithAReference = [player, 0];

if(mp.game.invoke("0xD75960F6BD9EA49C", argumentsWithAReference))
{ 
  let boneCoords = mp.game.invoke("0x17C07FC640E86B4E", 
                                  types.Vector3,
                                  [player, argumentsWithAReference[1], 0, 0, 0]);
    
  mp.gui.chat.push(`Bone: ${argumentsWithAReference[1]}; ${boneCoords.x}, ${boneCoords.y}, ${boneCoords.z}`);
}
  • Objects/ped/markers/checkpoints/pickups got streaming API:
mp.objects.new(model, position,
{
	streamDistance: streamDistance // pass stream distance as an additional param on creation
});

object.streamDistance = 300; // or set it later

object.streamDistance = 5000; // make the object globally visible

object.notifyOnStreamingUpdate = true; // makes it calling entityStreamIn/Out; false by default

object.hidden = true; // hide entity from the world
  • JS setVarible got support of setting variables from an object (which is more optimized way, by the way):
player.setVariables({foo: bar, foo2: bar2});
  • Added "dummy" entities that allow you to add your own entities (for example a server-side fire, particle or virtual entities like ATM). Here's a really quick example of server-side static peds - a highly asked feature ;):
// client-side
function initializeStaticPeds()
{
	mp.dummies.forEachByType(1337, (entity) => // loop though dummy entities with "dummy" id 1337
	{
      if(!entity.pedInstance)
      {
        entity.pedInstance = mp.peds.new(entity.getVariable("position"), entity.getVariable("heading"), (function(ped)
        {
          ped.taskPlayAnim(this.getVariable("animationDict"), this.getVariable("animation"), 8.0, 1.0, -1, this.getVariable("animationFlag"), 1.0, true, true, true);
        }).bind(entity), entity.dimension);
        
        entity.pedInstance.parentEntity = entity;
      }
	});
}

// server-side
function addStaticPed(model, position, heading, animationDict, animationFlag, animation, dimension)
{
  let entity = mp.dummies.new(1337, // dummy entity type
    dimension,
    { // initial shared variables
    	heading: heading,
    	animationDict: animationDict,
    	animationFlag: animationFlag,
    	animation: animation
  	});
  
  entity.playAnimation = function(dict, anim) { this.setVariable({ animationDict: dict, animation: animation }); };
  
  return entity;
}

 

0.4a: C# API Updates

  • Added: unique object instancing that is useful to compare different objects with same NetHandles
  • Updated: model enums are up to date now
  • Changes: Value type arguments are now passed by read-only reference to avoid unnecessary heap allocations. readonly-ref.md (Github)
  • Fixes: Resolved runtime assembly issues, bridge should be fully standalone.
  • Fixes: The bridge now has its own Newtonsoft.Json to avoid version conflicts with the user-loaded (newer/older) assembly.
  • Fixes: Dynamic type no longer relies on an older Microsoft.CSharp.dll assembly which was a workaround.
  • Added: Methods to register Commands at runtime using NAPI.Command.Register and NAPI.Command.Unregister
  • Added: Method and property to Client to Block parsing commands
  • Added: Methods to invoke RemoteEvents and Commands using NAPI.RemoteEvent.Invoke and NAPI.Command.Invoke
  • Added: Ability to register RemoteEvents at runtime using NAPI.RemoteEvent.Register and NAPI.RemoteEvent.Unregister
  • Updated: Bootstrapper now relies on .NET Core 2.1.0
  • Important: Bridge's framework update now targets netcoreapp2.1, make sure to set your target framework to .NET Core 2.1 in your projects for the resource to function properly, this framework update brings a lot of performance improvements over .NET Core 2.0 as well as the missing features for EF Core importantly.
  • Updated: Overall bridge performance improvements and optimizations. most evidently, ClientEvent Triggers now perform at least 2 times faster than they did before.
  • Updated: Allow Instantiating private ctors (fool-proofing)
  • Updated: Commands, ServerEvents and RemoteEvents should no longer require a public (& non-static) access modifier. for example
  • Removed: The unable to locate .NET Core SDK message, the bridge is self-contained and does not require any SDKs to be installed.
  • Fixed: VehicleSirenToggle event
  • Fixed: Vehicle Trailer API
  • Added: Driver property to Vehicle object (OOP)
  • Added: Commands Attributes, this should be an alternative to the current ones. Here's an example of usage and a list of available attributes
  • Added: RemainingText parameter attribute to Commands, this should replace GreedyArg. Here's an example of usage
  • Removed: NativeHashes enum (obsolete)
  • Added: Disabling default server behaviour event attributes: [DisableDefaultChat], [DisableDefaultOnConnectSpawn] and [DisableDefaultOnDeathRespawn], example of usages can be seen, as following on OnChatMessage, OnPlayerDeath and OnPlayerConnected.
  • Added: GetAllPlayers to ColShape object (OOP)
  • Added: Included Windows-1251 (Cyrillic) Encoding by default Encoding.GetEncoding("Windows-1251")
  • Fixed: Cast exceptions and other bugs reported by users.
  • Added: As much as possible fool-proofing to avoid devs falling in pitfalls of mistakes
  • Added: ConsoleOutput overloads with the ability to output colorful text on console.. examples of usages: here
  • Updated: NAPI.Log.Exception now has a customizable file param, example usage: NAPI.Log.Exception("Ouch, I've crashed!", "server_ouches.txt")
  • Added: GetServerPassword method
  • Added: New server events such as VehicleDeathEx with additional reason and killer params
  • Added: A Remote Console that can interact with the server directly which supports multiple kinds of input. very useful for development and testing without having to in-game. You can read the documentation here
  • Fixed: A couple of memory leaks in ClientEvent triggers
  • Fixed: Vehicle mods API
  • Fixed: Clean up EntityData after deletion
  • Added: Default resource template creation for an easy resource creation using the guides as following: Setting up a dev env using Visual Studio and Setting up a dev env using Visual Studio Code

 

*0.4a changelogs are non-final and still are subject to change. Full 0.4b-0.4 Stable changelogs will be posted at its release.

 

2nd May, 2018: 0.4 Announcement

@rangemultiplayer am 05/02/2018 11:51 pm

CPUVk9s.png

 

2nd of May, 2016. This was the day that RAGE Multiplayer started development. For many, this was a leap into the unknown and no one knew what to expect from a project with such great potential. Having that said, we can't stress enough how proud we are after two years of hard work to announce the 0.4 of RAGE Multiplayer on the occasion of its BIRTHDAY! :x

Here's a summary of what to expect from the much awaited 0.4:
 

A complete new synchronization

During the process of our continuous reworking of the synchronization code, we've found a couple of unused game functionalities that have proved to be very useful in improving general synchronization. So we went ahead and decided to implement these functionalities to improve the overall game synchronization and the result is much better than initially expected. Here's a couple of screenshots that showcase some of the new sync features.

image.png

(Cover sync while blind firing, different tasks being smoothly sync'ed as if it was just one task)

 

unknown.png

(Proper first-person synchronization, allows you to see where your friends are looking at while in first person)

 

image.png

(Ruiner2 parachute synchronization)

 

image.png

(Proper combat rolls sync)

 

OJEeD7V-Imgur.gif

(Vehicle hydraulics synchronization)

 

image.png

(Stealth mode synchronization)

 

 

A hybrid networking cocktail, Peer-To-Peer mixed with Client/Server!

As stated, our rework of synchronization does not stop there, we've also taken a leap ahead and reworked the networking aswell. It now utilizes P2P, when possible, to synchronize the gameplay as smoothly as possible, so there is more juice for the server to sip and much less strain on the network!

 

Client-side C#.. Awesome! Right?

A much much requested feature, C# client side, has been added! We're currently working on the Documentation & Implementation so stay tuned for further updates!

 

Miscellaneous

A lot of miscellaneous stuff has been added, removed, fixed, and changed. RAGE Multiplayer is much more stable than ever, with no known major issues such as the crash locations being reported. Performance has also improved and we've managed to modernize our networking & synchronization methods. All in all, this is a very promising update which we are sure will fall in taste. Stay tuned for the changelog to find out what exactly 0.4 is all about!
 

RAGE Multiplayer 0.3.5 Public Release

@rangemultiplayer am 02/20/2018 11:10 pm

Hello gamers and developers! We were mainly working on refactoring and the future updates, but that doesn't mean there wouldn't be updated in between! So, here's what 0.3.5 is adding, fixing and improving (and porting!) in the platform:

 

GENERAL

  • Linux build of C# API has been released!
  • Added: player.removeDecoration(decoration, collection)
  • Added: mp.world.time.set(hour, minute, second) as an alternative of mp.world.time.hour/minute/second
  • Fixed: bullet synchronization issues introduced with former game patches
  • Fixed: passenger synchronization issues
  • Fixed: entityDataChange event
  • Fixed: global colshapes
  • Fixed: s2w and arguments in click event
  • Fixed: inactive CEF windows are visible after opening and hiding multiplayer menu
  • Improved: streamer reliability
  • Fixed: attached objects being streamed out when it shouldn't
  • Fixed: trailer events
  • Fixed: hidden CEF windows receiving mouse click events
  • Miscellaneous fixes, optimizations and improvements

 

BRIDGE

  • Important: A new .NET hosting method for the bridge which means an obnoxiously screamingly loud "LINUX SUPPORT!" for the bridge, so you can now use your cheap a$$ virtual private servers.
  • Updated: Performance improvements of events, remote events and commands.. it's basically the stuff that programmers love seeing, if you're not impressed.. get out of here!!
  • Added: SetEntitySharedData overload with Dictionary as a param, this should help you a lot to avoid overhead and increase efficiency, as well as SetSharedData OOP method for entities
  • Added: SetPlayerCustomization
  • Added: SetPlayerDecoration (incl. an overload with an array as param)
  • Added: RemovePlayerDecoration
  • Added: SetPlayerDecoration
  • Added: SetPlayerClothes overload with dictionary as param
  • Added: Missing Client customization OOP methods and properties including the ones mentioned above
  • Added: FirstChanceException Event that should catch all the exceptions thrown before being handled.
  • Added: UnhandledException Event that should catch all the unhandled exceptions thrown.
  • Added: DeathReason enum that can be obviously used to determine the death reason in the Death event (as well as the WeaponHash)
  • Fixed: StackOverflow exception due to events when no resources are loaded.
  • Fixed: Deleted props should now be synced on player connection.
  • Updated: The old-fashioned way of events was completely replaced with a new efficient and performant system that relies on attributes while looking quite clean and fancy. (Here's an example)
  • NOTE: Make sure your event method modifier is set to public!!!
  • Removed: For the sake of the events overhaul, CancelEventArgs had to be deprecated, worry not though, there's a replacement as following:
  • Added: NAPI.Server.SetAutoRespawnAfterDeath(bool value) -- disables the default auto respawning after death, default value: true.
  • Added: NAPI.Server.SetAutoSpawnOnConnect(bool value) -- disables the default auto spawn on player connection, default value: true.
  • Added: NAPI.Server.SetGlobalServerChat(bool value) -- disables the default server chat, default value: true.
  • Updated: Remote events have been enhanced (as requested by many) and should now be very straightforward to use like commands (Here's an example of possible usages)
  • Updated: Additionally, We've also made it possible to use Entity objects (Client, Vehicle, Object, etc..) in Remote events, so you wont have to do the additional work (Here's an example)
  • Updated: Commands have been optimized and should now be much more performant than ever
  • Added: Non thread-safe methods will no longer cause a server crash when called outside of main thread, will simply print a warning on console.
  • Added: Added (NetHandle).Entity<T>() method for the sake of OOP fanciness, this has the same usage as NAPI.Entity.GetEntityFromHandle
  • Fixed: CreateVehicle should now spawn with desired colors set in the parameters.
  • Added: Exceptions are now logged into their own file (server_exceptions.txt), so now you can worry not about the console crashing without you having a look at the thrown exception.
  • Added: Additionally, we've added Ben.Dymestifier which should make exception (stack traces) logs more productive.
  • Added: Optionally, NAPI.Log class was added which includes a Exception(string exceptionText) method
  • Added: FromJson<T>(string json) and FromJson<T>(object json) to NAPI.Util
  • Updated: Weather methods now use Weather enum instead
  • Added: SetPlayerSkin/(Client)SetSkin method overloads were added with a uint param
  • Fixed: Custom vehicle colors were not working as expected (Issue #66 and #59)
  • Added: VehicleSeats, DisconnectionType, CheckpointType and MarkerType enums were added
  • Fixed: ConstantVehicleData was not functional thus not reading from vehicleData.json correctly, a lot of vehicle related methods were not functional.
  • Fixed: (Client).Vehicle crashes server if player is not in a vehicle (Issue #58)
  • Fixed: Explosions should no longer crash the server.
  • Added: NAPI.Vehicle.GetVehicleMaxPassengers
  • Added: NAPI.Server.SetGlobalDefaultCommandMessages(bool value) -- disables the default messages thrown out by commands (as per request from some lazy dude that didn't want to use the Hide attribute param)

 

Just now, ragempdev said:

RAGE Multiplayer 0.3.5.3 has been pushed: it adds support of Grand Theft Auto V's "Southern San Andreas Super Sport Series" DLC (patch 1.0.1365.0/1.43).

 

HOW TO INSTALL
-> Setting up the Server on Linux/Windows

-> Setting up the Bridge on Linux/Windows

DOWNLOADS

Copyright © 2018 - www.rage-multiplayer.de | Datenschutzerklärung