Passer au contenu principal

2023 Jan: Character, Weather, Console!

· 8 minutes de lecture
Gabriel T. Nardy

Nouveau personnage, système de météo, commandes et disposition de la console et bien plus encore !

Nouvelle classe de peCe mois-ci, nous avons travaillé dur pour réactualiser nos implémentations internes de joueur/personnage et toutes les choses avec lesquelles il interagit (armes, accessoires, véhicules). Notre code interne était encore très fortement lié à l'entité principale du personnage, tout en ayant des références directes à celle-ci. Nous avons donc retravaillé pour les modulariser, ce qui a permis d'ajouter de nouvelles classes de personnages "secondaires"

This month we worked hard on refactoring our internal Player/Character implementations and all things that it interacts to (Weapon, Props, Vehicles). Our internal code was still very strongly linked to the main Character entity, everything having direct references to it. So we worked hard to modularizing them, which allowed new "Sub" Character classes to be added.

And as an initial version, we created the new CharacterSimple class. A "simple" but powerful new class, it has no special features besides basic movement (based on Unreal base Character), but it allows to be constructed by passing a customized Animation Blueprint! Also it supports passing a StaticMesh as a mesh, which we automatically adjusts the Capsule Size of it based on the mesh size, perfect for Prop Hunt!

This new Character entity can then be used by anything, Custom NPCs, Animals, Props, etc. And them all can be possessed by Players!

info

We will be studying the ability to add more features to this class (e.g. Drive Vehicles or Handle Weapons). As this class is aimed to be simple, those features weren't added so far.

Read more in the CharacterSimple class page.

Docs Improvements

A summary of important changes in the docs.

Sandbox Section

I added a new section just for the Sandbox game-mode. This has examples on how the Spawn Menu, Context Menu and the Tool Guns work, and teaches how you can create scripts to extend or create new features which integrate with it! It is a great new Quick Start we have!

Changelog

We've got a new Changelog tab with the most recent updates of nanos world!

Compatibility Version

I moved the Compatibility Version pages to a new single page under Core Concepts / Packages section. Now all Compatibility Versions changes and the it's guide will be centralized there.

Improved CSS

We've got some improvements on the docs layout and CSS. The Mobile visualization was improved and we got new dividers between API definitions, making all look neat!

Troubleshoot Assets

I added a new section of Troubleshooting for Assets with the most common problems and their fixes.

ADK is on Steam

Now it is possible to download and use the Assets Development Kit through Steam directly! This new Steam Tool Entry for nanos world makes the ADK to be always updated! It launches the Unreal Editor automatically.

New Console Colors

We reworked our Console Layout and now it is more colorful and pretty! It got much more robust and modern! Hope you like it!

Console Commands

We've introduced the official Console Commands system. This new system allows adding custom console commands to both Server and Client consoles, and integrates it with the Available commands list when typing help on it.

It is a simple initial implementation which you can define the name of the parameters and the description of it, in the future we may expand it to define which type to expect, default values and more:

Console.RegisterCommand("myawesomecommand",
function(parameter_one, parameter_two)
-- Do something with parameter_one and parameter_two
end,
"this command executes awesome codes", -- Description
{ "parameter one", "parameter two" } -- Parameters
)

Read more in the Console.RegisterCommand method page.

Steam Avatar

Now it is possible to retrieve the Player's Steam Avatar! We've added a new method Player:GetPlayerIconURL() which returns a special URL which can be load the Steam Avatar on WebUIs:

Sky & Weather

We integrated the Weather system from Ultra Dynamic Sky into the Sky class! Now it is possible to change the current weather through Sky.ChangeWeather() and even have it integrated in your maps by using Ultra Dynamic Sky Material Functions from it's Assets Content if you have the UDS!

We've added a new dropdown to Context Menu to allow you changing the Weather from there:

Also the Sandbox Context Menu has a new section only for controlling Weather & Sky, and also an automatic Weather change system which synchronizes the current Weather with all connected players!

