How to...

Discuss everything related to custom data creation.

Moderator: NADEO

User avatar
Alinoa
Nadeo
Nadeo
Posts: 4108
Joined: 14 Jun 2010, 11:55
Location: France, Paris
Contact:

How to...

Post by Alinoa » 03 Jun 2014, 10:37

How to...
How to add news and notifications to your Title Pack
gouxim wrote:Much hello,

The default MP3 station overlay is evolving with two new features:
* Official news
* Notifications

Official news

You can now display an official newsfeed on the station. It uses maniaflash as backoffice. It will be visible by everyone who installed your title, even if they havn't bookmarked your maniaflash channel.

To enable this on your title, follow these trivial steps:
* Create your maniaflash channel
* Go on the title admin page at https://player.maniaplanet.com/titles/
* Specify your maniaflash channel ID in the dedicated field
* You all done! Your station will display the last 3 messages with a media (image or bik video).

You can see it in action on the Elite station!
station-news-notifications.jpg
Notifications

Players now see their notifications for a title directly on the station. It will display the maniahome notification with the right Title Uid defined in the notification. Therefore it is applicable to only a little content at the moment. For instance, solo record notifications when someone in one of your groups beat one of your official record.
station notifications.jpg
What about both?

No problemo.
stations news.PNG
:pop:
You do not have the required permissions to view the files attached to this post.
Last edited by Alinoa on 12 Mar 2015, 11:12, edited 10 times in total.
Reason: Added table of contents with links to the first topic
Ubisoft Support
Your Player Page

More information about maniaplanet, support, contents, community activities: useful links

ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)

User avatar
Alinoa
Nadeo
Nadeo
Posts: 4108
Joined: 14 Jun 2010, 11:55
Location: France, Paris
Contact:

Re: How to...

Post by Alinoa » 03 Jun 2014, 10:38

How to publish your Title Pack in the Store
gouxim wrote:Much hello,

You can now specify up to 4 images* for your title pack on the store. It is as easy as https://player.maniaplanet.com/titles
Capture.PNG
* To be more precise i should say "media"; you can put BIK videos if you like :yes:
gouxim wrote:
TMarc wrote:Nice :thumbsup:
Is there any new restriction to the BIK?
dimensions / aspect ratio / duration / file size / etc.?
Dimensions should be the same than images (2:1 if i recall). There's no other limitation for now so feel free to go crazy. We'll see if it becomes a problem.
gouxim wrote:On the playerpage, on the title admin page, you can now specify an "Official manialink". It will be displayed on the store page, and also on the station later on.
gouxim wrote:Very hello,

We just rolled out a new requirement to publish a Title Pack in the store: your Title need to have at least 10 registered players before it can be published in the store.
Ubisoft Support
Your Player Page

More information about maniaplanet, support, contents, community activities: useful links

ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)

User avatar
Alinoa
Nadeo
Nadeo
Posts: 4108
Joined: 14 Jun 2010, 11:55
Location: France, Paris
Contact:

Re: How to...

Post by Alinoa » 03 Jun 2014, 10:41

How to use pick up items in your title packs
Eole wrote:Hi everyone,

For those who want to try pickup items (as seen in new Combo mode),
you can download http://files.maniaplanet.com/tools/Samp ... pItems.zip.

Unzip the content of this zip archive into your ManiaPlanet userdir (typically <userdocs>/ManiaPlanet/ , so that, in that case you have the <userdocs>/ManiaPlanet/Items/SMCommon/Pickups folder).

After extraction, restart Maniaplanet.
New items should appear in map editor, object mode (F4).

WARNING: The ManiaScript item API changed drastically. The following code doesn't work anymore with the current version of the game.

To use items in a game mode you have to create a TitlePack with a custom mode script.
First you must load the items you want to use at the beginning of your script.

Code: Select all

ItemList_Begin();
declare ArmorId = ItemList_Add("SMCommon\\Pickups\\Armor.Item.gbx");
declare RocketId = ItemList_Add("SMCommon\\Pickups\\Rocket.Item.gbx");
declare LaserId = ItemList_Add("SMCommon\\Pickups\\Laser.Item.gbx");
declare NucleusId = ItemList_Add("SMCommon\\Pickups\\Nucleus.Item.gbx");
declare ArrowId = ItemList_Add("SMCommon\\Pickups\\Arrow.Item.gbx");
ItemList_End();
ItemList_Add() takes the path to the item as an argument and return the Id of the item model. It's highly recommended to restart your server after adding this bit of code at the start of your script to be sure the server could load it properly.

You can now create an item:

Code: Select all

