Skip to content

Mapping and Textures

Aranud edited this page May 6, 2020 · 1 revision

Mapping and Textures - map makers' page

All about mapping & game assets.

Notice: Feel free to add any info, links and hints about ET mapping.

Links

You'll find interesting links for mappers and info about Models & Textures on our link page. Also nice to know: ET Player Models Documentation and entity & spawns functions

Important CVARs and commands for map makers and scripters

Before any release of your map you should run the game with different commands and some CVARs set. Read this page to interpret the results and run both ways: game- and listen servers.

Commands

entitylist/entitylist X

csinfo/csinfo X

Debug start params and CVARS

Run a map in developer mode:

+devmap  +set developer 1

Run script debugging (X of g_scriptDebugLevel is the level of detail) :

+set g_scriptDebug 1 +set g_scriptDebugLevel 

Editors

  • under construction -

pak0.pk3 file info

Unused models/textures/data in genuine PAK files

  • gameinfo.dat - default values for game type and some other obsolete values
  • models/multiplayer/flagpole/flag_waypoint.md3
  • genuine logos

Missing models/textures in genuine PAK files

  • flak38 textures & model (aagun)

Map optimizations

While doing a map mappers can optimize the map and FPS with VIS-blocking, portals and other techniques but there are more things to optimize. Strictly speaking mappers should know some info before they start with editing in map editors so the map can even be used without issue on bigger servers.

Configstrings or the configstring

The configstring internally controls the game and is splitted into single configstrings. Configstrings are strings containing data related to the game and game state. These are set on the server, and automatically sent to each client.

Each configstring is identified by a number, which is referenced by a #defined in the ET gamecode - see game/bg_public.h. A group of related configstrings up to 64 such as CS_MODELS, CS_PLAYERS usually have a symbolic name for the first value, with a number (entity number in the case of CS_PLAYERS) added to to get a particular value.