New Config.toml Format

The Server configuration file was completely reworked. Now we have several different sections and many more settings available to set through that. Almost all settings available through command line parameters now can be defined there persistently.

See the full configuration file schema here.

Compression

A new setting which has been added is the compression, which allows you configuring the amount of compression (0 is none, 9 is extreme) applied to some network operations. For now we are testing this new compression system for small files transfer and server requirements manifest, we managed to see up to 90% reduction of the size of those files when having it enabled!

tip

Using high level of compression affects the server and client performance as we add a new layer of computation processing to the CPU.

Level Entities Settings

Now it is possible to toggle in the Package.toml if you wish to load Level Entities, a.k.a. loading Level StaticMeshes as entities. This setting acts as a global OR setting which if we have at least one Package which enabled it, the setting will be enabled globally.

This setting allows we skipping a lot of processing and runtime performance loss if we don't need to use or reference level's StaticMeshes through scripting.

New Settings to Map.toml

We added two new settings to Map.toml: package_requirements and compatibility_version, allowing Map Packages to work better on their own.

Level Streaming Support

We implemented the full support to Level Streaming and World Partition. Before they weren't properly integrated into our Level class but now the events are triggered for auto-streaming and chunks from World Partition being loaded/unloaded as well! Also it is now integrated with Level Entities making the Level StaticMeshes to load/unload as entities on demand as well!

Large World Coordinates

Our Vector structs were refactored and now we have support for double-precision to Vector struct! Meaning huge Levels are now possible in nanos world! Read more about it in the Unreal Official Documentation page.

WebUI Layout

We added a new method to WebUI which although seems simple, it expands a lot the possibilities and modularity with UIs. Now it is possible to change the WebUI Canvas layout through WebUI:SetLayout.

This method allows changing the Canvas Layout (anchors, offset, alignment) of it, meaning we can have WebUIs working just as small popups, allowing you clicking on background WebUIs while having others small ones in the front of the screen!

WebUI ExecuteJavaScript

We added a new experimental method to WebUI: WebUI:ExecuteJavaScript. This allows executing arbitrary JavaScript code in your WebUI.

note

This method only works on local WebUIs.

In the last month we removed the logo settings from Config, Package and Asset Packs, as now they all must be locally-placed jpg images. But now we added back the --logo command line parameter to the server allowing it to auto download it as the Server.jpg image! Allowing you to easily setup a remote server and add a logo to it.

New Graphic Settings

We've added a new setting allowing to change the Shadow Map method to use the new experimental Virtual Shadow Maps method!

CEF Framerate

We've improved our CEF implementation by dynamically configuring it's render/update rate, and now it refreshes at the same rate as the game improving a lot the perception of fluidity.

HTTP & Database Renames

We've renamed HTTP and Database methods to follow the correct standard of names.

E.g. We've changed HTTP:Select to become a synchronous method and added a new HTTP:SelectAsync method which is the new async. See more information about this new Compatibility Version in the official Documentation Page.

Conclusion

Since a few months now, we have had major significant changes internally in codebase (which until now were only served to add random bugs to the game 😜), but finally we can start to see the good results of that, being able to extend the API by having new classes coming up, such as the new CharacterSimple!

I love to make these improvements like the Console Layout or Config.toml changes because they greatly add to our Quality of Life as devs, and give things a refreshing air.

I was surprised on how the Ultra Dynamic Sky and specially the Weather integration was really easy to do. It was literally just drag'n dropping the Blueprint into the map! And that adds much more immersion to the players!

In this update, we solved several impasses we had so far, such as Large World Coordinates or Level Streaming/World Partition which were uncertain whether or not they would work. Not to mention the new added class of Character that was a much requested thing and will add a lot more possibilities to the game! And that's just the beginning!

Thanks for another month of support! I hope you enjoyed this news blog! See you next time!