declare ItemArmor = CreateItem(ArmorId);
CreateItem() uses the model id of the item you want to create. With this you have one item in the script, but it's not spawned on the map already.

If the map creator puts items on the map, and you want to spawn them in your mode (as in Combo):

Code: Select all

foreach (ItemAnchor in ItemAnchors) {
	switch (ItemAnchor.ItemName) {
		case "SMCommon\\Pickups\\Armor.Item.gbx": {
			AttachItemToAnchor(ItemArmor, ItemAnchor);
		}
	}
}
AttachItemToAnchor() takes two parameters:
- The item you want to spawn in the map
- The anchor used to spawn the item
With this you have one item in your map at the position designed by the map maker.

Now you have to manage what happen when a player pick up an item:

Code: Select all

foreach (Event in PendingEvents) {
	if (Event.Type == CSmModeEvent::EType::OnPlayerTouchesItem) {
		if (Event.Player != Null && Event.Player.SpawnStatus == CSmPlayer::ESpawnStatus::Spawned) {
			AttachItemToPlayer(Event.Item, Event.Player);

			// Do something depending on the item
			// ...

			PassOn(Event);
		}
	}
}
AttachItemToPlayer() has two parameters:
- The item to pick up
- The player who'll receive the item


A short list of item related functions:

Code: Select all

// ----------------------------------------------------- //
/**	Create an item
 *
 *	@param	ModelId		The model if of the item to create
 *
 *	@return				The created item
 */
CSmItem CreateItem(Ident ModelId)

// ----------------------------------------------------- //
/**	Destroy an item
 *
 *	@param	Item		The item to destroy
 */
Void DestroyItem(CSmItem Item)

// ----------------------------------------------------- //
/// Destroy all the created items
DestroyAllItems()
You can access all the items created in the script by using the Items array.

Code: Select all

// ----------------------------------------------------- //
/**	Attach an item to an anchor
 *
 *	@param	Item		The item to attach
 *	@param	ItemAnchor	The anchor where to attach the item
 */
Void AttachItemToAnchor(CSmItem Item, CSmItemAnchor ItemAnchor)

// ----------------------------------------------------- //
/**	Attach an item to a player
 *
 *	@param	Item		The item to attach
 *	@param	Player		The player where to attach the item
 */
Void AttachItemToPlayer(CSmItem Item, CSmPlayer Player)
You can access all the item anchors by using the ItemAnchors array.

Code: Select all

// ----------------------------------------------------- //
/**	Detach an item, it will be dropped at the position of the player/anchor carrying the item
 *
 *	@param	Item		The item to drop
 */
Void DetachItem(CSmItem Item)

// ----------------------------------------------------- //
/**	Detach an item and drop it at a given position
 *
 *	@param	Item		The item to drop
 *	@param	Position	The position of the item
 *	@param	Yaw			The orientation of the item
 */
Void DetachItemAndSetPosition(CSmItem Item, Vec3 Position, Real Yaw)

Code: Select all

// ----------------------------------------------------- //
/**	Unspawn an item
 *
 *	@param	Item		The item to unspawn
 */
Void UnspawnItem(CSmItem Item)

Code: Select all

// ----------------------------------------------------- //
/**	Find the player carrying a specific item
 *
 *	@param	Item		The item to search
 *
 *	@return				The player carrying the given item, Null if the item is not carried by a player
 */
CSmPlayer GetPlayerCarryingItem(CSmItem Item)

// ----------------------------------------------------- //
/**	Find the anchor carrying a specific item
 *
 *	@param	Item		The item to search
 *
 *	@return				The anchor carrying the given item, Null if the item is not carried by an anchor
 */
CSmBlock GetBlockCarryingItem(CSmItem Item)
Other information relative to this subject in the thread of Eole: http://forum.maniaplanet.com/viewtopic. ... 21&t=18717
Ubisoft Support
Your Player Page

More information about maniaplanet, support, contents, community activities: useful links

ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)

User avatar
Alinoa
Nadeo
Nadeo
Posts: 4108
Joined: 14 Jun 2010, 11:55
Location: France, Paris
Contact:

Re: How to...

Post by Alinoa » 03 Jun 2014, 10:45

How to use bots in your title packs
Kak0 wrote:With the release of ShootMania comes a brand new feature: Bots ! This post will give you all information you need to use your custom bots in your title packs. To help you understand this feature, please download the Horde mode's data here : http://files.maniaplanet.com/botdata/BotExample.zip. Horde is a Shootmania mode created specifically to give you an example of what can be done with Maniaplanet bots.