Important to know:

  • Each connected player adds about 140 chars to the configstring
  • pk3 files on the server are part of the configstring (admins shouldn't put more than 20-30 maps into etmain folder)
  • Server side forced cvars are part of the configstring!
  • Fireteams reserve configstrings (this is the most case for ingame MAX GAMESTATECHARS EXCEEDED error + object trigger info)
  • When using colors 2 additional chars are added (player names, announcements etc)

The map runs into MAX GAMESTATECHARS EXCEEDED error

This happens when the configstrings size - the configstring in total - reaches the limit of 16000 chars. This bug is heavily dependant on how many maps/pk3 files are in path because all pk3s in path (fs_homepath and fs_basepath) are stored in the CS_SYSTEMINFO (see cmd: "csinfo 1") twice. By name and by checksum. It's also dependant on how a map is designed and which settings are done by an admin (see above part "Important to know")

What you can do as a mapper/scripter: Shorten the strings - all names! This starts with the name of your map or the name of the pk3 and ends with file names. In general keep names of any game objects short! The configstring is related to admin settings but also considers used names for objects of the map.

What you can do as a server admin: Decrease your number of maps/pk3 files in paths (etmain & mod folder). Shorten the strings of names in your config files for bots, MOTD, hostname etc. Don't force too many cvars. Use Venice map as reference - this map populates the configstring near the limit. In case of your server is stable with 32 used slots and venice ends with no MAX GAMESTATECHARS error (remember the fireteams) the rotation should be fine.

The Legacy mod has got an additional command to get the size of the configstring. Console "csinfo" cmd will print the total size of the configstrings. You can also add a parameter to this command to print the content and size of a single configstring "csinfo 1".

Trigger names and names in *.script and *.sound files

Ensure trigger names aren't too long. See CS_OID_TRIGGERS part in the configstring.

Bad example:

	wm_removeteamvoiceannounce	0 "1944_nordwind2_axis_steal_tank"
	wm_removeteamvoiceannounce	1 "1944_nordwind2_allies_protect_tank"

Better:

	wm_removeteamvoiceannounce	0 "ax_steal_tank"
	wm_removeteamvoiceannounce	1 "al_protect_tank"

... and bad sound definitions - see CS_SOUNDS:

1944_nordwind2_allies_tank_stolen
{
	sound sound/vo/1944_nordwind2/allies/hq_allies_tank_stolen.wav
	voice
	streaming
}

Better:

allies_tank_stolen
{
	sound sound/vo/1944_nordwind2/allies/hq_allies_tank_stolen.wav
	voice
	streaming
}

The last example is even better if you shorten the path of name of the sound (w/o '1944_nordwind2').

New assets

Whenever you add new assets or objects: Use short names.

For names of:

  • Shader definitions
  • Files (sound, models)

Finally if there are less chars in the configstrings the server has less data to communicate!

How to see what's inside the string?

In ET main you can use the /configstrings server cmd to get some info about the string. Some mods have special commands. In legacy mod or NQ f.e. there is /csinfo or /csinfo <configstring_No>.

Map entities & avoid laggy servers

Above we did talk about game objects - the game entities. In total ET can deal with 1024 entities but for server games it's recommended not to process more than 500 entities at the same time. One reason is that snapshots only store and process 512 entities - see MAX_ENTITIES_IN_SNAPSHOT 512. Mappers should know snapshot entities are a subset of game entities. They are created per client, related to the view and contain all the delta info for the gameplay.

Entities are: players, events, triggers, game models, bullets, dropped weapons/items, spawns, movers ...

Some of the these like bullets are probably never observed by mappers. It's finally also of interest to know how the server is set up. How many med- or ammo packs are dropped on death? More players create more entities ...

Run the /entitylist command on your map. Unfortunately this command can't show all used entities. Some of them (tracers f.e.) are processed during a snaphot and are not cought by the entitylist cmd. From my experience servers start to lag when 'entitylist' shows about 480 used entities in general. Depending on player/bot count.

Maps starting with about 300 entities (no player connected) ensure high player counts. Maps as fueldump (about 400) start to lag when there are more than about 34 players connected. Simply add some omnibot waypoints to your map and start a local bot server. You'll notice the player limit in your lagometer ;)

Obviously there is a conflict between nice looking (also good gameplay) maps and having no lags on the server. Just think about each entity when creating a map ...

How to find possible lag locations (the real ones)

From my experince (IR4) after dealing some years with the engine I figured out there is a real lag when many game objects have to be freshly rendered into the game (this isn't a real surprise is it?!) You can reproduce these lags on stock maps especially when many players are on the server and in sight.

Start a listen server with 20 bots (or join a populated game server) and enable the lagometer (cg_lagometer 1). Watch the lagometer at given map loctions - see attached screenshots: Fueldump near last asis spawn on the stairs and Goldrush path to first barrier (the popular route for bunny hopping). On both paths there are granted lag spikes.

So what's going on? It took me a long time to understand this probably because I don't set the related debug cvar any day. At both locations there is a massive update of potential visibility data. Set r_showtris 2 (or see screenshots at bottom of page) to see what I'm talking about.

Legacy engine and mod info for mappers

The ETL engine and legacy mod support some extra options for mappers:

Engine

  • The Engine supports *.ogg sound files

Mod

  • Extra script_movers spawnflag 1024 - sets flamer damage only

  • Extra trigger_multiple spawnflag 512 - trigger can be used by disguised players only

  • Extra trigger_multiple spawnflag 1024 - trigger can be used when player is carrying an objective only

  • surface parm 'slag' in shader definitions enables mud movement in/under water

  • entity misc_aagun is available and basically working see attached file (harc = 360, varc = 45)

  • wm_set_main_objective command in map scripts does no longer expect a number (which did never work in all mods). In order to make it work use the target (not targetname!) of trigger objective info (TOI) and the affected team. See oasis.script of pak3 as reference - Example 'wm_set_main_objective "dynawall" 1' - You'll identify TOI entities via /entiylist cmd. - see ET_OID_TRIGGER.

Must read for mappers

Invalid images of shaders

It turned out there are shaders defined with an invalid image (not in path). Whenever you include these in your maps ensure you add the given image explicitly.

Don't trust definitions of decals.shader file!

notice. Important - we did identify more shaders without image see https://github.com/etlegacy/etlegacy/issues/992

Examples:

textures/decals/corrosive_sign
{
	qer_editorimage textures/xlab_props/sign_c17.tga (*not in genuine pak2*)
	
	polygonOffset
	surfaceparm pointlight
	implicitBlend textures/xlab_props/sign_c17.tga (*not in genuine pak2*)
}

textures/decals/burnm_01a
{
	qer_editorimage textures/decals/burnm_01.tga (*not in genuine pak2*)
	
	polygonOffset
	surfaceparm pointlight
	implicitBlend textures/decals/burnm_01.tga (*not in genuine pak2*)
}

textures/decals/hay
{
	qer_editorimage textures/props/hayd.tga (*not in genuine pak2 - textures/props/hay.tga is in path?!)
	
	polygonOffset
	surfaceparm pointlight
	implicitBlend -
}