Important note : This feature is meant to be used in your custom title packs. The reason is that if you use custom bots (model, skins), the player who wants to play your mode will need the assets to load the bots. If a player install your title pack he will automatically download these assets. In this tutorial though, we explain how to test custom bots in Storm. You shouldn't set up a Storm dedicated server with a mode or with maps that use bots. For more informations about title packs, please read this thread (and particularly this post).

--- QUICK TEST SECTION ---

Here we will explain you how to create maps for this Horde mode.

1) Install the bot files
You first have to install the specific kind of bots used by Horde mode (a creature that looks like a toad):
- Copy the item file OrganicSmall.Item.gbx into MyDocuments\ManiaPlanet\Items\Characters (create folders if necessary)
- Copy the skin file OrganicSmall.zip into MyDocuments\ManiaPlanet\Skins\Models\Minion (create folders if necessary)

2) Install the script files
You also have to install the mode itself, which consists of two scripts:
- Copy the maptype file HordeArena.Script.txt into MyDocuments\ManiaPlanet\Scripts\MapTypes\Shootmania (create folders if necessary)
- Copy the mode file Horde.Script.txt into MyDocuments\ManiaPlanet\Scripts\Modes\Shootmania (create folders if necessary)

3) How to place bots in a map
(If you don't want to create your own maps, just use the maps mentionned at the end of step 4 and go to step 5)
Open the map editor (in advanced mode) and create a new map.
There are two ways to place bots in your map:

3.a) Autonomous bots
Switch to Item Mode (by clicking on the tree-shaped icon at the bottom of the screen) and select the bot you have installed in step 1.
You can place it on the map with left click, turn it with right click, remove it by clicking on it while holding "X" key, etc. just as you do when you place blocks in Block Mode.
The bots you place with this method will appear in any mode, even if the mode is not supposed to handle bots. They defend the zone where they were placed. They attack players who come too close but stop following them if they leave the zone. These bots have two points of armor, and respawn automatically a little while after they are eliminated.

3.b) Script-managed bots
Switch to Item Mode (by clicking on the tree-shaped icon at the bottom of the screen) and select the bot you have installed in step 1. Then click on the icon that has appeared at the bottom left corner of the screen (just above the "Save" icon) to switch to Path Mode.
You can create a new path with RIGHT CLICK, and then add points to this path with left clicks. You can also select an existing path by holding "Ctrl" key while you click or remove some points with "X" + click.
This method creates paths, not bots. Bots will appear in game only if the mode script decides to spawn bots on the paths of the map (as Horde mode do).

4) How to create a Horde map
Create a new map. Click on the script name at the top left corner of the screen and select HordeArena (the map type script you have intsalled at step 2).
Then build your map, keeping in mind that you must place one spawn (where the player(s) will appear) and at least one pole (that the player(s) will have to defend).
Place some PATHS in the map as described in the 3-b) section. All paths should end near a pole.
You can define the Map Objectives by clicking on the little hammer on the bottom-right corner of the screen and clicking on Set Map Objectives. In this mode, the map objectives are times (in milliseconds) that players have to reach to earn medals (just like TrackMania).
Here are some examples of Horde maps (copy them into MyDocuments\ManiaPlanet\Maps\My Maps)
- A single player map: Horde_Single.Map.Gbx
- A two players map (best players can try it alone ^^): Horde_Double.Map.Gbx

5) Let's play Horde!
While you are in the map editor, you can test your map simply by clicking on the green flag at the bottom right corner of the screen (if it is not green, it means that you forgot to place one spawn and a pole in your map).
The other way to play is to create a server in your local network:
- select the Storm station
- select "Local Play" and then "Create"
- choose the script "Horde" and click on "Launch"
- choose the maps you have created or the ones provided in the .zip file
- if you play with other players, make sure everyone has put the files in the places described in step 1.

In this mode, the players have to cooperate to defend their poles from waves of toads (bots) that spawns in the map (in the maps provided in the .zip file, they spawn next to the cristals). Each time a wave of bots spawns, the difficulty increases, making the toads more powerful (first gaining speed, then gaining armor). After 12 waves, the Insane mode is activated, making the bots spawn continuously. The game ends once 10 bots have reached the Poles. All players have the Laser. If you hit 10 toads without failing a laser, you enter in Frenzy during 10 seconds, increasing your reload rate. The goal is to defend the poles during as long as possible. Your time then grants you a medal determined by the ones stored in the map.

--- ADVANCED SECTION ---

This section is for advanced players who want to create their own bot skins or their own modes using bots.

1) Create new bot skins
available soon!

2) Use bots in your own mode

This part will explain you how to use the ManiaScript API to customize your bots.To understand how bots are managed in script, you should take a look at the script "Horde.Script" given in the .zip file (cf the beginning of this thread).

Tell the game you are going to use bots
Place the following instruction at the beginning of the main function (StartServer section if your script extends ModeBase.Script.txt) :

Code: Select all

DbgEnableNavMesh = True;
Prepare the model
Before the Mode::LoadMap call, you need to tell the game that you wish to use a custom bot. For this purpose, call the ItemList_Add() function with the path to your file (e.g., in our case, ItemList_Add("Characters/OrganicSmall.Item.gbx")). This function returns an Ident that you need to store somewhere, in order to use it when you spawn a bot of this kind.

Spawn a bot
To spawn a bot from the script, you need to use the CreateBotPlayer function. This function takes five arguments:
  • [Ident] the model of the bot which you have stored from ItemList_Add (0 for the StormMan)
  • [Integer] the team of the bot
  • [Integer] the armor of the bot
  • [CSmLandmark] element of the BotPaths array, which represents the path of the bot (the bot spawns on the first point of the path)
  • [Integer] Time of activation

It returns a CSmPlayer pointer to your bot, just like the function SpawnPlayer would have done for a human player. The difference is that the bot's Driver component (type CSmPlayerDriver) is not Null. This Driver is what defines what the bot does.

Behaviour
The bot's Driver contains all the parameters you can tweak to customize your bot. First, let's see the parameters to define the bot's behaviour against potential targets :

AggroRadius (Real): distance from which the bot attacks its target
DisengageDistance (Real): when the bot is further than this distance from its initial point, it retreats. During its retreat the bot doesn't attack anyone.
Accuracy (Real): Real between 0 and 1 that defines the efficiency of the bot (1 means he always shoots straight at its target)
RocketAnticipation (Bool): Boolean
ReactionTime (Integer): Time the bot takes before handling its target
ShootPeriodMin (Integer): Minimum time between two shots
ShootPeriodMax (Integer): Maximum time between two shots
AttackFilter (enum CSmPlayerDriver::ESmAttackFilter): Defines what kind of players the bot needs to attack
  • OppositePlayers: only players of the opposite team
  • OppositeBots: only bots of the opposite team
  • AllOpposite: players and bots of the opposite team
  • AllPlayers: players of both teams
  • AllBots: bots of both teams
  • All: everyone
ForcedTarget: Whatever the current behaviour is, the bot will start chasing the target defined in this variable (CSmPlayer class) and won't stop untill this variable is set to Null.

Now that we have seen how the bot can handle a target, let's see how it can move. There are three predefined behaviours, stored in the Behaviour member (enum CSmPlayerDriver::ESmDriverBehaviour):

Turret

The bot doesn't move. It will fire at the targets in its AggroRadius.

Saunter

The bot wanders in a zone defined by a point and a radius. More precisely, the bot goes to a random location in this zone, then waits, and chooses another point in the same zone (and loops on this pattern). Use the following Driver's parameters to customize this behaviour :
  • Saunter_AnchorPoint (Vec3) -> Center of the zone
  • Saunter_Radius (Real) -> Radius of the zone
  • Saunter_BaseChillingTime (Integer) -> Time between two moves (in ms)
  • Saunter_ChillingDeltaTime (Integer) -> Used to add some randomness in the chilling time. For example, if the BaseChillingTime is 1000 and ChillingDeltaTime is 300, the chilling time will be a random value between 0.7 and 1.3 second.
The bot will engage the targets within its AggroRadius, following them and shooting at them until they are out of sight or until the distance between the bot and its AnchorPoint is above its DisengageDistance. The bot then disengages and goes back in a random point in its zone.

Patrol

The bot follows the path bound to the BotPath object it was attached to. The only parameter you need to modify is named Patrol_Mode (enum CSmPlayerDriver::ESmDriverPatrolMode). There are three values:
  • OneTrip (default one) -> the bots stops at the end of the path
  • BackAndForth -> the bot goes back and forth between the first and last points, always following the defined path
  • Loop -> When it reaches the end of the path, the bot returns to the first point of the path by the shortest way possible
The bot will engage the targets within its AggroRadius, following them and shooting at them until they are out of sight or until the distance between the bot and the point where he engaged the target is above its DisengageDistance. The bot then disengages and goes back to the closest point on its Path, resuming its Patrol.

Unspawn:
Unspawning a bot doesn't require anything special, but once it is unspawned, you should call the DestroyBotPlayer procedure.

Miscellaneous tips:
- The number of bots spawned at the same time should be limited, for performance issues. Keep in mind that there can't be more than 256 players on a map, bots included.

3) Different behaviours for different paths
In some cases, you might want to create different categories of BotPaths. For instance, if you do a team mode, you might want to have some paths for Blue bots and some others for Red bots. When you create a BotPath in the editor, use the spacebar to change the color of the path. This changes the Clan variable of the BotPath in the script. You can then use this variable to determine what you want to do with this BotPath.

-----------------------

This API will be completed in future updates, with more behaviours and more possibilities. Don't hesitate to ask questions if some parts remain unclear, and please give us your feedback on this feature. Horde is of course just a very simple example of a solo/co-op experience that you can create with this feature, and we can't wait to see your creations !

Have fun !

Edit : Update 24/04/2013
Script API :
  • Fixed an issue with bots movements in Saunter mode, they shouldn't be stuck anymore.
  • Changed the way a bot disengages an enemy while in Patrol mode : they joins the path as fast as possible, instead of cutting to the next waypoint on their path. This partially fixes an issue with the bots not engaging sometimes, although there seems to be some situations where it still happens. We are still investigating on this issue.
  • You can now change the zone in which the bot wanders while in Saunter mode with the variable Saunter_AnchorPoint (Vec3) in the bot's Driver.
  • There is a new variable in the Driver called Target (CSmPlayer), which stores the current target of the bot. This target is the closest player on which the bot can shoot (i.e. in the Line of Sight, within the AggroRadius, and that matches the AttackFilter). Note that there is no point in trying to set this target in the script, it is recomputed by the game engine when the bot is updated.
  • New AttackFilter value : Nobody. This enables you to create peaceful bots without having to tweak other variables like AggroRadius.
  • You can define a set of players that the bot should not target, with the Driver's variable TargetsToAvoid (an array of CSmPlayer).
  • New predefined Behaviour : Escape. The bot doesn't attack, it only flees when an enemy is too close, and keeps its current position otherwise. When the distance between an enemy and the bot is lower than Escape_DistanceSafe, the bot chooses a random point located between Escape_DistanceMinEscape and Escape_DistanceMaxEscape meters from its current location.
Editor :
  • You can now move a point of a path by left-clicking on it and dragging it to another location.
  • You can now add a point between two other points by left-clicking on the path between these two points and dragging it to another location.
Edit : Update 16/05/2013
Script API :
  • Before, when you wanted to respawn a bot, you had to destroy it and create it back. You can now respawn a bot like you would respawn a human player, with the function SpawnBotPlayer. This function takes the same arguments as SpawnPlayer, except that the Player has to be a bot and the spawn location doesn't have to be a CSmBlockSpawn, it can be any CSmScriptLandmark (including CSmScriptBotPath). Please note that you still have to call CreateBotPlayer for the first spawn, and you still need to destroy a bot when you don't use it anymore.
  • Fixed some issues that could occure while changing the Behaviour of the bot.
  • Fixed the bug that made rockets disappear when the bot who shot them was destroyed (should fix the bug of the non-appearing +1 as well)
  • Fixed some issues that could occure when a bot was in Patrol mode and was returning to its Path
  • New variable Path in CSmScriptBotPath, to access the points defined in the map editor (read-only)
  • New variable IsStuck in the Driver, to know if the bot can't move (this variable is True when the bot didn't move for 1 sec or more, when he is supposed to move)
  • New API to control the bot entirely with the script. The corresponding Behaviour enum is called Scripted. Here's the list of available functions:
    • ScriptedBot_Move(CSmPlayer Bot, Vec3 Position) : Moves the bot to the given position
    • ScriptedBot_MoveDelta(CSmPlayer Bot, Vec3 Delta) : Same as the previous function, but with a position depending on the current position
    • ScriptedBot_Aim(CSmPlayer Bot, Vec3 Position) : Aims at the given position
    • ScriptedBot_AimDelta(CSmPlayer Bot, Real DYaw, Real DPitch) : Turns the bot's aim with the given angles
    • ScriptedBot_MoveAndAim(CSmPlayer Bot, Vec3 Position) : Same as calling ScriptedBot_Move followed by ScriptedBot_Aim
    • ScriptedBot_RequestAction(CSmPlayer Bot) : Makes the bot use its current action (right click)
    • ScriptedBot_RequestGunTrigger(CSmPlayer Bot) : Makes the bot fire
    • Boolean variable Scripted_ForceAimInMoveDir in the Driver : Forces the bot to aim in the direction he is moving (just as he does when he is in a predefined mode). False by default.
Edit : Update 22/05/2013
Script API :
  • Crashfix : Game could crash when the bot engaged an enemy while not moving
  • Crashfix : Restarting server (Del) while bots were being destructed resulted in a crash
  • Crashfix : ForcedTarget could contain an invalid pointer
  • Bugfix : when a bot's AmmoGain variable was not set in the script, it took a random value (which could lead to the bot running quickly out of ammo or having infinite ammo)
  • Bugfix : the bot could sometimes run in circle while trying to reach a point
  • Bugfix : the bot could sometimes ignore targets
  • Bugfix : there were several issues when using the Patrol behaviour with a one-point Path
  • Bugfix : in Patrol behaviour, BackAndForth mode, the bot could go in the wrong direction when disengaging
Edit : Update 02/07/2013
Script API :
  • Crashfix/Bugfix : The game could crash when using a bot in Saunter or Escape behaviour
  • Bugfix : Bots could go in the wrong way when disengaging in Patrol behaviour using the Loop mode between the last point and the first point
  • Bugfix : Bots have less trouble with slopes
  • Bugfix : Bots could act strangely after being respawned in certain cases
  • New Feature : You can now set the Field of View of the Bot. This is an angle in radians (in other words a real between 0 and 2Pi) that defines the area in which a Target is considered as visible. The default value is 2Pi/3 (which was also the setting used in previous versions)
  • New Feature : Bots now take bumpers into account. They don't realize that bumpers make them go faster, but they understand bumpers can help them reach otherwise unreachable points. Bots don't use air control though, so they will always land in the same area (you can use the helpers available in the Block Property mode in the editor)
Other information available in the topic started by Kak0: http://forum.maniaplanet.com/viewtopic. ... 10#p157410
Ubisoft Support
Your Player Page

More information about maniaplanet, support, contents, community activities: useful links

ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)

User avatar
Alinoa
Nadeo
Nadeo
Posts: 4108
Joined: 14 Jun 2010, 11:55
Location: France, Paris
Contact:

Re: How to...

Post by Alinoa » 27 Jun 2014, 10:01

How to promote you Title Pack with ManiaPub
gouxim wrote:Much hi,

Step 1: learn about ManiaPub http://forum.maniaplanet.com/viewtopic.php?f=462&t=8287
Step 2: Use the link to your Title Pack page on the store when you create your ad

maniaplanet://#menustations=store?TitleUid

Eg. maniaplanet://#menustations=store?SMStormElite@nadeolabs

:yes:
Ubisoft Support
Your Player Page

More information about maniaplanet, support, contents, community activities: useful links

ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)

User avatar
Alinoa
Nadeo
Nadeo
Posts: 4108
Joined: 14 Jun 2010, 11:55
Location: France, Paris
Contact:

Re: How to...

Post by Alinoa » 07 Jul 2014, 09:55

Mods with item texture replacement

http://forum.maniaplanet.com/viewtopic. ... 09#p220909
xbx wrote:Hi!

Just passing to inform you that since MP3.1, you can mod custom item textures in addition to the enviro textures.

here is how:

Imagine you have the following layout:
  • Items/MyCollection/Group1/Textures/image1.dds
  • Items/MyCollection/Group1/Textures/imagex.dds
  • Items/MyCollection/Group1/item1.item1.gbx
  • Items/MyCollection/Group1/item3.item1.gbx
  • Items/MyCollection/Group1/item12.item1.gbx
  • Items/MyCollection/Group2/Textures/image.dds
  • Items/MyCollection/Group2/item1.item1.gbx
  • Items/OtherCollection/itemtest.item1.gbx
  • Items/OtherCollection/itemtest.dds
then you can add folders to the mod zip
  • Items/MyCollection!Group1!Textures/image1.dds
  • Items/MyCollection!Group1!Textures/imagen.dds
  • Items/MyCollection!Group2!Textures/image.dds
  • Items/OtherCollection/imagetest.dds
notice how the hierarchy was flattenend out by replaceing path separators by '!'




In addition, it is also possible to do:
  • Items/MyCollection/Textures/Wood/image1.dds
  • Items/MyCollection/Textures/Wood/image2.dds
  • Items/MyCollection/Textures/Stone/image1.dds
  • Items/MyCollection/Textures/Stone/image2.dds
  • Items/MyCollection/Group1/item1.item1.gbx
  • Items/MyCollection/Group1/item3.item1.gbx
  • Items/MyCollection/Group1/item12.item1.gbx
  • Items/MyCollection/Group2/item1.item1.gbx
and have in the mod.zip
  • Items/MyCollection!Textures/Wood/image1.dds
  • Items/MyCollection!Textures/Stone/image1.dds
With the technical limitation that you can't have a hierarchy more than 2 folder deep..[/size]


An other thing is that while when you play a map and the P2P downloads the mod, it is applied at race restart as soon as it is downloaded. This will not work for items.
For items, the mod.zip must be on the disk when the map is loaded to be applied.
Ubisoft Support
Your Player Page

More information about maniaplanet, support, contents, community activities: useful links

ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)

User avatar
Alinoa
Nadeo
Nadeo
Posts: 4108
Joined: 14 Jun 2010, 11:55
Location: France, Paris
Contact:

Re: How to...

Post by Alinoa » 15 Jul 2014, 14:22

Free item mode in map editor

relative topic: http://forum.maniaplanet.com/viewtopic. ... 87#p221787
angry_duck wrote:Hi item makers & users! :D

Since the latest update, the map editor has a new mode for placing items called "free item mode".

You can switch between classic and free item modes simply by clicking on the Item mode icon (or pressing F4).
- In classic mode, you may have noticed that the rules for placing an item change for each item: it is the item creator who decides if his item can be placed in the air, or every 2 meters on the ground, etc.
- In free mode, these placement rules are the same for all items, and they enable the mapper to place items almost anywhere he wants (even if there are still some limitations).

So, if the item creator spends some time to choose good placement parameters, classic mode will be the most pleasant and efficient to use. But when you will have an item to place at a very specific position that you cannot reach in classic mode, use the free mode and you should get more accurate results.

Enjoy, and feel free to give some feedback in this topic!
Ubisoft Support
Your Player Page

More information about maniaplanet, support, contents, community activities: useful links

ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)

User avatar
TMarc
Posts: 14352
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: How to...

Post by TMarc » 30 Jul 2014, 22:25

Use WebM for animated avatar

From Setting GIF as avatar?:
beauchette wrote:well, I tried a 128x128 webm that was under 30kB (~25) and it worked !

I used ffmpeg that way to convert it :
ffmpeg -i filename.gif -c:v libvpx -crf 10 -b:v 300K filename.webm

For me crf 10 and b:v 300K were fine, depending on the size, and number of frames, I suppose you'd have to adjut these (and the size, if there are too much frames, 64x64 seems to enough), from livpx encoding options :
By default the CRF value can be from 4–63, and 10 is a good starting point. Lower values mean better quality.
Here, you can choose different values for the bitrate other than 1M, e.g. 500K, but you must set all options (i.e., minrate, maxrate and b:v) to the same value.
maniaplanet forum global moderator

Link list with FAQ, Support, Wiki, Tutorials, Community activities, and much more.

System specs: Intel i7-970 12GB RAM, nVidia GTX 970, Creative SB X-Fi, 2xSSD

User avatar
Alinoa
Nadeo
Nadeo
Posts: 4108
Joined: 14 Jun 2010, 11:55
Location: France, Paris
Contact:

Re: How to...

Post by Alinoa » 04 Nov 2014, 14:49

[Program] Express Exporter

http://www.maniapark.com/forum/viewtopi ... 31#p195131
SKleer wrote:Hello everyone.
I am beginner to C#, but did analogue program Convert Assistant, as it seemed I was not clear ...
Download!

Image

The main advantages of my program:
- No need to create. Xml files! Yes! The program itself will make them for you!
- Light weight program.
- Intuitive interface.
- Suitable for the latest version of Nadeo Importer.

disadvantages:
- You can not export dynamic objects

You still need to have Nadeoimporter.
Your objects should be located in the following folder: UserDir/Work/Items
This program should be located in the root folder with the game. For example:
C:\games\ManiaPlanet

I hope you enjoy this program!
Also, I hope I can fulfill your wishes.

== Update 1 ==
- Fixed a bug that only imported objects in the environment "Canyon".
- Added export objects in all environment (But I only want to TM2, but there is no such collection = ( )
== Update 2 ==
- Now you can export your car (Forgot add select enviroments :mrblue ).
- .xml and .bat files deleting after use a program.
- It is else? Strange...
== Update 3 ==
- Add pivot points
- Add button "work". It open folder "work". If you not have this folder, program creating it
- Now selected folder "work" when you export your car
== Update 4 :pil ==
- Now you can selecting languages
- Thanks Haribofighter and GKRacer for help with translating texts. :yes
== Update 5 ==
- Now you can enter a negative numbers for pivot points
- Fixed the bug that incorrectly installed pivot points (instead of Y Z was set and vice versa)
P.S. Sorry for google :mrblue
== Update 6 ==
- Now, you can export: normal block, checkpoints, start and finish
- Add filed where you can write autor name
- Add "Model Scale" function
- Material name get from .fbx and writing in filed. (Tested only Blender .fbx)
(material name from Material Lib now useless, because program not generating list from Material Lib.txt)
== Update 7 ==
- Fix bug when you can't export your models!!! :yes
- Now MaterialLib is work! (Only for 1 material in model, waiting a next patch for all materials)
- Add new collections: Storm, TMCommon, SMCommon
== Update 8 ==
- Now support all materials from model
- Now max mesh scale is 10 (was only 1)
- Now materials from Material Lib sorting in list
== Update 9 ==
- Grid Snap up to 128
- Add "Grid Offset" function
- Fix bug due to which Author Name not add in object
- Now when you load new model choosed materials not zeroed
- Add function for deleting .xml after closing a program.
- Add all translations
== Update 10 ==
- Carskin now converting
- Now we can drag and drop all files in program window. Please, drag and drop only .fbx files of your models that not using button "browse". :D (Just I don't know how using only .fbx for drag and drop...)
== Update 11 ==
- Now light is suppor!
- Some code imrove
- Some bug fix

What I planing:
- Add export dynamic blocks
Ubisoft Support
Your Player Page

More information about maniaplanet, support, contents, community activities: useful links

ManiaPlanet technical documentation portal (Dedicated server, Mediatracker, ManiaLink, ManiaScript, Titles...)

User avatar
TMarc
Posts: 14352
Joined: 05 Apr 2011, 19:10
Location: Europe
Contact:

Re: How to...

Post by TMarc » 10 Nov 2014, 19:07

[How to] Specular maps in mods
Fix wrote:It's not a very long tutorial yet, but here are some hints that could help modders.

Some modders are using the diffuse map as specular map, this can work a little bit, but the best results are really obtained by doing each specular channel separately.
We are not using a real PBR technique (PBR = Physically Based Rendering) which is used nowadays alot in current and nextgen engines, but we are using similar concepts in the maniaplanet engine.

You can learn a lot from PBR tutorials, especially how light works and interacts with materials.
google search for PBR tutorials
http://www.marmoset.co/toolbag/learn/pbr-theory

In our engine, you could translate the PBR like this :

1-we don't have metals like PBR"s
2-Albedo = Diffuse
3-Microsurface = Specular exponent = Specular's Alpha channel = glossiness / roughness (black = rough, white = glossy)
4-Reflectivity = Specular intensity = Specular's Green channel (black : matte, white = shiny)
5-Fresnel = Specular's Red channel (black = low, white = high) (the color shown by our fresnel is given by the lightmap, it's a very low quality averaged color of the world around the pixel)
6-Ambient occlusion : is computed in the lightmap

work your specular map in RGB becasue most filters/modifiers don't touch the alpha channel:
RGB = FIE
Red = Fresnel
Green = Intensity
Blue = Exponent

before saving your map as .dds, convert it to RGBA=FI0E (0=zero).
This means cut/paste your Blue channel into Alpha channel, and set your blue channel to black.

some random Tips :
-unless really wanted, avoid too high exponent, makes everything wet or plastic
-be cautious with the specular intensity, this can makes very bright spots.
-the fresnel helps reading the volumes but adds a faery/virtual/toonish look to your material if too strong
-wet materials are darker than when they're dry, to simulate a puddle of water on the road : darken the diffuse, very strong fresnel, very high exponent, and high intensity (normal map of water/liquid should be flat (rgb = 127.127.255))
-to simulate oil : use a very dark almost black diffuse, and treat it like water. use brown for mud.
-in some "stoneish" materials, the brighter parts are more matte than the other ones (expecially true for concrete) : if you use your diffuse as a source for your specular, invert its glossiness values (bright diffuse = dark exponent/ intensity)
- asphalt as often an inversed specular : dark asphalt is shiny/new, and bright/grey asphalt is old, matte.
-do not apply the same modifications(brightness/contrast/curves, etc...) to the 3 channels of the specular maps, you'll have deeper and more interesting results if they are not synchronized (I use Curves adjustment in photoshop, and I tweak the curve for Red Green and Blue separately.
Source
maniaplanet forum global moderator

Link list with FAQ, Support, Wiki, Tutorials, Community activities, and much more.

System specs: Intel i7-970 12GB RAM, nVidia GTX 970, Creative SB X-Fi, 2xSSD

Post Reply

Return to “Title Pack & Custom Data Creation”

Who is online

Users browsing this forum: No registered users and 2 guests